Skip to content

Commit

Permalink
Site Health: Update php update strings to not overpromise performance.
Browse files Browse the repository at this point in the history
Fixes #52327.

Props chanthaboune, SergeyBiryukov, audrasjb, Clorith, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@50041 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
whyisjake committed Jan 28, 2021
1 parent 7447e21 commit 8bfe823
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public function get_test_php_version() {
'<p>%s</p>',
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.' ),
__( 'PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are created with increased performance in mind, so you may see a positive effect on your site&#8217;s performance. The minimum recommended version of PHP is %s.' ),
$response ? $response['recommended_version'] : ''
)
),
Expand Down
25 changes: 20 additions & 5 deletions src/wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function wp_dashboard_setup() {
$response = wp_check_php_version();
if ( $response && isset( $response['is_acceptable'] ) && ! $response['is_acceptable'] && current_user_can( 'update_php' ) ) {
add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );
wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' );
wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' );
}

// Site Health.
Expand Down Expand Up @@ -1747,16 +1747,31 @@ function wp_dashboard_php_nag() {
}

if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
$msg = __( 'WordPress has detected that your site is running on an insecure version of PHP.' );
$msg = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your site is running an insecure version of PHP (%s), and should be updated.' ),
PHP_VERSION
);
} else {
$msg = __( 'WordPress has detected that your site is running on an outdated version of PHP.' );
$msg = sprintf(
/* translators: %s: The server PHP version. */
__( 'Your site is running an outdated version of PHP (%s), and should be updated.' ),
PHP_VERSION
);
}

?>
<p><?php echo $msg; ?></p>

<h3><?php _e( 'What is PHP and how does it affect my site?' ); ?></h3>
<p><?php _e( '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.' ); ?></p>
<p>
<?php
printf(
/* translators: %s: The minimum recommended PHP version. */
__( 'PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are created with increased performance in mind, so you may see a positive effect on your site&#8217;s performance. The minimum recommended version of PHP is %s.' ),
$response ? $response['recommended_version'] : ''
);
?>
</p>

<p class="button-container">
<?php
Expand Down

0 comments on commit 8bfe823

Please sign in to comment.