Linux 软件免费装
Banner图

WT Hardening

开发者 webmastersteam
更新时间 2026年11月26日 23:08
捐献地址: 去捐款
PHP版本: 8.2 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

security brute-force xmlrpc hardening security-headers

下载

1.1.3 1.0.6 1.0.4 1.0.5 1.0.2 1.0.7 1.0.3 1.1.0 1.1.1 1.1.2 1.2.0

详情介绍:

WT Hardening is a lightweight, modular security plugin that turns on the most important WordPress hardening measures without modifying your theme, wp-config.php, or .htaccess. Everything works through WordPress hooks and can be disabled at any moment with a single click. The plugin is completely free, without a PRO version, without ads, and without sending data to external servers. Built by the Webmasters.Team crew for daily WordPress work. Modules Works with WT Notifier With WT Notifier active, its notifications about logins and failed logins can carry a Check or block IP link (add it in WT Notifier under Links). The link opens the WT Hardening page about the address: who tried to log in from it and with which accounts, whether a login succeeded, WooCommerce orders and comments from it. One click there locks it out. WT Hardening also gives WT Notifier the visitor address it detects, so behind Cloudflare or a reverse proxy the notifications show the real visitor and not the proxy. What makes it different What WT Hardening does NOT do (by design) For those needs we recommend dedicated plugins (e.g. Wordfence) or an infrastructure layer (Cloudflare, fail2ban).

安装:

Standard install
  1. In the WP admin go to Plugins → Add new.
  2. Search for “WT Hardening”.
  3. Click Install and then Activate.
  4. Open the WT Hardening menu in the admin (shield icon) and configure the modules.
Manual install (via ZIP)
  1. Download the archive from wordpress.org/plugins/wt-hardening.
  2. In the WP admin go to Plugins → Add new → Upload plugin.
  3. Pick the downloaded ZIP, click Install now, and then Activate plugin.
FTP/SFTP install
  1. Unzip the archive.
  2. Upload the wt-hardening folder to wp-content/plugins/ on your server.
  3. In the WP admin go to Plugins → Installed plugins and activate WT Hardening.
After activation all modules are enabled with sensible defaults. If something clashes with your workflow (for example the Jetpack mobile app that needs XML-RPC), just turn off the specific module in the settings.

屏幕截图:

  • Login log: currently locked IPs (IPv6 per /64 network) with an Unlock button, plus a list of recent failed attempts.
  • Event log: logins, lockouts, user changes, plugin activations, theme switches and settings changes.

升级注意事项:

1.2.0 Requires PHP 8.2. Adds manual IP lockouts, a page about each address, optional blocking of long lockouts in .htaccess (Apache, off by default) and WT Notifier integration. 1.1.3 Polish translation update only: the Polish texts now follow the WordPress Polish team glossary. No code or data changes, so the upgrade is safe. 1.1.2 WT Hardening moves into the shared Webmasters.Team menu (Settings, Login log, Event log and About tabs). Old page addresses redirect. No data changes, so the upgrade is safe. 1.1.1 Security fixes: REST API app password logins limited, IPv6 locked per /64, login leaks closed (/?author=1, REST and XML-RPC errors), Cloudflare visitors recognised automatically. HSTS includeSubDomains is now a separate setting (kept on for sites that had HSTS enabled). Recommended for all users. 1.1.0 Security fix: logging in to your own account no longer resets the brute-force counter for the IP. Adds escalating lockouts, IP allowlist, Cloudflare/proxy setting, unlock button and email alerts. 1.0.7 Confirmed compatible with WordPress 7.1. No code changes. 1.0.6 Security fix: the login limiter and event log no longer trust spoofable proxy headers (X-Forwarded-For etc.) by default, closing a brute-force bypass and a targeted-lockout vector. Behind Cloudflare/nginx? Enable the new wt_hardening_trust_proxy_headers filter. Recommended for all users. 1.0.5 New module (on by default) hides the post author’s name and URL from oEmbed responses, a user-enumeration vector picked up by WPScan. Need author attribution in embeds on other sites? Disable it in the settings. 1.0.4 Minor polish to a module description in the Settings panel. No behaviour or data changes. 1.0.3 Confirmed compatible with WordPress 7.0. No code or behavior changes. 1.0.2 The Plugin URI now points to the new landing page on Webmasters.Team. No code or behavior changes. 1.0.1 Compliance update: readme translated to English, escape fixes, safer URL parsing. No data or behavior changes. 1.0.0 First release. Install and activate it; modules are enabled with sensible defaults.

常见问题:

Does the plugin modify wp-config.php or .htaccess?

No. Everything is wired through WordPress hooks. Deactivating the plugin instantly reverts all changes (except HSTS, which browsers cache, so enabling HSTS is a conscious decision).

Will blocking XML-RPC break my mobile app / Jetpack / pingbacks?

Possibly, if you actually rely on them. Disable the XML-RPC module in the settings. The other protection layers stay active.

What happens to the event log on deactivation?

The table stays in the database (useful for later analysis). On full uninstall the tables are dropped cleanly.

Does the plugin work with multisite?

Tested on a single-site install. Settings, tables and cleanup jobs are per site; tables are created on each site the first time the plugin runs there, and uninstalling removes the data from every site of the network. Multisite is not yet formally supported, so file an issue if something breaks.

I locked myself out. What now?

Wait until the lockout expires, log in from another network (e.g. your phone’s mobile data), or ask another administrator to click Unlock under Webmasters.Team → WT Hardening → Login log tab. With WP-CLI access you can remove the lockout directly: wp db query "DELETE FROM wp_wt_hardening_lockouts WHERE ip='1.2.3.4'" (adjust the table prefix; for IPv6 use the /64 network shown in the log, e.g. 2001:db8:1:2::/64). Add your office IP to the allowlist to avoid this in the future.

How do I lock out an IP address by hand?

Open Webmasters.Team → WT Hardening → Login log tab, type the address under Lock out an IP address, choose how long and click Lock out, or click Lock out next to an address in the list of failed attempts (it opens the page of that address with the form filled in). Logging in from that address (for IPv6, its /64 network) is then refused on wp-login.php, the WooCommerce login form, XML-RPC and application passwords; the rest of the site stays available. Your own current address and addresses on the allowlist cannot be locked out. A lockout set to last until it is unlocked stays until you click Unlock. Click an address in the login log or the event log to open its page: failed and successful logins with the accounts involved, WooCommerce orders and comments from it, lockouts and event log entries, with the lockout form filled in. wp-admin/admin.php?page=wt-hardening&tab=log&wt_ip=203.0.113.5 opens the same page, which is how the WT Notifier Check or block IP link works. The link alone never locks anything out: you confirm in the form. Developers: the wt_hardening_blocked action runs after a manual lockout.

Can locked-out addresses be stopped before WordPress loads?

Yes, on Apache. Turn on Block long lockouts in .htaccess in the login limiter settings. Long and permanent lockouts (automatic and manual) are then also written to .htaccess between # BEGIN WT Hardening and # END WT Hardening, and the server answers those addresses with error 403 on the whole site. Further attempts no longer start PHP, so they do not slow the site down, fill the logs or trigger WT Notifier messages. Regular lockouts stay in WordPress only, so a customer who mistyped a password does not lose access to the whole shop. When you turn it on, the plugin writes a test rule and sends two requests to your own site to check that the server applies it; if it does not (for example nginx, LiteSpeed, or AllowOverride without AuthConfig, which causes error 500), the test rule is removed at once and the option stays off. It is not available on multisite, and it is refused when the site is behind Cloudflare or a reverse proxy without mod_remoteip, because the server would see the proxy address; block addresses in the proxy instead (in Cloudflare: Security → WAF → IP Access Rules). Addresses expire from the file together with their lockouts, Unlock removes them at once, and the whole block is removed when you turn the option off, deactivate or delete the plugin. Private and Cloudflare addresses, the server’s own address and the allowlist are never written.

My site is behind Cloudflare. What should I set?

Nothing. Since 1.1.1 Cloudflare is recognised automatically. When a request comes from Cloudflare’s published IP ranges (updated weekly from cloudflare.com, with a bundled copy as fallback), the visitor address is taken from the CF-Connecting-IP header, also with Site behind Cloudflare / proxy left at No. The header is ignored for requests from any other address, so it cannot be spoofed by hitting your server directly. Choosing Cloudflare explicitly works the same way. Without this every visitor would appear with a Cloudflare IP, so one attacker could lock everyone out.

My site is behind another reverse proxy (nginx, a load balancer). What should I set?

Set Site behind Cloudflare / proxy to Reverse proxy on the local network. X-Forwarded-For is then trusted only from private-network addresses. When the plugin sees such a proxy while the setting is still No, it shows a notice on its admin pages.

What about performance?

Modules only register the hooks they actually need. The event log is a single INSERT per event. No scanner, no background work beyond an hourly and daily cleanup of old rows. Real impact on response time: under 1 ms.

Why is HSTS disabled by default?

Because Strict-Transport-Security has a sticky effect (browsers remember the header for a year). Enabling it too early (before your entire traffic works on HTTPS without errors) can lock users out of the site for a long time. Turn it on once HTTPS is rock-solid. includeSubDomains is a separate setting (off by default) because it also forces HTTPS on every subdomain; preload is never added.

HSTS is on, but the header is missing behind my proxy. Why?

The header is sent only over HTTPS. When HTTPS ends at a proxy, WordPress sees plain HTTP and the plugin relies on the X-Forwarded-Proto: https header, but only from a proxy it trusts: Cloudflare’s IP ranges (always) or, with Site behind Cloudflare / proxy set to Reverse proxy on the local network, a private-network address. From any other address the header is ignored, so it cannot be spoofed.

Does the strong password policy apply to users created through WP-CLI or wp_create_user()?

No. The policy hooks into form validation (profile, registration, reset) and the REST API users endpoints. Programmatic user creation bypasses these hooks by design. For a typical client workflow (users are created through the admin panel) this is enough.

What personal data does the plugin store?

The login limiter stores the IP address and the login typed in failed attempts (kept for the configured counter window, at most 7 days) and in lockouts (kept until 24 hours after they end). The event log stores the user, IP address and event details, including logins typed in failed attempts and the email of new users (kept for the configured retention, 30 days by default). Everything stays in your database. The data is included in Tools → Export Personal Data, and Tools → Erase Personal Data deletes the person’s event log entries and removes their login from attempts and lockouts. The attempt and lockout records themselves, with their IP addresses, are kept until they expire (a security log); the erase tool reports them as retained and explains why. Mention the login security log in your privacy policy: the plugin adds suggested text with the current retention periods to Settings → Privacy → Policy guide.

更新日志:

1.2.0 1.1.3 1.1.2 1.1.1 1.1.0 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 First release.