WordPress.org

Ready to get started?Download WordPress

Forums

WP Slimstat
[resolved] [Plugin: WP SlimStat] Version 2.8 makes IPs all appear from one source (9 posts)

  1. croberson
    Member
    Posted 2 years ago #

    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/

  2. camu
    Member
    Plugin Author

    Posted 2 years ago #

    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

  3. matwes
    Member
    Posted 2 years ago #

    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 :)

  4. camu
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  5. svenk
    Member
    Posted 2 years ago #

    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

  6. camu
    Member
    Plugin Author

    Posted 2 years ago #

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

  7. camu
    Member
    Plugin Author

    Posted 2 years ago #

    And maybe start a new topic to avoid confusion?

  8. svenk
    Member
    Posted 2 years ago #

    a new topic started

  9. camu
    Member
    Plugin Author

    Posted 2 years ago #

    THank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic