Site Health: Improve wording for PHP update warning.

Props danieltj, garrett-eclipse, marybaum, afragen, chetan200891.
Fixes #47644.
Built from https://develop.svn.wordpress.org/trunk@46267


git-svn-id: http://core.svn.wordpress.org/trunk@46079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-23 19:39:58 +00:00
parent 571b0e8a00
commit 9510aaecde
2 changed files with 24 additions and 8 deletions

View File

@ -260,7 +260,7 @@ class WP_Site_Health {
$result['status'] = 'good'; $result['status'] = 'good';
$result['label'] = sprintf( $result['label'] = sprintf(
/* translators: %s: The current version of WordPress installed on this site. */ /* translators: %s: The current version of WordPress installed on this site. */
__( 'Your WordPress version is up to date (%s)' ), __( 'Your version of WordPress (%s) is up to date' ),
$core_current_version $core_current_version
); );
@ -654,7 +654,7 @@ class WP_Site_Health {
$result = array( $result = array(
'label' => sprintf( 'label' => sprintf(
/* translators: %s: The current PHP version. */ /* translators: %s: The current PHP version. */
__( 'PHP is up to date (%s)' ), __( 'Your version of PHP (%s) is up to date' ),
PHP_VERSION PHP_VERSION
), ),
'status' => 'good', 'status' => 'good',
@ -664,7 +664,11 @@ class WP_Site_Health {
), ),
'description' => sprintf( 'description' => sprintf(
'<p>%s</p>', '<p>%s</p>',
__( 'PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site&#8217;s performance.' ) sprintf(
/* translators: %s: The minimum recommended PHP version. */
__( 'PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are faster and more secure, so staying up to date will help your site&#8217;s overall performance and security. The minimum recommended version of PHP is %s.' ),
$response['recommended_version']
)
), ),
'actions' => sprintf( 'actions' => sprintf(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>', '<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
@ -681,9 +685,13 @@ class WP_Site_Health {
return $result; return $result;
} }
// The PHP version is older than the recommended version, but still acceptable. // The PHP version is older than the recommended version, but still receiving active support.
if ( $response['is_supported'] ) { if ( $response['is_supported'] ) {
$result['label'] = __( 'We recommend that you update PHP' ); $result['label'] = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your version of PHP (%s) is out of date' ),
PHP_VERSION
);
$result['status'] = 'recommended'; $result['status'] = 'recommended';
return $result; return $result;
@ -691,14 +699,22 @@ class WP_Site_Health {
// The PHP version is only receiving security fixes. // The PHP version is only receiving security fixes.
if ( $response['is_secure'] ) { if ( $response['is_secure'] ) {
$result['label'] = __( 'Your PHP version should be updated' ); $result['label'] = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your version of PHP (%s) should be updated' ),
PHP_VERSION
);
$result['status'] = 'recommended'; $result['status'] = 'recommended';
return $result; return $result;
} }
// Anything no longer secure must be updated. // Anything no longer secure must be updated.
$result['label'] = __( 'Your PHP version requires an update' ); $result['label'] = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your version of PHP (%s) requires an update' ),
PHP_VERSION
);
$result['status'] = 'critical'; $result['status'] = 'critical';
$result['badge']['label'] = __( 'Security' ); $result['badge']['label'] = __( 'Security' );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-46266'; $wp_version = '5.3-alpha-46267';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.