前言介紹
- 這款 WordPress 外掛「Geolocation IP Detection」是 2013-07-03 上架。
- 目前有 10000 個安裝啟用數。
- 上一次更新是 2025-02-01,距離現在已有 92 天。
- 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.2.5 以上。
- 有 59 人給過評分。
- 論壇上目前有 4 個提問,問題解答率 0%
外掛協作開發者
外掛標籤
GeoIP | ipstack | locator | maxmind | geolocation |
內容簡介
P地址提供了地理信息,可以在主題或其他外掛中使用,作為 shortcode 或通過 CSS body classes。城市和國家名稱被翻譯成不同的語言(支持的語言)。
特徵:
您可以使用以下其中一個數據源(請參閱比較):
免費(默認源):HostIP.info(僅限IPv4)
需要註冊免費:Maxmind GeoIP2 Lite City,每周自動更新
商業版:Maxmind GeoIP2 City或Maxmind GeoIP2 Country
商業版Web-API:Maxmind GeoIP2 Precision(City、Country或Insights)
基于主機提供商:Cloudflare或Amazon AWS CloudFront(Country)
免費或商業版Web-API:Ipstack
Amazon AWS Marketplace的商業版Web-API:Fastah
提供這5個功能:
geoip_detect2_get_info_from_ip($ip, $locales = array('en'), $options = array()):查找指定IP的地理信息
geoip_detect2_get_info_from_current_ip($locales = array('en'), $options = array()):查找當前網站用戶的地理信息
geoip_detect2_get_current_source_description(...):返回當前選擇的源的可讀標籤。
geoip_detect2_get_external_ip_adress():獲取網絡服務器的互聯網地址
geoip_detect2_get_client_ip():獲取客戶端IP(即使它在反向代理後面)
有關屬性名稱,請在WordPress後端中查看特定IP的結果(在工具>地理位置IP檢測下)。
您可以通過使用短碼[geoip_detect2 property="country.name" default="(country could not be detected)" lang="en"](其中‘country.name’也可以是其他屬性名稱,‘default’和‘lang’是可選的)將這些屬性包含在您的帖子和頁面中。
您可以使用短碼[geoip_detect2_show_if country="FR, DE" not_city="Berlin"]TEXT[/geoip_detect2_show_if] 顯示或隱藏內容。請參閱短碼文檔。
在選項頁面上啟用時,它會將CSS類添加到body標籤中,例如geoip-province-HE,geoip-country-DE和geoip-continent-EU。
如果您使用頁面高速緩存,建議使用AJAX模式
在選項頁面上啟用時,客戶端IP地址被添加到每個WordPress注釋的郵件地址中。
原文外掛簡介
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:
You can use one of these data sources (see comparison):
Free (default source): HostIP.info (IPv4 only)
Free with registration: Maxmind GeoIP2 Lite City, automatically updated weekly
Commercial: Maxmind GeoIP2 City or Maxmind GeoIP2 Country
Commercial Web-API: Maxmind GeoIP2 Precision (City, Country or Insights)
Hosting-Provider dependent: Cloudflare or Amazon AWS CloudFront (Country)
Free or Commercial Web-API: Ipstack
Commercial Web-API via AWS Marketplace: Fastah
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)
For the property names, see the results of a specific IP in the wordpress backend (under Tools > Geolocation IP 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).
You can show or hide content by using a shortcode [geoip_detect2_show_if country="FR, DE" not_city="Berlin"]TEXT[/geoip_detect2_show_if]. See Shortcode Documentation.
When enabled on the options page, it adds CSS classes to the body tag such as geoip-province-HE, geoip-country-DE and geoip-continent-EU.
If you are using a page cache, it is recommended to use the AJAX mode (see AJAX)
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]
A text input that is pre-filled with the detected city (or other property): [geoip_detect2_text_input city property:city lang:fr id:id class:class default:Paris]
Geolocation information for the email text: [geoip_detect2_user_info]
If you are using WP Forms, you can use this shortcode:
Geolocation information for the email text: [geoip_detect2_user_info]
Together with SVG Flags you can show the flag of the detected country: [geoip_detect2_current_flag] (see documentation)
See 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 pre-fill the shipping country
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!
Be careful to comply to the applicable laws. For example Regulation (EU) 2018/302 …
If you need to get the user’s timezone, it is more accurate to use JS solutions.
System Requirements: You will need at least PHP 7.2.5 . Also, if you use the plugin WooCommerce, you’ll need at least WooCommerce 3.9.0 .
GDPR: See Is this plugin GDPR-compliant?
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.)
Here are other ways to contribute to the development of this plugin.
This product can provide GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
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?
Or maybe you are using a site cache plugin. Then enable the option Disable caching a page that contains a shortcode or API call to geo-dependent functions.
More Troubleshooting Hints
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Geolocation IP Detection」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.8 | 3.0 | 2.5.3 | 2.5.4 | 2.5.6 | 2.5.7 | 2.6.0 | 2.7.0 | 2.8.0 | 2.8.2 | 2.9.0 | 2.9.1 | 2.9.2 | 3.0.1 | 3.0.2 | 3.0.3 | 3.0.4 | 3.1.0 | 3.1.1 | 3.1.2 | 3.2.0 | 3.2.1 | 3.3.0 | 4.0.0 | 4.0.1 | 4.1.0 | 4.2.0 | 4.2.1 | 4.2.2 | 4.2.3 | 5.0.0 | 5.1.0 | 5.1.1 | 5.2.0 | 5.2.1 | 5.2.2 | 5.3.0 | 5.3.1 | 5.3.2 | 5.4.0 | 5.4.1 | 5.5.0 | trunk | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.12.1 | 2.13.0 | 3.0.3.1 |
延伸相關外掛(你可能也想知道)
Store Locator Plus® for WordPress 》ied Google Maps API integration for a unique look and feel., Customize the search form fields and labels., , Improve Your Local SEO with the Search...。
Find My Blocks – Locate blocks on your site 》Find My Blocks 是一個 WordPress 外掛程式,旨在協助您 (正如其名) 找出在 WordPress 網站中使用特定 Gutenberg 區塊的位置。, Gutenberg 是一個很棒的工具...。
Simple Locator 》為什麼要使用 Simple Locator?, Simple Locator 適合開發人員尋找實現任何文章類型的位置搜尋的方法。它與其他插件不同之處在於可允許使用現有的自訂欄位作...。
Store Locator Widget 》一個功能齊全的商店定位器外掛,非常快速且容易配置,可以添加位置並嵌入您的 WordPress 網站。, StoreLocatorWidgets.com 的 Store Locator 軟件, 一個功能...。
Map Me 》Map Me 易於使用, Map Me 外掛可以在地圖上顯示多個位置,每個位置可以有不同的標記和資訊視窗,你還可以將某些標記動畫化以突出它們。, Map Me 提供超過 25 ...。
Preenchimento Automatico CEP Brasil 》透過郵遞區號自動填入地址欄位, 我們使用第三方 API https://viacep.com.br 提供的服務,其使用條款可在 https://viacep.com.br 的連結中查閱。。
Select Estados e Cidades Brasil 》WordPress外掛選擇巴西州市自動填充巴西的州和城市。, 我們使用https://www.mestresdowp.com.br/機構的API,其使用條款可在以下鏈接中找到:https://www.mest...。
G Web Pro Store Locator 》說明:這是一款名為 Gwebpro WordPress Store Locator 的外掛,這是一個獨特的位置地址搜尋和目錄系統,可以幫助您在整合的 WordPress 平台上找到和管理多個...。
LocatorLTE – Premium Store Locator 》可用於, , 分店/商店/辦事處定位器, 物業清單, 辦公室清單, 任何您可以想像在地圖上列出的東西, , 功能, , 在幾秒鐘內創建可搜索的列表, 可自定義的標記/圖標...。
Jigoshop Order Locator 》此外掛可擴充 JigoShop,為每筆訂單和產品新增一個獨特的定位器。。
Store Locator For Goong 》總結:, Store Locator Goong Maps API是一個功能強大的外掛,可以讓您輕鬆、迅速且具有成本效益地在地圖上顯示商店位置。這是Google Maps API的完美替代方案...。
9Map – Map Multi Locations 》總結:9Map - Map Multi Locations讓您可以將店面地址添加到Google地圖上,在網站上展示。, , 問題與答案:, 1. 這個外掛的功能特色是什麼?, - 這個外掛使用...。
Store Locator Software for Website 》Store Locator 軟件為網站提供解決方案,如果您有多家店鋪並想在網站上(一個地方)顯示它們的位置,30 天免費試用版本無廣告。, Store Locator Software by ...。
Phrankly Food & Drink Sourcing 》Phrankly 提供一種新型態的店家定位器,讓顧客更容易找到你的店家。它可以讓你輕鬆地嵌入你的餐廳或商店的食物和飲料來源或你的商品在哪裡可以購買。, 讓你的...。
Opening Times UK 》這個外掛程式增加了一個商店營業時間的搜尋框,只要填寫 "什麼?" 和 "在哪裡?" 的資訊,使用者就可以得到所有的營業時間、聯絡詳細資料及更多資訊。, 百萬...。