內容簡介
總結:GeoIP Content Switcher 是一個專業的 WordPress 外掛,能自動偵測訪客的國家,根據國家來動態切換內容、付款方式、運送方式和產品,非常適合國際 WooCommerce 商店和多國網站。
問題與答案:
1. 這個外掛可以偵測訪客的國家嗎?
- 答:是的,這個外掛可以自動偵測訪客的國家並根據國家進行內容、付款方式、運送方式和產品切換。
2. 這個外掛是否支援子網域重新導向?
- 答:是的,這個外掛可以自動重新導向到特定國家的子網域,如美國訪客將被重新導向至 us.yoursite.com。
3. 這個外掛是否與WooCommerce相容?
- 答:是的,這個外掛與WooCommerce相容,可以根據國家過濾付款閘道、運送方式,並且可以根據國家隱藏產品或分類。
4. 這個外掛有哪些安全功能?
- 答:此外掛具有防止直接訪問資料庫檔案、輸入清潔和驗證、為所有表單提供Nonce驗證、管理員功能的能力檢查等安全功能。
5. 這個外掛有哪些要求?
- 答:此外掛需要 WordPress 5.8 或更高版本、PHP 7.4 或更高版本(相容PHP 8.0、8.1、8.2、8.3)、WooCommerce 5.0 或更高版本(可選,供電子商務功能使用)、MaxMind GeoLite2國家數據庫(免費下載)。
外掛標籤
開發者團隊
原文外掛簡介
GeoIP Content Switcher is a professional WordPress plugin that automatically detects your visitor’s country and dynamically switches content, payments, shipping methods, and products accordingly. Perfect for international WooCommerce stores and multi-country websites.
Key Features
Automatic Country Detection
MaxMind GeoLite2 Database integration
Cloudflare CF-IPCountry header support
Session caching for optimal performance
Accurate IP-based geolocation
Subdomain Redirection
Automatic redirect to country-specific subdomains
Example: US visitors → us.yoursite.com
Geo-lock option to prevent manual country switching
Seamless cross-subdomain session management
WooCommerce Integration
Filter payment gateways by country
Filter shipping methods by country
Hide products or categories by country
Full WooCommerce HPOS compatibility
Content Switching
Country-specific homepage
Custom header content per country
Custom footer content per country
Full Elementor and page builder support
Performance Optimized
Session caching with configurable duration
Cloudflare integration
Compatible with WP Rocket, LiteSpeed Cache, W3 Total Cache
Minimal server resource usage
Security Features
Database files protected from direct access
Input sanitization and validation
Nonce verification for all forms
Capability checks for admin functions
Secure session handling
Developer Friendly
Clean, well-documented code
Shortcodes for displaying country info
Hooks and filters for customization
PSR-4 autoloading
Shortcodes
[geoip_country] – Display visitor’s country name
[geoip_country format="code"] – Display country code (e.g., US, UK, IN)
[geoip_ip] – Display visitor’s IP address
Requirements
WordPress 5.8 or higher
PHP 7.4 or higher (compatible with PHP 8.0, 8.1, 8.2, 8.3)
WooCommerce 5.0 or higher (optional, for e-commerce features)
MaxMind GeoLite2 Country Database (free download)
Use Cases
International e-commerce stores
Multi-country business websites
Region-specific content delivery
Localized payment and shipping options
Country-based product catalogs
Geo-targeted marketing campaigns
Compatibility
Themes:
* Woodmart (fully tested)
* Astra
* Divi
* Elementor
* Any WordPress theme
Cache Plugins:
* WP Rocket
* LiteSpeed Cache
* W3 Total Cache
* WP Super Cache
* Cloudflare
Page Builders:
* Elementor
* WPBakery
* Beaver Builder
* Divi Builder
Additional Information
About MaxMind GeoLite2
This plugin uses the free GeoLite2 database created by MaxMind, available from https://www.maxmind.com. The database provides country-level IP geolocation data.
Privacy Policy
This plugin:
* Detects visitor country using IP address
* Stores only country code in PHP sessions (temporary)
* Does not store IP addresses in the database
* Does not share data with third parties
* Does not use tracking cookies
Credits
MaxMind GeoLite2: https://www.maxmind.com/
GeoIP2 PHP Library: https://github.com/maxmind/GeoIP2-php
Developer
Developed by RAJ PATHAK
Email: [email protected]
Support the Plugin
If you find this plugin helpful, please:
* Rate it 5 stars on WordPress.org
* Share it with others who might need it
* Report bugs or suggest features in the support forum
Technical Details
System Requirements
WordPress 5.8+
PHP 7.4+ (8.0, 8.1, 8.2, 8.3 supported)
MySQL 5.6+ or MariaDB 10.0+
WooCommerce 5.0+ (optional)
MaxMind GeoLite2 Country Database
File Structure
/includes/ – Core plugin classes
/assets/ – CSS and JavaScript files
/database/ – MaxMind database location
/vendor/ – Composer dependencies
/languages/ – Translation files
Hooks and Filters
Developers can extend the plugin using WordPress hooks and filters. Documentation available in the code comments.
License
This plugin is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
