You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API:-AJAX.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ If the cached HTML is geo-independent, yet it should be customized depending on
6
6
7
7
GET `https://example.com/wp-admin/admin-ajax.php?action=geoip_detect2_get_info_from_current_ip`
8
8
9
-
The function `geoip_detect2_get_info_from_current_ip()` can be called via JS and returns the JSON data. This only works if the option "Enable JS API" is checked.
9
+
The function `geoip_detect2_get_info_from_current_ip()` can be called via JS and returns the JSON data. This only works if the option "Enable JS API" is checked.
10
10
11
11
## HTTP Response Codes
12
12
@@ -18,7 +18,7 @@ The function `geoip_detect2_get_info_from_current_ip()` can be called via JS and
18
18
19
19
## JSON Response object
20
20
21
-
The result from the datasource. See [Record Properties](./RecordProperties.md) for all available properties. No property name is guaranteed to exist:
21
+
The result from the datasource. See [Record Properties](./Record-Properties.md) for all available properties. No property name is guaranteed to exist:
22
22
23
23
```js
24
24
var city =record.city&&record.city.names&&record.city.names.en;
If you are only using the method geoip_detect.get_info(), then you can opt in to a smaller JS file variant.
107
+
If you are only using the method geoip_detect.get_info(), then you can opt in to a smaller JS file variant.
108
108
109
109
```php
110
110
define('GEOIP_DETECT_JS_VARIANT', 'base');
@@ -119,7 +119,7 @@ There are three possible variants:
119
119
### Storing data that overrides detected data
120
120
(Since 4.0.0)
121
121
122
-
It is best practise to give the user the option to override the geo-detected data, for example when showing different currencies in different countries.
122
+
It is best practise to give the user the option to override the geo-detected data, for example when showing different currencies in different countries.
123
123
This how you can set a new record manually in JavaScript:
* Both events get fired only if the corresponding feature is enabled in the backend options
214
-
* Both events potentially get fired more than once, e.g. after a call to [set_override](./API:-AJAX#storing-data-that-overrides-detected-data) or when used in combination with [autosave](./API:-Shortcodes).
214
+
* Both events potentially get fired more than once, e.g. after a call to [set_override](./API:-AJAX#storing-data-that-overrides-detected-data) or when used in combination with [autosave](./API:-Shortcodes).
```YellowTree\GeoipDetect\DataSources\City``` is a subclass of ```GeoIp2\Model\City``` and yes, for simplicity this object type is always used even if one of the country data sources is used. See [Record Properties](./RecordProperties.md) for all possible property names (all from Maxmind plus a few from this plugin).
27
+
```YellowTree\GeoipDetect\DataSources\City``` is a subclass of ```GeoIp2\Model\City``` and yes, for simplicity this object type is always used even if one of the country data sources is used. See [Record Properties](./Record-Properties.md) for all possible property names (all from Maxmind plus a few from this plugin).
Copy file name to clipboardExpand all lines: docs/FAQ.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ if ($userInfo->country->isoCode == 'de')
12
12
echo 'Hallo! Schön dass Sie hier sind!';
13
13
```
14
14
15
-
To see which property names are supported, refer to the list of [Record Properties](./RecordProperties.md) or to the plugin's Lookup page.
15
+
To see which property names are supported, refer to the list of [Record Properties](./Record-Properties.md) or to the plugin's Lookup page.
16
16
17
17
## How can I show text only if the visitor is coming from Germany?
18
18
@@ -30,15 +30,15 @@ Shipping to Germany is especially cheap!
30
30
```
31
31
32
32
You need to enable the option `Add a country-specific CSS class to the <body>-Tag` to make this work.
33
-
See [API Usage Examples#css-use](./APIUsageExamples#css-use.md) for a more elaborate example.
33
+
See [API Usage Examples#css-use](./API-Usage-Examples#css-use.md) for a more elaborate example.
34
34
35
35
## How can I add the current country name as text in my page?
36
36
37
37
Add this plugin shortcode somewhere in the page or post content:
38
38
39
39
Wie ist das Wetter in [geoip_detect2 property="country.name" lang="de" default="ihrem Land"] ?
40
40
41
-
For more information, check the [API: Shortcodes]] documentation and [[API Usage Examples](./API: Shortcodes]] documentation and [[API UsageExamples.md).
41
+
For more information, check the [API: Shortcodes](API:-Shortcodes) documentation and [API Usage Examples](API-Usage-Examples).
42
42
43
43
## Which data source should I choose?
44
44
@@ -57,11 +57,11 @@ Each source has its advantages and disadvantages:
57
57
Legend:
58
58
* Column _Cost_: The price can depend on several factors: if you need city or country data, if pay per month, per year, or per query, etc. A price per query, of course, is helpful if you use a low amount of queries per month.
59
59
* Column _Precision_: To compare the commercial and the free data of Maxmind, see [accuracy stats per country](https://www.maxmind.com/en/geoip2-city-database-accuracy). Accuracy between data sources may differ according to your main target country.
60
-
* Column _Performance_: There are great differences how long a lookup can take. The Web-APIs take 0.5-1 second per Lookup (that's why they are cached for new each IP you request data from), the File-based APIs only about 0.01 second.
60
+
* Column _Performance_: There are great differences how long a lookup can take. The Web-APIs take 0.5-1 second per Lookup (that's why they are cached for new each IP you request data from), the File-based APIs only about 0.01 second.
61
61
* Column _Registration_: Some services require you to sign up at their website before you can use this datasource.
62
62
63
63
Additional Notes for certain sources:
64
-
* If you choose "DB-IP", you must include a link back to DB-IP.com on pages that display or use results from the database.
64
+
* If you choose "DB-IP", you must include a link back to DB-IP.com on pages that display or use results from the database.
65
65
* If you choose "automatic" and enter the account's license key, this plugin will install "Maxmind GeoIP2 Lite City" and update it weekly. This is the easiest option.
66
66
* If you choose "manual", you can use any of the file-based Maxmind-Databases. It's recommended that you update the database regularly, for example by using the [shell script provided by Maxmind](http://dev.maxmind.com/geoip/geoipupdate/).
67
67
* If you choose "ipstack", note that the free plan does not allow HTTPS-Encryption of their lookup – which is bad if you have to comply to GDPR.
@@ -79,7 +79,7 @@ if (!defined('GEOIP_DETECT_READER_CACHE_TIME'))
* Details: [End User Licence Agreement](https://www.maxmind.com/en/end-user-license-agreement#internal-restricted-business-purposes)
84
84
85
85
(This changed on Dec 30, 2019. Before, the databases were licensed "Creative Commons ShareAlike-Attribution" - this is not the case anymore.)
@@ -92,7 +92,7 @@ There seem to be no issues with WordPress multisite, but it is not officially su
92
92
93
93
If your website is available in EU-countries, it must comply to GDPR-Regulations for privacy. Using this plugin is not GDPR-compliant per se, because it all depends on your use case and whether you explain it in your privacy policy.
94
94
95
-
1. If you use a web-based source (hostip.info, Maxmind Precision, ipstack), the plugin stores all IPs that visited the site in a cache (by default for 7 days) for performance reasons. If you want to disable this behavior, add `define('GEOIP_DETECT_READER_CACHE_TIME', 0);` in your theme's `function.php`.
95
+
1. If you use a web-based source (hostip.info, Maxmind Precision, ipstack), the plugin stores all IPs that visited the site in a cache (by default for 7 days) for performance reasons. If you want to disable this behavior, add `define('GEOIP_DETECT_READER_CACHE_TIME', 0);` in your theme's `function.php`.
96
96
97
97
2. If you use the source Ipstack.com, you must use encryption (thus you need to pay to ipstack.com because their free plans currently do not allow encryption).
98
98
@@ -119,7 +119,7 @@ Due to the California Consumer Privacy Act (CCPA), Maxmind has created an EULA t
119
119
120
120
You can choose to disable that behavior.
121
121
122
-
```php
122
+
```php
123
123
// Make sure you are compliant to the EULA in a different way!
0 commit comments