This plugin finds the country and city of the user by the IP address and saves the info in a cookie and a global php variable. Furthermore, for sites
Author: | Boyan Raichev (profile at wordpress.org) |
WordPress version required: | 4.0.0 |
WordPress version tested: | 4.6.1 |
Plugin version: | 1.1 |
Added to WordPress repository: | 13-10-2015 |
Last updated: | 15-12-2016
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 100 |
Rated by: | 1 |
Plugin URI: | https://github.com/talkingaboutthis/ip-loc8 |
Total downloads: | 2 014 |
Active installs: | 20+ |
Click to start download
|
FAQ
The plugin does not work!
If the plugin does not seem to locate the country the problem might be a connection timeout. The curl connection timeout is conservatively set to 2 seconds for CURLOPT_CONNECTTIMEOUT and 4 seconds for CURLOPT_TIMEOUT, so that the page loading time is not severely delayed when the servers are not responding. Still, in most cases this should be enough. If you experience timeouts often write on GitHub or the WordPress support forums and the limits will be reconsidered.
How long does the cookie remain in the browser?
The cookie is kept for 2 weeks only. People with smartphones and tablets often move, so we do not want to have data that is very old.
What if cookies are disabled?
The information is also stored in a global variable $visitorGeolocation. The plugin also uses the user session to store the information, so that the IP database is queried only upon the first page load.
What if I want to do other things upon first page load?
If you want to do some additional things upon first page load (set currency in your shop, for example), there are two ways to do that:
1. Use the ‘iploc8_set_country’ action, which is only run upon first page load (country 2 letter code is passed as a variable).
2. Check if the ‘IPLOC8NEW’ constant is defined. It is defined only at the first page load and its value is the user’s country 2-letter code.
ChangeLog