IP2Location Country Blocker

描述

如果启用了任何缓存插件,则此插件将不起作用。

此插件允许用户根据国家/地区或代理服务器来阻止不受欢迎的流量访问您的前端(博客页面)或后端(管理区域)。通过防止不受欢迎的访问者浏览特定页面或整个网站,它有助于轻松减少垃圾邮件和不被需要的注册。

关键功能

  • 允许您阻拦来自多个国家的访问。
  • 让您能够按国家分组阻止访问,例如欧盟、亚太地区等。
  • 允许您阻止匿名代理的访问。
  • 让您能够根据 IP 范围阻止访问。
  • 允许您将爬虫(例如 Google、Bing、Yandex 等)列入白名单,以索引您的页面(SEO 友好)。
  • 支持 IPv4 和 IPv6。
  • 默认为 403 错误(Permission Denied)显示
  • 允许您自定义您自己的 403 页面。
  • 如果有人试图访问您的管理区域,将向您发送电子邮件通知。
  • 为您提供阻拦流量的统计报告。

此插件同时支持使用 IP2Location BIN 数据和网络服务进行 IP 地理定位查找。如果您想要使用 IP2Location 地理定位 BIN 数据,您可以通过插件设置页面轻易地下载和更新 BIN 数据。或者,您也可以使用以下链接手动下载和更新 BIN 数据文件:

IP Geolocation 文件下载:
IP2Location & IP2Proxy LITE 数据库(免费)
IP2Location & IP2Proxy 付费数据库(完整)

To use the IP2Location IP geolocation web service (REST API) for geolocation, you’ll need to register an account at IP2Location.io IP Geolocation API. A free plan is available.

更多的信息

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

屏幕截图

  • 通过IP地址查找国家 - 允许您通过输入 IP 地址执行国家/地区查找。
  • 前端阻拦 - 选择您希望阻止访问者访问您的博客页面的国家/地区。支持页面重定向。
  • 后端阻拦 - 选择您希望阻止访问者访问您的管理区域 (wp-login) 页面的国家/地区。支持页面重定向。
  • 客制错误页面 - 客制化您专属的错误页面以配合您的 wordpress 主题。
  • 电子邮件提醒 - 当有用户尝试访问您的管理页面时通知您详细信息。

安装

使用 WordPress 控制面板

  1. 选择 Plugins -> Add New
  2. 搜索 “IP2Location Country Blocker”。
  3. 单击立即安装按钮以安装插件。
  4. 单击激活按钮以激活插件。
  5. Register a download account https://lite.ip2location.com (Free) or https://www.ip2location.com (Commercial).
  6. Get the download token from your account page.
  7. Go to “Country Blocker” form WordPress sidebar.
  8. Go through the setup wizard step by step.
  9. 您现在可以开始使用 IP2Location Country Blocker 来屏蔽访客。

手动安装

  1. 上传插件至 /wp-content/uploads/ip2location 目录。
  2. 通过 WordPress 的“插件”菜单以激活本插件。
  3. 从 https://lite.ip2location.com/database/ip-country (免费)或 https://www.ip2location.com/databases/db1-ip-country (付费)下载 IP2Location 库。
  4. 从 https://lite.ip2location.com/database/px1-ip-country (免费) 或 https://www.ip2location.com/databases/px1-ip-country (付费)下载 IP2Proxy 库。
  5. 解压缩 .BIN 文件并上传到 wp-content/uploads/ip2location
  6. 如果您在 https://www.ip2location.com/web-service 购买了 IP2Location 网络服务,请在设置标签输入您的 API 密钥。
  7. 如果您在 https://www.ip2location.com/ip2proxy-web-service 购买了 IP2Proxy 网络服务,请在设置标签输入您的 API 密钥。
  8. 您现在可以开始使用 IP2Location Country Blocker 来屏蔽访客。

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

  • 如果您正在使用 IP2Location LITE 数据库,请根据 这些指示 在您的网站添加归属。

常见问题

在安装插件后我是否需要下载 BIN 文件?

是的,请从 https://lite.ip2location.com/database/ip-country下载最新的 DB1 BIN 文件以进行快速测试。

我可以在哪里下载 BIN 文件?

您可以在 https://lite.ip2location.com 下载免费 LITE 版本或在https://www.ip2location.com 下载付费版本。解压缩已下载的 .BIN 文件并上传到 wp-content/uploads/ip2location

我需要更新 BIN 文件吗?

我们鼓励您每个月更新您的 BIN 文件以便您的插件能使用最新的 IP 地理定位结果。更新通常将在每个月的第一个星期准备就绪。

什么是前端?

前端意味着您的博客页面。

什么是后端?

后端是指 wordpress 管理页面。

我可以选择复数国家进行阻拦吗?

是的,您可以。

我可以在被阻止的 IP 上发送 403 页面吗?

是的,您可以使用此插件提供的预设 403.

我可以客制化我自己的错误页面吗?

是的,您可以在 wordpress 创建一个新的页面并设计您自己的错误显示。一旦完成,您可以标记您的错误页面为“私有”,并在设置页面配置错误重定向。

如果有人尝试访问我的管理员页面,我能设定电邮提醒吗?

是的,如果来自被阻止国家/地区列表的用户尝试访问您的管理页面,您可以配置电子邮件通知。

此插件是否适用于“缓存插件”,例如 W3 Total Cache?

不。您需要禁用“缓存插件”,我们的插件才能正常运行。

我该如何测试此插件?

请访问 https://www.locabrowser.com 获取代理/VPN 服务以测试地理定位结果。

我无法访问我的网站,停用或卸载不会改变任何东西

这可能是您本地缓存的问题。 请清除您的服务器和浏览器缓存。

没能找到您的答案?

发送电子邮件至 support@ip2location.com。

评价

2024 年 2 月 3 日
I just have to say that this plugin is literally SAVING my website. I have been receiving reports about failed logins to my website (over 1k for 2-3 months!). I used a different plugin to find the IP addresses only to find that they all belong to only two countries... The plugin gives you the option to block specific IPs or countries. I started blacklisting IPs individually, but after figuring out where they are coming from, I just blacklisted those countries. Job done. Also to add because I see some reviews mentioning interference with other cache plugins (even though it's indicated in the description that they need to be disabled, which is not really the best solution), in my case, it still works with a cache plugin I use to improve my site's performance. Thank you!
2023 年 12 月 1 日
Hi guys, I installed your plugin before I knew much about it and was only able to make this work after disabling our caching plugin: W3 Total cache. I see your disclaimer about disabling all caching plugin. I am asking politely, "Please explain to us why a caching plugin prevents your plugin from working?" Caching is kind of a big deal. Comparing the Benefits of a caching plugin - to a country location blocker - I would have to say the caching plugin wins hands down as the benefits of caching helps achieve SERP ranking by improving a website's performance. I provide a TEXT link .. ( not allowed to include an actual link in a review. ) so others can see these caching benefits that I'm talking about. wordpress.org (forwardslash) plugins (forwardslash) w3-total-cache It is for this reason I give your product 2/5 stars... it works, but not without being disruptive of our website's performance.
2023 年 10 月 25 日
Absolutely brilliant plugin. Easy to install, and started working right away. One of my websites has been getting slammed for the last 5 days with a bot from one specific country. Installed the plugin late last night, and the visits from that country are already down from more than 6,600 an hour to less than 150. I have also just lowered the threshold for the plugin to start blocking front end visits from a specific IP to a much lower number, and that seems to be catching most of the ones still slipping through. Very happy with the result so far, so will be installing it on the other 4 sites I own. Thanks so much for this. It's really made my day a lot less stressful 🙂
2023 年 9 月 27 日 8 回复
Could not make the plugin work with the latest version of Wordpress
2023 年 8 月 12 日
I installed this because I noticed that every time I installed a new WP website, the site immediately reveived tons of visitors from a specific country's search engine before it had even gone live and I had even made my first post. On an altogether different site, it turned out that the biggest trolls were non-Americans, even though my site was US-centric. I wasn't sure whether or not this plugin would work (I keep being told that it's oh, so difficult to block countries, practically impossible), but it does seem to be working. I noticed that failed login attempts went down to zero overnight, and that most of my visitors started coming from the US. Understand, though, that this plugin isn't 100% failsafe, as bad actors can also access archives of your site from the Wayback Machine or use VPNs and proxies. But it seems to do the job so far, and I'm crossing my fingers that it'll keep working in the future.
阅读所有111条评价

贡献者及开发者

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

贡献者

「IP2Location Country Blocker」插件已被翻译至 5 种本地化语言。 感谢所有译者为本插件所做的贡献。

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

对开发感兴趣吗?

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

更新日志

  • 2.34.6 Tested up to WordPress 6.5.1.
  • 2.34.5 Removed BIN database warning if Web service is used.
  • 2.34.4 Fixed CSRF issues.
  • 2.34.3 Fixed CSRF replace on API key value.
  • 2.34.2 Fixed decompress issue in Linux environment.
  • 2.34.1 Fixed SQL statement error.
  • 2.34.0 Updated setup wizard to include IP2Location.io Geolocation API service.
  • 2.33.7 Fixed value returned by get_current_url function.
  • 2.33.6 Fixed deprecated warning messages in PHP 8.
  • 2.33.5 Fixed undefined constants.
  • 2.33.4 Added a private key to protect debug log.
  • 2.33.3 Randomize debug log to protect unwanted access.
  • 2.33.2 Tested up to WordPress 6.4.1.
  • 2.33.1 Fixed string casting in PHP 8.x.
  • 2.33.0 Enabled pasting multiple IP addresses in blacklist/whitelist. Minor bugs fixed.
  • 2.32.4 Fixed undefined constant error.
  • 2.32.3 Fixed the proxy lookup issue when using IP2Location.io.
  • 2.32.2 Fixed database download issue for some users.
  • 2.32.1 Improved IP matching for IPv6.
  • 2.32.0 Added button to reset auto blacklist log.
  • 2.31.0 Added IP detection for website behind Securi firewall.
  • 2.30.2 Fixed CIDR function error.
  • 2.30.1 Improved accuracy of IP detection with CloudFlare.
  • 2.30.0 Improved IP detection for reverse proxy and CloudFlare services.
  • 2.29.2 Stop obtain client IP from custom header to prevent IP spoofing.
  • 2.29.1 Updated documentation and UI tweaks.
  • 2.28.9 Fixed undefined array key warning.
  • 2.28.8 Tested up to WordPress 6.2.
  • 2.28.7 Improve I18N Issues. (Credit: Alex Lion)
  • 2.28.6 Added source field into API web service.
  • 2.28.5 Updated to use IP2Location.io IP Geolocation API.
  • 2.28.4 Fixed error when running in wpcron.
  • 2.28.3 Updated “Requires at least” information.
  • 2.28.2 Tested up to WordPress 6.1.
  • 2.28.1 Prevent email notification when a blacklisted IP is blocked.
  • 2.28.0 Included automatic blacklist on frontend.
  • 2.27. 修复了错别字。
  • 2.27.0 Added CIDR format supports in whitelist/blacklist. Added automatic blacklist when exceeding threshold.
  • 2.26.16 Added sorting in whitelist & blacklist. Fixed minor bugs.
  • 2.26.15 Fixed whitelist/blacklist get wiped out when inserting a reserved IP address.
  • 2.26.14 已测试到WordPress 6.0。
  • 2.26.13 修复了缓存警告消息。
  • 2.26.12 修复了本地缓存存储问题。
  • 2.26.11 进一步提高插件安全级别。
  • 2.26.10 Migrated remote CDN scripts to host locally.
  • 2.26.9 Fixed XSS reported in https://www.exploit-db.com/exploits/50709
  • 2.26.8 Sanitized inputs to increase security level.
  • 2.26.7 已测试到WordPress 5.9。
  • 2.26.6 Improved security against CSRF by adding nonces.
  • 2.26.5 Fixed security issues with CSRF.
  • 2.26.4 移除了遗失的Javascript。
  • 2.26.3 Updated default blocking template.
  • 2.26.2 Fixed header warnings.
  • 2.26.1 修复了 IP2Proxy 数据库下载。
  • 2.26.0 性能调整和代码修复。
  • 2.25.16 修复了在撤销管理员通知后照旧显示通知的问题。
  • 2.25.15 修复了付费数据库的设置问题。
  • 2.25.14 修复了启用代理数据库时检测到的错误国家。
  • 2.25.13 修复了库以确保能够向后兼容。
  • 2.25.12 更新了 EU 国家名单。
  • 2.25.11 修复了Ajax 调用里的空白问题。
  • 2.25.10 默认使用 PX2 数据库来进行代理查找。
  • 2.25.9 修复了一些用户的文件权限问题。
  • 2.25.8 改进了以手动上传 BIN 数据库的检测。
  • 2.25.7 删除了 IP2Proxy 数据库下载的内存限制。
  • 2.25.6 修复了激活时缺少的默认值。
  • 2.25.5 修复了 IP2Proxy 库以支持 PHP 7.0 及以下。
  • 2.25.4 防止 Web 浏览器缓存插件脚本。
  • 2.25.3 在安装过程中添加了 bcmath 扩展检查。
  • 2.25.2 修复了下载 IP2Proxy 数据库时由于内存限制导致的安装指南问题。
  • 2.25.1 修复了 LITE 用户的下载问题。
  • 2.25.0 改进了 UI 和为新用户添加了安装指南。
  • 2.24.1 测试到WordPress 5.6。
  • 2.24.0 为新用户添加了导游。
  • 2.23.1 更新了 IP2Location 库以支持 PHP 的早期版本。
  • 2.23.0 更新了文件结构以将 Composer 用于 IP2Location 库。
  • 2.22.1 小UI更新。
  • 2.22.0 添加了对使用代理类型阻止的支持。
  • 2.21.2 修复了与其他插件冲突时的停用问题。
  • 2.21.1 测试到来 WordPress 5.5。
  • 2.21.0 在电子邮件提醒里添加了 URL。
  • 2.20.2 修复了未使用 IP2Proxy 数据库时的警告。
  • 2.20.1 更新了 IP2Location 库以支持更旧的 PHP 版本。
  • 2.20.0 实行了内部缓存,并修复了多个漏洞。
  • 2.19.21 清理了代码并净化用户输入。
  • 2.19.20 修复了变量错误。
  • 2.19.19 添加了归属指示。
  • 2.19.18 修复了停用问题。
  • 2.19.17 修复了版本问题。
  • 2.19.16 更新了 readme.txt。
  • 2.19.15 测试到 WordPress 5.4。
  • 2.19.14 修复了弹出没有被隐藏的问题。
  • 2.19.13 修复了没有储存电邮通知收件人的问题。
  • 2.19.12 增加了 BIN 下载中的超时。
  • 2.19.11 改进了 UI。
  • 2.19.10 修复了错别字。
  • 2.19.9 小修复。
  • 2.19.8 添加了反馈请求。
  • 2.19.7 测试了 WordPress 5.3.2。
  • 2.19.6 防止在设置页面中提交空 API 密钥。
  • 2.19.5 升级了 IP2Location 库到 8.1.0。
  • 2.19.4 修复了后端页面检测。
  • 2.19.3 修复了使用自定义页面时无限重定向的问题。
  • 2.19.2 移除了调式信息。
  • 2.19.1 修复了小错误。
  • 2.19.0 加强了多个功能。
  • 2.18.1 修复了小错误。
  • 2.18.0 添加了动态管理员页面的支持。
  • 2.17.6 将 FeedBurner 添加到机器人列表中。
  • 2.17.5 修复漏洞。
  • 2.17.4 更新了手动上传的指示。
  • 2.17.3 修复了未保存下载令牌的问题。
  • 2.17.2 修复了 IP2Location BIN 数据库没有下载的问题。
  • 2.17.1 修复了 BIN 数据库下载问题。
  • 2.17.0 为了防止在更新时 BIN 文件遭到删除,移动 BIN 数据库目录到 WordPress 上传目录。在调试日志中分组相同的访问者。
  • 2.16.0 修复了国家分组问题。
  • 2.15.3 更新了文档链接。
  • 2.15.2 测试到了 WordPress 5.1.1。
  • 2.15.1 修复了 IP2Location API 检查信用接口。
  • 2.15.0 将 IP2Location API 升级到 v2。添加了对日志表的额外检查。
  • 2.14.6 修复了 Windows 和 Linux 环境中的数据库文件检测。
  • 2.14.5 当 IP2Location 数据库遗失或损坏时禁止阻拦以避免管理员被挡下。
  • 2.14.4 不再提供BIN 数据库以避免本地副本被改写。防止 IP2Location & IP2Proxy 数据库在数据库更新期间相互删除彼此。
  • 2.14.3 测试到 WordPress 5.0.1。
  • 2.14.2 修复了服务器转发错误 IP 地址时的 IP 检测。
  • 2.14.1 根据最新的 ISO-3166 标准更新了国家名单。
  • 2.14.0 添加了国家分组以便一次性阻止多个国家。
  • 2.13.2 修复了更新数据库的问题。
  • 2.13.1 修复了小错误。
  • 2.13.0 添加了启用/禁用转发器 IP 的选项。
  • 2.12.0 添加了清除所有日志的选项。
  • 2.11.3 忽略 Facebook 爬虫。
  • 2.11.2 从机器人列表移除 Facebook。
  • 2.11.1 修复了图表显示问题。
  • 2.11.0 添加了调试日志。
  • 2.10.4 修复了自定义阻止不起作用。
  • 2.10.3 修复了小错误。
  • 2.10.2 修复了在旧版 PHP 上使用时的语法问题。
  • 2.10.1 小更改。
  • 2.10.0 IP2Location 数据库更新更改为使用下载令牌。
  • 2.9.2 修复了小漏洞。
  • 2.9.1 将 IP2Proxy 分开为一个额外的服务。
  • 2.9.0 添加了使用 IP2Proxy的代理检测功能。
  • 2.8.8 小更改。
  • 2.8.7 小更新。
  • 2.8.6 将塞尔维亚添加进国家名单。
  • 2.8.5 在通知邮件列表里只有管理员们会被列出。
  • 2.8.4 修复了当统计图表没有数据时的警告信息。
  • 2.8.3 修复了使用较小屏幕查看时的图表对齐问题。
  • 2.8.2 将图表分为前端和后端。
  • 2.8.1 修复了通知解除问题。
  • 2.8.0 允许自定义机器人/爬虫绕过检测。支持万用IP地址阻拦。
  • 2.7.5 修复了统计图表里的空的国家名字。
  • 2.7.4 添加了机器人检测。
  • 2.7.3 修复了记录日志时的漏洞。更新了 IP2Location 数据库。
  • 2.7.2 修复了电邮通知里的空的国家信息。
  • 2.7.1 如果用户作为管理员登录,略过阻拦。
  • 2.7.0 添加了白名单或黑名单 IP 的功能。并添加了跳过对登录用户的阻止。
  • 2.6.7 修复了禁止名单不能为空。
  • 2.6.6 修复了漏洞。
  • 2.6.5 改善了 Javascript 的性能。
  • 2.6.4 修复了与其他插件的 Javascript 冲突。
  • 2.6.3 修复了错别字。
  • 2.6.2 修复了小错误。
  • 2.6.1 修复了更新脚本。
  • 2.6.0 为了更好的用户体验和性能而进行的各种更改。
  • 2.5.3 修复了安装多个 IP2Location 插件时的冲突问题。
  • 2.5.2 修复了网络服务查找问题。
  • 2.5.1 修复了设置页面的问题。
  • 2.5.0 使用 IP2Location PHP 8.0.2 库进行查找。
  • 2.4.5 使用最新的 IP2Location 库进行查找。
  • 2.4.4 修复关闭粘性信息面板问题。
  • 2.4.3 修复了卸载功能。
  • 2.4.2 防止在停用或激活插件时遗失设置。
  • 2.4.1 使用最新的 IP2Location 库进行查找并更新设置页面。
  • 2.4.0 添加了禁止日志的选项。
  • 2.3.9 恢复更改以支持旧的 PHP 版本。
  • 2.3.8 修复了 WordPress 4.3里的警告信息。
  • 2.3.7 修复了与 PHP 5.3 及更早版本的兼容问题。
  • 2.3.6 修复了与 PHP 5.3 的兼容问题。
  • 2.3.5 修复了从上个版本更新时所发生的问题。
  • 2.3.4 使用最新的 IP2Location 库进行查找。
  • 2.3.3 修复了 iOS 设备的重定向问题。
  • 2.3.2 修复了后端阻拦的安全问题。
  • 2.3.10 测试到 WordPress 4.4。
  • 2.3.1 已修复小错误。
  • 2.3.0 修复了布局问题。添加了在阻止自己的国家时发出的警告。
  • 2.2.5 修复了用以绕过阻拦的密码的问题。
  • 2.2.4 修复了查找 IP 的问题。防止管理员阻止自己进入管理区域。
  • 2.2.2 修复了会话问题。
  • 2.2.2 修复了后端区域阻拦失败的问题。
  • 2.2.0 添加了 IP2Location 网络服务支持。细微的布局更改,并重写了背后的代码。
  • 2.1.0 添加了用于记录阻拦流量的统计信息。
  • 2.0.3 修复了如果其他插件定义了额外的标头资料时重定向可能不起作用的问题。
  • 2.0.2 更新了使用 javascript 重定向以纠正在某些情况下报告的不起作用的问题。
  • 2.0.1 修复了与其他 IP2Location 的冲突问题。
  • 2.0.0 添加了 IPv6 的支持。
  • 1.9.2 紧急漏洞修复。
  • 1.9.1 修复了性能问题。
  • 1.9.0 添加了验证是否使用默认旧样本bin进行检查的逻辑。
  • 1.8.0 修复了国家显示问题:南乔治亚岛和南桑威奇群岛
  • 1.7.0 修复了下载脚本错误。
  • 1.6.0 在电邮提醒信息内添加了用户资料。
  • 1.5.0 支持用以绕过后端验证的秘密代码。
  • 1.4.0 如果来自被阻止国家/地区的用户尝试访问您的后端页面,将发送电子邮件通知。
  • 1.3.0 将配置页面移至设置,以缓解设置页面位置的混乱。
  • 1.2.0 允许用户自定义他们自己的错误页面。
  • 1.1.0 添加了产品代码的下拉选择。