khromov / wp-wpml-geoip-browser-language-redirect

GeoIP Redirector for WPML (WordPress)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redirect not working: {"country_code":false}

opened this issue · comments

hi khromov,

thanks for this great plugin, unfortunately the redirect is not working for me.

When I visit https://www.mysite.com/?wpml_geoip=1, I get:

{"country_code":false}.

I'm in Kenya.

My console returns this when I'm in debug mode:

Uncaught TypeError: Cannot read property 'log' of undefined
at HTMLDocument. (browser-redirect-geoip.js?ver=4.8:23)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)
(anonymous) @ browser-redirect-geoip.js?ver=4.8:23
i @ jquery.js?ver=1.12.4:2
fireWith @ jquery.js?ver=1.12.4:2
ready @ jquery.js?ver=1.12.4:2
K @ jquery.js?ver=1.12.4:2

Do you know what could be wrong?

Many thanks!
Pieter

@pmjvanwijk Can you try updating your GeoIP.dat file and see if you still get undefined as your country code? You can find a new copy here: https://dev.maxmind.com/geoip/legacy/install/country/

@pmjvanwijk Must be some issue with the Maxmind library. Please check your server log for errors. This issue might be related: #2

@pmjvanwijk I know @andreasneuber added an options page for the mappings a while back, did you configure them? :)

Related: #20

@pmjvanwijk Mappings are handled through the web UI now. The readme documentation is out of date. See the ticket I linked above. 😄

Thanks! Good to know. I've reinstalled the plugin. I don't see any country codes in the settings menu.

screen shot 2017-08-01 at 4 06 23 pm

@pmjvanwijk Do you have WPML installed and configured for these languages? In that case I'll have to ask @andreasneuber if perhaps the integration needs to be updated.

Yep!
screen shot 2017-08-01 at 4 19 57 pm

@pmjvanwijk Please try with the latest version from GitHub - @andreasneuber added patch to fix this.