access.php
6 years ago
advanced_settings.php
5 years ago
exclusion_settings.php
6 years ago
geolocation_settings.php
6 years ago
get_started.php
6 years ago
info.php
5 years ago
info_bug_report.php
6 years ago
info_help.php
5 years ago
info_high_traffic.php
6 years ago
info_multisite.php
6 years ago
info_newsletter.php
6 years ago
info_shared.php
6 years ago
marketplace.php
5 years ago
privacy_gdpr.php
5 years ago
settings.php
6 years ago
summary.php
5 years ago
systemreport.php
6 years ago
tracking.php
5 years ago
update_notice_clear_cache.php
6 years ago
geolocation_settings.php
80 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Matomo - free/libre analytics platform |
| 4 | * |
| 5 | * @link https://matomo.org |
| 6 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 7 | * @package matomo |
| 8 | * Code Based on |
| 9 | * @author André Bräkling |
| 10 | * @package WP_Matomo |
| 11 | * https://github.com/braekling/matomo |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | use WpMatomo\Admin\GeolocationSettings; |
| 16 | |
| 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | exit; |
| 19 | } |
| 20 | /** @var bool $was_updated */ |
| 21 | /** @var bool $invalid_format */ |
| 22 | /** @var string $current_maxmind_license */ |
| 23 | |
| 24 | if ($invalid_format) { ?> |
| 25 | <div class="updated notice error"> |
| 26 | <p><?php esc_html_e( 'It looks like the MaxMind license key has a wrong format.', 'matomo' ); ?></p> |
| 27 | </div> |
| 28 | <?php |
| 29 | } |
| 30 | ?> |
| 31 | |
| 32 | <form method="post"> |
| 33 | <?php wp_nonce_field( GeolocationSettings::NONCE_NAME ); ?> |
| 34 | |
| 35 | <p> |
| 36 | <?php esc_html_e( 'On this page you can configure how Matomo detects the locations of your visitors.', 'matomo' ); ?> |
| 37 | </p> |
| 38 | <p> |
| 39 | <?php esc_html_e('To detect the location of a visitor, the IP address of a visitor is looked up in a so called geolocation database. This is automatically taken care of for you. However, the freely available database DB-IP we are using is sometimes less accurate than other freely available geolocation databases. This applies to the free and paid version of DB-IP. An alternative geolocation database is called MaxMind which has a free and a paid version as well. Because of GDPR we cannot configure this database automatically for you.', 'matomo'); ?> |
| 40 | <br><br> |
| 41 | <?php |
| 42 | echo sprintf( |
| 43 | __( 'To use MaxMind instead of the default DB-IP geolocation database %1$s get a MaxMind license key%2$s and then configure this key below.', 'matomo' ), |
| 44 | '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/faq/how-to/how-do-i-get-a-license-key-for-the-maxmind-geolocation-database/">', '</a>' |
| 45 | ); |
| 46 | ?> |
| 47 | </p> |
| 48 | |
| 49 | <table class="matomo-tracking-form widefat"> |
| 50 | <tbody> |
| 51 | <tr> |
| 52 | <th scope="row" style="vertical-align: top;"> |
| 53 | <label for="<?php echo esc_attr( GeolocationSettings::FORM_NAME ) ?>"><?php esc_html_e( 'MaxMind License Key', 'matomo' ); ?></label>: |
| 54 | </th> |
| 55 | <td> |
| 56 | <input size="20" type="text" maxlength="20" |
| 57 | id="<?php echo esc_attr( GeolocationSettings::FORM_NAME ) ?>" |
| 58 | name="<?php echo esc_attr( GeolocationSettings::FORM_NAME ) ?>" value="<?php echo esc_attr($current_maxmind_license) ?>"> |
| 59 | </td> |
| 60 | <td> |
| 61 | <?php if (!empty($current_maxmind_license)) {?> |
| 62 | <p style="color: green;"><span class="dashicons dashicons-yes" ></span> <?php esc_html_e('MaxMind is configured.', 'matomo') ?></p> |
| 63 | <?php }?> |
| 64 | <p> |
| 65 | <?php esc_html_e('Leave the field empty and click on "Save Changes" to configure the default DB-IP database.', 'matomo') ?> |
| 66 | <?php esc_html_e('When configured, your WordPress will send an HTTP request to a MaxMind server to download an approx. 60MB database and store it in your "wp-content/uploads/matomo" directory.', 'matomo') ?> |
| 67 | </p> |
| 68 | </td> |
| 69 | </tr> |
| 70 | <tr> |
| 71 | <td colspan="3"> |
| 72 | <p class="submit"><input name="Submit" type="submit" class="button-primary" |
| 73 | value="<?php echo esc_attr__( 'Save Changes', 'matomo' ); ?>"/></p> |
| 74 | </td> |
| 75 | </tr> |
| 76 | |
| 77 | </tbody> |
| 78 | </table> |
| 79 | </form> |
| 80 |