Normally it should only use the server IP if you have a localhost-Server (thus the IP of the client is not geo-specific). Can you tell me an IP from Israel for testing?
I’m not from Israel, I usually just search for proxies.
81.199.2.116
212.25.95.135
192.114.168.134
81.199.171.56
Using the test tool available at the admin panel of the plugin, it identifies the proxies IPs as israelis.
If I use the proxy to access it it doesn’t appear to work
Hello, Benjamin. Thank you for your work. This country based css is exactly what I need. Unfortunately, I got the same issue as ViperXd. Plugin detects my server IP instead of visitor’s. Is there any possible way to fix it?
Oh, does your server use a reverse proxy?
(How to find out: look at var_dump($_SERVER) and tell me which array key contains your IP.)
I have added reverse proxy support now. Please try the development version:
https://github.com/yellowtree/wp-geoip-detect/archive/master.zip
You will have to enable it in the options.
Thank you, Benjamin. That’s the answer!
Here are my results:
I ran var_dump($_SERVER) and got there: [“HTTP_X_FORWARDED_FOR”]=> [my real ip]
I installed dev version, and its immediately showed: The server is behind a reverse proxy (With Proxy: [my real ip] – Without Proxy: [server ip])
But for some time it doesn’t detect my ip on front-end correctly, it still was ip of the server. Few hours later (I was busy, changed nothing) I discovered everyrhing works like a charm (guess it’s cache thing).
It’s the most efficient way to implement geo-targeting without one tiny change in css. Excellent work! Thank you very much!
Version 1.8 was now released.