#56134 closed enhancement (fixed)
Site Health: If 0 active plugins (themes), they can't be "all up to date"
| Reported by: | Presskopp | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Site Health | Version: | |
| Severity: | normal | Keywords: | has-test-info has-patch needs-testing commit has-unit-tests |
| Cc: | Focuses: |
Description
If 0 plugins are active it states:
Your site has 0 active plugins, and they are all up to date.
In my opinion we should strip the "up to date" part in that case.
Same for themes.
Attachments (1)
Change History (16)
#4
@
4 years ago
Testing Instructions
These steps define how to test the feature or enhancement, and indicates the expected behavior or results.
Steps to Test
- Rename plugins folder and themes folder
- Open "Tools" > "Site Health"
- Open "Passed Tests" > "Your plugins are all up to date"
- Read "Your site has 0 active plugins, and they are all up to date."
- Open "recommended improvements"
- Open "Have a default theme available"
- Read "Your site has 0 installed themes, and they are all up to date."
Expected Results
Output:
- ✅ Your site does not have any active plugins.
- ✅ Your site does not have any installed themes.
#6
follow-up:
↓ 7
@
4 years ago
- Keywords needs-unit-tests added
@SergeyBiryukov, did you consider adding unit tests to the patch?
I can see that Tests_Site_Health tests cover only the site health check cron at the moment. Adding more specific tests will probably require considerable effort. Has this been already discussed somewhere?
#7
in reply to: ↑ 6
@
4 years ago
Replying to martin.krcho:
@SergeyBiryukov, did you consider adding unit tests to the patch?
Thanks for bringing this up! Not really, I would for any functionality changes, but this is only a string change, so I don't think it requires unit tests.
I can see that
Tests_Site_Healthtests cover only the site health check cron at the moment. Adding more specific tests will probably require considerable effort. Has this been already discussed somewhere?
Yes, there's a ticket for that: #47880.
#8
@
4 years ago
Sounds good to me, @SergeyBiryukov. I will follow #47880 and see if I can help at some point.
This ticket was mentioned in PR #13960 on WordPress/wordpress-develop by @irozum.
6 weeks ago
#13
- Keywords has-unit-tests added; needs-unit-tests removed
What this covers: Adds unit tests for WP_Site_Health::get_test_plugin_version() and WP_Site_Health::get_test_theme_version(), specifically the zero-count messaging branch that [53816] / [53817] introduced for this ticket.
Why these cases: Before [53816], a site with 0 active plugins (or 0 installed themes) got the confusing "Your site has 0 active plugins, and they are all up to date." wording. The fix added a dedicated branch for the zero case ("Your site does not have any active plugins." / "...does not have any installed themes."), but neither method had any test coverage at all, so nothing guards that wording today.
test_get_test_plugin_version_with_no_active_plugins— setsactive_pluginsto an empty array and asserts the description contains the zero-plugins message.test_get_test_theme_version_with_no_installed_themes— temporarily points$wp_theme_directoriesat an empty list (clearing the themes cache, same pattern used inTests_Theme_ThemeDir) sowp_get_themes()returns no themes, then asserts both thegoodstatus and the zero-themes message.
Test-only change: this PR adds no production behaviour — git diff trunk touches only tests/phpunit/tests/admin/wpSiteHealth.php. Each new test was verified to fail when the corresponding message string in src/wp-admin/includes/class-wp-site-health.php is altered, then verified to pass again once reverted.
This is a follow-up to [53816] (and its coding-standards follow-up [53817]), which already fixed and closed this ticket — these tests just add the missing coverage.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Picking the ticket, reading the existing fix and surrounding code to determine the exact untested branches, writing the two test methods, and running the red/green verification loop. I reviewed the diff and test output before opening this PR.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request.
🤖 Generated with Claude Code
@lancewillett commented on PR #13960:
2 weeks ago
#15
PR #13960 landed in https://core.trac.wordpress.org/changeset/65103
I wonder if:Your site does not have any installed themes.might be better as:
Your site does not have any themes installed.The latter reads a little more natural to me, though it's a minor thing that I'm not precious about.Nevermind - Just realised this would create a discrepancy with the other strings used.
The patch looks good to me! Adding
needs-testing.@Presskopp or @SergeyBiryukov, could you add some testing instructions and the
has-testing-infokeyword for the Test Team?