Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin & Theme authors are now required to have 2FA enabled. #316

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Comment on lines -229 to -238
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this is still in here, I think we can just remove it all?
Let's see if this breaks the unit tests on this PR..

$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
Loading