| 开发者 | marc4 |
|---|---|
| 更新时间 | 2026年2月10日 06:39 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/?author=N queries (returns 404)
X-Frame-Options: SAMEORIGIN (clickjacking protection)
X-Content-Type-Options: nosniff (MIME sniffing protection)Referrer-Policy: strict-origin-when-cross-originPermissions-Policy (restricts geolocation, microphone, camera)wp_head output⚠️ Important: Always test security settings in a staging environment first. Some features may affect third-party integrations or plugins.
By default, the plugin enables:
No. The plugin uses lightweight WordPress hooks and native functions. Security headers add negligible overhead, and rate limiting only checks transients during login attempts.
By default, rate limiting uses REMOTE_ADDR. If behind a trusted proxy, add this to wp-config.php:
define('WPSH_TRUSTED_PROXIES', array( '173.245.48.0', // Example: Cloudflare IP range // Add your proxy IPs here ));
The plugin will then check HTTP_CF_CONNECTING_IP (Cloudflare) or HTTP_X_FORWARDED_FOR headers.
When security headers are enabled:
X-Frame-Options: SAMEORIGINX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originPermissions-Policy: geolocation=(), microphone=(), camera=()
When HSTS is enabled (HTTPS only):
Strict-Transport-Security: max-age=31536000; includeSubDomains (configurable)
Yes. Security headers are sent at the PHP level before caching. However, if you use aggressive server-level caching, you may need to configure your cache to allow these headers through.
Yes, but be careful of conflicts. If another plugin also:
When you uninstall (not just deactivate) the plugin:
No. The plugin only secures user-related endpoints by requiring authentication. All other REST API functionality works normally. Public endpoints like oEmbed continue to work.
Failed login blocks expire automatically based on your configured window (default: 15 minutes). Wait for the block period to expire, or:
_transient_wpsh_login_ in the name/?author=1 (should return 404 if blocking is enabled)Not required, but strongly recommended. HSTS features require HTTPS. For maximum security, your entire site should use HTTPS with a valid SSL certificate.
The plugin is designed for single-site installations. Multisite compatibility has not been tested and is not officially supported at this time.
WPSH_TRUSTED_PROXIES constant