wp-admin/includes/class-wp-site-health.php:726Tests if the supplied PHP version is supported.
array public function get_test_php_version() { $response = wp_check_php_version(); $result = array( 'label' => sprintf( /* translators: %s: The server PHP version. */ __( 'Your site is running PHP %s' ), PHP_VERSION ), 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), 'color' => 'blue', ), 'description' => sprintf( '<p>%s</p>', __( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site’s performance.' ) ), 'actions' => sprintf( '<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), /* translators: Hidden accessibility text. */ __( '(opens in a new tab)' ) ), 'test' => 'php_version', ); if ( ! $response ) { $result['label'] = sprintf( /* translators: %s: The server PHP version. */ __( 'Unable to determine the status of the current PHP version (%s)' ), PHP_VERSION ); $result['status'] = 'recommended'; $result['description'] = '<p><em>' . sprintf( /* translators: %s is the URL to the Serve Happy docs page. */ __( 'Unable to access the WordPress.org API for <a href="%s">Serve Happy</a>.' ), 'https://codex.wordpress.org/WordPress.org_API#Serve_Happy' ) . '</em></p>' . $result['description']; return $result; } $result['description'] .= '<p>' . sprintf( /* translators: %s: The minimum recommended PHP version. */ __( 'The minimum recommended version of PHP is %s.' ), $response['recommended_version'] ) . '</p>'; // PHP is up to date. if ( version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) { $result['label'] = sprintf( /* translators: %s: The server PHP version. */ __( 'Your site is running a recommended version of PHP (%s)' ), PHP_VERSION ); $result['status'] = 'good'; return $result; } // The PHP version is older than the recommended version, but still receiving active support. if ( $response['is_supported'] ) { $result['label'] = sprintf( /* translators: %s: The server PHP version. */ __( 'Your site is running on an older version of PHP (%s)' ), PHP_VERSION ); $result['status'] = 'recommended'; return $result; } /* * The PHP version is still receiving security fixes, but is lower than * the expected minimum version that will be required by WordPress in the near future. */ if ( $response['is_secure'] && $response['is_lower_than_future_minimum'] ) { // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.Introduced in 5.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-admin/includes/class-wp-site-health.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.