Title: Shift8 GEO IP Location
Author: shift8
Published: <strong>27 Settembre 2017</strong>
Last modified: 10 Aprile 2023

---

Ricerca i plugin

![](https://ps.w.org/shift8-geoip-location/assets/banner-772x250.png?rev=2124769)

Questo plugin **non è stato testato con le ultime 3 versioni principali (major releases)
di WordPress**. Potrebbe non essere più mantenuto, o supportato, e potrebbe presentare
problemi di compatibilità se utilizzato con versioni più recenti di WordPress.

![](https://ps.w.org/shift8-geoip-location/assets/icon-256x256.png?rev=2124769)

# Shift8 GEO IP Location

 Di [shift8](https://profiles.wordpress.org/shift8/)

[Scarica](https://downloads.wordpress.org/plugin/shift8-geoip-location.zip)

 * [Dettagli](https://it.wordpress.org/plugins/shift8-geoip-location/#description)
 * [Recensioni](https://it.wordpress.org/plugins/shift8-geoip-location/#reviews)
 *  [Installazione](https://it.wordpress.org/plugins/shift8-geoip-location/#installation)
 * [Sviluppo](https://it.wordpress.org/plugins/shift8-geoip-location/#developers)

 [Supporto](https://wordpress.org/support/plugin/shift8-geoip-location/)

## Descrizione

Plugin that utilizes [ip-api](http://ip-api.com) to get geolocation coordinates 
based on the end-users’ IP address. Read the [blog post detailing how to interact with the plugin](https://www.shift8web.ca/2018/01/wordpress-plugin-get-geolocation-coordinates-visitors-ip-address/).

### Want to see the plugin in action?

You can view three example sites where this plugin is live :

 * Example Site 1 : [WordPress Hosting](https://www.stackstar.com)
 * Example Site 2 : [Web Design in Toronto](https://www.shift8web.ca)

#### Features

 * Cookie session established with IP address and latitude / longitude coordinates
   of the end-user browsing the site

## Screenshot

 * [[
 * Admin area

## Installazione

This section describes how to install the plugin and get it working.

e.g.

 1. Upload the plugin files to the `/wp-content/plugins/shif8-geoip` directory, or 
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Navigate to the plugin settings page and define your settings
 4. Once enabled, the system should trigger for every site visit.

## FAQ

### I tested it on myself and its not working for me!

Try clearing all cookies and re-visit the website. Then examine the cookies set 
by the website in your browser. The cookie name should be “shift8_geoip”.

### How do I read and use the shift8_geoip cookie?

The plugin will set the cookie after successful geolocation and encrypt the value
using OpenSSL with wp_salt(‘auth’) as a key. This means in order to access the geolocation
data you have to write code (in functions.php for example) such as the following:

    ```
    $cookie_data = explode('_', shift8_geoip_decrypt(wp_salt('auth'), $_COOKIE['shift8_geoip']));
    ```

The cookie data when decrypted will look like the following :

    ```
    ipaddress_latitude_longitude
    ```

Which means you can use php’s explode function to convert it into an array as in
the above example

### How can I decrypt the cookie data? You encrypted it!

Well the data could be construed as somewhat sensitive and could be used maliciously
to (for the most part) geographically place the end user. The decision to encrypt
the cookie data was made to protect the user from the data falling into the wrong
hands. In the plugin code, we are using OpenSSL to encrypt/decrypt the geo-location
data. You can use the function below to decrypt the cookie data :

    ```
    // Function to decrypt session data
    function shift8_geoip_decrypt($key, $garble) {
        if (!empty($key) && !empty($garble)) {
            list($encrypted_data, $iv) = explode('::', base64_decode($garble), 2);
            return openssl_decrypt($encrypted_data, 'aes-256-cbc', $key, 0, $iv);
        } else {
            return false;
        }
    }
    ```

So to actually use the above function, you could do the following :

    ```
    shift8_geoip_decrypt(wp_salt('auth'), $_COOKIE['shift8_geoip']);
    ```

### What is wp_salt?

You can read more about the wp_salt function by [clicking here](https://codex.wordpress.org/Function_Reference/wp_salt)

## Recensioni

Non ci sono recensioni per questo plugin.

## Contributi e sviluppo

“Shift8 GEO IP Location” è un software open source. Le persone che hanno contribuito
allo sviluppo di questo plugin sono indicate di seguito.

Collaboratori

 *   [ shift8 ](https://profiles.wordpress.org/shift8/)

[Traduci “Shift8 GEO IP Location” nella tua lingua.](https://translate.wordpress.org/projects/wp-plugins/shift8-geoip-location)

### Ti interessa lo sviluppo?

[Esplora il codice](https://plugins.trac.wordpress.org/browser/shift8-geoip-location/)
segui il [repository SVN](https://plugins.svn.wordpress.org/shift8-geoip-location/),
segui il [log delle modifiche](https://plugins.trac.wordpress.org/log/shift8-geoip-location/)
tramite [RSS](https://plugins.trac.wordpress.org/log/shift8-geoip-location/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0

 * Stable version created

#### 1.01

 * Switched from stored session variable to encrypted cookie using wp_salt function.
   This is to easily allow development options to read and process the cookie data

#### 1.02

 * Updated readme with helpful FAQ entries

#### 1.03

 * Better error checking with geoip class and returned array

#### 1.04

 * If no valid IP is found in the get_ip function, the last return value still needs
   to be chcecked if a valid IP, otherwise return false

#### 1.05

 * Now including country code in geoip encrypted cookie

#### 1.06

 * WordPress 5 compatibility

#### 1.07

 * WordPress 5.5 compatibility

#### 1.08

 * WordPress 6.2 compatibility

## Meta

 *  Versione **1.08**
 *  Ultimo aggiornamento **3 anni fa**
 *  Installazioni attive **10+**
 *  Versione WordPress ** 3.0.1 o superiore **
 *  Testato fino alla versione **6.2.9**
 *  Lingua
 * [English (US)](https://wordpress.org/plugins/shift8-geoip-location/)
 * Tag
 * [geo location](https://it.wordpress.org/plugins/tags/geo-location/)[geolocation](https://it.wordpress.org/plugins/tags/geolocation/)
   [ip address location](https://it.wordpress.org/plugins/tags/ip-address-location/)
   [ip geolocation](https://it.wordpress.org/plugins/tags/ip-geolocation/)
 *  [Visualizzazione avanzata](https://it.wordpress.org/plugins/shift8-geoip-location/advanced/)

## Valutazioni

Non sono state ancora inviate recensioni.

[Your review](https://wordpress.org/support/plugin/shift8-geoip-location/reviews/#new-post)

[Vedi tutte le recensioni](https://wordpress.org/support/plugin/shift8-geoip-location/reviews/)

## Collaboratori

 *   [ shift8 ](https://profiles.wordpress.org/shift8/)

## Supporto

Hai qualcosa da dire? Ti serve aiuto?

 [Chiedi nel forum di supporto](https://wordpress.org/support/plugin/shift8-geoip-location/)

## Donazioni

Vuoi sostenere le versioni future?

 [ Fai una donazione per lo sviluppo ](https://www.shift8web.ca)