Git Product home page Git Product logo

samarpw / wp-geoip-detect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yellowtree/geoip-detect

0.0 1.0 0.0 31.04 MB

Wordpress plugin: Retrieving Geo-Information using one the Maxmind GeoIP2 databases. (BTW, We're looking for a new developer! yellowtree.de/jobs/)

Home Page: http://wordpress.org/plugins/geoip-detect/

License: GNU General Public License v3.0

PHP 97.58% Shell 2.42%

wp-geoip-detect's Introduction

Tests: Build Status

GeoIP Detection

Retrieving Geo-Information using one the Maxmind GeoIP2 databases.

Description

Provides geographic information detected by an IP adress. This can be used in themes or other plugins, as a shortcode, or via CSS body classes. The city & country names are translated in different languages (supported languages).

= Features: =

  • Provides these 5 functions (see API Documentation):
    • geoip_detect2_get_info_from_ip($ip, $locales = array('en'), $options = array()): Lookup Geo-Information of the specified IP
    • geoip_detect2_get_info_from_current_ip($locales = array('en'), $options = array()): Lookup Geo-Information of the current website user
    • geoip_detect2_get_current_source_description(...): Return a human-readable label of the currently chosen source.
    • geoip_detect2_get_external_ip_adress(): Fetch the internet adress of the webserver
    • geoip_detect2_get_client_ip(): Get client IP (even if it is behind a reverse proxy)
  • You can use one of these data sources (see comparison):
  • For the property names, see the results of a specific IP in the wordpress backend (under Tools > GeoIP Detection).
  • You can include these properties into your posts and pages by using the shortcode [geoip_detect2 property="country.name" default="(country could not be detected)" lang="en"] (where 'country.name' can be one of the other property names as well, and 'default' and 'lang' are optional).
  • When enabled on the options page, it adds CSS classes to the body tag such as geoip-country-DE and geoip-continent-EU.
  • When enabled on the options page, the client IP respects a reverse proxy of the server.
  • If you are using Contact Form 7, you can use these shortcodes:
    • A select input with all countries, the detected country being selected by default [geoip_detect2_countries mycountry]
    • Tracking information for the email text [geoip_detect2_user_info]

See API Documentation for more info.

= How can I use these functions? =

  • You could choose the currency of the store based on the country name
  • You could suggest an timezone to use when displaying dates
  • You could show the store nearest to your customer
  • You show or hide content specific to a geographic target group
  • Etc. ... You tell me! I'm rather curious what you'll do with this plugin!

System Requirements: You will need at least PHP 5.4.

This extension is "charity-ware". If you are happy with it, please leave a tip for the benefit of this charity. (See FAQ for more infos.)

This product can provide GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

Installation

  • Install the plugin
  • Go to the plugin's option page and choose a data source.
  • Test it by clicking on "Lookup" on the lookup page.

Troubleshooting

Does geoip_detect2_get_info_from_current_ip() return the same country, regardless of where you are visiting the site from? Maybe your server has a reverse proxy configured. You can check this: Go to the options page and look for "reverse proxy". Are there 2 IPs listed there? If so, which one corresponds to your public IP?

Frequently Asked Questions

Technically speaking, how could I verify if my visitor comes from Germany?

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

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

Which data source should I choose?

Can I change the time period how long the data is cached?

The Maxmind Lite databases are licensed Creative Commons ShareAlike-Attribution. When do I need to give attribution?

Does this plugin work in a MultiSite-Network environment?

What you mean by "This plugin is charity-ware"?

Further documentation

API Documentation

Record Properties

API usage examples

Screenshots

  1. Lookup page (under Tools > GeoIP Lookup)
  2. Options page (under Preferences > GeoIP Detection)

= 2.9.0 =

There have been changes to the reverse proxy logic. If you have enabled a reverse proxy, check if the detected IP is correct.

Changelog

= 2.9.1 =

Older changelog

wp-geoip-detect's People

Contributors

benjaminpick avatar fabacab avatar mickrip avatar jakejackson10 avatar joshuadavidnelson avatar jj-dev avatar yavormilchev avatar

Watchers

James Cloos avatar

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.