-
Notifications
You must be signed in to change notification settings - Fork 0
Improve Higlight-MFA Module notice to specify the affected roles #28
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
Conversation
…is are admins/editors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines the Highlight MFA module's notice messaging to explicitly reference affected high-privilege roles, either “Administrator or Editor” for the default configuration or a customizable set of roles. The changes include updating translation strings in the PHPUnit tests and refactoring the module's logic by introducing a default role constant and helper methods for generating the notice messages.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/phpunit/test-highlight-mfa-users.php | Updates to translation strings and tests to support role-specific notices. |
modules/highlight-mfa-users/class-highlight-mfa-users.php | Refactored default role configuration and message generation logic. |
$notice_message_text = ''; | ||
if ( $is_default_config ) { | ||
$notice_message_text = sprintf( | ||
/* Translators: %d is the number of users with Administrator or Editor roles and 2FA disabled. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Indentation looks off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunobasto Agree. I wonder why it wasn't caught by the linting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed indentation in cf48a0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and looks good! Thank you for the quick fix!
Description
When using the default config, the Highlight MFA module will create a notice saying that there are users without MFA.
That was considered too broad and would not represent the actual config which is based on the administrators and editors who do not have MFA active.
In this PR we're introducing a change in the messaging so that whenever we're using the default config, we're exposing the fact that administrators and editors are the one affected by this notice.
At the same time if the module is set up to use a different set of roles, we will also support those by having a more generic yet less broad definition which uses the term "high privileges" to indicate that the affected users are relevant when managing the site.
Pre-review checklist
Please make sure the items below have been covered before requesting a review:
Pre-deploy checklist
Steps to Test
wp-admin
>Users
list and check the two new messages, click on the filter link and check that the message is consistent.