Wordpress plugin "Geolocation IP Detection": Provides geographic information detected by an IP adress.
Contributors: benjaminpick
License: GPL v3 or later
Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL
Provides geographic information detected by an IP adress.
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: =
geoip_detect2_get_info_from_ip($ip, $locales = array('en'), $options = array())
: Lookup Geo-Information of the specified IPgeoip_detect2_get_info_from_current_ip($locales = array('en'), $options = array())
: Lookup Geo-Information of the current website usergeoip_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 webservergeoip_detect2_get_client_ip()
: Get client IP (even if it is behind a reverse proxy)[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).[geoip_detect2_show_if country="FR, DE" not_city="Berlin"]TEXT[/geoip_detect2_show_if]
. See Shortcode Documentation.geoip-province-HE
, geoip-country-DE
and geoip-continent-EU
.[geoip_detect2_countries mycountry]
[geoip_detect2_text_input city property:city lang:fr id:id class:class default:Paris]
[geoip_detect2_user_info]
[geoip_detect2_user_info]
[geoip_detect2_current_flag]
(see documentation)See Documentation for more info.
= How can I use these functions? =
System Requirements: You will need at least PHP 7.2.5 . Also, 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.
geoip_detect2_get_info_from_current_ip()
return the same country, regardless of where you are visiting the site from?Disable caching a page that contains a shortcode or API call to geo-dependent functions.
Technically speaking, how could I verify if my visitor comes from Germany?
How can I show text only if the visitor is coming from Germany?
How can I add the current country name as text in my page?
Which data source should I choose?
Can I change the time period how long the data is cached?
Does this plugin work in a MultiSite-Network environment?
Is this plugin GDPR-compliant?
What does “Privacy Exclusions” mean?
What do you mean by “This plugin is charity-ware”?
Further documentation
= 5.5.0 =
When using the default datasource “hostip.info”, the region code (i.e. CA) is now correctly moved to the property mostSpecificSubdivision
(previously, it was part of the property city
)
= 5.0.0 =
If you are using AJAX mode, please read the changelog.
= 5.5.0 =
mostSpecificSubdivision
(previously, it was part of the property city
)= 5.4.1 =
= 5.4.0 =
{geoip_detect2_user_info}
)= 5.3.2 =
= 5.3.1 =
= 5.3.0 =
= 5.2.2 =
= 5.2.0 =
= 5.1.1 =
geoip_detect2_client_ip_whitelist_internal_ips
.= 5.1.0 =
New Datasource: Fastah Web API (beta), see https://aws.amazon.com/marketplace/pp/prodview-k5gjowexrefl2
AJAX mode:
geoip_detect.set_override_with_merge
can modify the override record in one property, merging it with the currently saved propertyOther minor changes:
define('GEOIP_DETECT_DEBUG', true)
to your wp-config.php or so.= 5.0.0 =
In this release, there a small breaking changes marked by [!].
AJAX mode:
[geoip_detect2_show_if country=""]Country was not detected[/geoip_detect2_show_if]
are now working (they were ignored before)ajax
(e.g. [geoip_detect2_text_input ajax="invalid"]
) are now using the AJAX option instead of always disabling AJAX[geoip_detect2_show_if]
renders as a <div>
if it detects that the containing content has HTML block level elementsautosave
saves the user input as local override for this browser. [geoip_detect2_countries mycountry autosave]
and [geoip_detect2_text_input city property:city autosave]
. (Please give feedback if this works as expected!)set_override(record, duration_in_days)
now refreshes the AJAX shortcodes and CSS body classes.Other changes:
geoip_detect2_source_header_http_key
Other minor changes:
The code of the plugin has not changed much, I have named this version 3.0 to indicate the major change on Maxmind’s side of things. They explain it in this blog post:
https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/