IP2Location Tags

描述

IP2Location Tags 可帮助您通过 IP 地址查找根据不同国家和地区的地理位置向网站访问者提供特定内容。

该插件提供了一种相对简单的方法来检测访问者的 IP 地址并将其转换为地理位置信息,然后让访问者更好地参与与他们最相关的本地化信息或内容。

主要特征

  • Displays visitor’s’ information such as
    • Country code
    • 国家名称
    • 国旗
    • 地区名字
    • 城市名称
    • 纬度和经度
    • 邮政编码
    • ISP
    • 域名
    • 时区
    • 连接速度
    • IDD 代码
    • 区号
    • 气象站代码 & 名字
    • MNC,MCC,手机运营商名字
    • 海拔
    • 使用类型
    • Address type
    • Category
  • 根据国家或地区自定义页面内容
  • 支持 IPv4 和 IPv6

此重定向插件同时支持 IP2Location IP 地理定位 BIN 数据和 Web 服务来查找 IP 地址地理位置。如果您使用的是 BIN 数据,您可以使用设置页面上的向导每月更新一次 BIN 数据,以获得最准确的结果。或者,您也可以使用以下链接手动下载和更新 BIN 数据文件:

BIN 文件下载:IP2Location 商用数据库 | IP2Location LITE 数据库(免费版本)

如果您正在使用 IP2Location IP 地理位置网络服务,请浏览 IP2Location Web Service 以获取详情。

使用 Variable Tag 获取访问者的位置信息

使用例子

显示访客的 IP 地址,国家名字,地区名字和城市名字。
Your IP is {ip:ipAddress}
You are in {ip:countryName}, {ip:regionName}, {ip:cityName}

地理定位:使用 IP2Location Tag 自定义帖子内容

向特定国家显示内容的语法
[ip:XX[,XX]..[,XX]]Your content here.[/ip]
备注:XX 是两个字符的 ISO-3166 国家/地区代码。

例子
仅向美国或加拿大访问者显示内容。
[ip:US,CA]Only visitors from United States or Canada can view this line.[/ip]

向特定国家和地区显示内容的语法
[ip:XX:YY[,XX:YY]..[,XX:YY]]Your content here.[/ip]
备注:XX 是两个字符的 ISO-3166 国家/地区代码,而 YY 是 ISO-3166-2 细分代码。

例子
仅向加利福尼亚或纽约访客显示内容。
[ip:US:CA,US:NY]Only visitors from California or New York can view this line.[/ip]

从特定国家隐藏内容的语法
[ip:*,-XX[,-XX]..[,-XX]]Your content here.[/ip]
备注:XX 是两个字符的 ISO-3166 国家/地区代码。

例子
所有除了来自越南外的访客将能够看到这条信息。
[ip:*,-VN]All visitors will be able to see this line except visitors from Vietnam.[/ip]

从特定国家和地区隐藏内容的语法
[ip:*,-XX:YY[,-XX:YY]..[,-XX:YY]]Your content here.[/ip]
备注:XX 是两个字符的 ISO-3166 国家/地区代码,而 YY 是 ISO-3166-2 细分代码。

例子
所有除了来自加利福尼亚外的访客将能够看到这条信息。
[ip:*,-US:CA]All visitors will be able to see this line except visitors from California.[/ip]

更多的信息

请访问位于 https://www.ip2location.com的我们。

屏幕截图

  • IP2Location Tags 设置页面
  • IP2Location Tags 简码显示

安装

  1. 上传 ip2location 文件夹到 /wp-content/plugins/ 目录。
  2. 通过 WordPress 的“插件”菜单以激活本插件。
  3. 在设置页面下载最新的 BIN 数据库。
  4. 您现在可以开始使用 IP2Location tag 来自定义您的文章内容。

请注意此插件需要最少 PHP 版本 5.4

评价

2023 年 6 月 15 日
I was wondering why I couldn't get it to work within CF7 forms (yes, I know how to allow third-party shortcodes in CF7). Out of curiosity I looked at source code as the shortcode syntax looked unusual. Thing is, I searched over the whole plugin dir for add_shortcode and there wasn't a single match... looking closer, for some reason the developer decided it to be a good idea to roll their own shortcode system which just won't work at the same places as regular shortcodes. Regular shortcodes would have been the perfect solution to make this work reliably, but somehow that was off the table. And just to be clear: This is an issue purely of this plugin. Its sister plugin IP2Location Country Blocker works great, which speaks for the provider's database.
2020 年 7 月 30 日 1 回复
this plugin doesn't work, even if you update the database, it still doesn't work
2017 年 4 月 18 日
Plugin works with wordpress 4.7.3 Thanks you saved my time
2017 年 3 月 27 日
I needed to create a growing zone app where I would use the visitor's zipcode to associate with a growing zone. This plugin allows for me to fetch the zipcode from the visitor's ip address. Though it is not well stated, you will need to have access to your database, and you will need to create a table in your database and import the IP2LOCATION csv file to the new table. You will also need to have access to the server via FTP or cPanel to upload the appropriate bin and csv files. You may also need to periodically update the database, because it will probably not update on its own unless you pay for those services. There are ways to programmically have the database be updated automatically, but you will need to know what you are doing. Setting all of this up is not for the amateur, but once it is set up, it is awesome!
阅读所有8条评价

贡献者及开发者

“IP2Location Tags” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

将“IP2Location Tags”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

  • 2.13.1 Tested up to WordPress 6.5.1.
  • 2.13.0 Added ip2location.io web service support.
  • 2.12.7 Tested up to WordPress 6.4
  • 2.12.4 Tested up to WordPress 6.1.
  • 2.12.3 Tested up to WordPress 6.0.
  • 2.12.2 Fixed missing country flags.
  • 2.12.1 Enhanced checking.
  • 2.12.0 Updated IP2Location library.
  • 2.11.1 Tested up to WordPress 5.9.
  • 2.11.0 Added new address type and category fields.
  • 2.10.7 修复了弹出没有关闭的问题。
  • 2.10.6 测试到 WordPress 5.8。
  • 2.10.5 修复了网络服务的查找问题。
  • 2.10.4 测试到 WordPress 5.7。
  • 2.10.3 修复了一些用户的文件权限问题。
  • 2.10.2 修复了读取数据库文件的错误。
  • 2.10.1 移除了内置数据库。
  • 2.10.0 添加了设置向导。
  • 2.9.3 修复了当结果不可用时的错误。
  • 2.9.2 测试到WordPress 5.6。
  • 2.9.1 移除了已弃用的函数。
  • 2.9.0 更新了文件结构以将 Composer 用于 IP2Location 库。
  • 2.8.10 测试到 WordPress 5.5。
  • 2.8.9 修复了弃用警告。
  • 2.8.8 测试到 WordPress 5.4。
  • 2.8.7 修复了错别字。
  • 2.8.6 小修复。
  • 2.8.5 添加了反馈请求。
  • 2.8.4 测试了 WordPress 5.3.2。
  • 2.8.3 升级了 IP2Location 库到 8.1.0。
  • 2.8.2 更新了文档链接。
  • 2.8.1 测试到了 WordPress 5.1.1。
  • 2.8.0 升级了 IP2Location API 到 v2。
  • 2.7.1 添加了当 IP2Location 数据库遗失或损坏时的错误信息。
  • 2.7.0 添加了调试日志。
  • 2.6.1 小改动。
  • 2.6.0 IP2Location 数据库更新更改为使用下载令牌。
  • 2.5.1 修复了安装多个 IP2Location 插件时的冲突问题。
  • 2.5.0 使用 IP2Location PHP 8.0.2 库进行查找。
  • 2.4.9 支持 countryFlag 功能。
  • 2.4.8 修复了卸载功能。
  • 2.4.7 防止在停用/激活插件时丢失设置。
  • 2.4.6 修复了小漏洞。
  • 2.4.5 使用最新的 IP2Location 库并更新设置页面。
  • 2.4.4 测试到 WordPress 4.4。
  • 2.4.3 修复了在本地机器测试时的问题。
  • 2.4.2 修复了匹配区域或州属时的问题。
  • 2.4.11 使用最新的 IP2Location 库进行查找。
  • 2.4.10 修复关闭粘性信息面板问题。
  • 2.4.0 修复了多个性能问题。添加了 IP2Location 网络服务支持。
  • 2.3.3 支持根据地区或州属的内容的定制。
  • 2.3.2 修复了小工具的兼容问题。
  • 2.3.1 修复了小问题和 WordPress 标准。
  • 2.3.0 修复了与其他 IP2Location 插件的冲突。
  • 2.2.0 支持在设置页面下载数据库。支持括号[]来定义<&lgt;之外的标签规则,以解决被wordpress当作script标签的问题。
  • 2.1.0 初始版本