[WordPress] 外掛分享: Honeill Visitor Country Detection

首頁外掛目錄 › Honeill Visitor Country Detection
全新外掛
安裝啟用
尚無評分
12 天前
最後更新
問題解決
WordPress 5.6+ PHP 7.4+ v1.2.4 上架:2026-07-04

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.4) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Honeill Visitor Country Detection」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Honeill Visitor Country Detection detects a visitor’s country (ISO 3166-1 alpha-2, e.g. GB) from their IP address using MaxMind’s GeoLite2 database, and exposes it through a single WordPress filter so your theme or plugin can use it with no hard dependency.
The GeoLite2 database is not bundled — MaxMind’s license does not allow redistribution. Instead you enter your own free MaxMind license key once on the settings screen. The plugin then:

downloads the GeoLite2 country database immediately,
stores it in wp-content/uploads (so it survives plugin updates),
and refreshes it automatically every week via WP-Cron.

You never download or upload a database by hand.
Use it in your code
$country = apply_filters( 'honeill_visitor_country_detection_country_code', '' );

Returns a two-letter country code, or an empty string when it can’t be determined (local IP, missing database, etc.) — your code decides the fallback. Results are cached per IP, so it’s cheap to call on every request.
Prefer REST? GET /wp-json/honeill-visitor-country-detection/v1/country returns { "country": "GB" } for the caller.
This product includes GeoLite2 Data created by MaxMind, available from https://www.maxmind.com. This plugin is an independent project and is not affiliated with, endorsed, or sponsored by MaxMind, Inc. GeoIP and GeoLite2 are trademarks of MaxMind, Inc.
External services
This plugin connects to MaxMind to download the GeoLite2 country database, which it needs to resolve countries. The database is not shipped with the plugin because MaxMind’s license prohibits redistribution.

Service: MaxMind GeoLite2 database download (https://download.maxmind.com/app/geoip_download).
When it connects: when you save your license key, when you click “Update database now”, and automatically once per week.
What is sent: your MaxMind license key (as a request parameter) and, by nature of any outbound HTTPS request, your server’s IP address. No website visitor data is ever sent to MaxMind.

By using this plugin you agree to MaxMind’s GeoLite2 End User License Agreement and Privacy Policy:

Terms: https://www.maxmind.com/en/geolite2/eula
Privacy: https://www.maxmind.com/en/privacy_policy

延伸相關外掛

文章
Filter
Apply Filters
Mastodon