From 110b9c5ad32b6e7870023fe26b15caaa10e7775d Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 31 Jul 2026 23:55:14 +0200 Subject: [PATCH 1/3] validate against version 3 --- phpstan.dist.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 23ef496e..b435b320 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,7 +1,7 @@ includes: - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 2 + level: 3 paths: - includes - providers From 1846d8261cd3b054f898038f27be966fcf86c30a Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 1 Aug 2026 09:14:11 +0200 Subject: [PATCH 2/3] Update phpstan.dist.neon --- phpstan.dist.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.dist.neon b/phpstan.dist.neon index b435b320..82024922 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,7 +1,7 @@ includes: - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 3 + level: 4 paths: - includes - providers From 8205dc37fcecc28bd66525fc0ff9755a17fb99e1 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 1 Aug 2026 07:45:23 +0000 Subject: [PATCH 3/3] upgrade phpstan to level 5 --- class-two-factor-compat.php | 8 +++++++- class-two-factor-core.php | 6 +++--- phpstan.dist.neon | 2 +- providers/class-two-factor-backup-codes.php | 4 ++-- providers/class-two-factor-email.php | 2 +- providers/class-two-factor-totp.php | 10 +++++----- settings/class-two-factor-settings.php | 9 ++++++++- two-factor.php | 2 +- 8 files changed, 28 insertions(+), 15 deletions(-) diff --git a/class-two-factor-compat.php b/class-two-factor-compat.php index 94e47f4d..355b9a58 100644 --- a/class-two-factor-compat.php +++ b/class-two-factor-compat.php @@ -58,6 +58,12 @@ public function jetpack_rememberme( $rememberme ) { * @return boolean */ public function jetpack_is_sso_active() { - return ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'sso' ) ); + if ( ! class_exists( 'Jetpack' ) ) { + return false; + } + + $jetpack_is_module_active = array( 'Jetpack', 'is_module_active' ); + + return is_callable( $jetpack_is_module_active ) && (bool) call_user_func( $jetpack_is_module_active, 'sso' ); } } diff --git a/class-two-factor-core.php b/class-two-factor-core.php index de7e20ca..c9270db5 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -244,7 +244,7 @@ public static function uninstall() { } foreach ( $user_meta_keys as $meta_key ) { - delete_metadata( 'user', null, $meta_key, null, true ); + delete_metadata( 'user', 0, $meta_key, '', true ); } } @@ -1152,14 +1152,14 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg
- + - + authentication_page( $user ); ?>
diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 82024922..b5df8a22 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -1,7 +1,7 @@ includes: - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: - level: 4 + level: 5 paths: - includes - providers diff --git a/providers/class-two-factor-backup-codes.php b/providers/class-two-factor-backup-codes.php index d74592b3..79f33354 100644 --- a/providers/class-two-factor-backup-codes.php +++ b/providers/class-two-factor-backup-codes.php @@ -441,7 +441,7 @@ public function authentication_page( $user ) { ?>

- +

- +

- +