Opened 8 hours ago
Last modified 8 hours ago
#66359 new defect (bug)
Site Health: The "insecure registration" test shows its warning label when it passes
| Reported by: | ravipatel | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
WP_Site_Health::get_test_insecure_registration() (added in #43936, 7.0) sets its label once, for the default "good" result:
'label' => __( 'Open Registration with privileged default role' ), 'status' => 'good',
The critical branch changes the status and description but never the label. So on a correctly configured site, Tools > Site Health > Passed tests lists "Open Registration with privileged default role", which reads like a warning.
The critical description is also not wrapped in <p>, unlike the "good" description and other Site Health results.
Steps to reproduce
- Keep "Anyone can register" unticked (the default), or tick it with the default role set to Subscriber.
- Go to Tools > Site Health and expand "Passed tests".
- The passing result is labelled "Open Registration with privileged default role".
Proposed fix
- Give the passing result its own label, for example "New users are not given a privileged role".
- Set "Open registration with a privileged default role" (sentence case, like other Site Health labels) only in the critical branch.
- Wrap the critical description in
<p>. - Add unit tests: there is currently no test coverage for this check.
AI assistance: Yes
Tool(s): Claude Code
Used for: Finding the issue during 7.2-beta1 testing, and drafting the fix, tests and this description. I reviewed and ran the tests.
Change History (2)
This ticket was mentioned in PR #14669 on WordPress/wordpress-develop by @ravipatel.
8 hours ago
#1
- Keywords has-patch has-unit-tests added
#2
@
8 hours ago
PR: https://github.com/WordPress/wordpress-develop/pull/14669
The new tests fail on trunk for the label and the description markup, and all 9 pass with the PR on single site and multisite (npm run test:php -- --group 66359).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
WP_Site_Health::get_test_insecure_registration()set the label for its critical result as the default, so a site with safe registration settings listed "Open Registration with privileged default role" under Passed tests, which reads like a warning.<p>, like the passing description and other Site Health results.registrationoption, becauseusers_can_registerfollows it there.Two translatable strings change; 7.2 is in beta, before the RC1 string freeze.
Testing Instructions
Unit tests:
npm run test:php -- --group 66359. On trunk, the label and markup tests fail; with this PR, all 9 pass on single site and multisite.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Used for: Finding the issue during 7.2-beta1 testing, and drafting the fix, tests and this description. I reviewed the changes and ran the tests.