
前言介紹
- 這款 WordPress 外掛「Geo IP Library」是 2017-10-16 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2017-10-18,距離現在已有 3053 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.3 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.3 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
geo-ip | library | standalone | geo location | custom content |
內容簡介
Geo IP Library 可以啟用一些簡單但強大的功能,以在 WordPress 上提供地理 IP 國家功能。到目前為止,其主要功能包括:
用於插件和主題的靜態 PHP 函數。
顯示不同地區或一組國家的內容的簡碼。
從其來源更新本地庫的管理。
關於庫
此外掛使用一個沒有外部依賴性的第三方 PHP 單一庫文件,因此它在掛件中並在本地運行。它適用於不想使用(或依靠) Web 服務或實現 PHP GeoIP 擴展的任何人。
該庫由 Chirag Mehta 製作。
庫更新
由於使用本地庫可以節省時間,其數據可能在將來過期。此插件允許從其遠程來源更新本地庫。要這樣做,請轉到管理儀表板(具體位於工具菜單下),可以在不經任何風險的情況下更新庫。
更新限制
庫可每72小時更新一次。沒有必要進行較小的間隔。
如何使用
簡碼
使用 [geo-ip] 或 [geo] 標記,在文章和頁面中顯示每個國家(或國家)的不同內容。要實現魔法,請參閱以下語法:
/**
* INCLUDE PROPERTY
* Show content to a specific country or many countries
*/
// [geo-ip] tag
[geo-ip include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]
// [geo] tag
[geo include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]
/**
* EXCLUDE PROPERTY
* Show content to all countries but...
*/
// [geo-ip] tag
[geo-ip exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]
// [geo] tag
[geo exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]
如果沒有其他插件正在使用 [geo] 標籤(因為它是一個非常常見的單詞),則只能使用 [geo] 標籤。
包括和排除由於其目的而無法一起使用。
編程
可以在 GeoIPLibrary 類任何位置使用以下靜態函數:
/** 返回當前客戶端的 IP 地址(字符串)。
* 繞過代理和/或轉發。
* 如果失敗,則返回 FALSE。 */
GeoIPLibrary::get_client_address()
/** 返回當前客戶端的 ISO 3166-1 alpha-2 國家代碼
* 或指定為 $ip 參數的字符串
* 如果失敗,則返回 FALSE。 */
GeoIPLibrary::get_client_country_code(string $ip = '')
/** 返回當前客戶端的國家名稱
* 或指定為 $ip 參數的字符串
* 如果失敗,則返回 FALSE。 */
GeoIPLibrary::get_client_country_name(string $ip = '')<h3>Contributions</h3>Geo IP Library 仍在開發中,但目前穩定。您可以貢獻新想法、代碼優化/問題甚至語法/拼寫檢查(英語不是我的母語)。歡迎自由地 [提交請求拉取](https://github.com/ricardo-miguel/geo-ip-library/pulls) 或 [開啟問題](https://github.com/ricardo-miguel/geo-ip-library/issues)。
原文外掛簡介
Geo IP Library enables sort of simple but powerful functions in order to provide geo ip country features on WordPress. Main features so far until now:
Static PHP functions to be used in plugins and themes.
Shortcodes to display different contents by country or a bunch of countries.
Update management of local library from its source.
About library
This plugin uses a third-party PHP single library file which does not have external dependencies, so it comes within the plugin and works locally. It is intended for anyone who don’t want to use (or depend of) web services or either implement native PHP GeoIP extensions.
The library was made by Chirag Mehta.
Library update
Since working with a local library can be a time-saver, its data may get deprecated sometime in the future. This plugin allow update your local library from its remote source. To do that, go to admin dashboard (specifically under Tools menu), where the library can be updated without any risk.
Updating restriction
The library can be updated every 72 hours. It is not really necessary a minor interval.
How to use
Shortcode
Display different content for each country (or countries) within posts and pages by using [geo-ip] or [geo] tags. To do magic, see the following syntaxes:
/**
* INCLUDE PROPERTY
* Display content to a specific country or many countries
*/
// [geo-ip] tag
[geo-ip include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]
// [geo] tag
[geo include="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]
/**
* EXCLUDE PROPERTY
* Display content to all countries but...
*/
// [geo-ip] tag
[geo-ip exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo-ip]
// [geo] tag
[geo exclude="{2-digits country code [, other countries]}"]{plain text, HTML and/or shortcodes}[/geo]
[geo] tag is only available if no other plugin is using it (since it’s a pretty common word).
include and exclude cannot be used together due to their purpose.
Coding
The following static functions can be used anywhere along GeoIPLibrary class:
/** Returns the current client's IP address as STRING.
* It bypasses proxies and/or forwarding.
* Returns FALSE if it fails. */
GeoIPLibrary::get_client_address()
/** Returns the current client's ISO 3166-1 alpha-2 country code
* or the specified at $ip parameter as STRING.
* Returns FALSE if it fails. */
GeoIPLibrary::get_client_country_code(string $ip = '')
/** Returns the current client's country name
* or the specified at $ip parameter as STRING.
* Returns FALSE if it fails. */
GeoIPLibrary::get_client_country_name(string $ip = '')
Contributions
Geo IP Library is still in development, but currently stable. You can contribute with new ideas, coding improves/issues and even grammar/spelling check (english is not my mother language). Feel free to [make a pull request](https://github.com/ricardo-miguel/geo-ip-library/pulls) or [open an issue](https://github.com/ricardo-miguel/geo-ip-library/issues).
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Geo IP Library」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Who Hit The Page – Hit Counter 》這個外掛可以在您的網站上添加一個隱形的網頁點擊計數器,讓您知道誰瀏覽了您的網頁,您可以知道每個 IP 地址所瀏覽的總頁數以及瀏覽每個頁面的每位使用者所...。
Geo Controller 》你準備好提升你的 WordPress 遊戲了嗎?認識 Geo Controller,前身為 CF Geo Plugin,這是一個最終的地理行銷工具,可讓你完全掌握你的網站地理位置信息。, ...。Counter – Flag Counter 》這個 WordPress 外掛可以在小工具區內加入一個基於 JavaScript 的國旗計數器。, 你可以調整 JavaScript 程式碼設定。, 可以檢視最近 500 位訪客的城市和國家...。
IP Geolocation 》這個外掛程式可用於顯示 IP 資訊和地理位置,並使用了第三方 API 服務。, 你可以使用以下 API 服務:, – ipinfo.io(你必須取得 api 金鑰 – 需要...。
IP Address Approval 》IP地址批准系统提供了一种简单的方式,让你允许或阻止访问你的网站,以保护你的网站不受不必要的访问者干扰。你可以在公网网站和私人网络网站上都使用IP地址...。
My Geo Posts Free 》我的 Geo Posts Free 外掛使用 IpInfoDb 和/或 geoPlugin 的服務,取得訪問者 IP 位置資料,並將該資料以 cookie 的形式保存在訪問者的瀏覽器中,以減少 API ...。WP-Ultimate-Map 》WP Ultimate Map 是一個 WordPress 外掛,可讓您使用獨特的圖示分組地點,也可以對路線進行分組。您可以在地圖上放置多個地點,繪製多條路線,甚至可以繪製路...。
WP Comments Google Map for Posts 》WP Comments Google Map for Posts(WordPress 文章留言 Google 地圖)會在您的文章中加入 Google 地圖,並為該文章中每個留言者的位置標上標記。, , 自訂地...。
VCAT EDULABS Posts at Google Maps 》使用此外掛,您可以將文章和頁面放到 Google 地圖上。Geo-Position(地理位置)將從地址確定。, Google 地圖可以通過兩個短代碼嵌入到文章或頁面中,這兩個短...。
Shift8 GEO IP Location 》這個外掛可以利用 ip-api 得到使用者 IP 位置的地理座標。請閱讀 這篇部落格文章以了解如何與外掛互動。, 想看這個外掛的實際效果嗎?, 您可以查看三個實際運...。Ochre W3C Geolocation Services 》Ochre’s Geolocation Services plugin for, WordPress 使用 W3C Geolocation API 取得訪客的實際位置,讓 WordPress 網站能夠呈現適當於訪客實際位置的...。
IP2Phrase 》這個外掛可以讓你客製化歡迎訊息或其他想呈現的內容,根據訪客的國家語系做客製化。它會透過IP地址來判斷訪客的位置,並且方便地創建一個簡單的本地化訊息,...。
IHS Geo Location 》此外掛會偵測你的所在地並提供給你可套用在 div 元素上的某些類別,或您可以在主題上使用簡碼來顯示使用者的現在地區、城市、州、國家和地址。, , 使用:, , ...。GEO-location and directions 》此外掛會在僅限行動裝置使用者的瀏覽裝置中加入一個浮動按鈕。, 使用者按下此按鈕即可顯示其地理位置及前往網站所有者的位置指引。, 此外掛還提供控制面板,...。
GEO my WordPress – Current Location Forms 》「Current Location Forms」是針對 WordPress 外掛「GEO my WP」所開發的一個附加元件。它可強化現有的「Current Location」小工具及短代碼,使您得以選擇要...。
