Linux 软件免费装
Banner图

Advanced Country Blocker

开发者 brstefanovic
更新时间 2025年10月16日 18:03
PHP版本: 7.2 及以上
WordPress版本: 6.8
版权: GPLv3 or later
版权网址: 版权信息

标签

security country blocking geolocation ip blocking

下载

2.1.0 2.0.1 2.0.2 2.0.4 2.0.3 2.2.0

详情介绍:

Advanced Country Blocker helps you secure your WordPress site by restricting access based on the visitor's geolocation (country) or IP address. Upon activation, the plugin detects the activating admin’s country and automatically sets that as the only allowed country. All other visitors from different countries are blocked, unless they use a secret key parameter to temporarily whitelist their IP. Country detection uses the privacy-friendly ip-api.com service by default but can be switched to a fully offline MaxMind GeoLite2 (or compatible) database file once you configure a local copy. Key Features: Use the plugin settings page (Country Blocker menu in WP admin) to configure the list of allowed countries, blacklisted countries, blacklisted IPs, and whether email alerts are enabled.

安装:

  1. Upload the plugin folder to the /wp-content/plugins/ directory, or install via the WordPress "Add Plugin" feature.
  2. Download the GeoLite2 Country database (or another compatible MaxMind DB format country database) from MaxMind and place the .mmdb file somewhere on your server where PHP can read it (optional but recommended for offline mode).
  3. Activate the plugin through the "Plugins" menu in WordPress.
  4. Upon activation, the plugin will:
  5. Detect the activating admin's IP.
  6. Determine the corresponding country using your selected lookup method (remote API by default).
  7. Set that country as the only allowed country in the plugin settings.
  8. Go to Country BlockerSettings in your WordPress admin menu to adjust configurations (e.g., secret key, blacklisted countries, blacklisted IPs, etc.), choose the IP lookup method, and (optionally) provide the absolute path to your .mmdb file for offline lookups.

屏幕截图:

  • **Blocked Attempts Log** – View a list of recently blocked visitors.

升级注意事项:

2.0.0 Upgrading to 2.0.0 will add new features like logging, blacklisting, and an optional email alert system. Make sure your database is set up correctly and that you’ve reviewed the new settings.

常见问题:

Where do I get the GeoIP database file?

You can download the free GeoLite2 Country database from MaxMind (requires a free account). Upload the .mmdb file to a readable location on your server (for example, inside wp-content/uploads/) and paste the absolute file path into the GeoIP Database Path field on the plugin settings page.

My IP geolocation is incorrect. How do I fix it?

Local GeoIP databases occasionally have outdated entries. MaxMind updates GeoLite2 weekly, so download the latest release when you notice inaccuracies. You can also manually add or remove countries on the settings page to adjust who is allowed or blocked.

What if I accidentally block myself?

You can add your IP manually to the temporary whitelist by using the URL parameter (?YourSecretKey=1), or log in as an admin (if admin bypass is enabled). Alternatively, you can deactivate the plugin via FTP or your hosting control panel and adjust settings.

Does this plugin store any visitor data?

The plugin stores IP addresses and (optionally) country codes in a custom log table when visitors are blocked. This is purely for security and administrative review. Remove or adjust this functionality as needed to comply with privacy regulations.

Can I bypass the plugin if I’m an administrator?

Yes, by default, if you are logged in with manage_options capability. You can change or remove this bypass in the plugin code.

Can I customise the block page or send visitors somewhere else?

Yes. The settings page lets you change the block page title/message (with placeholders for {ip}, {country_code}, and {reason}), choose the HTTP status code to send (403, 410, or 451) or redirect visitors to a custom URL with the status code of your choice.

How do I only block a handful of countries?

Stay in the default allowlist mode when you want to permit just the countries you list. Switch to “Use Blacklist Mode” to list only the countries you want to block—everything else will be allowed automatically.

How can I clear or trim the log table?

Use the “Clear Logs” button on the Block Logs screen to wipe all entries instantly. You can also configure automatic log cleanup from the settings page—set the retention to 0 days to keep everything indefinitely.

更新日志:

2.2.0 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.1.0 1.0.0