From 3e4433cd130a61b29a238bf26a863207d74fd5bf Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Mon, 17 Aug 2026 15:55:46 +0000 Subject: [PATCH] v1.6.2 --- changelog.txt | 26 + includes/admin/class-manager-notice.php | 184 +++ includes/admin/class-settings-page.php | 2 + includes/class-plugin.php | 10 + languages/robotstxt-2fa.pot | 1468 +++++++++++++++++++++++ readme.txt | 40 +- robotstxt-2fa.php | 12 +- robotstxt-updater.php | 384 ------ update.json | 8 +- vendor/composer/autoload_real.php | 2 - vendor/composer/platform_check.php | 25 - 11 files changed, 1720 insertions(+), 441 deletions(-) create mode 100644 includes/admin/class-manager-notice.php create mode 100644 languages/robotstxt-2fa.pot delete mode 100644 robotstxt-updater.php delete mode 100644 vendor/composer/platform_check.php diff --git a/changelog.txt b/changelog.txt index 9552271..5ba5490 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,31 @@ == Changelog == += 1.6.2 = + +_Release date: 2026-08-17_ + +**Added** + +* Recommendation notice for the Manager (by ROBOTSTXT) plugin: when it is not installed and active, a dismissible notice appears on the Plugins screen and a permanent notice is shown on the plugin settings page, since updates are delivered through the Manager plugin. + +**Changed** + +* Updates are now handled by the Manager (by ROBOTSTXT) plugin. The bundled self-updater (robotstxt-updater.php and update.json) has been removed. +* Plugin and update URLs moved to robotstxt.software. +* Minimum WordPress version lowered from 6.4 to 5.6 after a full compatibility review (the code only requires WordPress 5.3+ functions, and WordPress 5.6 is the first release that runs on the required PHP 8.0). + +**Compatibility** + +* WordPress: 5.6 – 7.1 +* PHP: 8.0 – 8.5 + +**Tests** + +* PHP Coding Standards: PHP_CodeSniffer 3.13.6 / WPCS 3.4.1 — 0 errors +* PHPStan: level 9 — 0 errors +* PHPCompatibility: 8.0–8.5 — 0 issues +* PHPUnit: 9.6.36 — 59 tests, 148 assertions + = 1.6.1 = _Release date: 2026-08-14_ diff --git a/includes/admin/class-manager-notice.php b/includes/admin/class-manager-notice.php new file mode 100644 index 0000000..567a166 --- /dev/null +++ b/includes/admin/class-manager-notice.php @@ -0,0 +1,184 @@ +id, array( 'plugins', 'plugins-network' ), true ) ) { + return; + } + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + if ( self::is_manager_active() ) { + return; + } + + if ( get_user_meta( get_current_user_id(), self::DISMISSED_META_KEY, true ) ) { + return; + } + + $dismiss_url = wp_nonce_url( + add_query_arg( 'action', self::DISMISS_ACTION, self_admin_url( 'admin.php' ) ), + self::DISMISS_ACTION + ); + ?> +
+

+ + Manager (by ROBOTSTXT) to be installed and active to receive updates.', 'robotstxt-2fa' ), + esc_url( self::MANAGER_URL ) + ) + ); + ?> +

+

+ +

+
+ +
+

+ + Manager (by ROBOTSTXT) to be installed and active to receive updates.', 'robotstxt-2fa' ), + esc_url( self::MANAGER_URL ) + ) + ); + ?> +

+
+ is_network_context() ? network_admin_url( 'edit.php?action=robotstxt_2fa_network_save' ) : 'options.php'; diff --git a/includes/class-plugin.php b/includes/class-plugin.php index da0c9e2..269bd33 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -8,6 +8,7 @@ namespace Robotstxt\TwoFA; use Robotstxt\TwoFA\Admin\Dashboard_Page; +use Robotstxt\TwoFA\Admin\Manager_Notice; use Robotstxt\TwoFA\Admin\Migration_Page; use Robotstxt\TwoFA\Admin\Settings_Page; use Robotstxt\TwoFA\Cli\Cli_Command; @@ -134,6 +135,13 @@ class Plugin { */ private Migration_Page $migration_page; + /** + * Manager plugin dependency notice. + * + * @var Manager_Notice + */ + private Manager_Notice $manager_notice; + /** * REST API controller. * @@ -174,6 +182,7 @@ class Plugin { $this->geoip_updater = new GeoIP_Updater( $config ); $this->dashboard_page = new Dashboard_Page( $this->attempts_log, $config, $repository ); $this->migration_page = new Migration_Page(); + $this->manager_notice = new Manager_Notice(); $this->rest_controller = new Rest_Controller(); } @@ -191,6 +200,7 @@ class Plugin { $this->geoip_updater->register_hooks(); $this->dashboard_page->register_hooks(); $this->migration_page->register_hooks(); + $this->manager_notice->register_hooks(); $this->rest_controller->register_hooks(); $this->login_manager->register_hooks(); $this->profile_settings->register_hooks(); diff --git a/languages/robotstxt-2fa.pot b/languages/robotstxt-2fa.pot new file mode 100644 index 0000000..d878a91 --- /dev/null +++ b/languages/robotstxt-2fa.pot @@ -0,0 +1,1468 @@ +# Copyright (C) 2026 ROBOTSTXT +# This file is distributed under the GPLv3 or later. +msgid "" +msgstr "" +"Project-Id-Version: 2FA (by ROBOTSTXT) 1.6.2\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-2fa\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2026-08-17T15:23:09+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.12.0\n" +"X-Domain: robotstxt-2fa\n" + +#. Plugin Name of the plugin +#: robotstxt-2fa.php +#: includes/admin/class-dashboard-page.php:106 +#: includes/admin/class-settings-page.php:1143 +msgid "2FA (by ROBOTSTXT)" +msgstr "" + +#. Plugin URI of the plugin +#: robotstxt-2fa.php +msgid "https://www.robotstxt.software/plugins/robotstxt-2fa/" +msgstr "" + +#. Description of the plugin +#: robotstxt-2fa.php +msgid "Adds two-factor authentication to the WordPress login flow." +msgstr "" + +#. Author of the plugin +#: robotstxt-2fa.php +msgid "ROBOTSTXT" +msgstr "" + +#. Author URI of the plugin +#: robotstxt-2fa.php +msgid "https://www.robotstxt.software/" +msgstr "" + +#: includes/admin/class-dashboard-page.php:107 +#: includes/admin/class-dashboard-page.php:361 +#: includes/admin/class-settings-page.php:1144 +msgid "2FA" +msgstr "" + +#: includes/admin/class-dashboard-page.php:116 +msgid "Dashboard — 2FA" +msgstr "" + +#: includes/admin/class-dashboard-page.php:117 +msgid "Dashboard" +msgstr "" + +#: includes/admin/class-dashboard-page.php:133 +#: includes/admin/class-dashboard-page.php:248 +#: includes/admin/class-migration-page.php:236 +#: includes/admin/class-settings-page.php:99 +#: includes/admin/class-settings-page.php:1073 +#: includes/admin/class-settings-page.php:1532 +msgid "Sorry, you are not allowed to access this page." +msgstr "" + +#: includes/admin/class-dashboard-page.php:165 +msgid "Two-Factor Authentication Dashboard" +msgstr "" + +#: includes/admin/class-dashboard-page.php:170 +msgid "Total users" +msgstr "" + +#: includes/admin/class-dashboard-page.php:174 +msgid "2FA enabled" +msgstr "" + +#: includes/admin/class-dashboard-page.php:178 +msgid "Failed attempts (7 days)" +msgstr "" + +#: includes/admin/class-dashboard-page.php:182 +msgid "Users" +msgstr "" + +#: includes/admin/class-dashboard-page.php:199 +#: includes/admin/class-users-list-table.php:180 +msgid "Export CSV" +msgstr "" + +#: includes/admin/class-dashboard-page.php:203 +msgid "Recent failed attempts" +msgstr "" + +#: includes/admin/class-dashboard-page.php:206 +msgid "No failed attempts recorded." +msgstr "" + +#: includes/admin/class-dashboard-page.php:211 +msgid "Date/Time" +msgstr "" + +#: includes/admin/class-dashboard-page.php:212 +#: includes/admin/class-migration-page.php:282 +#: includes/admin/class-users-list-table.php:70 +msgid "User" +msgstr "" + +#: includes/admin/class-dashboard-page.php:213 +msgid "Method" +msgstr "" + +#: includes/admin/class-dashboard-page.php:214 +msgid "IP" +msgstr "" + +#: includes/admin/class-dashboard-page.php:231 +msgid "View all users →" +msgstr "" + +#: includes/admin/class-dashboard-page.php:386 +#: includes/admin/class-users-list-table.php:349 +msgid "Active" +msgstr "" + +#: includes/admin/class-dashboard-page.php:389 +msgid "Off" +msgstr "" + +#: includes/admin/class-manager-notice.php:108 +#: includes/admin/class-migration-page.php:173 +msgid "2FA (by ROBOTSTXT):" +msgstr "" + +#. translators: %s: URL of the Manager (by ROBOTSTXT) plugin page. +#: includes/admin/class-manager-notice.php:113 +#: includes/admin/class-manager-notice.php:145 +#, php-format +msgid "This plugin needs Manager (by ROBOTSTXT) to be installed and active to receive updates." +msgstr "" + +#: includes/admin/class-manager-notice.php:120 +msgid "Dismiss this notice" +msgstr "" + +#: includes/admin/class-manager-notice.php:140 +msgid "Manager (by ROBOTSTXT) is not active." +msgstr "" + +#: includes/admin/class-migration-page.php:125 +msgid "Import / Migration — 2FA" +msgstr "" + +#: includes/admin/class-migration-page.php:126 +msgid "Import" +msgstr "" + +#. translators: %d: number of users +#: includes/admin/class-migration-page.php:177 +#, php-format +msgid "%d user has an authenticator app secret from another 2FA plugin. Import it so they keep using the same app without reconfiguring." +msgid_plural "%d users have authenticator app secrets from another 2FA plugin. Import them so they keep using the same app without reconfiguring." +msgstr[0] "" +msgstr[1] "" + +#: includes/admin/class-migration-page.php:187 +msgid "Go to import tool →" +msgstr "" + +#: includes/admin/class-migration-page.php:190 +msgid "Dismiss for 7 days" +msgstr "" + +#: includes/admin/class-migration-page.php:244 +msgid "Import — Two-Factor Authentication" +msgstr "" + +#: includes/admin/class-migration-page.php:250 +msgid "Importable users" +msgstr "" + +#: includes/admin/class-migration-page.php:253 +msgid "No importable secrets found. Either no supported plugin is installed, no users have a configured authenticator app, or all secrets have already been imported." +msgstr "" + +#. translators: %d: number of users +#: includes/admin/class-migration-page.php:259 +#, php-format +msgid "Found %d user with an authenticator app secret that has not yet been imported." +msgid_plural "Found %d users with authenticator app secrets that have not yet been imported." +msgstr[0] "" +msgstr[1] "" + +#: includes/admin/class-migration-page.php:270 +msgid "The secret key is transferred directly — users will not need to reconfigure their authenticator app." +msgstr "" + +#: includes/admin/class-migration-page.php:283 +msgid "Email" +msgstr "" + +#: includes/admin/class-migration-page.php:284 +#: includes/admin/class-settings-page.php:407 +#: includes/admin/class-users-list-table.php:71 +msgid "Role" +msgstr "" + +#: includes/admin/class-migration-page.php:285 +msgid "Source plugin" +msgstr "" + +#. translators: %d: number of users +#: includes/admin/class-migration-page.php:319 +#, php-format +msgid "Import selected (%d)" +msgstr "" + +#: includes/admin/class-migration-page.php:364 +#: includes/admin/class-migration-page.php:432 +msgid "Sorry, you are not allowed to perform this action." +msgstr "" + +#: includes/admin/class-migration-page.php:801 +msgid "Two Factor (community)" +msgstr "" + +#: includes/admin/class-migration-page.php:802 +msgid "WP 2FA (Melapress)" +msgstr "" + +#: includes/admin/class-migration-page.php:803 +msgid "Wordfence Login Security" +msgstr "" + +#: includes/admin/class-migration-page.php:860 +msgid "Notice preferences" +msgstr "" + +#: includes/admin/class-migration-page.php:861 +msgid "Control how the migration banner behaves in the admin area." +msgstr "" + +#: includes/admin/class-migration-page.php:869 +msgid "Admin notice" +msgstr "" + +#: includes/admin/class-migration-page.php:879 +msgid "Permanently hide the migration notice in the admin area." +msgstr "" + +#: includes/admin/class-migration-page.php:881 +msgid "When unchecked, the notice appears until all importable secrets have been processed. Use the \"Dismiss for 7 days\" link in the notice for a temporary hide." +msgstr "" + +#: includes/admin/class-migration-page.php:886 +msgid "Save preferences" +msgstr "" + +#. translators: %d: number of secrets imported +#: includes/admin/class-migration-page.php:916 +#, php-format +msgid "✓ %d secret imported and OTP method activated." +msgid_plural "✓ %d secrets imported and OTP method activated." +msgstr[0] "" +msgstr[1] "" + +#. translators: %d: number of users skipped +#: includes/admin/class-migration-page.php:934 +#, php-format +msgid "%d user skipped (secret already present)." +msgid_plural "%d users skipped (secret already present)." +msgstr[0] "" +msgstr[1] "" + +#. translators: %d: number of users that could not be imported +#: includes/admin/class-migration-page.php:952 +#, php-format +msgid "✗ %d user could not be imported (invalid, encrypted, or missing secret)." +msgid_plural "✗ %d users could not be imported (invalid, encrypted, or missing secret)." +msgstr[0] "" +msgstr[1] "" + +#: includes/admin/class-migration-page.php:964 +msgid "No users were selected for import." +msgstr "" + +#: includes/admin/class-settings-page.php:111 +msgid "Two-Factor Authentication settings" +msgstr "" + +#: includes/admin/class-settings-page.php:146 +msgid "General options" +msgstr "" + +#: includes/admin/class-settings-page.php:153 +msgid "Required methods per role" +msgstr "" + +#: includes/admin/class-settings-page.php:161 +#: includes/user/class-profile-settings.php:539 +msgid "Verification frequency" +msgstr "" + +#: includes/admin/class-settings-page.php:169 +msgid "Enforce frequency" +msgstr "" + +#: includes/admin/class-settings-page.php:177 +msgid "Security" +msgstr "" + +#: includes/admin/class-settings-page.php:184 +msgid "Max failed attempts" +msgstr "" + +#: includes/admin/class-settings-page.php:192 +msgid "Lockout duration" +msgstr "" + +#: includes/admin/class-settings-page.php:200 +msgid "Trust browser for" +msgstr "" + +#: includes/admin/class-settings-page.php:208 +msgid "Grace period" +msgstr "" + +#: includes/admin/class-settings-page.php:216 +msgid "After grace period" +msgstr "" + +#: includes/admin/class-settings-page.php:224 +msgid "Data management" +msgstr "" + +#: includes/admin/class-settings-page.php:231 +msgid "Delete data on uninstall" +msgstr "" + +#: includes/admin/class-settings-page.php:239 +msgid "Access control" +msgstr "" + +#: includes/admin/class-settings-page.php:246 +msgid "Application Passwords" +msgstr "" + +#: includes/admin/class-settings-page.php:254 +msgid "Require 2FA to create Application Passwords" +msgstr "" + +#: includes/admin/class-settings-page.php:262 +msgid "IP allow list" +msgstr "" + +#: includes/admin/class-settings-page.php:270 +msgid "IP deny list" +msgstr "" + +#: includes/admin/class-settings-page.php:278 +msgid "Email notifications" +msgstr "" + +#: includes/admin/class-settings-page.php:285 +msgid "On method activation" +msgstr "" + +#: includes/admin/class-settings-page.php:293 +msgid "New location" +msgstr "" + +#: includes/admin/class-settings-page.php:301 +msgid "Recovery code used" +msgstr "" + +#: includes/admin/class-settings-page.php:309 +msgid "Activity digest" +msgstr "" + +#: includes/admin/class-settings-page.php:317 +msgid "GeoIP / Country restrictions" +msgstr "" + +#: includes/admin/class-settings-page.php:324 +msgid "Database path" +msgstr "" + +#: includes/admin/class-settings-page.php:332 +msgid "Auto database" +msgstr "" + +#: includes/admin/class-settings-page.php:340 +msgid "Country allow list (bypass 2FA)" +msgstr "" + +#: includes/admin/class-settings-page.php:348 +msgid "Country deny list (block login)" +msgstr "" + +#: includes/admin/class-settings-page.php:356 +msgid "Always challenge countries" +msgstr "" + +#: includes/admin/class-settings-page.php:369 +msgid "Control how two-factor authentication is enforced for user roles." +msgstr "" + +#: includes/admin/class-settings-page.php:372 +msgid "These settings are locked by a network administrator. Any changes made here will be ignored." +msgstr "" + +#: includes/admin/class-settings-page.php:394 +msgid "No editable roles were found." +msgstr "" + +#: includes/admin/class-settings-page.php:399 +#: includes/user/class-profile-settings.php:279 +#: includes/user/class-profile-settings.php:1346 +msgid "Email code" +msgstr "" + +#: includes/admin/class-settings-page.php:400 +msgid "Authenticator app" +msgstr "" + +#: includes/admin/class-settings-page.php:401 +#: includes/user/class-profile-settings.php:1354 +msgid "Recovery codes" +msgstr "" + +#: includes/admin/class-settings-page.php:420 +#: includes/admin/class-settings-page.php:470 +msgid "All" +msgstr "" + +#: includes/admin/class-settings-page.php:427 +msgid "All methods" +msgstr "" + +#. translators: 1: role name, 2: method name. +#: includes/admin/class-settings-page.php:443 +#, php-format +msgid "%1$s: require %2$s" +msgstr "" + +#: includes/admin/class-settings-page.php:479 +msgid "Check which verification methods are required for each role. Users assigned to a role with at least one checked method must complete two-factor authentication using one of those methods. Roles with no methods checked leave the choice to the user." +msgstr "" + +#: includes/admin/class-settings-page.php:573 +msgid "You are not allowed to update these settings." +msgstr "" + +#: includes/admin/class-settings-page.php:924 +msgid "Prevent users from overriding the global verification frequency." +msgstr "" + +#: includes/admin/class-settings-page.php:927 +msgid "When enabled, users will see the profile frequency control disabled and must follow the global schedule." +msgstr "" + +#: includes/admin/class-settings-page.php:936 +msgid "Brute-force protection, trusted device cookies, and grace period for new enrollments." +msgstr "" + +#: includes/admin/class-settings-page.php:950 +msgid "(0 = unlimited)" +msgstr "" + +#: includes/admin/class-settings-page.php:952 +msgid "Number of consecutive failed 2FA attempts before the user is temporarily locked out. The lock is cleared after the lockout duration expires." +msgstr "" + +#: includes/admin/class-settings-page.php:966 +msgid "minutes" +msgstr "" + +#: includes/admin/class-settings-page.php:968 +msgid "How long the account is locked after too many failed attempts. Applies only when Max failed attempts is greater than 0." +msgstr "" + +#: includes/admin/class-settings-page.php:982 +msgid "days (0 = disable trusted devices)" +msgstr "" + +#: includes/admin/class-settings-page.php:984 +msgid "When greater than 0, the \"Remember this browser\" checkbox is available after a successful 2FA verification. The trust duration is taken from each user's verification frequency (daily, weekly, or monthly), so the checkbox always complies with their profile setting. Set to 0 to disable the feature." +msgstr "" + +#: includes/admin/class-settings-page.php:998 +msgid "days (0 = no grace period)" +msgstr "" + +#: includes/admin/class-settings-page.php:1000 +msgid "Users whose role requires 2FA but who have not yet configured any method are allowed to log in for this many days before enforcement begins. The timer starts on their first login after the role requirement is applied." +msgstr "" + +#: includes/admin/class-settings-page.php:1017 +msgid "Block login — the user cannot access the dashboard until an administrator enables a method for them." +msgstr "" + +#: includes/admin/class-settings-page.php:1023 +msgid "Forced setup — the user can log in but is redirected to the 2FA profile section on every page until at least one method is confirmed." +msgstr "" + +#: includes/admin/class-settings-page.php:1034 +msgid "Control what happens to plugin data when the plugin is deleted." +msgstr "" + +#: includes/admin/class-settings-page.php:1055 +msgid "Remove all plugin data when the plugin is deleted." +msgstr "" + +#: includes/admin/class-settings-page.php:1058 +msgid "When checked, deleting this plugin will permanently remove all settings, per-user 2FA preferences, stored secrets, recovery codes, and verification history. This action cannot be undone. Leave unchecked (default) to preserve all data if you reinstall later." +msgstr "" + +#: includes/admin/class-settings-page.php:1154 +#: includes/admin/class-settings-page.php:1173 +msgid "Settings — 2FA" +msgstr "" + +#: includes/admin/class-settings-page.php:1155 +#: includes/admin/class-settings-page.php:1174 +msgid "Settings" +msgstr "" + +#: includes/admin/class-settings-page.php:1163 +#: includes/admin/class-settings-page.php:1182 +msgid "Documentation — 2FA" +msgstr "" + +#: includes/admin/class-settings-page.php:1164 +#: includes/admin/class-settings-page.php:1183 +msgid "Documentation" +msgstr "" + +#: includes/admin/class-settings-page.php:1197 +msgid "Application Passwords, IP allow lists and deny lists." +msgstr "" + +#: includes/admin/class-settings-page.php:1218 +msgid "Exempt Application Password requests from the 2FA challenge" +msgstr "" + +#: includes/admin/class-settings-page.php:1221 +msgid "Application Password requests cannot complete browser-based 2FA challenges. Enable to let REST API and WP-CLI clients using Application Passwords skip the verification step." +msgstr "" + +#: includes/admin/class-settings-page.php:1238 +msgid "One IP address or CIDR range per line (e.g. 192.168.1.0/24). Requests from these IPs skip the 2FA challenge." +msgstr "" + +#: includes/admin/class-settings-page.php:1255 +msgid "One IP address or CIDR range per line. Login is blocked outright for these IPs." +msgstr "" + +#: includes/admin/class-settings-page.php:1264 +msgid "Automatic email alerts for security-relevant events." +msgstr "" + +#: includes/admin/class-settings-page.php:1279 +msgid "Notify the user when an administrator enables 2FA for their account." +msgstr "" + +#: includes/admin/class-settings-page.php:1295 +msgid "Notify the user on login from an unrecognised browser or IP." +msgstr "" + +#: includes/admin/class-settings-page.php:1311 +msgid "Notify user when a recovery code is used." +msgstr "" + +#: includes/admin/class-settings-page.php:1320 +msgid "Also notify site administrator." +msgstr "" + +#: includes/admin/class-settings-page.php:1337 +msgid "Send a periodic activity digest to site administrators." +msgstr "" + +#: includes/admin/class-settings-page.php:1346 +#: includes/class-frequency-options.php:54 +msgid "Weekly" +msgstr "" + +#: includes/admin/class-settings-page.php:1353 +msgid "Monthly (every 30 days)" +msgstr "" + +#: includes/admin/class-settings-page.php:1377 +msgid "Require a recent 2FA verification before creating a new Application Password." +msgstr "" + +#: includes/admin/class-settings-page.php:1380 +msgid "When enabled, users must have completed a 2FA challenge within the last 15 minutes before they can generate a new Application Password via the REST API." +msgstr "" + +#: includes/admin/class-settings-page.php:1389 +msgid "Requires a MaxMind GeoLite2 Country database file (.mmdb). Leave empty to disable country-based rules. Download the free GeoLite2 Country database from maxmind.com." +msgstr "" + +#: includes/admin/class-settings-page.php:1406 +msgid "Absolute path to the GeoLite2-Country.mmdb file. Leave empty to disable GeoIP features." +msgstr "" + +#: includes/admin/class-settings-page.php:1425 +msgid "Use the free ROBOTSTXT GeoIP database (auto-updated daily)" +msgstr "" + +#: includes/admin/class-settings-page.php:1428 +msgid "When enabled, the country database is downloaded from ip.robotstxt.es into your uploads directory and refreshed every day by the WordPress cron. This overrides the manual database path above." +msgstr "" + +#: includes/admin/class-settings-page.php:1436 +msgid "Update now" +msgstr "" + +#. translators: %s: formatted date/time of last update. +#: includes/admin/class-settings-page.php:1448 +#, php-format +msgid "Last update: %s." +msgstr "" + +#. translators: %s: formatted date/time of last attempt. +#: includes/admin/class-settings-page.php:1454 +#, php-format +msgid "Last attempt failed on %s." +msgstr "" + +#: includes/admin/class-settings-page.php:1461 +msgid "No download has run yet. Click \"Update now\" or wait for the next cron run." +msgstr "" + +#: includes/admin/class-settings-page.php:1465 +msgid "The database has not been downloaded yet." +msgstr "" + +#: includes/admin/class-settings-page.php:1486 +msgid "ISO country codes (one per line, e.g. ES, US) whose logins bypass the 2FA challenge." +msgstr "" + +#: includes/admin/class-settings-page.php:1503 +msgid "ISO country codes blocked from logging in altogether." +msgstr "" + +#: includes/admin/class-settings-page.php:1520 +msgid "ISO country codes that always trigger a 2FA challenge, regardless of the verification frequency setting." +msgstr "" + +#: includes/admin/class-settings-page.php:1536 +msgid "Documentation — 2FA (by ROBOTSTXT)" +msgstr "" + +#: includes/admin/class-settings-page.php:1537 +msgid "Reference for developers: all actions, filters, and shortcodes exposed by the plugin." +msgstr "" + +#: includes/admin/class-settings-page.php:1539 +msgid "Shortcode" +msgstr "" + +#: includes/admin/class-settings-page.php:1540 +msgid "Renders the full 2FA settings section on any page or post without requiring wp-admin access. Useful for membership sites with a frontend dashboard." +msgstr "" + +#: includes/admin/class-settings-page.php:1544 +msgid "Attribute" +msgstr "" + +#: includes/admin/class-settings-page.php:1544 +#: includes/admin/class-settings-page.php:1587 +msgid "Default" +msgstr "" + +#: includes/admin/class-settings-page.php:1544 +#: includes/admin/class-settings-page.php:1557 +#: includes/admin/class-settings-page.php:1588 +msgid "Description" +msgstr "" + +#: includes/admin/class-settings-page.php:1546 +msgid "Current user" +msgstr "" + +#: includes/admin/class-settings-page.php:1546 +msgid "ID of the user to edit. Admins can specify another user." +msgstr "" + +#: includes/admin/class-settings-page.php:1547 +msgid "Current page" +msgstr "" + +#: includes/admin/class-settings-page.php:1547 +msgid "URL to redirect to after a successful save." +msgstr "" + +#: includes/admin/class-settings-page.php:1551 +msgid "Action hooks" +msgstr "" + +#: includes/admin/class-settings-page.php:1554 +msgid "Hook" +msgstr "" + +#: includes/admin/class-settings-page.php:1555 +#: includes/admin/class-settings-page.php:1586 +msgid "Since" +msgstr "" + +#: includes/admin/class-settings-page.php:1556 +msgid "Arguments" +msgstr "" + +#: includes/admin/class-settings-page.php:1562 +msgid "Fires just before the email verification code is delivered." +msgstr "" + +#: includes/admin/class-settings-page.php:1563 +msgid "Fires after a successful 2FA challenge. Use for audit logs or trusted-device recording." +msgstr "" + +#: includes/admin/class-settings-page.php:1564 +msgid "Fires on each failed 2FA attempt. Use for rate-limiting or alerting." +msgstr "" + +#: includes/admin/class-settings-page.php:1565 +msgid "Fires when a user activates a method from their profile." +msgstr "" + +#: includes/admin/class-settings-page.php:1566 +msgid "Fires when a user deactivates a method from their profile." +msgstr "" + +#: includes/admin/class-settings-page.php:1567 +msgid "Fires when QR code SVG rendering throws an exception." +msgstr "" + +#: includes/admin/class-settings-page.php:1568 +msgid "Fires when recovery code generation throws an exception." +msgstr "" + +#: includes/admin/class-settings-page.php:1582 +msgid "Filter hooks" +msgstr "" + +#: includes/admin/class-settings-page.php:1585 +#: includes/admin/class-users-list-table.php:353 +msgid "Filter" +msgstr "" + +#: includes/admin/class-settings-page.php:1593 +msgid "Return true to bypass the 2FA challenge entirely (REST API, WP-CLI, trusted IP…)." +msgstr "" + +#: includes/admin/class-settings-page.php:1594 +msgid "Override the required methods for a specific user; receives current role-based array and WP_User." +msgstr "" + +#: includes/admin/class-settings-page.php:1595 +msgid "Number of digits in the email verification code." +msgstr "" + +#: includes/admin/class-settings-page.php:1596 +msgid "Seconds before an email verification code expires." +msgstr "" + +#: includes/admin/class-settings-page.php:1597 +msgid "Minimum seconds between email resend requests." +msgstr "" + +#: includes/admin/class-settings-page.php:1598 +msgid "Subject line of the verification code email. Receives subject and WP_User." +msgstr "" + +#: includes/admin/class-settings-page.php:1599 +msgid "Body of the verification code email. Receives message, WP_User, and plain-text code." +msgstr "" + +#: includes/admin/class-settings-page.php:1600 +msgid "CSS class on the [robotstxt_2fa_profile] shortcode container." +msgstr "" + +#. translators: %s: link to hooks.md file. +#: includes/admin/class-settings-page.php:1618 +#, php-format +msgid "Full documentation with code examples: %s" +msgstr "" + +#: includes/admin/class-users-list-table.php:72 +msgid "2FA Status" +msgstr "" + +#: includes/admin/class-users-list-table.php:73 +msgid "Methods" +msgstr "" + +#: includes/admin/class-users-list-table.php:74 +msgid "Last verified" +msgstr "" + +#: includes/admin/class-users-list-table.php:75 +msgid "Unused codes" +msgstr "" + +#: includes/admin/class-users-list-table.php:340 +msgid "— All roles —" +msgstr "" + +#: includes/admin/class-users-list-table.php:348 +msgid "— All statuses —" +msgstr "" + +#: includes/admin/class-users-list-table.php:350 +msgid "Required (not set up)" +msgstr "" + +#: includes/admin/class-users-list-table.php:351 +msgid "Optional (disabled)" +msgstr "" + +#: includes/class-email-notifications.php:78 +msgid "Every 30 days" +msgstr "" + +#. translators: %s: site name. +#: includes/class-email-notifications.php:141 +#, php-format +msgid "[%s] Two-factor authentication has been activated on your account" +msgstr "" + +#. translators: 1: display name, 2: site name, 3: login URL. +#: includes/class-email-notifications.php:147 +#, php-format +msgid "" +"Hi %1$s,\n" +"\n" +"An administrator has enabled two-factor authentication on your account at %2$s.\n" +"\n" +"You can review and configure your two-factor preferences from your profile page:\n" +"%3$s\n" +"\n" +"If you did not expect this change, please contact the site administrator.\n" +"\n" +"-- %2$s" +msgstr "" + +#. translators: %s: site name. +#: includes/class-email-notifications.php:201 +#, php-format +msgid "[%s] New login to your account" +msgstr "" + +#. translators: 1: display name, 2: site name, 3: date/time, 4: anonymized IP. +#: includes/class-email-notifications.php:207 +#, php-format +msgid "" +"Hi %1$s,\n" +"\n" +"A new login to your account at %2$s was detected from an unrecognised browser or location.\n" +"\n" +"Date/time: %3$s\n" +"IP address: %4$s\n" +"\n" +"If this was you, no action is needed.\n" +"If you do not recognise this login, please change your password and contact the site administrator immediately.\n" +"\n" +"-- %2$s" +msgstr "" + +#. translators: %s: site name. +#: includes/class-email-notifications.php:247 +#, php-format +msgid "[%s] A recovery code was used to access your account" +msgstr "" + +#. translators: 1: display name, 2: site name, 3: date/time. +#: includes/class-email-notifications.php:253 +#, php-format +msgid "" +"Hi %1$s,\n" +"\n" +"One of your two-factor recovery codes was used to log in to %2$s.\n" +"\n" +"Date/time: %3$s\n" +"\n" +"If this was you, no action is needed. Recovery codes are single-use; the code has now been consumed.\n" +"If you do not recognise this activity, please contact your site administrator immediately.\n" +"\n" +"-- %2$s" +msgstr "" + +#. translators: %s: site name. +#: includes/class-email-notifications.php:280 +#, php-format +msgid "[%s] A recovery code was used — administrator notice" +msgstr "" + +#. translators: 1: user display name, 2: user login, 3: site name, 4: date/time. +#: includes/class-email-notifications.php:286 +#, php-format +msgid "" +"Administrator notice from %3$s:\n" +"\n" +"User \"%1$s\" (%2$s) used a recovery code to log in.\n" +"\n" +"Date/time: %4$s\n" +"\n" +"Please verify this was an expected action.\n" +"\n" +"-- %3$s" +msgstr "" + +#. translators: %s: site name. +#: includes/class-email-notifications.php:346 +#, php-format +msgid "2FA activity digest — %s" +msgstr "" + +#. translators: 1: site name, 2: total users, 3: users with 2FA, 4: failed attempts last 7 days. +#: includes/class-email-notifications.php:352 +#, php-format +msgid "" +"Two-factor authentication activity digest for %1$s\n" +"\n" +"Total registered users: %2$d\n" +"Users with 2FA configured: %3$d\n" +"Failed 2FA attempts (last 7 days): %4$d\n" +"\n" +"-- %1$s" +msgstr "" + +#: includes/class-frequency-options.php:46 +msgid "Every login" +msgstr "" + +#: includes/class-frequency-options.php:47 +msgid "Always require a new verification code after the password step." +msgstr "" + +#: includes/class-frequency-options.php:50 +msgid "Daily" +msgstr "" + +#: includes/class-frequency-options.php:51 +msgid "Remember successful verifications for 24 hours per device." +msgstr "" + +#: includes/class-frequency-options.php:55 +msgid "Remember successful verifications for 7 days per device." +msgstr "" + +#: includes/class-frequency-options.php:58 +msgid "Monthly" +msgstr "" + +#: includes/class-frequency-options.php:59 +msgid "Remember successful verifications for 28 days per device." +msgstr "" + +#: includes/class-geo-restrictions.php:112 +msgid "Login is not allowed from your country." +msgstr "" + +#: includes/class-geoip-updater.php:129 +msgid "The uploads directory is not writable." +msgstr "" + +#: includes/class-geoip-updater.php:136 +msgid "Could not create the storage directory for the GeoIP database." +msgstr "" + +#. translators: %d: HTTP response code. +#: includes/class-geoip-updater.php:158 +#, php-format +msgid "Download failed (HTTP %d)." +msgstr "" + +#: includes/class-geoip-updater.php:163 +msgid "The downloaded file is not a valid MaxMind database." +msgstr "" + +#: includes/class-geoip-updater.php:171 +msgid "Could not write the GeoIP database file." +msgstr "" + +#: includes/class-geoip-updater.php:177 +msgid "Could not finalize the GeoIP database file." +msgstr "" + +#: includes/class-geoip-updater.php:248 +msgid "Sorry, you are not allowed to do this." +msgstr "" + +#: includes/class-ip-restrictions.php:109 +msgid "Access denied. Your IP address is not allowed to log in." +msgstr "" + +#: includes/class-plugin.php:291 +msgid "A recent two-factor authentication verification is required to create an Application Password. Please log in and complete 2FA, then try again." +msgstr "" + +#. translators: %s: site name. +#: includes/login/class-email-code-sender.php:137 +#, php-format +msgid "[%s] Your verification code" +msgstr "" + +#. translators: %s: site name. +#: includes/login/class-email-code-sender.php:137 +msgid "WordPress" +msgstr "" + +#. translators: %s: user display name. +#: includes/login/class-email-code-sender.php:151 +#, php-format +msgid "Hi %s," +msgstr "" + +#. translators: %s: site name. +#: includes/login/class-email-code-sender.php:154 +#, php-format +msgid "Use the following verification code to finish signing in to %s:" +msgstr "" + +#. translators: %s: site name. +#: includes/login/class-email-code-sender.php:154 +msgid "your site" +msgstr "" + +#: includes/login/class-email-code-sender.php:158 +msgid "The code expires in 10 minutes." +msgstr "" + +#: includes/login/class-email-code-sender.php:160 +msgid "If you did not request this code you can ignore this email." +msgstr "" + +#: includes/login/class-login-form-manager.php:276 +msgid "Verification code" +msgstr "" + +#. translators: %d: verification code length. +#: includes/login/class-login-form-manager.php:287 +#, php-format +msgid "Enter the %d-digit code from your authenticator app." +msgstr "" + +#. translators: %d: verification code length. +#: includes/login/class-login-form-manager.php:294 +#, php-format +msgid "Enter one of your %d-character recovery codes." +msgstr "" + +#. translators: %d: verification code length. +#: includes/login/class-login-form-manager.php:302 +#, php-format +msgid "Enter the %d-digit verification code we sent to your email." +msgstr "" + +#. translators: %d: number of days the device trust lasts. +#: includes/login/class-login-form-manager.php:323 +#, php-format +msgid "Remember this browser for %d day" +msgid_plural "Remember this browser for %d days" +msgstr[0] "" +msgstr[1] "" + +#: includes/login/class-login-form-manager.php:353 +msgid "Send the code again" +msgstr "" + +#: includes/login/class-login-form-manager.php:362 +msgid "Back to login" +msgstr "" + +#: includes/login/class-login-form-manager.php:429 +msgid "We sent a verification code to your email. Enter it below to continue." +msgstr "" + +#: includes/login/class-login-form-manager.php:432 +msgid "We sent you a fresh verification code. Check your inbox." +msgstr "" + +#: includes/login/class-login-form-manager.php:434 +msgid "We could not send a new verification code. Please try again in a moment." +msgstr "" + +#: includes/login/class-login-form-manager.php:437 +msgid "Open your authenticator app and enter the code to continue." +msgstr "" + +#: includes/login/class-login-form-manager.php:439 +msgid "Enter one of your unused recovery codes to continue." +msgstr "" + +#: includes/login/class-login-form-manager.php:507 +msgid "Verify code" +msgstr "" + +#: includes/login/class-login-form-manager.php:568 +msgid "The verification form is missing a security token. Please try again." +msgstr "" + +#: includes/login/class-login-form-manager.php:574 +msgid "The verification request expired. Please sign in again to request a new code." +msgstr "" + +#: includes/login/class-login-form-manager.php:580 +msgid "We could not determine which account you are trying to access." +msgstr "" + +#. translators: %d: minutes remaining. +#: includes/login/class-login-form-manager.php:594 +#, php-format +msgid "Too many failed attempts. Please try again in %d minute." +msgid_plural "Too many failed attempts. Please try again in %d minutes." +msgstr[0] "" +msgstr[1] "" + +#: includes/login/class-login-form-manager.php:608 +msgid "Your verification session expired. Please sign in again." +msgstr "" + +#: includes/login/class-login-form-manager.php:615 +#: includes/login/class-login-form-manager.php:645 +msgid "The selected verification method is not available right now." +msgstr "" + +#: includes/login/class-login-form-manager.php:625 +msgid "Enter the verification code to continue." +msgstr "" + +#: includes/login/class-login-form-manager.php:675 +msgid "The verification code is incorrect or has expired." +msgstr "" + +#: includes/login/class-login-form-manager.php:799 +msgid "Your account requires two-factor authentication. Please contact your administrator to complete the setup." +msgstr "" + +#: includes/login/class-login-form-manager.php:812 +msgid "We could not send a verification code. Please contact the site administrator." +msgstr "" + +#: includes/login/class-login-form-manager.php:1189 +msgid "Use an email code instead" +msgstr "" + +#: includes/login/class-login-form-manager.php:1190 +msgid "Use your authenticator app instead" +msgstr "" + +#: includes/login/class-login-form-manager.php:1191 +msgid "Use a recovery code instead" +msgstr "" + +#: includes/rest/class-rest-controller.php:132 +msgid "Restrict the list to a single role slug." +msgstr "" + +#: includes/rest/class-rest-controller.php:137 +msgid "Filter by 2FA status: enabled, required, or disabled." +msgstr "" + +#: includes/rest/class-rest-controller.php:155 +msgid "You are not allowed to manage 2FA settings." +msgstr "" + +#: includes/user/class-frontend-profile.php:168 +msgid "Save" +msgstr "" + +#: includes/user/class-frontend-profile.php:211 +#: includes/user/class-profile-settings.php:165 +msgid "The recovery codes have been copied to your clipboard." +msgstr "" + +#: includes/user/class-frontend-profile.php:212 +#: includes/user/class-profile-settings.php:166 +msgid "Copying failed. Please copy the codes manually." +msgstr "" + +#: includes/user/class-otp-manager.php:177 +msgid "WordPress Site" +msgstr "" + +#. translators: 1: verification method label, 2: email address. +#: includes/user/class-profile-settings.php:284 +#, php-format +msgid "%1$s (%2$s)" +msgstr "" + +#: includes/user/class-profile-settings.php:315 +msgid "Two-Factor Authentication" +msgstr "" + +#: includes/user/class-profile-settings.php:321 +msgid "Status" +msgstr "" + +#: includes/user/class-profile-settings.php:326 +msgid "Two-factor authentication status" +msgstr "" + +#: includes/user/class-profile-settings.php:330 +msgid "Enable two-factor authentication for this account." +msgstr "" + +#: includes/user/class-profile-settings.php:334 +msgid "Two-factor authentication is enforced for at least one of your roles and cannot be disabled." +msgstr "" + +#: includes/user/class-profile-settings.php:338 +msgid "You can temporarily disable 2FA if you no longer wish to use the extra verification step." +msgstr "" + +#: includes/user/class-profile-settings.php:346 +msgid "Available methods" +msgstr "" + +#: includes/user/class-profile-settings.php:351 +msgid "Select the two-factor authentication methods you want to enable." +msgstr "" + +#: includes/user/class-profile-settings.php:362 +#: includes/user/class-profile-settings.php:380 +#: includes/user/class-profile-settings.php:428 +msgid "required for your role" +msgstr "" + +#: includes/user/class-profile-settings.php:390 +msgid "The authenticator app is active for this account." +msgstr "" + +#: includes/user/class-profile-settings.php:394 +msgid "Scan the QR code or enter the setup key below in your authenticator app." +msgstr "" + +#: includes/user/class-profile-settings.php:397 +msgid "Authenticator app QR code" +msgstr "" + +#: includes/user/class-profile-settings.php:400 +msgid "Install the QR code library and enable the XMLWriter extension to display the authenticator code image. Run the following command inside this plugin directory:" +msgstr "" + +#: includes/user/class-profile-settings.php:406 +msgid "If your app cannot scan the QR code, enter this setup key manually:" +msgstr "" + +#: includes/user/class-profile-settings.php:411 +msgid "Enter the current six-digit code from your authenticator app to activate this method. Submitting a valid code activates the authenticator app even if the Enable checkbox above is not checked." +msgstr "" + +#: includes/user/class-profile-settings.php:414 +msgid "Authenticator code" +msgstr "" + +#. translators: 1: number of unused codes, 2: total number of codes. +#: includes/user/class-profile-settings.php:440 +#, php-format +msgid "There are %1$d of %2$d recovery codes still unused." +msgstr "" + +#. translators: %s: formatted datetime. +#: includes/user/class-profile-settings.php:451 +#, php-format +msgid "Last generated on %s." +msgstr "" + +#: includes/user/class-profile-settings.php:459 +msgid "Recovery codes are active." +msgstr "" + +#: includes/user/class-profile-settings.php:463 +msgid "Regenerate codes" +msgstr "" + +#: includes/user/class-profile-settings.php:470 +msgid "Copy these recovery codes and store them somewhere safe. Each code works only once." +msgstr "" + +#: includes/user/class-profile-settings.php:479 +msgid "Copy codes" +msgstr "" + +#: includes/user/class-profile-settings.php:482 +msgid "✓ Copied to clipboard" +msgstr "" + +#: includes/user/class-profile-settings.php:488 +msgid "Enter one of the codes above to confirm you saved them:" +msgstr "" + +#: includes/user/class-profile-settings.php:492 +msgid "Once confirmed, the codes disappear from this page but remain valid until you use them." +msgstr "" + +#: includes/user/class-profile-settings.php:499 +msgid "We could not display recovery codes. Save the profile to try generating them again." +msgstr "" + +#: includes/user/class-profile-settings.php:503 +msgid "Choose at least one verification method to keep your account accessible if you lose access to another method." +msgstr "" + +#: includes/user/class-profile-settings.php:507 +msgid "Two-factor authentication is required. Activate at least one method above." +msgstr "" + +#: includes/user/class-profile-settings.php:516 +msgid "Preferred method" +msgstr "" + +#: includes/user/class-profile-settings.php:521 +msgid "Choose which verification method is requested first when you sign in." +msgstr "" + +#: includes/user/class-profile-settings.php:531 +msgid "Choose which method is requested first when you sign in. You can still switch methods on the login screen." +msgstr "" + +#: includes/user/class-profile-settings.php:544 +msgid "Choose how often to request an additional verification step on this device." +msgstr "" + +#: includes/user/class-profile-settings.php:547 +msgid "Frequency" +msgstr "" + +#: includes/user/class-profile-settings.php:561 +msgid "A site administrator enforces this schedule for your account." +msgstr "" + +#: includes/user/class-profile-settings.php:565 +msgid "Successful verifications are remembered per device and connection for the selected duration." +msgstr "" + +#: includes/user/class-profile-settings.php:622 +msgid "Trusted Devices" +msgstr "" + +#: includes/user/class-profile-settings.php:624 +msgid "No trusted devices. Check \"Remember this browser\" after your next verification to trust a device." +msgstr "" + +#: includes/user/class-profile-settings.php:629 +msgid "Device" +msgstr "" + +#: includes/user/class-profile-settings.php:630 +msgid "Trusted since" +msgstr "" + +#: includes/user/class-profile-settings.php:631 +msgid "Expires" +msgstr "" + +#: includes/user/class-profile-settings.php:657 +msgid "Revoke" +msgstr "" + +#: includes/user/class-profile-settings.php:666 +msgid "Revoke all trusted devices" +msgstr "" + +#: includes/user/class-profile-settings.php:706 +msgid "New recovery codes are ready below. Copy them and confirm you saved them by entering one code." +msgstr "" + +#: includes/user/class-profile-settings.php:751 +msgid "All recovery codes were used. Generating a new batch failed. Please try again." +msgstr "" + +#: includes/user/class-profile-settings.php:766 +msgid "All recovery codes were used. We prepared a new batch that must be confirmed below." +msgstr "" + +#: includes/user/class-profile-settings.php:816 +msgid "All trusted devices have been revoked." +msgstr "" + +#: includes/user/class-profile-settings.php:819 +msgid "Trusted device revoked." +msgstr "" + +#: includes/user/class-profile-settings.php:880 +msgid "We could not regenerate recovery codes. Please try again." +msgstr "" + +#: includes/user/class-profile-settings.php:899 +msgid "New recovery codes generated. Copy them and confirm one to activate." +msgstr "" + +#: includes/user/class-profile-settings.php:944 +msgid "Authenticator app disabled. Scan a new QR code below to reconnect it." +msgstr "" + +#: includes/user/class-profile-settings.php:957 +msgid "Enter the six-digit code currently shown in your authenticator app to activate this method." +msgstr "" + +#: includes/user/class-profile-settings.php:967 +msgid "Authenticator app enabled successfully." +msgstr "" + +#: includes/user/class-profile-settings.php:975 +msgid "The provided authenticator code is invalid or expired. Try again with a fresh code." +msgstr "" + +#: includes/user/class-profile-settings.php:997 +msgid "Recovery codes confirmed. Keep them in a secure location." +msgstr "" + +#: includes/user/class-profile-settings.php:1004 +msgid "We could not verify that code. Enter one of the freshly generated recovery codes to confirm." +msgstr "" + +#: includes/user/class-profile-settings.php:1023 +msgid "Recovery codes disabled. A fresh list is available below." +msgstr "" + +#: includes/user/class-profile-settings.php:1035 +msgid "Enter one of the displayed recovery codes to activate this method." +msgstr "" + +#: includes/user/class-profile-settings.php:1326 +msgid "no email address available" +msgstr "" + +#: includes/user/class-profile-settings.php:1338 +msgid "Receive a verification code in your inbox every time you sign in." +msgstr "" + +#: includes/user/class-profile-settings.php:1341 +msgid "Add a valid email address to your profile to receive verification codes." +msgstr "" + +#: includes/user/class-profile-settings.php:1350 +msgid "Authenticator app (OTP)" +msgstr "" + +#: includes/user/class-profile-settings.php:1351 +msgid "Use an app like Google Authenticator or 1Password to generate time-based codes." +msgstr "" + +#: includes/user/class-profile-settings.php:1355 +msgid "Keep printable backup codes in a safe place for emergencies." +msgstr "" + +#: includes/user/class-recovery-codes.php:68 +msgid "You must be logged in to manage recovery codes." +msgstr "" + +#: includes/user/class-recovery-codes.php:96 +#: includes/user/class-recovery-codes.php:116 +msgid "The requested user account could not be found." +msgstr "" + +#: includes/user/class-recovery-codes.php:105 +msgid "You are not allowed to modify recovery codes for this account." +msgstr "" + +#: includes/user/class-recovery-codes.php:135 +msgid "We could not generate recovery codes. Please try again." +msgstr "" diff --git a/readme.txt b/readme.txt index 6eec4a0..fbbe77f 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === 2FA (by ROBOTSTXT) === -Contributors: robotstxt +Contributors: robotstxt, javiercasares Tags: security, two-factor authentication, login, otp -Requires at least: 6.4 +Requires at least: 5.6 Tested up to: 7.0 Requires PHP: 8.0 -Stable tag: 1.6.1 +Stable tag: 1.6.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -53,12 +53,26 @@ Yes. Activate the plugin at the network level. Network administrators can set an == Compatibility == -* WordPress: 6.4 – 7.0 +* WordPress: 5.6 – 7.0 * PHP: 8.0 – 8.5 * MariaDB: 11.4 or newer == Changelog == += 1.6.2 = + +_Release date: 2026-08-17_ + +**Added** + +* Recommendation notice for the Manager (by ROBOTSTXT) plugin: when it is not installed and active, a dismissible notice appears on the Plugins screen and a permanent notice is shown on the plugin settings page, since updates are delivered through the Manager plugin. + +**Changed** + +* Updates are now handled by the Manager (by ROBOTSTXT) plugin. The bundled self-updater (`robotstxt-updater.php` and `update.json`) has been removed. +* Plugin and update URLs moved to `robotstxt.software`. +* Minimum WordPress version lowered from 6.4 to 5.6 after a full compatibility review (the code only requires WordPress 5.3+ functions, and WordPress 5.6 is the first release that runs on the required PHP 8.0). + = 1.6.1 = _Release date: 2026-08-14_ @@ -82,25 +96,9 @@ _Release date: 2026-08-07_ * `wp 2fa list` now shows separate **Enabled**, **Methods** (configured), and **Required** (role-enforced) columns, plus a new `--required` filter to list only users whose role enforces 2FA. -= 1.5.3 = - -_Release date: 2026-08-07_ - -**Added** - -* Per-user preferred sign-in method — a new "Preferred method" dropdown on the user profile (visible when two or more methods are enabled) lets each user choose which verification method is requested first at the login screen. Users can still switch methods on the login screen via the existing alternate-method links. - -**Changed** - -* Role enforcement is now a floor, not a ceiling. When a role requires specific methods, those methods are still forced on the user's profile (enforced setup), but at login users may authenticate with any method they have configured — not only the role-required ones. Previously, users who configured extra methods (e.g. an authenticator app) only saw the role-required method at login. - -**Fixed** - -* Security: the "Require 2FA to create Application Passwords" check could be bypassed via the `/wp/v2/users/me/application-passwords` REST route. The route matcher now accepts the `me` alias. - = Previous versions = -For the full changelog see the [changelog.txt](https://git.robotstxt.es/ROBOTSTXT/robotstxt-2fa/raw/branch/main/changelog.txt) file. +For the full changelog see the [changelog](https://www.robotstxt.software/plugins/robotstxt-2fa/) page. == Compliance == diff --git a/robotstxt-2fa.php b/robotstxt-2fa.php index fcc4e89..8bd4d4d 100644 --- a/robotstxt-2fa.php +++ b/robotstxt-2fa.php @@ -1,13 +1,15 @@ register(); - } - - /** - * Constructor. - * - * @param string $plugin_file_path Absolute path to the main plugin file. - */ - private function __construct( string $plugin_file_path ) { - $this->plugin_file_path = $plugin_file_path; - $this->plugin_basename = plugin_basename( $plugin_file_path ); - $this->plugin_slug = dirname( $this->plugin_basename ); - $this->plugin_data = $this->get_plugin_data(); - $this->json_url = $this->build_json_url(); - $this->cache_key = 'robotstxt_updater_' . md5( $this->plugin_basename ); - } - - /** - * Register WordPress hooks. - */ - private function register(): void { - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'inject_update_info' ) ); - add_filter( 'plugins_api', array( $this, 'provide_plugin_details' ), 10, 3 ); - add_action( 'admin_init', array( $this, 'handle_cache_clear' ) ); - add_action( 'robotstxt_updater_clear_cache', array( $this, 'clear_cache' ) ); - } - - /** - * Get plugin headers. - * - * @return array Plugin data. - */ - private function get_plugin_data(): array { - if ( ! function_exists( 'get_plugin_data' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return get_plugin_data( $this->plugin_file_path, false, false ); - } - - /** - * Build JSON URL from plugin headers. - * - * Tries to use "Gitea Plugin URI" header to construct the URL. - * Falls back to Plugin URI if Gitea URI is not available. - * - * @return string JSON URL. - */ - private function build_json_url(): string { - // Try Gitea Plugin URI (format: "OWNER/REPO" or full URL). - if ( ! empty( $this->plugin_data['Gitea Plugin URI'] ) ) { - $gitea_uri = $this->plugin_data['Gitea Plugin URI']; - - // If it's already a full URL, use it. - if ( str_starts_with( $gitea_uri, 'http' ) ) { - // Extract base URL and construct JSON path. - return rtrim( $gitea_uri, '/' ) . '/raw/branch/main/update.json'; - } - - // If it's in format "OWNER/REPO", construct full URL. - if ( preg_match( '#^[^/]+/[^/]+$#', $gitea_uri ) ) { - return "https://git.robotstxt.es/{$gitea_uri}/raw/branch/main/update.json"; - } - } - - // Fallback: try to extract from Plugin URI. - if ( ! empty( $this->plugin_data['PluginURI'] ) ) { - $plugin_uri = $this->plugin_data['PluginURI']; - if ( str_contains( $plugin_uri, 'git.robotstxt.es' ) ) { - return rtrim( $plugin_uri, '/' ) . '/raw/branch/main/update.json'; - } - } - - // Last resort: construct from plugin slug. - return "https://git.robotstxt.es/ROBOTSTXT/{$this->plugin_slug}/raw/branch/main/update.json"; - } - - /** - * Inject update info into WP's plugin update transient. - * - * @param object|mixed $transient The update_plugins transient. - * - * @return object The modified transient. - */ - public function inject_update_info( $transient ) { - if ( ! is_object( $transient ) ) { - $transient = new stdClass(); - } - - if ( empty( $transient->checked ) || ! is_array( $transient->checked ) ) { - return $transient; - } - - if ( empty( $transient->checked[ $this->plugin_basename ] ) ) { - return $transient; - } - - $current_version = $transient->checked[ $this->plugin_basename ]; - $remote = $this->get_remote_data(); - - if ( empty( $remote['version'] ) || empty( $remote['download_url'] ) ) { - return $transient; - } - - if ( ! $this->is_compatible( $remote ) ) { - return $transient; - } - - if ( version_compare( $remote['version'], $current_version, '>' ) ) { - $update = (object) array( - 'slug' => $remote['slug'] ?? $this->plugin_slug, - 'plugin' => $this->plugin_basename, - 'new_version' => $remote['version'], - 'url' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '', - 'package' => $remote['download_url'], - 'tested' => $remote['tested'] ?? '', - 'requires' => $remote['requires'] ?? '', - 'requires_php' => $remote['requires_php'] ?? '', - ); - - $transient->response[ $this->plugin_basename ] = $update; - } - - return $transient; - } - - /** - * Provide "View details" modal content. - * - * @param false|object|array $result The result object or array. - * @param string $action The type of information being requested. - * @param object $args Plugin API arguments. - * - * @return false|object The plugin information object or false. - */ - public function provide_plugin_details( $result, string $action, object $args ) { - if ( 'plugin_information' !== $action ) { - return $result; - } - - if ( empty( $args->slug ) || $args->slug !== $this->plugin_slug ) { - return $result; - } - - $remote = $this->get_remote_data(); - - if ( empty( $remote['version'] ) ) { - return $result; - } - - return (object) array( - 'name' => $remote['name'] ?? $this->plugin_data['Name'] ?? $this->plugin_slug, - 'slug' => $remote['slug'] ?? $this->plugin_slug, - 'version' => $remote['version'], - 'author' => $remote['author'] ?? $this->plugin_data['Author'] ?? '', - 'homepage' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '', - 'requires' => $remote['requires'] ?? '', - 'tested' => $remote['tested'] ?? '', - 'requires_php' => $remote['requires_php'] ?? '', - 'sections' => array( - 'description' => $remote['description'] ?? $this->plugin_data['Description'] ?? '', - 'changelog' => $remote['changelog'] ?? '', - ), - 'download_link' => $remote['download_url'] ?? '', - ); - } - - /** - * Get remote data with caching and HMAC signature verification. - * - * @return array Remote data. - */ - private function get_remote_data(): array { - $cached = get_site_transient( $this->cache_key ); - - // Verify HMAC signature if AUTH_SALT is defined and cache has signature. - if ( false !== $cached && defined( 'AUTH_SALT' ) && '' !== AUTH_SALT ) { - if ( is_array( $cached ) && isset( $cached['signature'], $cached['data'] ) ) { - $expected_sig = hash_hmac( 'sha256', $this->cache_key . serialize( $cached['data'] ), AUTH_SALT ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- Used for HMAC signing, not for unserializing untrusted data. - - if ( hash_equals( $expected_sig, $cached['signature'] ) ) { - // Signature valid, return data. - return is_array( $cached['data'] ) ? $cached['data'] : array(); - } - - // Signature invalid, delete corrupted cache. - delete_site_transient( $this->cache_key ); - $cached = false; - } - } - - // If no valid cache, fetch fresh data. - if ( false === $cached ) { - $remote = $this->fetch_json(); - - // Store with HMAC signature if AUTH_SALT is available. - if ( defined( 'AUTH_SALT' ) && '' !== AUTH_SALT ) { - $remote_data = is_array( $remote ) ? $remote : array(); - $payload = array( - 'data' => $remote_data, - 'timestamp' => time(), - 'signature' => hash_hmac( 'sha256', $this->cache_key . serialize( $remote_data ), AUTH_SALT ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- Used for HMAC signing, not for unserializing untrusted data. - ); - set_site_transient( $this->cache_key, $payload, 6 * HOUR_IN_SECONDS ); - } else { - // Fallback to standard caching. - set_site_transient( $this->cache_key, is_array( $remote ) ? $remote : array(), 6 * HOUR_IN_SECONDS ); - } - - return is_array( $remote ) ? $remote : array(); - } - - // Legacy cache format without signature (backward compatibility). - return is_array( $cached ) ? $cached : array(); - } - - /** - * Fetch JSON from remote URL. - * - * @return array Decoded JSON data. - */ - private function fetch_json(): array { - $response = wp_remote_get( - $this->json_url, - array( - 'timeout' => 10, - 'headers' => array( - 'Accept' => 'application/json', - ), - ) - ); - - if ( is_wp_error( $response ) ) { - return array(); - } - - $code = (int) wp_remote_retrieve_response_code( $response ); - if ( $code < 200 || $code >= 300 ) { - return array(); - } - - $body = wp_remote_retrieve_body( $response ); - $data = json_decode( $body, true ); - - return is_array( $data ) ? $data : array(); - } - - /** - * Check compatibility. - * - * @param array $remote Remote data. - * - * @return bool True if compatible. - */ - private function is_compatible( array $remote ): bool { - if ( ! empty( $remote['requires_php'] ) ) { - if ( version_compare( PHP_VERSION, $remote['requires_php'], '<' ) ) { - return false; - } - } - - if ( ! empty( $remote['requires'] ) ) { - if ( version_compare( get_bloginfo( 'version' ), $remote['requires'], '<' ) ) { - return false; - } - } - - return true; - } - - /** - * Handle manual cache clear via URL parameter. - */ - public function handle_cache_clear(): void { - // Check if this is a cache clear request first. - $clear_cache = filter_input( INPUT_GET, 'robotstxt_clear_update_cache', FILTER_UNSAFE_RAW ); - if ( null === $clear_cache ) { - return; - } - - // This is a cache clear request - now verify nonce. - $nonce_raw = filter_input( INPUT_GET, '_wpnonce', FILTER_UNSAFE_RAW ); - $nonce = $nonce_raw ? sanitize_text_field( wp_unslash( $nonce_raw ) ) : ''; - - if ( ! wp_verify_nonce( $nonce, 'robotstxt_clear_update_cache' ) ) { - wp_die( esc_html__( 'Security check failed', 'robotstxt-2fa' ) ); - } - - // Check permissions. - if ( ! current_user_can( 'update_plugins' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'robotstxt-2fa' ) ); - } - - $this->clear_cache(); - wp_safe_redirect( remove_query_arg( array( 'robotstxt_clear_update_cache', '_wpnonce' ) ) ); - exit; - } - - /** - * Clear update cache. - */ - public function clear_cache(): void { - delete_site_transient( $this->cache_key ); - delete_site_transient( 'update_plugins' ); - } - } -} diff --git a/update.json b/update.json index e46dbb3..7543046 100644 --- a/update.json +++ b/update.json @@ -1,8 +1,8 @@ { "name": "2FA (by ROBOTSTXT)", "slug": "robotstxt-2fa", - "version": "1.6.1", - "download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-2fa/releases/download/1.6.1/robotstxt-2fa-1.6.1.zip", + "version": "1.6.2", + "download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-2fa/releases/download/1.6.2/robotstxt-2fa-1.6.2.zip", "requires": "6.4", "requires_php": "8.0", "tested": "7.1", @@ -11,10 +11,10 @@ "author_profile": "https://www.robotstxt.es/", "homepage": "https://www.robotstxt.es/plugins/robotstxt-2fa/", "description": "Adds per-role two-factor authentication to the WordPress login flow. Supports email codes, authenticator apps (TOTP), and recovery codes.", - "changelog": "

1.6.1 - 2026-08-14

  • Fixed: Fatal error during editor autosaves — the [robotstxt_2fa_profile] shortcode expanded when WordPress applied content filters to a post revision via REST (e.g. an article that merely mentions the shortcode). The shortcode now bails out early on REST requests and loads the required wp-admin includes on demand elsewhere.
", + "changelog": "", "sections": { "description": "Adds per-role two-factor authentication to the WordPress login flow. Supports email codes, authenticator apps (TOTP), and recovery codes.", - "changelog": "

1.6.1 - 2026-08-14

  • Fixed: Fatal error during editor autosaves — the [robotstxt_2fa_profile] shortcode expanded when WordPress applied content filters to a post revision via REST (e.g. an article that merely mentions the shortcode). The shortcode now bails out early on REST requests and loads the required wp-admin includes on demand elsewhere.
" + "changelog": "" }, "banners": { "low": "", "high": "" }, "icons": { "1x": "", "2x": "" } diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 8955884..90d8705 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -22,8 +22,6 @@ class ComposerAutoloaderInit3c8f2c10a8655d88b9115205b533c7e2 return self::$loader; } - require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit3c8f2c10a8655d88b9115205b533c7e2', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit3c8f2c10a8655d88b9115205b533c7e2', 'loadClassLoader')); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index 14bf88d..0000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,25 +0,0 @@ -= 80200)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - throw new \RuntimeException( - 'Composer detected issues in your platform: ' . implode(' ', $issues) - ); -}