[WordPress] 外掛分享: Geo IP Library

WordPress 外掛 Geo IP Library 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Geo IP Library」是 2017-10-16 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2017-10-18,距離現在已有 2755 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.3 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.3 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ricardomiguel |

外掛標籤

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 = '')

Contributions

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 環境。


0.9.6 | 0.9.7 | trunk |

延伸相關外掛(你可能也想知道)

  • Media Cleaner: Clean your WordPress! 》Media Cleaner 是一個強大的外掛,它可以幫助你清理 WordPress 媒體庫中未使用的媒體條目和文件,以及修復損壞的條目。內置回收站功能讓你可以在永久刪除之前...。
  • Media Library Categories 》此外掛可允許在 WordPress 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。
  • Simple File Downloader 》這個外掛將允許管理員在最簡單、無壓力的方式下向任何文章/頁面中添加下載連結。, 無需使用者限制,所有網站訪客都可以從您的網站下載任何文件。, 功能, , 在...。
  • Link Library 》此外掛用於在您的網站上建立一個頁面,列出 WordPress 管理介面內的 "連結" 部分中所定義的所有連結分類及其內所包含的所有連結。使用者可以選擇是否顯示某些...。
  • Document Gallery 》這個外掛可讓使用者毫不費力地建立文件和其他附加媒體的圖庫,就像現有的圖像附件圖庫選項一樣。, 觀看以下視頻以瞭解 Document Gallery 如何運作:, , 在設...。
  • Media Library Enable Infinite Scrolling 》在 WordPress 5.8 發布後,媒體庫預設將取消無限捲動。有關更改集的 Trac 票證 50105,以及決定背後的歷史背景的票證 40330。, 這個外掛程式,化解瞭媒體庫中...。
  • Snippet Shortcodes 》文件/升級, Snippet Shortcodes 網站, Snippet Shortcodes 是什麼?, 您是否想在整個網站上使用相同的文本片段或 HTML 片段,但只需在一個位置更改值?如果是...。
  • The Easiest WordPress Media Manager Plugin – WP Media Manager Lite 》ress多媒體管理員 Lite, , 使用拖放媒體文件到文件夾的簡單方式 - WP Media Manager Lite, 產品頁面 | 演示 | 文檔 | 高級版本 | 支持, , 拖放媒體文件和文件...。
  • WP Media Categories 》在 WordPress 媒體庫中增加分類功能。, 主要功能, , 與文章分類一樣控制媒體分類。, 在列表和網格檢視中,按類別過濾媒體庫。, , 也請見, , WP Chosen, WP Te...。
  • Store file uploads for Contact Form 7 》預設狀態下,Contact Form 7 不會保留通過其聯絡表單發送的數據。, 雖然像 Flamingo 這樣的外掛會保存這些數據,但上傳的文件並不會添加到媒體庫。, 這個外掛...。
  • Polaroid Gallery 》Polaroid Gallery 是一個 CSS3 和 jQuery 圖像庫 WordPress 外掛程式,它使用 WordPress 媒體庫在當前頁面或文章上以拍立得照片的方式重疊圖像。使用 Polaroi...。
  • F4 Media Taxonomies 》F4 Media Taxonomies 可以讓你使用分類、標籤或自訂分類來過濾媒體庫。, 你可以使用內建分類 (category) 或標籤 (post_tag) 的分類,或是任何自訂分類。, 如...。
  • Download Media 》Download Media 可以讓你一鍵直接從媒體庫下載媒體到你的設備。, 你可以一個一個地下載媒體,也可以批量下載。, 需要幫助嗎?發現錯誤嗎?想要貢獻程式碼嗎?...。
  • Scissors Continued 》這個外掛在 WordPress 的圖片上傳和管理對話框中添加了剪裁、調整大小和旋轉功能。Scissors 外掛還允許在圖片上傳時進行自動調整大小,並支持自動和手動添加...。
  • Media Library Downloader 》原生的 WordPress 無法直接從媒體庫中下載檔案,但透過此外掛,您可以輕易地下載任何需要的檔案!, 主要功能:, , 下載單個 / 多個檔案, 與列表 / 網格視圖相...。

文章
Filter
Apply Filters
Mastodon