WordPress.org

Make WordPress Core

Changeset 47931


Ignore:
Timestamp:
06/09/2020 11:25:53 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Site Health: Avoid a PHP notice in WP_Site_Health::wp_cron_scheduled_check() if async test response does not contain the expected result.

Additionally, avoid a PHP notice in ::get_test_php_version() if the minimum recommended version of PHP could not be determined.

Props schlessera, oakesjosh.
Merges [47628] to the 5.4 branch.
Fixes #49943.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/src/wp-admin/includes/class-wp-site-health.php

    r47466 r47931  
    720720                    /* translators: %s: The minimum recommended PHP version. */
    721721                    __( '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’s overall performance and security. The minimum recommended version of PHP is %s.' ),
    722                     $response['recommended_version']
     722                    $response ? $response['recommended_version'] : ''
    723723                )
    724724            ),
     
    22902290
    22912291                if ( ! is_wp_error( $result_fetch ) ) {
    2292                     $results[] = json_decode( wp_remote_retrieve_body( $result_fetch ) );
     2292                    $result = json_decode( wp_remote_retrieve_body( $result_fetch ), true );
     2293                } else {
     2294                    $result = false;
     2295                }
     2296
     2297                if ( is_array( $result ) ) {
     2298                    $results[] = $result;
    22932299                } else {
    22942300                    $results[] = array(
Note: See TracChangeset for help on using the changeset viewer.