• The plugin does not recognise the IP location anymore. It is always displaying the US link, even that the UK is selected as the default country.

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author paulstuttard

    (@paulstuttard)

    First things first, if you visit https://www.ip2nation.com you can double check that your IP is being correctly recognised as a UK one.

    Be aware that if you are running any third party caching software that will cache only one version of the page, so any change of locale will not be reflected in the pages displayed.

    You could try installing the Amazon Link Extra - Spoof Locale plugin and changing the locale that should be displayed by adding ?spoof_locale=uk to the url, e.g. https://www.tripinsiders.net/?spoof_locale=uk

    Paul

    Thread Starter tripinsider

    (@tripinsider)

    Hi Paul,

    Yes, I can see that ip2nation is detecting the country with no problem. Why would the plugin use all the time the link to US? I have tried from different countries (using proxies and remote desktop) and there is no change at all. It was working ok some time ago so I suspect it was an update.

    Can you give a hint of where to debug or try to find the problem?

    Cheers

    Thread Starter tripinsider

    (@tripinsider)

    Hi Paul,

    Could you please let me know the file and/o function where the country is detected and the default link rendered so I can debug it?

    Cheers

    Thread Starter tripinsider

    (@tripinsider)

    I am using cloudflare. Could this be the root cause of the problem?

    Thread Starter tripinsider

    (@tripinsider)

    So yes I found that Cloudflare was the problem, as ip2n->get_cc() was returning ‘eu’. As a quick fix, I enabled GeoLocation on Cloudflare and I changed amazon.php to use $_SERVER[“HTTP_CF_IPCOUNTRY”] (set by Cloudflare) instead of ip2n.

    Plugin Author paulstuttard

    (@paulstuttard)

    Excellent work, sorry I could not be more help (busy at work), I’ll investigate building that into the plugin.

    Paul

    Thread Starter tripinsider

    (@tripinsider)

    I think a simple configuration such as “Use Cloudflare GeoLocation HTTP header” would do it. You then use ip2n->get_cc() or $_SERVER[“HTTP_CF_IPCOUNTRY”] accordingly

    Thread Starter tripinsider

    (@tripinsider)

    Hi Paul,

    I just upgraded the plugin and I lost the fix for cloudflare. Are you planning to include it?

    Cheers

    Thread Starter tripinsider

    (@tripinsider)

    Hi Paul,

    I just saw you actually added it. I think you need the following correction:

    strtolower($_SERVER[“HTTP_CF_IPCOUNTRY”]);

    Cheers

    Plugin Author paulstuttard

    (@paulstuttard)

    Hi, Sorry – I don’t use cloud flare so did not test the fix, but I’ll put your change into the next version of the plugin.

    Paul

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Location not recognised’ is closed to new replies.