Skip to content

Commit ecba0ac

Browse files
committed
Address review feedback: bump version constant, use instanceof WP_User checks
- Update TWO_FACTOR_VERSION fallback define to 0.16.0 to match the plugin header - Replace truthiness checks with `instanceof WP_User` in Two_Factor_Email authentication_page(), pre_process_authentication() and validate_authentication()
1 parent 28fe133 commit ecba0ac

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

providers/class-two-factor-email.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public function generate_and_email_token( $user ) {
340340
* @param WP_User|false $user WP_User object of the logged-in user.
341341
*/
342342
public function authentication_page( $user ) {
343-
if ( ! $user ) {
343+
if ( ! ( $user instanceof WP_User ) ) {
344344
return;
345345
}
346346

@@ -388,7 +388,7 @@ public function authentication_page( $user ) {
388388
* @return boolean
389389
*/
390390
public function pre_process_authentication( $user ) {
391-
if ( ! $user ) {
391+
if ( ! ( $user instanceof WP_User ) ) {
392392
return false;
393393
}
394394

@@ -409,7 +409,7 @@ public function pre_process_authentication( $user ) {
409409
* @return boolean
410410
*/
411411
public function validate_authentication( $user ) {
412-
if ( ! $user ) {
412+
if ( ! ( $user instanceof WP_User ) ) {
413413
return false;
414414
}
415415

two-factor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
if ( ! defined( 'TWO_FACTOR_VERSION' ) ) {
30-
define( 'TWO_FACTOR_VERSION', '0.15.0' );
30+
define( 'TWO_FACTOR_VERSION', '0.16.0' );
3131
}
3232

3333
if ( ! defined( 'ABSPATH' ) ) {

0 commit comments

Comments
 (0)