Skip to content

Commit

Permalink
Plugin & Theme authors are now required to have 2FA enabled. (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 committed Oct 8, 2024
1 parent 6a1ff16 commit 46b274d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions wporg-two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@ function user_requires_2fa( $user ) : bool {
return false;
}

// @codeCoverageIgnoreStart
if ( ! array_key_exists( 'phpunit_version', $GLOBALS ) ) {
// 2FA is opt-in during beta testing.
// todo Remove this once we open it to all users.
if ( ! is_2fa_beta_tester( $user ) ) {
return false;
}
}
// @codeCoverageIgnoreEnd

$required = false;

if ( is_special_user( $user->ID ) ) {
Expand All @@ -247,6 +237,16 @@ function user_requires_2fa( $user ) : bool {
$required = true;
}

// If a user ... they have to have 2FA enabled.
if (
// Is (or was) a plugin committer
$user->has_plugins ||
// Has (or had) a live theme
$user->has_themes
) {
return true;
}

return $required;
}

Expand Down

0 comments on commit 46b274d

Please sign in to comment.