Opened 6 months ago
Last modified 3 months ago
#61623 assigned defect (bug)
Site Health PHP check shows inaccurate status
Reported by: | swb1192 | Owned by: | pbearne |
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | 6.5.5 |
Component: | Site Health | Keywords: | has-patch has-screenshots |
Focuses: | administration, performance | Cc: |
Description
Site Health has a PHP check that returns a string related to the status of the PHP version. It should state if the PHP version is the latest version, an older (but supported) PHP version, or an older and insecure PHP version.
However, the current result states all supported versions are the "current version" of PHP.
To reproduce:
- Set up a WordPress installation
- Configure PHP as version 7.4 (supported but insecure and not the latest version)
- Go to Tools > Site Health
- View the Passed Tests
See:
"Your site is running the current version of PHP (7.4.30)"
Expected:
"Your site is running on an outdated version of PHP 7.4, which does not receive security updates. It should be updated."
Attachments (3)
Change History (30)
#1
@
6 months ago
- Keywords close added
This happens because PHP 7.4 is still the recommended version, so this is expected. See https://github.com/WordPress/wordpress-develop/blob/9cff1de6b3adcf8767bfc60c4e71b5cce81f0e1b/src/wp-admin/includes/class-wp-site-health.php#L758-L761
#2
@
6 months ago
- Keywords close removed
@swissspidy Please re-open this ticket. The issue is not about whether PHP 7.4 is supported or not. The issue is that it says 7.4 is the current version of PHP. It may be recommended, but it's not the current version of PHP.
#3
@
6 months ago
I didn't close the ticket. It is still open, the close
just says closing is suggested.
#4
@
6 months ago
Got it, thank you. I can adjust the ticket copy if the intent or issue was unclear.
This ticket was mentioned in PR #7011 on WordPress/wordpress-develop by @psykro.
6 months ago
#5
- Keywords has-patch added
Updates the Site Health PHP check message to correctly refer to the currently recommended version of PHP, not the current version of PHP
Trac ticket: https://core.trac.wordpress.org/ticket/61623
#6
@
6 months ago
Looking at the code, the text needs to match any version of PHP that is equal to or greater than the recommended version.
So instead of
Your site is running the current version of PHP
It could say
Your site is running at least the minimum recommended version of PHP
This way, if the PHP version exceeds whatever the current recommended version is, the wording still makes sense.
#7
follow-up:
↓ 19
@
6 months ago
- Focuses performance added
- Milestone changed from Awaiting Review to Future Release
I think clarifying the wording for this health check makes sense. What doesn't make sense is that we are showing this success message also when wp_check_php_version()
returns false
due to an error validating the /core/serve-happy
API response. We could consider changing that behavior as part of this ticket but shouldn't be blocking.
I'm also tagging for the performance
focus given that this is labeled as a performance check.
#8
follow-up:
↓ 12
@
6 months ago
@psykro Thanks for the patch. Perhaps better wording could be:
Your site is running a recommended version of PHP.
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
6 months ago
#11
@
6 months ago
- Milestone changed from Future Release to 6.7
Hi there!
This ticket was discussed on today's performance bug scrub.
The next step should be update site health copy text.
Move in to 6.7
for visibility.
Additional props: @swissspidy @joemcgill
#12
in reply to:
↑ 8
@
6 months ago
- Owner set to psykro
- Status changed from new to accepted
Replying to swb1192:
@psykro Thanks for the patch. Perhaps better wording could be:
Your site is running a recommended version of PHP.
Yup, you're probably right, I'll update the patch.
@SergeyBiryukov commented on PR #7011:
6 months ago
#14
Thanks for the PR! Merged in r58832.
#16
@
4 months ago
I have tested the patch.
Test Report
Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/7011.diff
Steps to Test ( As per description)
Set up a WordPress installation
Configure PHP as version 7.4 (supported but insecure and not the latest version)
Go to Tools > Site Health
View the Passed Tests
Environment
WordPress:6.6.1
Browser: Firefox 128.0
PHP: 7.4.3
Theme: TT4
Plugins: none
Before patch
Check the screenshot: https://d.pr/i/5ENYFo
After patch
Check the screenshot https://d.pr/i/KI4zYY
Results
The patch is working as suggested
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
4 months ago
This ticket was mentioned in PR #7350 on WordPress/wordpress-develop by @pbearne.
4 months ago
#18
Refactor the logic for setting the PHP version label and status in the site health check. Adds a condition to handle failures in obtaining the recommended PHP version from WordPress.org, updating the label and description accordingly.
#19
in reply to:
↑ 7
@
4 months ago
- Keywords good-first-bug removed
- Owner changed from psykro to pbearne
- Status changed from accepted to assigned
Replying to joemcgill:
I think clarifying the wording for this health check makes sense. What doesn't make sense is that we are showing this success message also when
wp_check_php_version()
returnsfalse
due to an error validating the/core/serve-happy
API response. We could consider changing that behavior as part of this ticket but shouldn't be blocking.
I'm also tagging for the
performance
focus given that this is labeled as a performance check.
I have added patch to adjust eh message if the call to wp.org fails
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
3 months ago
@mukesh27 commented on PR #7350:
3 months ago
#21
@joemcgill @SergeyBiryukov Could you please take a look when you have moment so we can commit it before RC.
#22
@
3 months ago
- Keywords has-screenshots added
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/7350
Environment
- WordPress: 6.7-alpha-58576-src
- PHP: 8.2.15
- Server: nginx/1.25.3
- Database: mysqli (Server: 8.0.36 / Client: mysqlnd 8.2.15)
- Browser: Chrome 129.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Four 1.2
- MU Plugins:
- Safe Autoloaded Options Limit Test (MU Plugin) 1.0
- Plugins:
- Test Reports 1.1.0
Expected Results
Text should be updated to : "Your site is running a recommended version of PHP (%s)"
Actual Results
Text is updated after the patch is applied. ✅
Supplemental Artifacts
Add as Attachment
#23
@
3 months ago
@pbearne I am not sure how can I test this scenario:
Your site is running PHP Version (%s) but the call to get the recommended version failed.
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
3 months ago
#25
@
3 months ago
@SergeyBiryukov @joemcgill Are either of you able to take a quick look at the follow up PR and see if it addresses comment 7
screenshot running php 7.4