Plugin Author
ralxz
(@ralxz)
Hey Mathijs,
Thanks for the message. That’s a great idea, I’ll see if I can put in some logic to use their IPV6 address if available.
I’ll see if I can get to it this week.
Cheers,
Ryan
Plugin Author
ralxz
(@ralxz)
Hey Mathijs,
I just looked into this, and it looks like if they are using IPV6 it should be logging correctly.
This is the code in the plugin:
function get_user_ip() {
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP)) {
$ip = $client;
} elseif(filter_var($forward, FILTER_VALIDATE_IP)) {
$ip = $forward;
} else {
$ip = $remote;
}
return $ip;
}
If the server is accepting connections on an IPv6 socket, then it should report back correctly. If you are only getting IPv4 addresses for your users, maybe it’s something to due with your hosting configuration?
Let me know if I can be more help.
-Ryan
Oke. Thanks 🙂 When I change hosting in januari I will ask to set it up right 🙂
It works on my new server 🙂