Make WordPress Core

Ticket #47644: 47644.2.diff

File 47644.2.diff, 2.4 KB (added by danieltj, 5 years ago)

Proposed patch for PHP test.

  • wp-admin/includes/class-wp-site-health.php

    diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php
    index 12e1273..4bf9c0d 100644
    a b class WP_Site_Health { 
    639639                $result = array(
    640640                        'label'       => sprintf(
    641641                                // translators: %s: The current PHP version.
    642                                 __( 'PHP is up to date (%s)' ),
     642                                __( 'Your version of PHP is up to date (%s)' ),
    643643                                PHP_VERSION
    644644                        ),
    645645                        'status'      => 'good',
    class WP_Site_Health { 
    649649                        ),
    650650                        'description' => sprintf(
    651651                                '<p>%s</p>',
    652                                 __( '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.' )
     652                                sprintf(
     653                                        __( 'PHP is the programming language used to power WordPress. Newer versions of PHP are both faster and more secure, so staying up to date will have a positive effect on your site&#8217;s overall performance. The latest version of PHP is %s.' ),
     654                                        $response['recommended_version']
     655                                )
    653656                        ),
    654657                        'actions'     => sprintf(
    655658                                '<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>',
    class WP_Site_Health { 
    666669                        return $result;
    667670                }
    668671
    669                 // The PHP version is older than the recommended version, but still acceptable.
    670                 if ( $response['is_supported'] ) {
    671                         $result['label']  = __( 'We recommend that you update PHP' );
    672                         $result['status'] = 'recommended';
    673 
    674                         return $result;
    675                 }
    676 
    677                 // The PHP version is only receiving security fixes.
    678                 if ( $response['is_secure'] ) {
    679                         $result['label']  = __( 'Your PHP version should be updated' );
     672                // The PHP version is older than the recommended version but still recieving fixes.
     673                if ( $response['is_supported'] || $response['is_secure'] ) {
     674                        $result['label']  = sprintf( __( 'Your version of PHP should be updated (%s)' ), PHP_VERSION );
    680675                        $result['status'] = 'recommended';
    681676
    682677                        return $result;
    683678                }
    684679
    685680                // Anything no longer secure must be updated.
    686                 $result['label']          = __( 'Your PHP version requires an update' );
     681                $result['label']          = sprintf( __( 'Your version of PHP requires an update (%s)' ), PHP_VERSION );
    687682                $result['status']         = 'critical';
    688683                $result['badge']['label'] = __( 'Security' );
    689684