This commit is contained in:
Javier Casares 2026-06-05 16:30:07 +00:00
commit a115f08319

View file

@ -1,98 +1,132 @@
# Changelog
## [Unreleased]
## [1.0.0] - 2026-06-05
### Fixed
- Enable 2FA checkbox now defaults to email and pre-checks it in the UI on first activation.
- QR code for authenticator apps now displays correctly in the user profile.
- "Send the code again" link is disabled for 60 seconds after delivery with a live countdown.
### Changed
- Recovery codes section redesigned: plain list with code chips, no coloured notification box.
- 2FA login screen links now in a vertical list for better readability.
### Removed
- "Generate new secret" button from the OTP section.
**Compatibility**
* WordPress: 6.4 – 7.1
* PHP: 8.2 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPCompatibility: 8.2–8.5 — 0 issues
* PHPUnit: 9.6.34 — 42 tests, 109 assertions
## [0.3.0] - 2026-06-05
### Added
- Delete-on-uninstall option (disabled by default — all plugin data is preserved on removal).
### Security
- Email verification codes now use `random_int()` (CSPRNG) for cryptographically secure code generation.
- Recovery code preview transient TTL reduced from indefinite to 5 minutes.
### Fixed
- Network admin settings now save correctly via a dedicated handler writing to `wp_sitemeta`.
- Settings option registered with `autoload=false` to avoid loading on every page request.
- `update.json` corrected to reference the 2FA plugin instead of the SMTP plugin.
**Compatibility**
* WordPress: 6.4 – 7.1
* PHP: 8.2 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPCompatibility: 8.2–8.5 — 0 issues
* PHPUnit: 9.6.34 — 42 tests, 109 assertions
## [0.2.0] - 2026-06-05
### Added
- Per-role 2FA method matrix in admin settings: administrators can now choose exactly which verification methods (email, authenticator app, recovery codes) are required for each WordPress role, with select-all row and column controls.
- Authenticator app (TOTP) support: stored secrets, QR code provisioning via `bacon/bacon-qr-code`, manual setup key display, and one-time activation confirmation.
- Recovery codes: 10 single-use 8-digit codes with profile management, one-time display grid, copy-to-clipboard, and mandatory confirmation before activation.
- Email-based verification codes with throttled delivery (60 s resend cooldown) and 10-minute expiry.
- Configurable verification frequency (every login, daily, weekly, or every 28 days) remembered per device fingerprint; administrators can lock the global schedule.
- Dedicated verification stage token (WP nonce) securing the 2FA screen between password validation and code submission.
- Secure method-switch links on the verification screen letting users change between OTP, email, and recovery-code challenges without restarting the login.
- Network-wide multisite support: network administrators can set and lock enforcement settings across all sites (`Network: true` header).
- Uninstall routine removing all plugin options and user meta.
- Admin settings page as a top-level menu with `manage_options` capability guard.
### Changed
- Settings page now uses the per-role method matrix instead of a flat forced-roles list; old `force_roles` + `default_method` data is automatically migrated on first read.
- Profile method checkboxes require explicit confirmation: OTP demands a valid 6-digit code, recovery codes demand entering one of the displayed codes before the method activates.
- Profile screen regenerates the OTP secret when the authenticator method is disabled and provides a "Generate new secret" button.
- Recovery code batch exhaustion now auto-generates a fresh batch and surfaces a confirmation prompt rather than locking the user out.
- Login screen hides the username/password fields, removes the Remember Me checkbox, and focuses the verification code input during the 2FA stage.
- Login form auto-submits once the input reaches the method's expected digit count.
### Fixed
- Hardened authenticator QR generation by catching library errors and guiding administrators to the required dependency.
- Recovery-code preview persists via transient until explicitly acknowledged; fixes cases where codes disappeared before confirmation.
## [0.1.0] - 2024-04-08
### Added
- Initial skeleton for the 2FA (by ROBOTSTXT) plugin.
- Initial documentation files (`readme.txt`, `AGENTS.md`, `changelog.txt`).
- Placeholder classes for login handling, user profile integration, and admin settings.
== Changelog ==
= 1.1.0 =
_Release date: 2026-06-05_
**Added**
* Developer filter/action hooks: `robotstxt_2fa_skip_challenge`, `robotstxt_2fa_verification_success`, `robotstxt_2fa_verification_failed`, `robotstxt_2fa_method_enabled`, `robotstxt_2fa_method_disabled`, `robotstxt_2fa_code_length`, `robotstxt_2fa_code_ttl`, `robotstxt_2fa_resend_interval`, `robotstxt_2fa_email_subject`, `robotstxt_2fa_email_message`, `robotstxt_2fa_before_send_email`.
* `robotstxt_2fa_required_methods_for_user` filter to override per-user method requirements.
* `robotstxt_2fa_profile_wrapper_class` filter for the frontend shortcode container.
* `[robotstxt_2fa_profile]` shortcode — renders the full 2FA settings section on any WordPress page without requiring wp-admin access. Supports `user_id` and `redirect` attributes.
* `top_up_codes_for_user()` method on `Recovery_Codes` — generates only the missing codes to fill the batch back to 10, preserving existing unused codes.
* "Regenerate codes" button on the profile when recovery codes are active, without needing to disable and re-enable the method.
**Compatibility**
* WordPress: 6.4 – 7.1
* PHP: 8.0 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPCompatibility: 8.0–8.5 — 0 issues
* PHPUnit: 9.6.34 — 42 tests, 109 assertions
= 1.0.0 =
_Release date: 2026-06-05_
**Fixed**
* Enable 2FA checkbox now defaults to email and pre-checks it in the UI on first activation.
* QR code for authenticator apps now displays correctly in the user profile.
* "Send the code again" link is disabled for 60 seconds after delivery with a live countdown.
**Changed**
* Recovery codes section redesigned: plain list with code chips, no coloured notification box.
* 2FA login screen links now in a vertical list for better readability.
**Removed**
* "Generate new secret" button from the OTP section.
**Compatibility**
* WordPress: 6.4 – 7.1
* PHP: 8.0 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPCompatibility: 8.0–8.5 — 0 issues
* PHPUnit: 9.6.34 — 42 tests, 109 assertions
= 0.3.0 =
_Release date: 2026-06-05_
**Added**
* Delete-on-uninstall option (disabled by default — all plugin data is preserved on removal).
**Security**
* Email verification codes now use `random_int()` (CSPRNG).
* Recovery code preview transient TTL reduced from indefinite to 5 minutes.
**Fixed**
* Network admin settings now save correctly via a dedicated handler writing to `wp_sitemeta`.
* Settings option registered with `autoload=false`.
* `update.json` corrected to reference the 2FA plugin instead of the SMTP plugin.
**Compatibility**
* WordPress: 6.4 – 7.1
* PHP: 8.0 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPCompatibility: 8.0–8.5 — 0 issues
* PHPUnit: 9.6.34 — 42 tests, 109 assertions
= 0.2.0 =
_Release date: 2026-06-05_
**Added**
* Per-role 2FA method matrix with select-all row/column controls.
* Authenticator app (TOTP) support with QR provisioning and manual setup key.
* Recovery codes: 10 single-use 8-digit codes with confirmation workflow.
* Email-based verification codes with 60-second resend throttle and 10-minute expiry.
* Configurable verification frequency (every login, daily, weekly, monthly) per device.
* Dedicated stage token (WP nonce) securing the 2FA screen.
* Network-wide multisite support.
* Admin settings page with top-level menu.
**Changed**
* Profile method checkboxes require explicit confirmation before activation.
**Fixed**
* QR generation errors caught; recovery-code preview persists until acknowledged.
**Compatibility**
* WordPress: 6.4 – 7.0
* PHP: 8.0 – 8.5
**Tests**
* PHP Coding Standards: PHP_CodeSniffer 3.13.5 / WPCS 3.3.0
* PHPStan: level 9 — 0 errors
* PHPUnit: 9.6.34
= 0.1.0 =
_Release date: 2024-04-08_
**Added**
* Initial plugin skeleton.
* Documentation files.
* Placeholder classes for login handling, profile integration, and admin settings.