WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: WP SlimStat] Version 2.8 makes IPs all appear from one source

[Resolved] [Plugin: WP SlimStat] Version 2.8 makes IPs all appear from one source

  • croberson
    Member

    @croberson

    When viewing my stats it shows 2 different ip addresses…the main address is what is used for tracking, showing that all people are accessing our site through our server, not as individuals coming from other sources.
    Im not sure if that makes sense but overall I only have 1 unique ip for today but 145 views, all of which are from different sources and bots so it should show as more unique ips.

    http://wordpress.org/extend/plugins/wp-slimstat/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jason Crouse
    Participant

    @coolmann

    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 🙂

    Plugin Author Jason Crouse
    Participant

    @coolmann

    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

    Plugin Author Jason Crouse
    Participant

    @coolmann

    Can you paste your code in http://pastebin.com/ ?

    Plugin Author Jason Crouse
    Participant

    @coolmann

    And maybe start a new topic to avoid confusion?

    a new topic started

    Plugin Author Jason Crouse
    Participant

    @coolmann

    THank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] [Plugin: WP SlimStat] Version 2.8 makes IPs all appear from one source’ is closed to new replies.