Skip to content

Commit

Permalink
Plugin & Theme authors are now required to have 2FA enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Oct 1, 2024
1 parent bc2b46d commit 2667931
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions wporg-two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,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 @@ -246,6 +236,18 @@ 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 /* ||
// Has (or had) an elevated role on a site (WordPress.org, BuddyPress.org, bbPress.org, WordCamp.org)
$user->has_elevated_role */
) {
return true;
}

return $required;
}

Expand Down

0 comments on commit 2667931

Please sign in to comment.