Title: Geo IP Library
Author: Ricardo Miguel
Published: <strong>17 de octubre de 2017</strong>
Last modified: 18 de octubre de 2017

---

Buscar plugins

![](https://ps.w.org/geo-ip-library/assets/banner-772x250.jpg?rev=1748387)

Este plugin **no se ha probado con las últimas 3 versiones mayores de WordPress**.
Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas 
de compatibilidad cuando se usa con las versiones más recientes de WordPress.

![](https://ps.w.org/geo-ip-library/assets/icon-256x256.jpg?rev=1748387)

# Geo IP Library

 Por [Ricardo Miguel](https://profiles.wordpress.org/ricardomiguel/)

[Descargar](https://downloads.wordpress.org/plugin/geo-ip-library.0.9.7.zip)

 * [Detalles](https://es.wordpress.org/plugins/geo-ip-library/#description)
 * [Valoraciones](https://es.wordpress.org/plugins/geo-ip-library/#reviews)
 * [Desarrollo](https://es.wordpress.org/plugins/geo-ip-library/#developers)

 [Soporte](https://wordpress.org/support/plugin/geo-ip-library/)

## Descripción

Geo IP Library enables sort of simple but powerful functions in order to provide
geo ip country features on WordPress. Main features so far until now:

 * Static PHP functions to be used in plugins and themes.
 * Shortcodes to display different contents by country or a bunch of countries.
 * Update management of local library from its source.

### About library

This plugin uses a third-party PHP single library file which does not have external
dependencies, so it comes within the plugin and works locally. It is intended for
anyone who don’t want to use (or depend of) web services or either implement [native PHP GeoIP extensions](http://php.net/manual/es/book.geoip.php).

The library was made by [Chirag Mehta](http://chir.ag/projects/geoiploc/).

### Library update

Since working with a local library can be a time-saver, its data may get deprecated
sometime in the future. This plugin allow update your local library from its remote
source. To do that, go to admin dashboard (specifically under _Tools_ menu), where
the library can be updated without any risk.

#### Updating restriction

The library can be updated every 72 hours. It is not really necessary a minor interval.

### How to use

#### Shortcode

Display different content for each country (or countries) within posts and pages
by using **[geo-ip]** or **[geo]** tags. To do magic, see the following syntaxes:

    ```
    /**
    * INCLUDE PROPERTY
    * Display content to a specific country or many countries
    */

    // [geo-ip] tag
    [geo-ip include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]

    // [geo] tag
    [geo include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]

    /**
    * EXCLUDE PROPERTY
    * Display content to all countries but...
    */

    // [geo-ip] tag
    [geo-ip exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]

    // [geo] tag
    [geo exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]
    ```

 * [geo] tag is only available if no other plugin is using it (since it’s a pretty
   common word).
 * _include_ and _exclude_ cannot be used together due to their purpose.

#### Coding

The following static functions can be used anywhere along GeoIPLibrary class:

    ```
    /** Returns the current client's IP address as STRING. 
        * It bypasses proxies and/or forwarding. 
        * Returns FALSE if it fails. */
    GeoIPLibrary::get_client_address()


    /** Returns the current client's ISO 3166-1 alpha-2 country code 
        * or the specified at $ip parameter as STRING. 
        * Returns FALSE if it fails. */
    GeoIPLibrary::get_client_country_code(string $ip = '')


    /** Returns the current client's country name 
        * or the specified at $ip parameter as STRING. 
        * Returns FALSE if it fails. */
    GeoIPLibrary::get_client_country_name(string $ip = '')<h3>Contributions</h3>Geo IP Library is still in development, but currently stable. You can contribute with new ideas, coding improves/issues and even grammar/spelling check (english is not my mother language). Feel free to [make a pull request](https://github.com/ricardo-miguel/geo-ip-library/pulls) or [open an issue](https://github.com/ricardo-miguel/geo-ip-library/issues).
    ```

## Reseñas

No hay valoraciones para este plugin.

## Colaboradores y desarrolladores

«Geo IP Library» es un software de código abierto. Las siguientes personas han colaborado
con este plugin.

Colaboradores

 *   [ Ricardo Miguel ](https://profiles.wordpress.org/ricardomiguel/)

[Traduce «Geo IP Library» a tu idioma.](https://translate.wordpress.org/projects/wp-plugins/geo-ip-library)

### ¿Interesado en el desarrollo?

[Revisa el código](https://plugins.trac.wordpress.org/browser/geo-ip-library/) ,
echa un vistazo al [repositorio SVN](https://plugins.svn.wordpress.org/geo-ip-library/)
o suscríbete al [registro de desarrollo](https://plugins.trac.wordpress.org/log/geo-ip-library/)
por [RSS](https://plugins.trac.wordpress.org/log/geo-ip-library/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Versión **0.9.7**
 *  Última actualización **hace 9 años**
 *  Instalaciones activas **10+**
 *  Versión de WordPress ** 4.3 o superior **
 *  Probado hasta **4.8.33**
 *  Versión de PHP ** 5.3 o superior **
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/geo-ip-library/)
 * Etiquetas:
 * [custom content](https://es.wordpress.org/plugins/tags/custom-content/)[geo location](https://es.wordpress.org/plugins/tags/geo-location/)
   [geo-ip](https://es.wordpress.org/plugins/tags/geo-ip/)[library](https://es.wordpress.org/plugins/tags/library/)
   [standalone](https://es.wordpress.org/plugins/tags/standalone/)
 *  [Vista avanzada](https://es.wordpress.org/plugins/geo-ip-library/advanced/)

## Valoraciones

Aún no se han enviado valoraciones.

[Tu valoración](https://wordpress.org/support/plugin/geo-ip-library/reviews/#new-post)

[Ver todas las reseñas](https://wordpress.org/support/plugin/geo-ip-library/reviews/)

## Colaboradores

 *   [ Ricardo Miguel ](https://profiles.wordpress.org/ricardomiguel/)

## Soporte

¿Tienes algo que decir? ¿Necesitas ayuda?

 [Ver el foro de soporte](https://wordpress.org/support/plugin/geo-ip-library/)