Viewing 6 replies - 1 through 6 (of 6 total)
  • I had this ZZ country code too – it was after a failed save try. I had resetted the values immediately and had no such effects then as you describe.

    Have you tried a reset?

    Greetings!

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Dear guys,

    I’m sorry for poor documentation about country code ZZ. It means “Unknown country” that is cause by two cases.

    1. A new IP address and there’s no data in DBs.
    2. A Private address or localhost.

    In both cases, this plugin can not decide the country code.

    If your IP address is within the range of the above, please give this plugin a fake IP. For example, the following snippet in your functions.php:

    function my_replace_ip( $ip ) {
        return '98.139.183.24'; // yahoo.com
    }
    add_filter( 'ip-geo-block-ip-addr', 'my_replace_ip' );

    I embed the following code into wp-config.php in my local PC for test purpose to change IP with different browsers:

    $_SERVER['REMOTE_ADDR'] = '182.22.72.251'; // yahoo.co.jp
    if ( FALSE !== strpos( $_SERVER['HTTP_USER_AGENT'], 'Chrome' ) ) {
        $_SERVER['REMOTE_ADDR'] = '98.137.149.56'; // yahoo.com
    }

    Also please refer to the document about the filter hook “ip-geo-block-ip-addr“.

    I hope this may help you.

    P.S. ZZ is a User-assigned code elements.

    Anyway: I had maybe executed first “Best practice” and then “Default settings” after the failed save process, at least I had then my old entries again and the ZZ was no more there.

    However: thank you very much for detailed explaining the “ZZ” – it’s really useful to know this!

    Kind regards!

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi there,

    @alpengreis: Thank you for sharing your information!

    @ksalhoff: If you are within the LAN (for example, see this topic), could you try to add your private address with CIDR notation into Whitelist of extra IP addresses prior to country code like “192.168.0.0/16” ?

    Or should I implement some module which can distinguish private addresses from public?

    I would appreciate any comments or suggestions.
    Thanks.

    Thread Starter ksalhoff

    (@ksalhoff)

    So I re-enabled the plugin with “US,ZZ” as whitelised and added the private networks as extra IP addresses and it’s no longer blocking. I appreciate the help and the explanations.

    Plugin Author tokkonopapa

    (@tokkonopapa)

    Glad to hear that!

    And my recomendation is: please enable only Maxmind and IP2Location at Geolocation API settings. Because if your client IP address is localhost or private address, this plugin tries to fetch all the enabled geolocation service APIs which would be failed. It wastes certain time.

    Good luck!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ZZ Country code blocked always’ is closed to new replies.