Make WordPress Core

Changeset 47628


Ignore:
Timestamp:
04/27/2020 09:59:10 PM (4 years 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.
Fixes #49943.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r47585 r47628  
    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            ),
     
    23352335
    23362336                if ( ! is_wp_error( $result_fetch ) ) {
    2337                     $results[] = json_decode( wp_remote_retrieve_body( $result_fetch ) );
     2337                    $result = json_decode( wp_remote_retrieve_body( $result_fetch ), true );
     2338                } else {
     2339                    $result = false;
     2340                }
     2341
     2342                if ( is_array( $result ) ) {
     2343                    $results[] = $result;
    23382344                } else {
    23392345                    $results[] = array(
Note: See TracChangeset for help on using the changeset viewer.