WP SlimStat uses PHP’s $_SERVER[‘REMOTE_ADDR’] to get the main IP address, while the ‘other IP’ is recorded if the visitor is using a proxy that sends the HTTP_X_FORWARDED_FOR header or something like that. In other words, that would be the ‘private IP’ of your visitors, when available.
if (isset($_SERVER["REMOTE_ADDR"]) && long2ip($ip2long = ip2long($_SERVER["REMOTE_ADDR"])) == $_SERVER["REMOTE_ADDR"])
$long_ip[0] = $ip2long;
So, not sure why $_SERVER[‘REMOTE_ADDR’] is returning your server’s IP address in your case.
You may want to check your server’s configuration.
Camu
i have the same problem running wp behind a reverse proxy (just 1 unique IP visitor). REMOTE_ADDR is set to IP address of reverse proxy server, while HTTP_X_FORWARDED_FOR is set to client IP address. Switching contents of $long_ip[0] and $long_ip[1] in _get_ip2long_remote_ip() would show numbers of unique visitors correctly but might be a dirty solution.
btw, camu thx for that great plugin, looking forward for IP anonymization 🙂
Hi there,
in your specific case, you may want to swap those two in the source code, but it would not work for everybody. So implementing this in the official code is something I can’t do.
If more and more people will start asking for something to be added to the plugin, I may think of an option to do that. Of course you’re more than welcome to contribute and provide some code that makes this feature general and useful for everybody (i.e. via an option)
Cheers,
Camu
PS: a vote for my plugin would be a nice way to say thank you.
Please help with this “dirty” solution. Switching contents of $long_ip[0] and $long_ip[1] in _get_ip2long_remote_ip() did not help. I’m getting 0.0.0.1 as the visitor’s IP.
Cheers,
Sven
Can you paste your code in http://pastebin.com/ ?
And maybe start a new topic to avoid confusion?