Developers
benjaminpick |
benjamin4 |
Download Stats
Today | 29 |
Yesterday | 58 |
Last Week | 671 |
All Time | 107,818 |
Provides geographic information detected by an IP adress. This can be used in themes or other plugins, as a shortcode, or via CSS body classes. The city & country names are translated in different languages (supported languages).
Features:
- You can use one of these data sources (see comparison):
- Free (default source): HostIP.info (IPv4 only)
- Free with registration: Maxmind GeoIP2 Lite City, automatically updated weekly
- Commercial: Maxmind GeoIP2 City or Maxmind GeoIP2 Country
- Commercial Web-API: Maxmind GeoIP2 Precision (City, Country or Insights)
- Hosting-Provider dependent: Cloudflare or Amazon AWS CloudFront (Country)
- Free or Commercial Web-API: Ipstack
- Commercial Web-API via AWS Marketplace: Fastah
- Provides these 5 functions (see API Documentation):
-
geoip_detect2_get_info_from_ip($ip, $locales <h4>array('en'), $options</h4> array())
: Lookup Geo-Information of the specified IP -
geoip_detect2_get_info_from_current_ip($locales <h4>array('en'), $options</h4> array())
: Lookup Geo-Information of the current website user -
geoip_detect2_get_current_source_description(...)
: Return a human-readable label of the currently chosen source. -
geoip_detect2_get_external_ip_adress()
: Fetch the internet adress of the webserver -
geoip_detect2_get_client_ip()
: Get client IP (even if it is behind a reverse proxy)
-
- For the property names, see the results of a specific IP in the wordpress backend (under Tools > Geolocation IP Detection).
- You can include these properties into your posts and pages by using the shortcode
[geoip_detect2 property="country.name" default="(country could not be detected)" lang="en"]
(where 'country.name' can be one of the other property names as well, and 'default' and 'lang' are optional). - You can show or hide content by using a shortcode
[geoip_detect2_show_if country="FR, DE" not_city="Berlin"]TEXT[/geoip_detect2_show_if]
. See Shortcode Documentation. - When enabled on the options page, it adds CSS classes to the body tag such as
geoip-province-HE
,geoip-country-DE
andgeoip-continent-EU
. - If you are using a page cache, it is recommended to use the AJAX mode (see AJAX)
- When enabled on the options page, the client IP respects a reverse proxy of the server.
- If you are using Contact Form 7, you can use these shortcodes:
- A select input with all countries, the detected country being selected by default:
[geoip_detect2_countries mycountry]
- A text input that is pre-filled with the detected city (or other property):
[geoip_detect2_text_input city property:city lang:fr id:id class:class default:Paris]
- Geolocation information for the email text:
[geoip_detect2_user_info]
- A select input with all countries, the detected country being selected by default:
- Together with SVG Flags you can show the flag of the detected country:
[geoip_detect2_current_flag]
(see documentation)
See Documentation for more info.
How can I use these functions?
- You could choose the currency of the store based on the country name
- You could pre-fill the shipping country
- You could show the store nearest to your customer
- You show or hide content specific to a geographic target group
- Etc. ... You tell me! I'm rather curious what you'll do with this plugin!
- Be careful to comply to the applicable laws. For example Regulation (EU) 2018/302 ...
- If you need to get the user's timezone, it is more accurate to use JS solutions.
System Requirements: You will need at least PHP 7.2.5 If you use the plugin WooCommerce, you'll need at least WooCommerce 3.9.0 .
GDPR: See Is this plugin GDPR-compliant?
This extension is "charity-ware". If you are happy with it, please leave a tip for the benefit of this charity. (See FAQ for more infos.)
Here are other ways to contribute to the development of this plugin.
This product can provide GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
Releases (40 )
Version | Release Date | Change Log |
---|---|---|
5.1.1 | 2022-10-27 |
|
5.1.0 | 2022-10-27 | New Datasource: Fastah Web API (beta), see https://aws.amazon.com/marketplace/pp/prodview-k5gjowexrefl2 AJAX mode:
* NEW: The JS function Other minor changes:
* FIX: In non-AJAX mode, properties such as "extra.original.zip" can be accessed again
* FIX: Automatic download of Maxmind database now also works when the temp folder is group/world writeable (as in AWS configurations)
* If you want to enable more Warnings (e.g. while debugging), you can add |
5.0.0 | 2022-01-07 | If you are using AJAX mode, please read the changelog. |
4.2.3 | 2021-07-26 |
|
4.2.2 | 2021-07-19 |
|
4.2.1 | 2021-07-19 |
|
4.2.0 | 2021-07-16 |
|
4.1.0 | 2021-03-11 |
|
4.0.1 | 2021-03-02 | Hotfix - avoid fatal erros if another plugin also has the Maxmind library included |
4.0.0 | 2021-03-02 | Improving Shortcodes (and Shortcodes for AJAX!) New Minimum Requirements: PHP 7.2.5, and if you use WooCommerce it needs to be 3.9.0 or later. |
3.3.0 | 2020-12-15 | Improving AJAX mode - now you can use it for specific pages. |
3.2.1 | 2020-12-02 | This update fixes an issue of 3.2.0 if your installation has WP_DEBUG enabled. |
3.2.0 | 2020-11-26 | This plugin version simplifies complying the the EULA of Maxmind by automatically retrieving and honoring their Privacy Exclusion List. You need to enter your Account ID in the options. Find more information about the Privacy Exclusion API in the FAQ of the plugin. |
3.1.2 | 2020-11-04 |
|
3.1.1 | 2020-08-10 |
|
3.1.0 | 2020-06-26 | The property access for shortcodes has been rewritten so that property names such as "extra.original.zip" (Datasource: ipstack) are possible now. |
3.0.4 | 2020-05-05 |
|
3.0.3.1 | 2020-03-31 | Hotfix for the Manual download Maxmind datasource. The Plugin was renamed to Geolocation IP Detection in order to prevent trademark issues. |
3.0.3 | 2020-03-27 | The Plugin was renamed to Geolocation IP Detection in order to prevent trademark issues. |
3.0.2 | 2020-03-26 | The Plugin was renamed to Geolocation IP Detection in order to prevent trademark issues. |
3.0.1 | 2020-01-08 | 3.0 was not compatible with the WooCommerce plugin. |
3.0 | 2019-12-30 | If you use Maxmind "Automatic download" then you need to upgrade to this plugin version in order to continue to receive database update. The Database licence changed and you will need to register at their website and agree to the EULA. |
2.13.0 | 2019-12-02 | PHP 5.6 is required now. If you are using the AJAX mode, this version will drastically reduce the number of requests as it will store the visitor's geo-information in a cookie. |
2.12.1 | 2019-11-01 |
|
2.12.0 | 2019-09-11 | New: Ipstack.com can be used as data source |
2.11.1 | 2019-07-13 |
|
2.11.0 | 2019-04-11 | The Download code of the automatically updated Maxmind file was rewritten for better performance. Also, AJAX support is now in beta (see documentation). |
2.10.0 | 2019-02-22 |
|
2.9.2 | 2018-12-04 | Hotfix: In 2.9.1, this plugin was incompatible with other Contact Form 7-Special Mailtags (https://contactform7.com/special-mail-tags/). |
2.9.1 | 2018-11-21 | Online Shops: Be careful to comply to (EU) 2018/302 (going into effect 03 Dec 2018) in how you use this plugin ! |
2.9.0 | 2018-07-24 | There have been changes to the reverse proxy logic. If you have enabled a reverse proxy, check if the detected IP is correct. New: Shortcode for showing/hiding content! = |
2.8.2 | 2018-01-13 | This plugin version is compatible with PHP 7.2 and adapted the automatic update code. |
2.8.0 | 2017-10-12 | Warning: This bugfix version of the plugin requires PHP 5.4. |
2.7.0 | 2017-03-17 |
|
2.6.0 | 2016-09-30 | Support for Cloudflare & AWS. 2 shortcodes for Contact Form 7. |
2.5.7 | 2016-03-29 |
|
2.5.6 | 2016-02-05 | Some users reported problems with open_basedir-notices - if that's you, this update will help. Otherwise there are no changes. |
2.5.4 | 2015-12-03 |
|
2.5.3 | 2015-10-15 | This is a security update (please update). |
1.8 | 2014-12-02 |
|