Skip to content

Conversation

@pbearne
Copy link

@pbearne pbearne commented Sep 13, 2024

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.

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

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.
@github-actions
Copy link

github-actions bot commented Sep 13, 2024

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @pbearne@git.wordpress.org.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Props pbearne, westonruter, mukesh27, joemcgill, peterwilsoncc.

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

@github-actions
Copy link

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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • 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.

@mukeshpanchal27
Copy link
Member

@joemcgill @SergeyBiryukov Could you please take a look when you have moment so we can commit it before RC.

Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close, but I'm not sure this is quite right yet. My main concern is that the feedback if the wp_check_php_version() fails is not that helpful to most folks. Instead, I think we can share the current server info, but avoid giving any info about the recommended version, since it couldn't be determined and then return early before doing the other checks.

I've left some suggestions inline.

pbearne and others added 3 commits October 16, 2024 17:29
Co-authored-by: Joe McGill <801097+joemcgill@users.noreply.github.com>
The error message about communication with WordPress.org was unnecessary and has been removed. This simplifies the code and ensures clearer messaging during health checks.
@pbearne pbearne requested a review from joemcgill May 27, 2025 17:32
pbearne and others added 3 commits October 21, 2025 09:00
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
…into 61623-don't-dispaly-good-if-call-to-wp.org-failed
@westonruter
Copy link
Member

@joemcgill Do you feel your feedback has been addressed?

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing without been able to connect to the WordPress API, I noticed that a passing request to the API does not show the recommended version of WP.

Site health screen showing a warning unable to connect to WordPress.org and the PHP section finishing with The minimum recommended version of PHP is . 9ie, without showing the version)

pbearne and others added 3 commits October 30, 2025 16:58
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
@westonruter
Copy link
Member

@pbearne It looks like the last feedback is addressing what Peter found in #7350 (review)

/* translators: %s: The minimum recommended PHP version. */
__( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site&#8217;s performance. The minimum recommended version of PHP is %s.' ),
$response ? $response['recommended_version'] : ''
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the The minimum recommended version of PHP is %s. part of this string should be removed so that this becomes instead:

Suggested change
__( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site&#8217;s performance.' )

Then below, the description can be appended with the current version.

Co-authored-by: Weston Ruter <westonruter@gmail.com>
@westonruter
Copy link
Member

While testing without been able to connect to the WordPress API, I noticed that a passing request to the API does not show the recommended version of WP.

@peterwilsoncc Now it shows as:

image

@westonruter
Copy link
Member

When wp_check_php_version() returns:

array(
	'recommended_version' => '10.0.0',
	'minimum_version'     => '9.0.0',
	'is_supported'        => false,
	'is_secure'           => false,
	'is_acceptable'       => false,
)
image

When:

$response = array(
	'recommended_version' => '10.0.0',
	'minimum_version'     => '8.0.0',
	'is_supported'        => true,
	'is_secure'           => true,
	'is_acceptable'       => true,
);
image

When:

$response = array(
	'recommended_version' => '8.0.0',
	'minimum_version'     => '7.2.0',
	'is_supported'        => true,
	'is_secure'           => true,
	'is_acceptable'       => true,
);
image

pento pushed a commit that referenced this pull request Nov 4, 2025
Previously, the status could be misleading, especially if the check against the WordPress.org API failed. The initial status message is now more neutral, and a dedicated check has been added to handle cases where the API is unreachable.

Developed in #7350

Follow-up to [58832].

Props pbearne, joemcgill, mukesh27, peterwilsoncc, swb1192, krupajnanda, psykro, SergeyBiryukov, swissspidy, imranhasanraaz, amin7, flixos90, vgnavada, audrasjb, adamsilverstein, Presskopp, westonruter.
Fixes #61623.


git-svn-id: https://develop.svn.wordpress.org/trunk@61123 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61123
GitHub commit: 9f3e07c

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Nov 4, 2025
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Nov 4, 2025
Previously, the status could be misleading, especially if the check against the WordPress.org API failed. The initial status message is now more neutral, and a dedicated check has been added to handle cases where the API is unreachable.

Developed in WordPress/wordpress-develop#7350

Follow-up to [58832].

Props pbearne, joemcgill, mukesh27, peterwilsoncc, swb1192, krupajnanda, psykro, SergeyBiryukov, swissspidy, imranhasanraaz, amin7, flixos90, vgnavada, audrasjb, adamsilverstein, Presskopp, westonruter.
Fixes #61623.

Built from https://develop.svn.wordpress.org/trunk@61123


git-svn-id: http://core.svn.wordpress.org/trunk@60459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to gilzow/wordpress-performance that referenced this pull request Nov 4, 2025
Previously, the status could be misleading, especially if the check against the WordPress.org API failed. The initial status message is now more neutral, and a dedicated check has been added to handle cases where the API is unreachable.

Developed in WordPress/wordpress-develop#7350

Follow-up to [58832].

Props pbearne, joemcgill, mukesh27, peterwilsoncc, swb1192, krupajnanda, psykro, SergeyBiryukov, swissspidy, imranhasanraaz, amin7, flixos90, vgnavada, audrasjb, adamsilverstein, Presskopp, westonruter.
Fixes #61623.

Built from https://develop.svn.wordpress.org/trunk@61123


git-svn-id: https://core.svn.wordpress.org/trunk@60459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

5 participants