お問い合わせ
image

IP Location Detector Plugin for WordPress

制作・開発
profile

Iftekhar Eather

If you’re looking for a way to dynamically serve content based on a user’s location, the IP Location Detector plugin for WordPress is your ultimate solution. This powerful plugin enables you to detect whether a user is in Japan or any other country you select, all based on their IP address. Using MaxMind’s GeoLite2 database, the plugin offers robust local IP detection, an intuitive admin panel, and the flexibility to update the database with ease.

Key Features

  • GeoLite2 Database Integration: Fully supports MaxMind’s GeoLite2 database for precise IP-based location detection.
  • Country Selection: Choose any country from a comprehensive list directly in the admin settings. Built-in functionality to detect users in Japan.
  • Database Update Feature: Seamlessly update the GeoLite2 database with your MaxMind LICENSE_KEY.
  • Shortcode Support: Add location-based functionality to your posts and pages using intuitive shortcodes.
  • Caching and Performance: Reduces redundant lookups for better speed and efficiency.

Installation

  1. Download and Upload: Download the plugin zip file from the GitHub repository.
  2. Upload it to your WordPress website via the Plugins section.
  3. Activate the Plugin: Navigate to Plugins > Installed Plugins and activate the IP Location Detector.
  4. Configure Settings: Go to Settings > IP Location Detector to:
    • Enter your MaxMind LICENSE_KEY.
    • Select the country you wish to monitor.
    • Update the GeoLite2 database when necessary.

Usage

Shortcodes for Location Detection

Detect Japan

Use [is_user_in_japan] to display messages such as:

  • “The user is in Japan.”
  • “The user is not in Japan.”

Example:

[is_user_in_japan]

Detect Selected Country

Use [is_user_in_selected_country] to display messages such as:

  • “The user is in the selected country.”
  • “The user is not in the selected country.”

Example:

[is_user_in_selected_country]

Boolean Checks for Custom Logic

  • [is_user_in_japan_boolean]: Returns 1 if the user is in Japan, otherwise 0.
  • [is_user_in_selected_country_boolean]: Returns 1 if the user is in the selected country, otherwise 0.

Example in PHP:

$isInCountry = do_shortcode('[is_user_in_selected_country_boolean]');
if ($isInCountry == '1') {
    echo 'Localized content for your country!';
} else {
    echo 'Content for international visitors.';
}

Admin Panel Features

  • MaxMind LICENSE_KEY Configuration: Securely add your MaxMind LICENSE_KEY for database updates.
  • Country Selection: Choose the country for location checks from a dropdown menu.
  • Database Update Button: Click to fetch and integrate the latest GeoLite2 database directly into your plugin.
  • Cache Clearing: Easily clear cached IP data to refresh location lookups.

Screenshots

Admin Settings Page:

Shortcode Output Example:

 

Why Use IP Location Detector?

  1. Localized Content Delivery: Serve region-specific content effortlessly.
  2. User Engagement: Improve user experience by personalizing based on location.
  3. Simple Setup: Easy to install, configure, and integrate with your existing website.
  4. Performance-Oriented: Efficient caching ensures faster response times and reduced server load.

Get Started Today!

Download the IP Location Detector plugin and bring the power of location-based personalization to your WordPress website. Whether you’re targeting users in Japan or around the globe, this plugin is the perfect solution for your needs.