WordPress plugin intelligence profile

Geocode Switch

GeoSwitch is a plugin that allows you to change the content of your site based on the location of your client’s IP.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.9
Current version1.1.4
WordPress coverageTested up to WordPress 4.9
Minimum stackWP 3.0 · PHP —
Directory statusactive
Last directory update21 Jul 20188y ago
Active installations30Adoption metric — not a quality score
WordPress.org rating4.7 / 5 from 3 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Geocode Switch version 1.1.4 as active, updated 8y ago and tested up to WordPress 4.9.

Overview

About this plugin

GeoSwitch is a plugin that allows you to change the content of your site based on the location of your client’s IP.

To geolocate users based on IP GeoSwitch supports can user either the new the new GeoIP2 MaxMind

databases or GeoIP2 Precision Service.

MaxMind offers free and paid geolocation databases and the paid GeoIP2 Precision web service,

the author of this plugin is not affiliated with MaxMind in any way.

The main development of this plugin is in github.

Please open a new issue if you find a bug in this plugin.

This plugin uses the MaxMind PHP library which is released under the

0

Usage

= GeoSwitch Conditional Blocks =

GeoSwitch uses two shortcodes [geoswitch] and [geoswitch_case] to create conditional blocks.

The [geoswitch] shortcode is used to enclose one or more [geoswitch_case] shortcodes with different conditions. The

[geoswitch_case] shortcodes enclose content that will be shown if the condition is true.

The following example illustrates a GeoSwitch conditional block that will show different contact information depending

on the user’s IP location:

[geoswitch] [geoswitch_case country_code="AU" state_code="NSW"]New South Wales Office[/geoswitch_case] [geoswitch_case country_code="AU"]Australian Office[/geoswitch_case] [geoswitch_case]International Office[/geoswitch_case] [/geoswitch]

The above GeoSwitch block will display “New South Wales Office” to users in New South Wales within Australia,

“Australian Office” to other Australian users and “International Office” to any other user.

The [geoswitch_case] shortcode accepts the following attributes:

  • country – comma delimited list of country names
  • country_code – comma delimited list of country ISO codes
  • state – comma delimited list of of state names
  • state_code – comma delimited list of state ISO codes
  • city – comma delimited list of city names
  • within, from – This set of attributes is used to test for distances. Within is the distance in kilometers or miles and

6”]).

The [geoswitch_case] shortcode matches only the attributes specified so:

[/geoswitch_case] [/geoswitch]

g Paris, France or Paris, Texas, USA.

A [geoswitch_case] shortcode without any attributes always matches and can be used as the last condition in a conditional block

to show default content.

Content between [geoswitch_case] blocks can contain any markup including any other shortcodes, but conditional blocks should

not be nested as this is not supported by WordPress.

Content between the [geoswitch] and [geoswitch_case] shortcodes should be whitespace but is usually ignored:

[/geoswitch_case] [/geoswitch]

Informational Shortcodes

In addition to the conditional block GeoSwitch offers the following shortcodes to display user information:

  • [geoswitch_ip] – The user’s IP.
  • [geoswitch_city] – The user’s city name.
  • [geoswitch_state] – The user’s state name.
  • [geoswitch_state_code] – The user’s state ISO code.
  • [geoswitch_country] – The user’s country name.
  • [geoswitch_country_code] – The user’s country code.

’

Debug Shortcodes

-

geoswitch_setip – Override the user IP. Affects shortcodes after this one.

Usage:

10′]

For debugging whole websites the user IP can be set globally in the admin settings for the plugin.

Filter Hooks

Geoswitch supports the following filter hooks:

geoswitch_skip_ip_check

Allows to programatically skip the ip check. If the hook callback function returns true the MaxMind libraries are not used to check the IP and the

default content (if configured) will be displayed.

Usage:

function skip_ip_callback( $skipCheck, $userIp ) { if ( some_custom_test($userIp) ) { $skipCheck = true; } return $skipChek; }

add_filter( 'geoswitch_skip_ip_check', 'skip_ip_callback', 10, 2 );

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • geocode filter
  • geocode switch
  • geomarketing
  • geotag
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.9

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.9.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.9
Minimum requirementsWordPress 3.0 · PHP not listed
Update activity21 Jul 20188y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.