No description
  • PHP 99%
  • JavaScript 0.7%
  • CSS 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-04 14:38:18 +00:00
assets v1.0.0 2026-06-05 14:07:16 +00:00
includes v1.6.10 2026-11-04 14:38:18 +00:00
languages v1.6.2 2026-08-17 15:55:46 +00:00
vendor v1.6.10 2026-11-04 14:38:18 +00:00
changelog.txt v1.6.10 2026-11-04 14:38:18 +00:00
LICENSE v0.3.0 2026-06-05 14:06:16 +00:00
readme.txt v1.6.10 2026-11-04 14:38:18 +00:00
robotstxt-2fa.php v1.6.10 2026-11-04 14:38:18 +00:00
uninstall.php v1.6.9 2026-11-04 14:37:18 +00:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=== 2FA (by ROBOTSTXT) ===
Contributors: robotstxt, javiercasares
Tags: security, two-factor authentication, login, otp
Requires at least: 7.0
Tested up to: 7.2
Requires PHP: 8.3
Stable tag: 1.6.10
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Security plugin that adds per-role two-factor authentication to the WordPress login flow.

== Description ==

2FA (by ROBOTSTXT) enforces two-factor authentication on the WordPress login screen. Administrators configure a per-role matrix that specifies exactly which verification methods are required for each role: email codes, authenticator apps (TOTP), or recovery codes.

After the username and password are validated, the login screen redirects to a dedicated verification step. The screen hides the username and password controls, prioritises authenticator apps when enabled, and offers links to switch between methods without restarting the login. Email users can request a fresh code from the same screen.

Users manage their preferences from their profile page. Every method starts unchecked until explicitly confirmed. Activating the authenticator app requires scanning the QR code and entering a valid six-digit code. Recovery codes must be saved and confirmed with one code before activation. Codes are shown in a two-column grid and automatically refresh when the batch is exhausted.

Administrators can remember successful verifications for a configurable duration — per login, daily, weekly, or every 28 days — and lock the schedule so all users follow the global setting. Device and IP fingerprints are stored securely to decide when a fresh challenge is needed.

Multisite is fully supported: network administrators can set and lock enforcement settings across all sites.

== Installation ==

1. Upload the `robotstxt-2fa` directory to `/wp-content/plugins/`.
2. Activate the plugin through the "Plugins" menu in WordPress (or network-activate it for multisite).
3. Open the **2FA** top-level menu in the dashboard and configure which methods are required per role.
4. Users can set up their preferred methods from their profile page.

== Frequently Asked Questions ==

= Is this plugin production ready? =

Yes. Email codes, authenticator apps with on-site QR codes, and recovery codes are all available and tested.

= How do I enable the authenticator QR code? =

Install the optional QR library inside this plugin directory with `composer require bacon/bacon-qr-code:^3.0`. The plugin loads the Composer autoloader automatically when present.

= Can I enforce 2FA for specific roles only? =

Yes. The admin settings page shows a matrix of roles × methods. Check the methods you want to require for each role. Roles with no methods checked leave the choice to the user.

= What happens if a user loses all their verification methods? =

An administrator can edit the user's profile and generate a fresh batch of recovery codes, or disable the role enforcement temporarily while the user regains access.

= Is multisite supported? =

Yes. Activate the plugin at the network level. Network administrators can set and lock enforcement settings; per-site settings are overridden when network settings exist.

== Compatibility ==

* WordPress: 7.0 - 7.2
* PHP: 8.3 - 8.6
* MariaDB: 11.4 or newer

== Changelog ==

= 1.6.10 =

_Release date: 2026-11-03_

**Fixed**

* The 2FA verification stage now stays on the login URL the visitor actually used. When wp-login.php executes through an alias or renamed slug (a `/login` rewrite, a "hidden login" setup that does not filter `site_url`), the post-password redirect previously always targeted the literal `/wp-login.php` — on sites where that URL is blocked or renamed away at server level, users were stranded on a 403/404 page right after a correct password. Logins submitted from custom pages keep landing on the real wp-login.php as before.

= 1.6.9 =

_Release date: 2026-11-03_

**Changed**

* Compatibility floors raised to WordPress 7.0 and PHP 8.3, verified with full-range compatibility scans (WordPress 4.7-7.2, PHP 5.6-8.6). WordPress 7.2 and PHP 8.6 are now tested and documented.
* The admin menu icon is now a brand SVG (shield with keyhole) instead of the Dashicons shield. Rendered through WordPress' native SVG menu-icon support, it stays crisp on high-density screens, works identically on WordPress 7.0/7.1/7.2, and is future-proof against the ongoing move from Dashicons to SVG icons in the WordPress admin.

**Fixed**

* PHP 8.6 deprecation removed: a REST-controller class constant named `namespace` (case-insensitive) triggered a deprecation notice on PHP 8.6 and would become a fatal error on PHP 9.

**Compatibility**

* WordPress: 7.0 - 7.2
* PHP: 8.3 - 8.6

**Tests**

* PHP Coding Standards: PHP_CodeSniffer 3.13.6 / WPCS 3.4.1 — 0 errors
* PHPStan: level max (10), no baseline — 0 errors
* PHPCompatibility: 8.3-8.6 — 0 issues
* PHPUnit: 9.6.38 — 110 tests, 220 assertions

= 1.6.8 =

_Release date: 2026-09-21_

**Added**

* Administrator visibility when email delivery fails: failed verification-code deliveries record a marker and administrators see a persistent, self-clearing notice ("2FA: email delivery is failing…") in wp-admin and the network admin, since forced-email users cannot sign in while delivery is broken.

**Fixed**

* "We could not determine which account you are trying to access" during verification: the pending-stage token was stored in a transient, which external object caches (Redis/Memcached) can evict at any time, killing live verification sessions. Tokens now live in a persistent option map and the error message asks the user to sign in again.

= Previous versions =

For the full changelog see the [changelog](https://www.robotstxt.software/plugins/robotstxt-2fa/) page.

== Compliance ==

This plugin adheres to the following security measures and review protocols for each version:

* [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
* [WordPress Plugin Security](https://developer.wordpress.org/plugins/wordpress-org/plugin-security/)
* [WordPress APIs Security](https://developer.wordpress.org/apis/security/)
* [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)
* [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/)