Giter Site home page Giter Site logo

pierre-lannoy / wp-ip-locator Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 2.9 MB

Country and language IP-based detection for WordPress.

Home Page: https://perfops.one/

License: GNU General Public License v3.0

PHP 50.68% CSS 2.73% JavaScript 46.58%
wordpress wordpress-plugin geolocation country-codes country-flags geoip ip-location country-languages country-names

wp-ip-locator's Introduction

IP Locator

version php wordpress license

IP Locator is a country and language detection tool for WordPress. It is fast, reliable and plug & play.

See WordPress directory page or official website.

IP Locator can detect and render the country, the main language and the country flag of each visitor of your site. It provides:

  • a strong, accurate and ultra-fast IP and country detection;
  • many shortcodes to display country names, languages and flags (emoji or vectorized);
  • a shortcode to conditionally hide or show strings or other shortcodes;
  • a CSS modifier to add a country-specific class to the body tag of your site;
  • an automatic system to be always up to date (no API key, no IP data files to manually import);
  • a full-featured API for plugins / themes developers.

For full details, you can browse the shortcodes list or the API description (for developers).

IP Locator can be used too to report the following main items and characteristics:

  • KPIs: number of detected countries and languages, accesses breakdown and detection ratio;
  • countries for real humans with public IPs;
  • languages for real humans with public IPs;
  • metrics variations;
  • full list of countries per channel;
  • full list of countries per client (requires the free Device Detector plugin).

Technically, IP Locator:

  • works on dedicated or shared servers;
  • can detect the source IP even behind proxies or load-balancers;
  • can use AWS CloudFront, Cloudflare and Apache mod_geoip to speed-up detection;
  • natively supports APCu caching(1) and all other dedicated object caching mechanisms, like Memcached or Redis;
  • has a minimal footprint in the page rendering time;
  • runs its data updates in background, without impact on the website speed;
  • is fully compatible with multisites;
  • natively supports names and languages localizations(2).

(1): APCu needs to be activated on your server if you want to use it in IP Locator.

(2): PHP Intl extension needs to be activated on your server if you want to use it in IP Locator.

IP Locator is part of PerfOps One, a suite of free and open source WordPress plugins dedicated to observability and operations performance.

The development of The PerfOps One plugins suite is sponsored by Hosterra - Ethical & Sustainable Internet Hosting.

IP Locator is a free and open source plugin for WordPress. It integrates many other free and open source works (as-is or modified). Please, see 'about' tab in the plugin settings to see the details.

WP-CLI

IP Locator implements a set of WP-CLI commands. For a full help on these commands, please read this guide.

Hooks

IP Locator introduces some filters and actions to allow plugin customization. Please, read the hooks reference to learn more about them.

Installation

WordPress method (recommended)

  1. From your WordPress dashboard, visit Plugins | Add New.
  2. Search for 'IP Locator'.
  3. Click on the 'Install Now' button.

You can now activate IP Locator from your Plugins page.

Contributions

If you find bugs, have good ideas to make this plugin better, you're welcome to submit issues or PRs in this GitHub repository.

Before submitting an issue or a pull request, please read the contribution guidelines.

⚠️ The master branch is the current development state of the plugin. If you want a stable, production-ready version, please pick the last official release.

Smoke tests

WP compatibility PHP compatibility

wp-ip-locator's People

Contributors

pierre-lannoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

renowncoder

wp-ip-locator's Issues

Synchronisation des tables WooCommerce et Stockage des Logs de Action Scheduler dans les commentaires

Describe the bug
Sur un WordPress avec WooCommerce, j'ai mis du temps à trouver mais je me suis rendu compte qu l'extension IP Locator rends impossible la synchronisation des commandes de l'ancien système au nouveau HPOS de WooCommerce.

Il y a un autre problème : le stockage des logs des actions dans les commentaires. C'est cela qui m'a permis de remonté le problème du dessus dont je n'arrivais pas à trouver la source.

To Reproduce
Steps to reproduce the behavior:

  1. Création d'une installation neuve
  2. Ajout de WooCommerce
  3. Ajout d'IP Locator
  4. Bug n°1 : Voir les commentaires
  5. Création d'une commande (meme sans produit ça marche)
  6. Forcer la synchronisation vers l'ancien système (Réglages -> Avancée -> Fonctionnalités)
  7. Retournée dans les commentaires voir cette erreur :
    Une défaillance est survenue lors de la récupération de cette action : L’action [468989] comporte des arguments non valides. Elle ne peut pas être un JSON décodé dans un tableau. $args = array (
    )
    en lien avec l'action wc_run_batch_process

et en supprimant cette ligne, cela règle le problème, il me semble.
ip-locator.php 41 : add_filter( 'action_scheduler_migration_dependencies_met', '__return_false' );

Qui bloque apparemment la migration de l’utilisation des nouvelles tables pour gérer les actions. Solution pour les versions avant 3.0 de Action Scheduler : https://actionscheduler.org/version3-0/

_I would like to update a plugin for testing that includes Action Scheduler 3.0 but would like to postpone the migration until that testing is complete. Is that possible?

Yes, while we recommend migrating to custom tables as soon as possible for performance reasons, you can use add_filter( 'action_scheduler_migration_dependencies_met', '_return_false' ); to prevent the migration from initiating.

Merci Pierre.

mydomain.INET6_ATON does not exist

Hi Pierre,
I just installed the plugin v3.5.1 and created a file logger instance using DecaLog https://wordpress.org/plugins/decalog/ . One of the entries shows the SQL table is either missing a column or a function is not defined. I am not sure how to interpret it.

AJAX.CRITICAL: A database error was detected during the page rendering: “FUNCTION mydomain.INET6_ATON does not exist“ in the query “SELECT `country` FROM `wp_iplocator_v4` WHERE `from` ≤ INET6_ATON(`195.201.152.254`) AND `to` ≥ INET6_ATON(`195.201.152.254`) ;“. {"class":"db","component":"MySQL compatible","version":"5.5" ...

Environment (please complete the following information):

  • PHP version: 7.3.24-3+ubuntu
  • WordPress version and flavour: 5.9
  • mysql version: 5.5.15

IP Locator gives back false results

Describe the bug
I’ve recognised recently that IP Locator gives back false results. For example, for 165.22.93.228 (Frankfurt, Germany) it says US, 87.249.133.109 (Austria) it says UK.
What could be the problem?

To Reproduce
Steps to reproduce the behavior:

  1. Go to Admin / PrefOps One / Tools / Locations /
  2. Write IP Address to the field
  3. Scroll down to '....'

Expected behavior
See above

Environment (please complete the following information):

  • PHP version: 8.0.30
  • WordPress version 6.4.2

IP Location Detects wrong with cloudflare proxy

Describe the bug
Sometime I notice that the plugin only use the reverse proxy IP instead of client IP when Im using Cloudflare reverse proxy

To Reproduce
Steps to reproduce the behavior:

  1. Enable Cloudflare proxy

Expected behavior
Detect source IP instead

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • PHP version: php 7.4
  • WordPress version and flavour: 6.4.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.