From f7d4ea3ceb99ae4d35fe4982f06ac65548706301 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 16 Dec 2024 14:08:24 +0000 Subject: [PATCH] Site Health: Remove use of deprecated function from `wp_is_https_supported()`. Follow up to [56664]. Props peter8nss, debarghyabanerjee, sebastienserre, geekofshire, swissspidy, desrosj. Fixes #62252. See #58494. Built from https://develop.svn.wordpress.org/trunk@59517 git-svn-id: http://core.svn.wordpress.org/trunk@58903 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/https-detection.php | 22 ++++++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/wp-includes/https-detection.php b/wp-includes/https-detection.php index f34d6a3a11..87fd4ad626 100644 --- a/wp-includes/https-detection.php +++ b/wp-includes/https-detection.php @@ -63,31 +63,33 @@ function wp_is_site_url_using_https() { /** * Checks whether HTTPS is supported for the server and domain. * + * This function makes an HTTP request through `wp_get_https_detection_errors()` + * to check for HTTPS support. As this process can be resource-intensive, + * it should be used cautiously, especially in performance-sensitive environments, + * to avoid potential latency issues. + * * @since 5.7.0 * * @return bool True if HTTPS is supported, false otherwise. */ function wp_is_https_supported() { - $https_detection_errors = get_option( 'https_detection_errors' ); + $https_detection_errors = wp_get_https_detection_errors(); - // If option has never been set by the Cron hook before, run it on-the-fly as fallback. - if ( false === $https_detection_errors ) { - wp_update_https_detection_errors(); - - $https_detection_errors = get_option( 'https_detection_errors' ); - } - - // If there are no detection errors, HTTPS is supported. + // If there are errors, HTTPS is not supported. return empty( $https_detection_errors ); } /** * Runs a remote HTTPS request to detect whether HTTPS supported, and stores potential errors. * - * This internal function is called by a regular Cron hook to ensure HTTPS support is detected and maintained. + * This function checks for HTTPS support by making an HTTP request. As this process can be resource-intensive, + * it should be used cautiously, especially in performance-sensitive environments. + * It is called when HTTPS support needs to be validated. * * @since 6.4.0 * @access private + * + * @return array An array containing potential detection errors related to HTTPS, or an empty array if no errors are found. */ function wp_get_https_detection_errors() { /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 318ee98780..c0f7d2c47c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59516'; +$wp_version = '6.8-alpha-59517'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.