=== Better Login Security by Quintaphon ===
Contributors: quintaphon
Donate link: https://buymeacoffee.com/quintaphon
Tags: login security, two-factor, limit login attempts, hide login, captcha
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Limit failed logins, move wp-login.php to your own address, two-factor by email, reCAPTCHA, alerts and a login page designer.

== Description ==

Better Login Security by Quintaphon protects the WordPress sign-in from password guessing, stolen passwords and bots, and tells you when something looks wrong. One clean settings screen, no account, and it works on unlimited sites.

Plugin site: [quintaphon.com/wordpress/better-login-security](https://quintaphon.com/wordpress/better-login-security/)
Documentation: [quintaphon.com/docs/wordpress/better-login-security](https://quintaphon.com/docs/wordpress/better-login-security/)

= Custom login address =

* Move the sign-in page from wp-login.php to an address you pick, such as `/team-door/`.
* Visitors who open wp-login.php or wp-admin see the "page not found" page, or the home page if you prefer.
* Every link WordPress makes to the login page (lost password, registration, emails) points to the new address.
* The new address is emailed to the site admin address whenever it changes.

= Limit failed attempts =

* Lock an address out after a number of failed sign-ins within a time window, with a longer lockout for repeat offenders.
* Shows how many tries are left, or a message of your own.
* Instant lockout for usernames only bots use (such as "admin" when no such account exists).
* Counts failures from wp-login.php, XML-RPC, the REST API, two-factor codes and CAPTCHA, without counting one failure twice.
* Lockouts screen: unlock one address or all of them, lock an address for a set time, or move it to the allowlist or blocklist.

= Allow and block lists =

* Allowlist and blocklist with single addresses, ranges and CIDR networks (IPv4 and IPv6), each with a note.
* Reads the real visitor address behind Cloudflare and other proxies, and warns you when the setting looks wrong.
* Your own address can never be locked out by accident from the settings screen.

= Two-factor sign-in by email =

* A one-time code by email after the password.
* Require it for chosen roles.
* Each user turns it on or off on their profile; administrators can reset a user.

= Passwords =

* Minimum length for new passwords.
* Blocks common passwords.

= Google reCAPTCHA =

* reCAPTCHA v2 (checkbox) and v3 (invisible score).
* On the sign-in, registration and lost-password forms.

= Login page designer =

* 3 templates: Classic, Clean Card and Minimal Line.
* Your logo with its link and width (or the site icon, or the site name as text), and the browser tab title.
* Background, card, text, accent, link and field colours.
* Your own heading, message above the form and footer text; hide the "Go to site" link, the language switcher or "Lost your password?".
* Live preview in the settings screen, on desktop and phone sizes, before you save.

= Activity log and dashboard =

* Every sign-in, failure, lockout, two-factor step, password change and settings change, kept for 30 days by default and up to a year, with address, country and device.
* Filter and search.
* Dashboard with a 14-day chart, two-factor coverage and a checklist of what to fix.

= Email alerts =

* Long lockouts, new administrators, and two-factor turned off for a user.

= Hardening =

* XML-RPC: keep it, remove password methods only, or turn it off.
* Hide usernames from author scans, the REST API users list and the users sitemap.
* Vague login errors that do not tell which part was wrong.
* Limit or turn off application passwords.
* Session length, "Remember me" length and one session per user.
* Hide the WordPress version.

= Multisite =

* Activate per site or network-wide; each site keeps its own settings and log.

= Better Login Security Pro =

An optional add-on, sold separately on [quintaphon.com](https://quintaphon.com/wordpress/better-login-security/#pricing), adds authenticator apps and backup codes, Cloudflare Turnstile and hCaptcha, more login page templates and fonts, country rules, Slack and webhook alerts, active sessions, social login, access links and a multisite network mode. This plugin works fully on its own and contains no code of the add-on.

== Installation ==

1. Upload the `better-login-security` folder to `/wp-content/plugins/`, or install it from **Plugins > Add New**.
2. Activate it.
3. Open **Login Security** in the admin menu. The dashboard checklist shows what to set up first.

Locked out? Add `define( 'QBLS_DISABLE', true );` to `wp-config.php`, sign in, fix the setting, and remove the line again.

== Frequently Asked Questions ==

= I forgot my custom login address. =

Look for the email "New login address" sent to the site admin address. If you can't find it, add `define( 'QBLS_DISABLE', true );` to `wp-config.php`, sign in at wp-login.php, look at **Login Security > Hardening**, and remove the line again.

= I locked myself out. What now? =

Wait for the lockout to end, or sign in from another connection (for example your phone on mobile data) and unlock your address under **Login Security > Lockouts**. If that is not possible, add `define( 'QBLS_DISABLE', true );` to `wp-config.php`. The plugin then does nothing until you remove the line.

= My site is behind Cloudflare. Will everyone share one address? =

Not if **IP Rules > Visitor address** is set correctly. The plugin suggests the right setting, and the dashboard warns you if it looks wrong.

= A user can't reach their email. How do they get in? =

An administrator can turn two-factor off for that user from **Users > Edit user**, and the user turns it on again later.

= Does two-factor work with the REST API and XML-RPC? =

Apps and scripts should use application passwords, which skip two-factor by design. Password sign-in through the REST API and XML-RPC is refused for two-factor users unless you allow it.

= Does the plugin send data to Quintaphon? =

No. See External services below. The only outside service this plugin can use is Google reCAPTCHA, and only when you set it up.

== Screenshots ==

1. Dashboard with chart, two-factor coverage and checklist.
2. Limit failed attempts.
3. Two-factor settings.
4. Login page designer.
5. Activity log.

== External services ==

Better Login Security by Quintaphon connects to the external service below only when you turn it on and set it up yourself; otherwise it contacts no outside service. No data is sent to Quintaphon.

= Google reCAPTCHA =

What it is for: telling people from bots on the sign-in, registration and lost-password forms (CAPTCHA, provider reCAPTCHA v2 or v3).

What is sent and when: only when reCAPTCHA is the chosen provider. The visitor's browser loads `https://www.google.com/recaptcha/api.js` on the protected forms, and Google receives what its script collects. When the form is sent, your server sends the token, your secret key and the visitor's IP address to `https://www.google.com/recaptcha/api/siteverify`.

Google [Terms of Service](https://policies.google.com/terms) and [Privacy Policy](https://policies.google.com/privacy).

No other external requests are made. The admin screens and the Inter font are served from your own site.

== Third-party libraries ==

* **Inter** variable font 4.x (latin, latin-ext), SIL Open Font License 1.1 (assets/fonts/OFL.txt). Used by the admin screens only. Source: https://github.com/rsms/inter

== Developer hooks ==

Actions: `qbls_event` (every logged event, with its data), `qbls_settings_updated`.

Filters: `qbls_modules`, `qbls_has`, `qbls_schema`, `qbls_nav`, `qbls_section_file`, `qbls_log_max_days`.

Constant: `QBLS_DISABLE` (pause the whole plugin).

== Changelog ==

= 1.0.1 =
* Settings screens escape every attribute where it is printed.
* The sign-in after the two-factor step now ends the same way as a normal WordPress sign-in.
* The activity log can be kept for up to 365 days.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.1 =
Keep the activity log for up to a year, plus a small clean-up of the settings screens and the two-factor sign-in.

= 1.0.0 =
First release.
