Make WordPress Core


Ignore:
Timestamp:
09/14/2022 10:17:53 PM (3 years ago)
Author:
azaozz
Message:

Site health:

  • Add a check to wp_check_php_version() whether the current PHP version is lower than the next (desired) minimum version.
  • Set the next desired minimum PHP version to 7.2.
  • Use that check to update the warnings in the wp_dashboard_php_nag() widget, and on the Site Health screen.

Props Clorith, SergeyBiryukov, ironprogrammer, azaozz.
See #56199.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/misc.php

    r54122 r54169  
    15861586         *  'is_supported' - boolean - Whether the PHP version is actively supported.
    15871587         *  'is_secure' - boolean - Whether the PHP version receives security updates.
    1588          *  'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress.
     1588         *  'is_acceptable' - boolean - Whether the PHP version is still acceptable or warnings
     1589         *                              should be shown and an update recommended.
    15891590         */
    15901591        $response = json_decode( wp_remote_retrieve_body( $response ), true );
     
    16141615    }
    16151616
     1617    $response['is_lower_than_future_minimum'] = false;
     1618
     1619    // The minimum supported PHP version will be updated to 7.2. Check if the current version is lower.
     1620    if ( version_compare( $version, '7.2', '<' ) ) {
     1621        $response['is_lower_than_future_minimum'] = true;
     1622
     1623        // Force showing of warnings.
     1624        $response['is_acceptable'] = false;
     1625    }
     1626
    16161627    return $response;
    16171628}
Note: See TracChangeset for help on using the changeset viewer.