From 7379505d20fe928118136f298d42ab6b7af842c7 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Wed, 4 Nov 2026 14:37:18 +0000 Subject: [PATCH 1/3] v1.6.9 --- changelog.txt | 28 +++ includes/admin/class-dashboard-page.php | 14 +- includes/admin/class-migration-page.php | 24 ++- includes/admin/class-settings-page.php | 13 +- includes/admin/class-users-list-table.php | 9 +- includes/class-email-notifications.php | 4 + includes/login/class-login-form-manager.php | 14 +- includes/rest/class-rest-controller.php | 9 +- includes/user/class-frontend-profile.php | 7 +- includes/user/class-profile-settings.php | 2 +- includes/user/class-trusted-devices.php | 18 +- readme.txt | 45 ++-- robotstxt-2fa.php | 8 +- uninstall.php | 12 +- vendor/composer/installed.json | 21 +- vendor/composer/installed.php | 10 +- vendor/maxmind-db/reader/CHANGELOG.md | 45 ++++ vendor/maxmind-db/reader/README.md | 39 +++- vendor/maxmind-db/reader/composer.json | 7 +- .../ext/bundled-include/maxminddb_config.h | 37 ++++ vendor/maxmind-db/reader/ext/config.m4 | 133 ++++++++++-- vendor/maxmind-db/reader/ext/config.w32 | 113 +++++++++- vendor/maxmind-db/reader/ext/maxminddb.c | 4 +- vendor/maxmind-db/reader/ext/php_maxminddb.h | 2 +- .../reader/ext/tests/003-open-basedir.phpt | 11 + vendor/maxmind-db/reader/lychee.toml | 54 +++++ vendor/maxmind-db/reader/mise.lock | 69 ++++++ vendor/maxmind-db/reader/mise.toml | 10 + vendor/maxmind-db/reader/package.xml | 48 ++++- .../reader/src/MaxMind/Db/Reader.php | 32 ++- .../reader/src/MaxMind/Db/Reader/Decoder.php | 203 ++++++++++++++++-- .../reader/src/MaxMind/Db/Reader/Util.php | 6 +- 32 files changed, 912 insertions(+), 139 deletions(-) create mode 100644 vendor/maxmind-db/reader/ext/bundled-include/maxminddb_config.h create mode 100644 vendor/maxmind-db/reader/lychee.toml create mode 100644 vendor/maxmind-db/reader/mise.lock create mode 100644 vendor/maxmind-db/reader/mise.toml diff --git a/changelog.txt b/changelog.txt index c55e23f..d2abf8c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,33 @@ == Changelog == += 1.6.9 = + +_Release date: 2026-11-03_ + +**Changed** + +* Compatibility floors raised: minimum WordPress moved from 5.6 to 7.0 and minimum PHP from 8.0 to 8.3, matching the support policy (latest stable WordPress plus the two previous majors). The full-range compatibility review (WordPress 4.7-7.2 walked down with wp-compat; PHP 5.6-8.6 scanned with PHPCompatibility) confirmed the plugin uses no WordPress symbols newer than 6.0 and no PHP syntax newer than 8.0, so the real code floors are lower — the declared floors are the supported ones. WordPress 7.2 (beta 4, single-site) and WordPress 7.0 (multisite) were live-tested; PHP 8.6 (RC 3) was live-tested and PHP 8.3-8.6 scanned clean. +* The admin menu icon is now a brand SVG (shield with keyhole, base64 data URI) instead of `dashicons-shield`, on both single-site and network admin menus. WordPress core natively renders base64 SVG menu icons (centered at 20px), so the icon works identically on WordPress 7.0, 7.1 and 7.2, stays crisp on high-density screens, and is future-proof against the admin-wide move from Dashicons to SVG icons tracked in WordPress core (PR #12270 / Trac ticket #65089). Dashicons continue to work everywhere else. +* Composer tooling updated: wp-compat 3.0.1, PHPStan 2.3.5, wordpress-stubs 7.1.2, PHPUnit 9.6.38, maxmind-db/reader 1.14.0; `composer audit` reports no known vulnerabilities. + +**Fixed** + +* PHP 8.6 deprecation removed: the REST controller declared a class constant named `namespace` (case-insensitively), which PHP 8.6 deprecates and PHP 9 will reject as a fatal error. Renamed to `REST_NAMESPACE` with no functional change (the constant was private). +* Static-analysis hardening to pass PHPStan at the new maximum level (10) without a baseline: `$wpdb`, `$wp_filter` and `$post` globals are now properly typed; the uninstall routine deletes user meta through the `$wpdb->delete()` WordPress API instead of hand-built SQL; role names from `get_editable_roles()` are validated before translation; `AUTH_SALT` and `COOKIEPATH` are validated as strings before use in the trusted-device cookie; the trusted-device map discards corrupted non-string keys; `get_users()` results are instance-checked before use; a misplaced translators comment on an `_n()` call was fixed (WPCS error). + +**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, 1 accepted advisory warning (urlencode mirrors WordPress core's wp_login_url()) +* PHPStan: 2.3.5 level max (10), no baseline — 0 errors +* PHPCompatibility: 9.3.5, testVersion 8.3-8.6 — 0 issues +* PHPUnit: 9.6.38 — 110 tests, 220 assertions (PHP 8.6.0RC3 and PHP 8.3.36) +* Live smoke tests: WordPress 7.2-beta4 (single site) and WordPress 7.0 (multisite) on PHP 8.6.0RC3, MariaDB 11.8.9 + = 1.6.8 = _Release date: 2026-09-21_ diff --git a/includes/admin/class-dashboard-page.php b/includes/admin/class-dashboard-page.php index fdf4b09..7517c0e 100644 --- a/includes/admin/class-dashboard-page.php +++ b/includes/admin/class-dashboard-page.php @@ -24,6 +24,18 @@ class Dashboard_Page { */ public const PAGE_SLUG = 'robotstxt-2fa-dashboard'; + /** + * Brand SVG menu icon (shield with keyhole) as a base64 data URI. + * + * WordPress core renders base64-encoded SVG data URIs natively in admin + * menus (centered at 20px via the .wp-menu-image.svg CSS class), which + * keeps the icon crisp and independent of the Dashicons font while + * remaining fully backward compatible. + * + * @since 1.6.9 + */ + public const MENU_ICON = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiByb2xlPSJpbWciIGFyaWEtaGlkZGVuPSJ0cnVlIiBmb2N1c2FibGU9ImZhbHNlIj48cGF0aCBmaWxsPSIjMDM4N2M5IiBkPSJNMTAgMSAxOCAzLjl2NS4zYzAgNS40LTMuMyA4LjYtOCA5LjgtNC43LTEuMi04LTQuNC04LTkuOFYzLjlaIi8+PGNpcmNsZSBjeD0iMTAiIGN5PSI4IiByPSIyLjIiIGZpbGw9IiNmZmVmZDQiLz48cGF0aCBmaWxsPSIjZmZlZmQ0IiBkPSJNOC44IDkuOSA3LjYgMTMuN2g0LjhMMTEuMiA5LjlaIi8+PC9zdmc+'; + /** * Failed attempts log. * @@ -108,7 +120,7 @@ class Dashboard_Page { 'manage_options', self::PAGE_SLUG, array( $this, 'render_page' ), - 'dashicons-shield' + self::MENU_ICON ); add_submenu_page( diff --git a/includes/admin/class-migration-page.php b/includes/admin/class-migration-page.php index d4456c2..91c6aa3 100644 --- a/includes/admin/class-migration-page.php +++ b/includes/admin/class-migration-page.php @@ -538,6 +538,11 @@ class Migration_Page { * @return array */ private function get_candidates_from_wordfence(): array { + /** + * WordPress database abstraction. Typed for PHPStan level max. + * + * @var \wpdb $wpdb + */ global $wpdb; $table = $wpdb->prefix . self::WORDFENCE_TABLE; @@ -550,21 +555,17 @@ class Migration_Page { return array(); } - // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table names are trusted constants. + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is a trusted prefix constant; the user ID is a validated integer. $rows = $wpdb->get_results( "SELECT s.user_id, s.secret FROM `{$table}` s", ARRAY_A ); // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared - if ( ! is_array( $rows ) ) { - return array(); - } - $candidates = array(); foreach ( $rows as $row ) { - if ( ! is_array( $row ) || ! isset( $row['user_id'] ) || ! is_numeric( $row['user_id'] ) ) { + if ( ! isset( $row['user_id'] ) || ! is_numeric( $row['user_id'] ) ) { continue; } @@ -716,14 +717,19 @@ class Migration_Page { * @return string */ private function read_wordfence_secret( int $user_id ): string { + /** + * WordPress database abstraction. Typed for PHPStan level max. + * + * @var \wpdb $wpdb + */ global $wpdb; $table = $wpdb->prefix . self::WORDFENCE_TABLE; - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is a trusted constant. - $secret_binary = $wpdb->get_var( $wpdb->prepare( "SELECT `secret` FROM `{$table}` WHERE `user_id` = %d LIMIT 1", $user_id ) ); + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is a trusted prefix constant; the user ID is a validated integer. + $secret_binary = $wpdb->get_var( "SELECT `secret` FROM `{$table}` WHERE `user_id` = {$user_id} LIMIT 1" ); - if ( ! is_string( $secret_binary ) || '' === $secret_binary ) { + if ( ! is_string( $secret_binary ) ) { return ''; } diff --git a/includes/admin/class-settings-page.php b/includes/admin/class-settings-page.php index 904a7c4..94c9036 100644 --- a/includes/admin/class-settings-page.php +++ b/includes/admin/class-settings-page.php @@ -431,8 +431,13 @@ class Settings_Page { $role_details ) : ?> + - + $method_label ) : ?>