Linux 软件免费装

Wonderful Geoblocking Countries

开发者 wonderfulplugins
更新时间 2026年10月5日 04:31
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv3
版权网址: 版权信息

标签

security geolocation country block geoblocking block vpn

下载

1.0.3 1.0.2 1.1.0 1.1.1 1.2.0 1.2.1

详情介绍:

https://www.youtube.com/watch?v=S__b9oz7UQE Some sites simply do not need worldwide traffic — or keep getting spam registrations and brute-force login attempts from countries they never do business with. Wonderful Geoblocking Countries lets you block three areas of your site independently, each with its own country list and its own message: For every area you pick the mode that fits: On top of that, every area can also block visitors who use a VPN service — regardless of which country their VPN server is in. Without this, anyone could get around a country rule with a VPN. Blocked visitors receive an HTTP 403 response with your custom message (basic HTML allowed). Built-in safety rails: Two free data sources, stored on your server: Both updates run automatically and can be switched off at any time; the Download / update databases now button fetches both at once. Sites behind a CDN or reverse proxy can feed the real visitor IP (or a ready-made country code, e.g. from Cloudflare's CF-IPCountry header) into the plugin via the wonderful_geoblocking_countries_client_ip and wonderful_geoblocking_countries_pre_country_code filters. This plugin uses IP2Location LITE data available from https://lite.ip2location.com. The optional VPN list is built from data by X4BNet (https://github.com/X4BNet/lists_vpn, MIT license), antonme/ipranges (https://github.com/antonme/ipranges, CC0) and RIPE NCC RIPEstat (https://stat.ripe.net/).

安装:

  1. Upload the wonderful-geoblocking-countries folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Create a free account at lite.ip2location.com and copy your download token.
  4. Go to Settings > Geoblocking Countries, paste the token, save, and click Download / update database now.
  5. Optional: tick VPN list, save, and download again to also block VPN users.
  6. Pick the countries to block per area (and tick VPN where you want to block VPN users), write your block messages, done!

常见问题:

Why is the geolocation database not included in the plugin?

The IP2Location LITE database is free but published under its own license that requires every user to register for their own copy. The download with your personal token takes less than a minute and enables automatic monthly updates.

What happens while no database is installed?

Nothing — no visitor is blocked. The plugin shows an admin notice until a database is installed, and visitors whose country cannot be determined are always let through.

Can I lock myself out?

Not while you are logged in: administrators are always exempt from all three rules. Only the login rule can affect you when you are logged out and your own country is on its list — the settings page warns you about exactly that.

My site runs behind Cloudflare or another proxy — the detected country is wrong.

Behind a proxy, REMOTE_ADDR is the proxy's address, not the visitor's. Use the wonderful_geoblocking_countries_client_ip filter to supply the real client IP from a header you trust, or short-circuit the lookup entirely with wonderful_geoblocking_countries_pre_country_code (e.g. return the value of Cloudflare's CF-IPCountry header).

Does blocking also apply to the REST API and feeds?

The site access rule runs on every frontend request, including feeds and the REST API. The WordPress admin (including admin-ajax) and wp-login.php are excluded from it.

How does VPN blocking work, and how reliable is it?

Tick VPN list under Databases and download it, then tick VPN in every area where VPN users should be blocked. A visitor whose IP lies in a range of a known VPN provider is then blocked — regardless of the country and even in allow-list mode (otherwise a VPN server in an allowed country would be a way in). The list combines the X4BNet list, the server lists of the big providers (NordVPN, Surfshark, ExpressVPN, ProtonVPN, Mullvad, PIA and others) and the complete networks of pure VPN operators, and is updated daily. iCloud Private Relay is never counted as a VPN. No free list catches every VPN, though: small or self-hosted VPNs, Tor and residential proxies are usually not included. Logged-in administrators are never blocked, VPN or not.

Why not the IP2Proxy LITE database?

We tried it: the free IP2Proxy LITE edition only lists open public proxies — no VPN servers and no Tor exits (those are reserved for the paid edition) — and is more than 1 GB in size. The combined VPN list takes about 120 KB on your server and actually recognises VPN providers.

Can other plugins use the VPN list?

Yes. Once the VPN list is installed: $is_vpn = apply_filters( 'wonderful_geoblocking_countries_is_vpn_ip', null, $ip ); It returns true or false, and the default (null) while the VPN list is disabled or not installed.

Is any visitor data sent to a third party?

No. Country lookups run locally against the downloaded database file. The only external request is the database download itself, which you trigger with your own token.

更新日志:

1.2.1 1.2.0 1.1.1 1.1.0 1.0.3 1.0.2 1.0.1 1.0.0