Skip to content

Commit a64a8e9

Browse files
author
Benjamin Pick
committed
docs update links [ci skip]
1 parent 7c96c08 commit a64a8e9

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

docs/API:-AJAX.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If the cached HTML is geo-independent, yet it should be customized depending on
66

77
GET `https://example.com/wp-admin/admin-ajax.php?action=geoip_detect2_get_info_from_current_ip`
88

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.
1010

1111
## HTTP Response Codes
1212

@@ -18,7 +18,7 @@ The function `geoip_detect2_get_info_from_current_ip()` can be called via JS and
1818

1919
## JSON Response object
2020

21-
The result from the datasource. See [Record Properties](./Record Properties.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:
2222

2323
```js
2424
var city = record.city && record.city.names && record.city.names.en;
@@ -52,21 +52,21 @@ jQuery(document).ready(function($) {
5252
// console.log('Record', record.data);
5353

5454
// If no locales are given, use the website language
55-
$('.geo-continent').text(record.get('continent'));
55+
$('.geo-continent').text(record.get('continent'));
5656

5757
// Second parameter is the default value if the property value is empty or non-existent. For example, the IP might be from a satellite connection.
5858
$('.geo-continent').text(record.get('continent', 'Weird: no country detected.'));
59-
59+
6060
// Return the German name of the country, if not available, use English
6161
$('.geo-country').text(record.get_with_locales('country', ['de']));
62-
62+
6363
// Return the German name of the country, if not available, show "default text"
6464
$('.geo-country-de').text(record.get('country.names.de', 'default text'));
65-
65+
6666
// Try French first, then German, then English. The pseudo-property "name" is also supported ('city' would result in the same return value).
6767
$('.geo-city').text(record.get_with_locales('city.name', ['fr', 'de', 'en'], 'No city detected.'));
68-
69-
// The same property names can be used as in the shortcode syntax
68+
69+
// The same property names can be used as in the shortcode syntax
7070
$('.geo-city-id').text(record.get('city.geoname_id'));
7171
$('.geo-ip').text(record.get('traits.ip_address'));
7272

@@ -75,7 +75,7 @@ jQuery(document).ready(function($) {
7575
// This will return the same JS promise as above, so that this will not result in a second AJAX request.
7676
geoip_detect.get_info().then(function(record) {
7777
$('.geo-country-2').text(record.get_with_locales('country', ['en']));
78-
});
78+
});
7979

8080
});
8181
```
@@ -104,7 +104,7 @@ add_filter('geoip_detect2_ajax_localize_script_data', function($data) {
104104
### JS Variants
105105
(Since 5.3.0)
106106

107-
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.
108108

109109
```php
110110
define('GEOIP_DETECT_JS_VARIANT', 'base');
@@ -119,7 +119,7 @@ There are three possible variants:
119119
### Storing data that overrides detected data
120120
(Since 4.0.0)
121121

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.
123123
This how you can set a new record manually in JavaScript:
124124

125125
```js
@@ -131,7 +131,7 @@ geoip_detect.set_override(new_record, { duration_in_days: 1 });
131131
geoip_detect.set_override_with_merge('country.iso_code', 'en', { duration_in_days: 1 });
132132
```
133133

134-
If you want to undo this override, simply call `geoip_detect.remove_override()`.
134+
If you want to undo this override, simply call `geoip_detect.remove_override()`.
135135

136136
(If you want to remove all overrides server-side, the easiest method to do this is renaming the cookie name.)
137137

@@ -146,7 +146,7 @@ geoip_detect.set_override_with_merge('country.iso_code', 'en', { duration_in_day
146146

147147
If you only need this JS on some sites, enqueue the JS file manually and uncheck the option `Add JS to make the access to the AJAX endpoint easier.`.
148148

149-
You can add the shortcode `[geoip_detect2_enqueue_javascript]` (since 3.3.0) on the pages/posts where you have geo-dependent content.
149+
You can add the shortcode `[geoip_detect2_enqueue_javascript]` (since 3.3.0) on the pages/posts where you have geo-dependent content.
150150

151151
Or, if you need a more general solution:
152152

@@ -211,4 +211,4 @@ document.getElementsByTagName('body')[0].addEventListener('geoip-detect-shortcod
211211
Note that:
212212

213213
* 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).

docs/API:-PHP.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ These are the PHP functions that you can use in your theme or plugin:
99
* @param array Property names with options.
1010
* @param boolean $skipCache TRUE: Do not use cache for this request. (Default: FALSE)
1111
* @param string $source Change the source for this request only. (Valid values: 'auto', 'manual', 'precision', 'header', 'hostinfo')
12-
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
12+
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
1313
* @param int $connectTimeout Initial connection timeout in seconds (Precision API only)
1414
* @return YellowTree\GeoipDetect\DataSources\City GeoInformation. (Actually, this is a subclass of \GeoIp2\Model\City)
15-
*
15+
*
1616
* @see https://github.com/maxmind/GeoIP2-php API Usage
1717
* @see http://dev.maxmind.com/geoip/geoip2/web-services/ API Documentation
1818
*
@@ -24,7 +24,7 @@ These are the PHP functions that you can use in your theme or plugin:
2424
function geoip_detect2_get_info_from_ip($ip, $locales = null, $options = array()) { ... }
2525
```
2626

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).
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).
2828

2929
```php
3030
/**
@@ -35,7 +35,7 @@ function geoip_detect2_get_info_from_ip($ip, $locales = null, $options = array()
3535
* @param array Property names with options.
3636
* @param boolean $skipCache TRUE: Do not use cache for this request. (Default: FALSE)
3737
* @param string $source Change the source for this request only. (Valid values: 'auto', 'manual', 'precision', 'header', 'hostinfo')
38-
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
38+
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
3939
* @param int $connectTimeout Initial connection timeout in seconds (Precision API only)
4040
* @return YellowTree\GeoipDetect\DataSources\City GeoInformation.
4141
*
@@ -51,14 +51,14 @@ function geoip_detect2_get_info_from_current_ip($locales = null, $options = arra
5151
/**
5252
* Get the Reader class of the currently chosen source.
5353
* (Use this if you want to use other methods than "city" or otherwise customize behavior.)
54-
*
54+
*
5555
* @param array(string) List of locale codes to use in name property
5656
* from most preferred to least preferred. (Default: Site language, en)
5757
* @param array Property names with options.
5858
* @param string $source Change the source for this request only. (Valid values: 'auto', 'manual', 'precision', 'header', 'hostinfo')
59-
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
59+
* @param float $timeout Total transaction timeout in seconds (Precision+HostIP.info API only)
6060
* @param int $connectTimeout Initial connection timeout in seconds (Precision API only)
61-
*
61+
*
6262
* @since 2.0.0
6363
* @since 2.5.0 new parameter $options
6464
* @since 2.7.0 Parameter $options['source'] has been introduced
@@ -71,7 +71,7 @@ function geoip_detect2_get_reader($locales = null, $options = array()) { ... }
7171
* Return a human-readable label of the currently chosen source.
7272
* @param string|object Id of the source or the returned record
7373
* @return string The label.
74-
*
74+
*
7575
* @since 2.3.1
7676
* @since 2.4.0 new parameter $source
7777
*/
@@ -83,10 +83,10 @@ function geoip_detect2_get_current_source_description($source = null) { ... }
8383
/**
8484
* Sometimes we can only see an local IP adress (local development environment.)
8585
* In this case we need to ask an internet server which IP adress our internet connection has.
86-
*
86+
*
8787
* @param boolean $unfiltered If true, do not check the options for an external adress. (Default: false)
8888
* @return string The detected IPv4 Adress. If none is found, '0.0.0.0' is returned instead.
89-
*
89+
*
9090
* @since 2.0.0
9191
* @since 2.4.3 Reading option 'external_ip' first.
9292
* @since 2.5.2 New param $unfiltered that can bypass the option.
@@ -100,16 +100,16 @@ This function is used automatically if the API sees an local IP adress (IPv4 or
100100
/**
101101
* Get client IP (even if it is behind a reverse proxy)
102102
* For security reasons, the reverse proxy usage has to be enabled on the settings page.
103-
*
103+
*
104104
* @return string Client Ip (IPv4 or IPv6)
105-
*
105+
*
106106
* @since 2.0.0
107107
*/
108108
function geoip_detect2_get_client_ip() { ... }
109109
```
110110

111111
## Shortcodes
112-
(See [API: Shortcodes](./API: Shortcodes.md))
112+
(See [API: Shortcodes](./API:-Shortcodes.md))
113113

114114
## JS API
115-
(See [API: AJAX](./API: AJAX.md))
115+
(See [API: AJAX](./API:-AJAX.md))

docs/FAQ.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ($userInfo->country->isoCode == 'de')
1212
echo 'Hallo! Schön dass Sie hier sind!';
1313
```
1414

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.
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.
1616

1717
## How can I show text only if the visitor is coming from Germany?
1818

@@ -30,15 +30,15 @@ Shipping to Germany is especially cheap!
3030
```
3131

3232
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](./API Usage Examples#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.
3434

3535
## How can I add the current country name as text in my page?
3636

3737
Add this plugin shortcode somewhere in the page or post content:
3838

3939
Wie ist das Wetter in [geoip_detect2 property="country.name" lang="de" default="ihrem Land"] ?
4040

41-
For more information, check the [API: Shortcodes]] documentation and [[API Usage Examples](./API: Shortcodes]] documentation and [[API Usage Examples.md).
41+
For more information, check the [API: Shortcodes](API:-Shortcodes) documentation and [API Usage Examples](API-Usage-Examples).
4242

4343
## Which data source should I choose?
4444

@@ -57,11 +57,11 @@ Each source has its advantages and disadvantages:
5757
Legend:
5858
* 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.
5959
* 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.
6161
* Column _Registration_: Some services require you to sign up at their website before you can use this datasource.
6262

6363
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.
6565
* 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.
6666
* 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/).
6767
* 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'))
7979

8080
In general, no. Read the information by Maxmind:
8181

82-
* [Site Licence Overview](https://www.maxmind.com/en/site-license-overview)
82+
* [Site Licence Overview](https://www.maxmind.com/en/site-license-overview)
8383
* Details: [End User Licence Agreement](https://www.maxmind.com/en/end-user-license-agreement#internal-restricted-business-purposes)
8484

8585
(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
9292

9393
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.
9494

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`.
9696

9797
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).
9898

@@ -119,7 +119,7 @@ Due to the California Consumer Privacy Act (CCPA), Maxmind has created an EULA t
119119

120120
You can choose to disable that behavior.
121121

122-
```php
122+
```php
123123
// Make sure you are compliant to the EULA in a different way!
124124
add_filter('geoip_detect2_maxmind_ccpa_do_update', '__return_false');
125125
add_filter('geoip_detect2_maxmind_ccpa_enabled', '__return_false');
@@ -134,9 +134,9 @@ I have decided against trying to make this plugin profitable. Also, the work pro
134134
[Paypal Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BSYUZHS8FH3CL)
135135

136136
## How can I test that my geoip-implementation works?
137-
You can use a VPN provider to get an IP in your desired country and test using that output.
137+
You can use a VPN provider to get an IP in your desired country and test using that output.
138138
Alternatively, you can use tools dedicated for Geo-IP testing such as [GeoScreenshot](https://www.geoscreenshot.com/)
139139

140140
## How can I install a beta version of this plugin?
141141

142-
See [Beta Testing](./Beta Testing.md).
142+
See [Beta Testing](./Beta-Testing.md).

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Documentation (How to use it):
44
* [API: PHP](./API:-PHP.md) - for themes or plugins
55
* [API: Shortcodes](./API:-Shortcodes.md) - if you don't know how to code PHP
66
* [API: Shortcodes for Contact Form 7](./API:-Shortcodes-for-Contact-Form-7.md) - Integration into CF7 forms
7+
* [API: Shortcodes for WPForms](./API:-Shortcodes-for-WPForms.md) - Integration into WPForms
78
* [API: AJAX](./API:-AJAX.md) - if you are using a page cache, this is a great option. You need to code in JS, though.
89

910
Other documentation:

0 commit comments

Comments
 (0)