Skip to content

Site Health: Use a passing label for the insecure registration test - #14669

Open
rvpatel wants to merge 1 commit into
WordPress:trunkfrom
rvpatel:66359-site-health-insecure-registration-label
Open

rvpatel wants to merge 1 commit into
WordPress:trunkfrom
rvpatel:66359-site-health-insecure-registration-label

Conversation

@rvpatel

@rvpatel rvpatel commented Oct 21, 2026

Copy link
Copy Markdown

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.

  • The passing result now reads "New users are not given a privileged role".
  • The critical result sets its own label, "Open registration with a privileged default role", in sentence case like other Site Health labels.
  • The critical description is wrapped in <p>, like the passing description and other Site Health results.
  • Adds the first tests for this check: each combination of open or closed registration and default role, plus the label, description markup and action link. On multisite, the tests set the network registration option, because users_can_register follows it there.

Two translatable strings change; 7.2 is in beta, before the RC1 string freeze.

Trac ticket: https://core.trac.wordpress.org/ticket/66359

Testing Instructions

  1. Keep "Anyone can register" unticked, or tick it with the default role set to Subscriber.
  2. Go to Tools > Site Health and expand "Passed tests".
  3. Before: "Open Registration with privileged default role". After: "New users are not given a privileged role".
  4. Tick "Anyone can register" and set the default role to Administrator. The critical result reads "Open registration with a privileged default role".

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.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

The insecure registration test 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.

The passing result now reads "New users are not given a privileged role", and the critical result sets its own label in sentence case. Its description is wrapped in a paragraph, like the passing description and other Site Health results.

Adds the first tests for this check.

See #66359.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props ravipatel.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant