
內容簡介
ShivWeb Login Verification 為您的 WordPress 登入流程增加雙重驗證(2FA),透過電子郵件發送登入代碼,確保即使密碼被竊取,未經授權的使用者也無法登入。此外掛無需設置身份驗證應用程式或外部服務,簡化了安全性流程。
【主要功能】
• 透過電子郵件提供雙重驗證代碼
• 角色基礎的驗證設定
• 完全支援 WooCommerce 登入流程
• 記住信任的裝置,減少重複驗證
• 新註冊用戶的電子郵件驗證
• 自訂電子郵件模板與螢幕訊息
外掛標籤
開發者團隊
② 後台搜尋「ShivWeb Login Verification: Email OTP & Two-Factor (2FA) for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
ShivWeb Login Verification adds two-factor authentication (2FA) to WordPress and WooCommerce logins with a one-time password (OTP) sent by email. A user signs in with their password as usual, then types the code from their inbox. Someone who has stolen a password but cannot open the inbox stays locked out.
Your users don’t need an authenticator app, and you don’t need an SMS service, an account anywhere, or API keys. Codes go out through your site’s own email, so the SMTP plugin you already use handles delivery.
Many people know this as two-step verification. It is one of the simplest ways to add login security to a WooCommerce store, because customers already have the one thing it needs: their email.
Why add a second step to your login
Passwords leak all the time. People reuse the same password across shops, newsletters and forums, and when one of those sites is breached, attackers try the leaked email and password pairs everywhere else. Phishing emails, now often written with AI tools, trick people into typing their password on fake pages. Either way, the attacker ends up with a working password.
A second step changes that. With email OTP verification switched on, a correct password is no longer enough. The attacker also needs a fresh code that was just sent to the account owner’s inbox, and that code expires within minutes.
For a WooCommerce store this protects what customers trust you with: their saved addresses, their order history and their account details. For membership, course and community sites it stops shared or leaked passwords from becoming shared accounts.
How a login works
The user enters their username and password as normal, on any login form.
The plugin emails them a one-time code and holds the session.
They type the code on a clean verification screen.
They continue exactly where they were going: My Account, the checkout, the dashboard or the page they asked for.
Until the code is entered, the session can’t do anything else. It can’t open other pages, call admin-ajax, use the REST API, post comments or place an order. The check runs on the server, so it can’t be skipped by closing a popup or turning off JavaScript. The verification screen itself works without JavaScript too.
What makes it different
Most login OTP plugins hook into one login form. This one checks the session itself, on the server, after any login. That one design choice is why it covers forms other plugins miss, like the WooCommerce block checkout, and why a held session can’t sneak past through admin-ajax, the REST API or the comment form.
It is also built to be easy to trust. There is no account to create, no external service in the middle, no bundled libraries and no hidden upsell. The settings fit on one screen, and the safety switches are there from the first minute.
Who it’s for
WooCommerce stores that want OTP verification for customer logins, without asking customers to install an app.
Membership, course and community sites that want two-factor authentication for specific user roles.
Agencies and freelancers who want simple login security on client sites, with a recovery path that can’t lock the client out.
Any site that wants email verification for new sign-ups, to stop spam registrations made with made-up email addresses.
What your customers see
After the password, customers see a short, calm page titled “Verify your email”. It shows the address the code went to, partly masked, so they know which inbox to check. They type the six digits and continue.
If the email is slow, a “Send a new code” link appears after a short countdown. A “Log out” link is always there if they want to stop. When they get a code wrong, the message says so in plain words and the field is ready for another try.
The email itself is short: a greeting with their name, the code in large bold digits, how many minutes it stays valid, and a line saying they can ignore the message if they didn’t try to sign in.
Choose who needs a code
Enforcement is role based. Tick the roles that should verify and leave the rest alone. Out of the box only the Customer role is selected, so a store can protect shopper accounts without changing how the team logs in. You can add Subscriber, Author, Editor, Shop manager, Administrator or any custom role your other plugins create.
Administrators are not asked for a code unless you tick that role. We suggest testing the flow with a customer account first, then adding your own role once you have seen it work.
Two-factor authentication for WooCommerce
The plugin was built for WooCommerce from the start, and it covers every place a customer can log in:
the My Account login form
the classic checkout’s returning customer login
the WooCommerce block checkout, which signs customers in through the Store API in the background
wp-login.php and wp-admin
Most OTP login plugins add a field to the login form. The block checkout never shows that field, so those plugins can’t protect it. This plugin checks the session after login, on the server. While a session is waiting for its code, the Store API refuses checkout requests, and a small script sends the shopper to the verification screen. After they verify, they land right back at checkout with their cart intact.
It also guards the less visible WooCommerce routes, such as wc-ajax requests and legacy wc-api callbacks, so a held session can’t slip through a side door. Payment gateway callbacks that come server to server are not affected.
The plugin declares compatibility with WooCommerce’s High-Performance Order Storage (HPOS) and the cart and checkout blocks. WooCommerce is optional: on a site without it, the plugin protects wp-login.php, wp-admin and every other login the same way.
Email verification at registration
You can also require new sign-ups to confirm their email address with a code. This is WooCommerce customer email verification that happens before the account is used, and it works on the WordPress register form and the WooCommerce My Account register form.
On register forms, a small popup asks for the code before the account is created. A typo in the email address is caught on the spot.
Checkout sign-ups can’t be verified before the account exists, so they are verified right after, at the customer’s first session.
Accounts that never verify are removed automatically after a two-day grace period. Accounts with a WooCommerce order and accounts with editing rights are always kept.
Because the address has to receive a real code, this cuts down spam registrations and fake accounts made with made-up email addresses.
Trusted devices
Customers who log in often don’t want a code every time. When they enter a code, they can tick “Trust this device”, and that browser skips the code for as many days as you choose. Set it anywhere from 1 to 365 days, or set it to 0 to turn the option off.
The trust lives in a secure cookie on that one browser, and only hashed tokens are stored on your site. Logging in from a new browser or another computer still asks for a code.
You can’t lock yourself out
Login security plugins are known for locking site owners out. This one is built to make that very hard:
Codes stay off until you prove your site can send email. You send yourself a test code from the settings screen and enter it, and only then can the switch be turned on. A broken mailer can’t lock everyone out.
Administrators are not gated unless you choose that role.
If anything goes wrong later, one line in wp-config.php or one WP-CLI command turns everything off and releases every held session at once.
Good habits for login security
Email codes work best alongside a few simple habits:
Send email through an SMTP plugin or a transactional email service, so codes arrive in seconds and don’t land in spam.
Start with the Customer role, watch a few real logins, then add other roles.
Tell your customers before you switch it on, for example in a store notice or a short email, so the new step doesn’t surprise them.
Keep “Trust this device” short on stores where people share computers.
Encourage everyone, and especially your team, to protect their email account with its own two-step login, since that inbox is now the second step.
Rate limits and abuse protection
Every way of requesting or entering a code has a limit, so the code screen can’t be used to flood an inbox or guess codes:
a cooldown between “Send a new code” requests
a maximum number of codes per login attempt
a lockout after too many wrong codes, for a time you choose
a cap on how many codes one account can receive in a set window
per email and per IP limits on the sign-up popup
Codes are generated with a secure random generator and stored only as keyed hashes, never in plain text. Each code expires after the number of minutes you set.
Email that arrives
Codes are sent through wp_mail(), the same way WordPress sends password resets. If you use an SMTP plugin or a transactional email service, the codes go through it automatically.
You can change the sender name and address, the subject and the message. The email body supports simple HTML and these placeholders: {otp}, {site_name}, {user_name}, {user_email} and {validity_minutes}. Every message on the verification screen can be changed too, so the wording matches your store.
Works with your setup
WordPress login (wp-login.php) and the admin area
WooCommerce My Account, classic checkout and block checkout
social login and other plugins that log users in through WordPress’s normal login
the REST API and XML-RPC: for roles that need a code, logging in there with the main password is blocked, so apps and scripts use Application Passwords instead
persistent session storage such as Redis
any SMTP or transactional email plugin
Lightweight and private
The plugin does one job. It adds no custom database tables, writes no log files and calls no outside service to send codes. Its data is one settings option, a few small user meta entries and the WordPress session record, which is cleared when the user logs out. Uninstalling removes all of it.
Privacy and personal data
To send a code, the plugin uses the email address already saved on the user’s account. It doesn’t collect any new personal data, and codes are never stored in a readable form. The only cookie it sets is the optional “Trust this device” cookie, which holds a random token, not personal details.
Codes are sent from your own site through your own mail setup. No third party sees them. This keeps the plugin simple to cover in your privacy policy: the email address is used to send a security code, and that is all.
Accessibility and mobile
The verification screen is built to work for everyone. The code field is a proper labelled input, error messages are announced to screen readers, and the layout fits small phone screens. The field is marked as a one-time code, so phones show a number keypad and can offer to fill the code in from the email. The screen is also kept out of search engines.
For developers
SWLV_DISABLE_OTP in wp-config.php turns enforcement off for emergencies.
WP-CLI: wp swlv status, wp swlv disable and wp swlv reset-user
Filters: swlv_enforce to switch enforcement off in code, swlv_abandoned_account_max_age and swlv_delete_abandoned_account to control the sign-up cleanup, and swlv_registration_ip_send_limit for the sign-up throttle.
Settings at a glance
Everything lives on one screen under Settings, then Email Verification:
Require a code at login, protected by the test-code check
Roles that need a code
Verify email at registration
Code length, from 4 to 8 digits
How many minutes a code stays valid
The wait before “Send a new code” works again
How many codes one login attempt may request
How many wrong tries are allowed, and how long the lockout lasts
How many codes one account may receive in a set window
How many days “Trust this device” lasts
Sender name and address, email subject and email body
Every message shown on the verification screen
Features
Two-factor authentication with email OTP codes, no authenticator app
Pick exactly which user roles must verify
WooCommerce: My Account, classic checkout and block checkout
Email verification for new registrations, with automatic cleanup
Trusted devices, remembered for as many days as you choose
Rate limits on resends, wrong attempts and codes per account
Your own email template and on-screen messages
No external service for codes, no API keys, no per-message fees
Recovery through a wp-config.php constant or WP-CLI
Recovery
If you ever lock yourself out, add define( 'SWLV_DISABLE_OTP', true ); to wp-config.php, or run wp swlv disable with WP-CLI. Both release every held session immediately. To unstick one user (send limit reached, mailbox typo), run wp swlv reset-user
Usage data (opt-in)
After activation, the plugin asks an administrator whether it may send a short weekly report to Shiv Web, the plugin author, at shivweb.com. Nothing is sent unless an administrator clicks Allow. The report holds the site address, the WordPress, PHP, WooCommerce and plugin versions, the site language and theme, and which plugin features are on. The admin email is added only if the administrator ticks a separate box. User accounts, customer data and login codes are never sent. You can switch it on or off at any time under Settings, Email Verification, in the “Help improve the plugin” section.
When you deactivate the plugin from the Plugins screen, a short optional survey asks why. Your answer is sent only if you click “Send and deactivate”.
Both go to https://shivweb.com/wp-json/shivweb-insights/v1/. See the Shiv Web privacy policy.
Translations
The plugin is fully translation ready. You can help translate it into your language on translate.wordpress.org.
