Linux 软件免费装
Banner图

Nahnu Login Shield

开发者 ja1me4
更新时间 2026年10月21日 00:44
PHP版本: 8.3 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

captcha login security brute force two factor geo blocking

下载

1.0.12 1.0.11 1.0.13 1.0.14 1.0.15 1.0.10

详情介绍:

Nahnu Login Shield protects every WordPress login entry point: the login form, WooCommerce My Account, XML-RPC, the REST API and your form plugins. It is a login security plugin, not a general security suite. No subscription. No license key. No upsell. Everything is free. Brute-force lockout Early blocking An optional must-use plugin turns locked-out IPs away before WordPress loads. It is off by default and never installed automatically: click "Install early-block mu-plugin" on the General tab, and "Remove" to delete it again. CAPTCHA / verification providers One provider site-wide, shown on every protected form: OOPSpam (with VPN, data-centre and disposable-email blocking), reCAPTCHA v2 and v3, hCaptcha, Cloudflare Turnstile (managed or invisible), Friendly Captcha, Cap, mCaptcha and ALTCHA, or none. Two-factor authentication Passwordless sign-in White-label emails 2FA codes, magic links and signup confirmations use your sender name, logo, colours and footer. Subject, heading and intro are editable, with a preview and test send. Access control Geo-fencing Reads the visitor country from CDN headers (Cloudflare, Bunny.net, CloudFront, Vercel, Fastly/Akamai) with no API quota, falling back to freeipapi.com or ipinfo.io with caching. Edge blocking: Bunny.net and Cloudflare More protection WooCommerce My Account All protections extend to the My Account login, registration, lost-password, checkout and order-tracking forms, each with its own toggle. Customers get a Login & security tab to manage passkeys, 2FA and sign-in options without seeing wp-admin. The same panel is available anywhere with the [nahnls_account_security] shortcode. Form plugin integrations Bricks Builder forms (per form), SureForms (all forms or the ones you pick) and the WordPress comment form, each with its own toggle. Anything else can integrate through the developer API: template tags, shortcodes, actions and filters, REST routes under nahnls/v1 and a JavaScript API (see docs/API.md). Event log and analytics MainWP extension A separate companion extension shows lockouts, edge blocks, recent events and settings across all your MainWP child sites. Privacy IP addresses and usernames are stored in a local database table for the event log, with configurable retention. No data is sent to any Nahnu server. Third-party services you enable receive only what they need (see below). Deleting the plugin removes all stored data. External services Nahnu Login Shield works fully offline by default. Each service below is contacted only when the site administrator explicitly selects or configures it in the plugin settings. No data is ever sent to a Nahnu server. Country flags shown in the admin log are SVG files bundled with the plugin (assets/img/flags/); no flag CDN or other external image service is used. Bundled third-party libraries No scripts are loaded from a CDN. These libraries ship inside the plugin (assets/vendor/ unless noted otherwise):

安装:

  1. Upload the nahnu-login-shield folder to /wp-content/plugins/.
  2. Activate through Plugins in the WordPress admin.
  3. Go to Settings > Login Shield to configure.
Quick start:
  1. On the Widget tab, choose a CAPTCHA provider (or leave it as None to use lockout only).
  2. On the Lockout tab, review the attempt thresholds.
  3. On the Geo tab, enable geo-blocking and select blocked countries if needed.
  4. On the Integrations tab, enable protections for WooCommerce My Account, Bricks Builder forms, SureForms and WordPress comments as needed.
  5. On the Edge Blocking tab, connect your Bunny.net or Cloudflare account to push blocks to the edge.
To use OOPSpam, install and activate the OOPSpam Anti-Spam plugin and enter your API key there first. Nahnu Login Shield detects it automatically.

屏幕截图:

  • Widget tab — pick the CAPTCHA provider (OOPSpam, reCAPTCHA v2/v3, hCaptcha, Turnstile, Friendly Captcha) with a live preview.
  • Geo tab — block the login form by country using CDN geo headers or an IP lookup API.
  • Edge Blocking tab, IP Blocking — push lockouts and honeypot hits to the Bunny.net or Cloudflare WAF so attackers are stopped at the edge.
  • Lockout tab — failed-attempt thresholds, escalation to long bans, the lockout message and proxy header settings.
  • Integrations tab — WooCommerce My Account forms plus Bricks Builder, SureForms and WordPress comment protection.
  • 2FA tab — two-factor authentication for selected roles, with email codes as the baseline and authenticator apps or passkeys as stronger options.
  • Passwordless tab — magic login links and passkeys (WebAuthn).
  • Settings tab — log retention and white-label email branding for every email the plugin sends.

升级注意事项:

1.0.15 Better right-to-left display of the account security panel. 1.0.14 Cleaner design for the customer-facing account security panel (My Account > Security and the shortcode). 1.0.13 New Cloudflare WAF tab: one-click login rate limit on every Cloudflare plan, blocked IPs with Unblock, and "Block network" for attacker ASNs. Fixes Cloudflare blocks never being lifted on expiry. The rate limit needs the API token permission Zone → Zone WAF → Edit. 1.0.12 New Bunny Shield tab under Edge Blocking: a one-click login rate limit (fixed limits on the free plan, your own on Advanced), blocked IPs on a Shield access list automatically when your pull zone has Shield, and "Block network" for attacker ASNs (Shield Advanced). Block pages now return HTTP 403. 1.0.11 SureForms protection now works (per form), and your own username can go on the honeypot list again: sign in with your email instead. If you are locked out, NAHNLS_DISABLE_HONEYPOT in wp-config.php switches the list off. 1.0.10 Prefix rename release. Settings, the event log, user 2FA/passkey data and cron schedules migrate automatically on upgrade. The early-block mu-plugin is now opt-in: the old copy is removed and nothing is copied into mu-plugins automatically - open Settings > Login Shield > General and click "Install early-block mu-plugin" if you want it. If you defined NLS_BYPASS_IP in wp-config.php it still works, but the new name is NAHNLS_BYPASS_IP. 2FA, when on, now challenges every user in the selected roles (all roles unless you used Enforce mode) with email codes as the baseline - make sure your site sends email, or add an authenticator app first. Developers: hook, shortcode, REST (nahnls/v1) and JS names changed - see docs/API.md. 1.0.9 Chart.js and the Friendly Captcha widget are now served from the plugin itself rather than a CDN. No settings changes needed. 1.0.8 Requires PHP 8.3. The early-block mu-plugin now only trusts proxy headers when "Trust proxy headers" is on - if your site sits behind Cloudflare/Bunny/a reverse proxy, make sure that setting is enabled (Lockout tab) or lockouts will be keyed to the proxy address. ip-api.com geo source removed; sites using it are switched to freeipapi. 1.0.0 Initial public release. No upgrade path from pre-release builds.

常见问题:

Do I need OOPSpam installed?

No. OOPSpam is one of seven CAPTCHA provider options. All other providers and all other features work independently.

Does this plugin slow down my site?

No. Assets load only on wp-login.php and any pages you opt into via the Integrations tab. The JS check uses a tiny inline script with no external request. Geo lookups from CDN headers are zero-latency. API fallback results are cached per IP for a configurable period. If you opt in to the early-block mu-plugin, it turns away locked-out IPs before WordPress fully loads.

What happens if the CAPTCHA API goes down?

All providers fail open. A network or API error never locks out legitimate users.

Will this conflict with other security plugins?

It hooks specifically into WordPress login actions and standard WooCommerce and form-plugin hooks. If another plugin hooks the same actions it may conflict. Open a support thread with details if you see an issue.

Can I use this without any CAPTCHA?

Yes. Set the provider to None. Geo-blocking, brute-force lockout, honeypot username trapping, the JS presence check, and 2FA all work independently of CAPTCHA.

Does it work with WooCommerce?

Yes. The WooCommerce My Account login, registration, lost-password, checkout, and order-tracking forms each have their own toggle in the WooCommerce section of the Integrations tab.

I locked myself out. How do I get back in?

Two options. First, add define( 'NAHNLS_BYPASS_IP', 'your.ip.address' ); to wp-config.php (above the "That's all, stop editing" line). It accepts a comma-separated list of IPs and CIDR ranges, and exempts them from lockouts, the IP blocklist, geo blocking and the early-block rate limit - no deactivation needed. Second, rename the plugin folder from nahnu-login-shield to _nahnu-login-shield via SFTP, which deactivates it. If you are stuck at the two-factor step instead, see the next question.

Can I put my own username on the honeypot list?

Yes, and it is a good idea: usernames are public (author pages, feeds, the REST API), so bots try them. Add your username to the Honeypot list on the Lockout tab and sign in with your email address from then on. Anyone who tries the username is locked out like a bot. Email addresses of real accounts are never blocked, so patterns like admin@* do not affect your own sign-in. The Lockout tab lists which entries are real accounts and reminds you if your own username is on the list. If you get locked out anyway, add define( 'NAHNLS_DISABLE_HONEYPOT', true ); to wp-config.php (above the "That's all, stop editing" line) to switch the honeypot list off, sign in, fix the list, then remove the line. To clear an IP that is already locked, also see the question above.

I can't receive the 2FA email / I'm locked out

When two-factor authentication is on, every sign-in asks for a code, and email codes are the baseline. If the email does not arrive (a mail problem on the server, spam filtering), first try a backup code or "Email me a code" again. If that does not help, add define( 'NAHNLS_DISABLE_2FA', true ); to wp-config.php (above the "That's all, stop editing" line). This switches the 2FA check off for everyone, so you can sign in with just your password; the plugin's settings page shows a notice while it is set. Fix email delivery (an SMTP plugin usually does it), add an authenticator app on your Login & security page so you are not dependent on email, then remove the line. Note: NAHNLS_BYPASS_IP does NOT bypass 2FA - it only exempts addresses from lockouts, the IP blocklist, geo blocking and the early-block rate limit.

Can my login, registration and My Account pages be cached?

Mostly yes. Every protected form carries a hidden security token that lives about a day. On page load the plugin's small script fetches a fresh token (one request to admin-ajax.php), so pages served from a full-page cache keep working as long as JavaScript runs - including cached blog posts with a comment form. Without JavaScript, a cached copy of the form older than a day fails the security check and asks the visitor to reload. Login, registration and My Account pages should still be excluded from full-page caching (WooCommerce requires this anyway). Developers can lengthen the token life with the nahnls_form_nonce_life filter.

Is this compatible with multisite?

It is not tested on multisite and is not recommended for network activation.

How does geo-blocking work when I do not use a CDN?

It falls back to one of two free IP geolocation APIs (freeipapi.com or ipinfo.io) with a configurable cache. CDN headers are always checked first and take priority.

How do I get a new form plugin supported?

Open a support thread or submit a request at https://nahnuloginshield.com/support/. Bricks Builder, SureForms and WordPress comments are the supported integrations today; anything else can be wired up through the developer API (docs/API.md) while a request is considered.

What is the mu-plugin and is it safe to have?

The mu-plugin is optional and opt-in. Nothing is copied until you, as an administrator, click Install early-block mu-plugin on the General tab. That button copies nahnls-early-block.php from the plugin folder into your must-use plugins directory (WPMU_PLUGIN_DIR, normally wp-content/mu-plugins/). The file checks whether the requesting IP is locked out or rate-limited and, if so, sends a 403/429 response before WordPress fully loads — dramatically reducing server load during bot floods. The General tab shows whether it is installed, not installed or outdated; after a plugin update you are offered an Update mu-plugin button (it is never refreshed automatically). Clicking Remove deletes the file, and it is also removed on plugin deactivation and deletion. If the directory is not writable, the settings page shows manual copy instructions instead. The per-IP rate-limit counters the mu-plugin uses are tiny text files stored inside your WordPress uploads directory at wp-content/uploads/nahnu-login-shield/ratelimit/ (protected by an index.php and .htaccess; files older than five minutes are pruned automatically). Nothing is written outside the WordPress installation; the folder is deleted when the plugin is uninstalled.

Can attackers bypass the lockout by rotating IPs?

The per-username lockout catches this: if the same username is attempted from too many different IPs within the time window, the username itself is locked regardless of IP. Adding common targets (admin, administrator, root) to the Honeypot username list gives the strongest protection — one attempt from any IP is enough to lock both the IP and the username globally.

更新日志:

1.0.15 1.0.14 1.0.13 1.0.12 1.0.11 1.0.10 1.0.9 1.0.8 1.0.7 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0