• Resolved fulviods

    (@fulviods)


    Hi

    I have this bug
    Undefined index: country in .../web/wp-content/plugins/wp-slimstat/wp-slimstat.php on line 557

    My plugin is updated
    I check on google : search and noticed a lot of websites have the same problem! what is it ?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @fulviods,

    It’s possible that’s related to invalid MaxMind data file. You can find more info in other posts.

    From other side, MaxMind v2 has some changes: ( https://dev.maxmind.com/geoip/geoip2/whats-new-in-geoip2/ ):

    Country, Registered Country, and Represented Country

    We now distinguish between several types of country data. The country is the country where the IP address is located. The registered_country is the country in which the IP is registered. These two may differ in some cases.

    Finally, we also include a represented_country key for some records. This is used when the IP address belongs to something like a military base. The represented_country is the country that the base represents. This can be useful for managing content licensing, among other uses.

    For some IP addresses, I see (other languages have removed):

    array (
      'continent' => 
      array (
        'code' => 'EU',
        'geoname_id' => 6255148,
        'names' => 
        array (
          'en' => 'Europe',
        ),
      ),
      'registered_country' => 
      array (
        'geoname_id' => 6252001,
        'iso_code' => 'US',
        'names' => 
        array (
          'en' => 'United States',
        ),
      ),
    )
    

    So, it’s normal behavior that regular IP has empty country index. I’m not sure what’s good approach, maybe we should copy registered_country or represented_country to country ( when basic county is empty).

    Regards,
    Sasa

    I see that WP debug mode (or PHP error_reporting is E_ALL) is enabled on your website and PHP notices are shown inside HTML code.

    You can set only logging PHP errors – set constant WP_DEBUG_DISPLAY to false or display_errors (php.ini) to Off. More info on:
    https://codex.ww.wp.xz.cn/Debugging_in_WordPress
    http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors

    It seems that’s same issue as https://ww.wp.xz.cn/support/topic/php-notice-undefined-index-country/ and you can see more details there.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined index’ is closed to new replies.