內容簡介
總結:SDLC Country Block 外掛讓您可以根據訪客的國家限制對個別文章和頁面的訪問,同時保持對 SEO 機器人和網路爬蟲的解除封鎖以進行安全索引。
1. 這個外掛有多少種檢測國家的方式?
- 這個外掛按照以下順序進行訪客國家的檢測:Cloudflare 標頭 (CF-IPCountry)、伺服器 GeoIP 變數、PHP GeoIP 擴展 (geoip_country_code_by_name)、Wordfence 外掛。
2. 這個外掛具有哪些特點?
- 可以對每個文章/頁面進行多個國家的選擇。
- 對 SEO 友好:機器人/網路爬蟲可以繞過封鎖。
- 可選擇的操作:重定向到端點 (/blocked)、重定向到自定義 URL 或返回 403 錯誤碼。
- 可自定義端點的別名。
- 基於角色的繞過功能 (例如,管理員、編輯者)。
- 可選的僅管理員可見的除錯橫幅。
- 正確的清洗、逸出和密鑰串。
- 設置 Vary: CF-IPCountry 以保持快取的正確性。
- 乾淨的卸載過程 (移除選項和文章元數據)。
3. 這個外掛由什麼公司維護?
- 這個外掛由 SDLC CORP 維護,是一家擁有專業知識的數字轉型公司,提供 WordPress 開發、Shopify 解決方案、人工智慧和機器學習、模型開發和自然語言處理以及企業級 AI 開發服務。
額外問題:這個外掛需要哪些擴展或外掛才能正常運作?
- 需要 Cloudflare、Server GeoIP、PHP GeoIP 擴展或 Wordfence 外掛之一啟用。如果沒有啟用任何,該外掛將無法檢測訪客的國家。
外掛標籤
開發者團隊
原文外掛簡介
The SDLC Country Block plugin lets you restrict access to individual posts and pages based on the visitor’s country, while keeping SEO bots and crawlers unblocked for safe indexing.
🔐 4 Layers of Country Detection
To ensure maximum compatibility, the plugin checks for the visitor’s country in this order:
1. Cloudflare header (CF-IPCountry)
2. Server GeoIP variables (if your hosting environment provides them)
3. PHP GeoIP extension (geoip_country_code_by_name)
4. Wordfence plugin (using Wordfence GEO detection)
⚠️ Note: At least one of these extensions or plugins must be enabled. If none are active, the plugin cannot detect visitor countries.
✨ Features
Per-post/page multi-select of countries (full ISO list)
SEO-safe: bots/crawlers can bypass blocks
Choose action: redirect to endpoint (/blocked), redirect to custom URL, or 403
Customizable endpoint slug
Role-based bypass (e.g., admin, editor)
Optional admin-only debug banner
Proper sanitization, escaping, and nonces
Sets Vary: CF-IPCountry for cache correctness
Clean uninstall (removes options and post meta)
This plugin is maintained by SDLC CORP — a Digital Transformation Company with expertise in:
– WordPress Development
– Shopify Solutions
– Artificial Intelligence (AI) & Machine Learning
– Model Development and NLP (Natural Language Processing)
– Enterprise-grade AI Development Services
By publishing this open-source plugin, SDLC CORP demonstrates its commitment to empowering developers and businesses with scalable AI-driven solutions and modern web technologies.
Requirements & Compatibility
For the plugin to work, at least one of the following extensions or plugins must be enabled on your server:
Cloudflare → Enable the IP Geolocation setting in your Cloudflare dashboard (adds the CF-IPCountry header).
Server GeoIP → Your hosting provider must support GeoIP (ask your host if they provide GEOIP_COUNTRY_CODE).
PHP GeoIP Extension → Install and enable the PHP geoip extension on your server (may require server admin/hosting support).
Wordfence Plugin → Install the free Wordfence Security plugin and enable its country blocking/GeoIP feature.
➡️ At least one of these must be active. If none are available, the plugin cannot detect visitor countries.
Third-Party Compatibility
This plugin is designed to work with third-party services such as Cloudflare and Wordfence when available.
SDLC Country Block is an independent plugin and is not affiliated with or endorsed by Cloudflare or Wordfence.
License
This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License, or (at your option) any later version.
This plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GPL v2 license is included in this package. You can also see https://www.gnu.org/licenses/gpl-2.0.html.
Trademark
“SDLC CORP” and the SDLC CORP logo are trademarks of SDLC CORP.
The GPL license covers the plugin’s source code. It does not grant rights to use SDLC CORP’s trademarks or branding in modified versions in a way that suggests endorsement or affiliation without permission.
