• Resolved wzshop

    (@wzshop)


    Hi,
    When i lookup my location with IP 185.54.163.231, through your plugin it shows as country: BE.
    However when i run this script it shows NL

    <?php
     $userInfocustom = geoip_detect2_get_info_from_current_ip();
    echo $userInfocustom->country->isoCode;
    ?>

    How is this possible?
    I am not using any cache plugins btw.

    Thanks

    https://www.ads-software.com/plugins/geoip-detect/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Benjamin Pick

    (@benjamin4)

    Maybe he is detecting the wrong IP? Try

    echo geoip_detect2_get_client_ip();
    
    Thread Starter wzshop

    (@wzshop)

    Hi,
    Thanks for your reply.
    To be clear, i am testing the functionality through a VPN service. I actually am in NL, but connect to a server in BE.

    When insert your code i do not see my own ip or the new ip. Instead i get this: 162.158.108.5

    Now Ive found out this originates from Cloudflare, which is the CDN that I am using. When i deactivate cloudflare, it is working again.

    My question now is, is this plugin not working when using Cloudflare? Or is it just not working because of the VPN?
    Thanks

    Plugin Author Benjamin Pick

    (@benjamin4)

    In this case, Cloudflare is your “reverse proxy”. You can activate reverse proxy support in the plugin options.

    Thread Starter wzshop

    (@wzshop)

    Awesome, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Showing the wrong content?’ is closed to new replies.