Support » Plugin: WP Statistics » Visitors Unknown, All Identical IP Addresses

  • Resolved newlaurie20

    (@newlaurie20)


    Since the latest update, my WP Statistics visitors have all shown unknown country and city, and an identical IP address of 10.69.56.225

    PHP Version 5.6.33-1~dotdeb+7.1
    MYSQL Version 5.5.35-0+wheezy1-log

    • This topic was modified 1 month, 4 weeks ago by  newlaurie20.
Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Contributor Mehrshad Darzi

    (@mehrshaddarzi)

    Hi @newlaurie20
    Please tell me what is your wordpress and php version ?

    Wordpress 5.1

    PHP Version 5.6.33-1~dotdeb+7.1
    MYSQL Version 5.5.35-0+wheezy1-log

    Plugin Contributor Mehrshad Darzi

    (@mehrshaddarzi)

    @newlaurie20

    first update again GEOIP database in admin.php?page=wps_settings_page [external tab].
    then check exist files GeoLite2-Country.mmdb and GeoLite2-City.mmdb in wp-content\uploads\wp-statistics folder in your host.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    @newlaurie20
    Please try to update the GeoIP database and let us know about the result of your test.

    I have updated the GeoIP collection and the GeoIP city. The problem remains.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Did you check @mehrshaddarzi instructions?

    Yes, I did. As you can see, I responded to those instructions yesterday. The problem persists.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Please do below instructions.

    – Disable GeoIP
    – Remove GeoIP database file from wp-content\uploads\wp-statistics
    – Make sure the Use Cache Plugin, Anonymize IP Addresses and Hash IP Addresses options are disabled.
    – Enable GeoIP again.

    I have completed all of the steps per your instructions. I have also had my host’s technical support look at the issue: it’s not a problem on their end, but rather with the plugin.

    The problem persists.

    Plugin Contributor Mehrshad Darzi

    (@mehrshaddarzi)

    @newlaurie20

    It seems like the host is giving you the IP address incorrectly.
    please create a PHP file in your server e.g:s.php and push this code :

    
    <?php
    $envs = array(
    	'REMOTE_ADDR',
    	'HTTP_CLIENT_IP',
    	'HTTP_X_FORWARDED_FOR',
    	'HTTP_X_FORWARDED',
    	'HTTP_FORWARDED_FOR',
    	'HTTP_FORWARDED',
    	'HTTP_X_REAL_IP',
    );
    foreach ( $envs as $env ) {
    	if ( array_key_exists( $env, $_SERVER ) ) {
    		$check_ip = getenv( $env );
    		echo "$env - with env function -> $check_ip";
    		echo '<br>';
    		echo "$env - with variable SERVER -> " . $_SERVER[ $env ];
    		echo '<br>';
    	}
    }
    exit;
    

    then run in chrome and give me a screenshot.
    thanks

    Here is the code you requested:

    REMOTE_ADDR – with env function -> 10.69.56.225
    REMOTE_ADDR – with variable SERVER -> 24.80.133.30
    HTTP_X_FORWARDED_FOR – with env function -> 24.80.133.30
    HTTP_X_FORWARDED_FOR – with variable SERVER -> 24.80.133.30

    Plugin Contributor Mehrshad Darzi

    (@mehrshaddarzi)

    @newlaurie20

    Thank you for this report.
    please change line 793-810 in

    wp-content/plugins/wp-statistics/includes/classes/class-wp-statistics.php

    to :

    
    if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
    			$user_ip = $_SERVER['HTTP_CLIENT_IP'];
    		} else if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
    			$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    		} else if ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
    			$user_ip = $_SERVER['HTTP_X_FORWARDED'];
    		} else if ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
    			$user_ip = $_SERVER['HTTP_FORWARDED_FOR'];
    		} else if ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
    			$user_ip = $_SERVER['HTTP_FORWARDED'];
    		} else if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
    			$user_ip = $_SERVER['REMOTE_ADDR'];
    		} else {
    			$user_ip = false;
    		}
    
    		//Check Validation IP
    		$check_ip = $this->get_ip_value( $user_ip );
    		if ( $check_ip != false ) {
    			$this->ip = $check_ip;
    		}
    

    and save it.
    Then test in a few hours and say the result.

    It has been several hours since updating the code, and there has been no change.

    I will check it again in a few hours and report back.

    • This reply was modified 1 month, 2 weeks ago by  newlaurie20.

    I’ve just checked it again: the problem remains.

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    I’ve just checked it again: the problem remains.

    We’re working for improvement get_IP() method for any environments. below is one of change in this method.

    https://github.com/wp-statistics/wp-statistics/commit/325ede12a813bc74efeccb0cb53f1df7b2accec5

    We’ll inform you on this topic when the section completed.

    • This reply was modified 1 month, 2 weeks ago by  Mostafa Soufi.
    • This reply was modified 1 month, 2 weeks ago by  Mostafa Soufi.
    • This reply was modified 1 month, 2 weeks ago by  Mostafa Soufi.
    • This reply was modified 1 month, 2 weeks ago by  Mostafa Soufi.
    • This reply was modified 1 month, 2 weeks ago by  Jan Dembowski.
Viewing 15 replies - 1 through 15 (of 26 total)
  • You must be logged in to reply to this topic.