Make WordPress Core


Ignore:
Timestamp:
09/22/2023 07:06:45 PM (18 months ago)
Author:
adamsilverstein
Message:

Security: remove the cron event that checked for https support.

Fix an issue where a cron job ran every 12 hours to check for https support - even when https support was already enabled. The check is now run only when the user visits the Site Health page. Reducing the unneeded requests lowers the impact and load of hosting WordPress sites.

The wp_update_https_detection_errors function is deprecated and the https_detection_errors option that was previously set by the cron job is no longer maintained. The pre_wp_update_https_detection_errors filter is deprecated and replaced by the pre_wp_get_https_detection_errors filter which serves the same function.

Props audrasjb, johnbillion, Michi91.
Fixes #58494.

File:
1 edited

Legend:

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

    r56658 r56664  
    23412341        // Enable attachment pages.
    23422342        update_option( 'wp_attachment_pages_enabled', 1 );
     2343
     2344        // Remove the wp_https_detection cron. Https status is checked directly in an async Site Health check.
     2345        $scheduled = wp_get_scheduled_event( 'wp_https_detection' );
     2346        if ( $scheduled ) {
     2347            wp_clear_scheduled_hook( 'wp_https_detection' );
     2348        }
    23432349    }
    23442350}
Note: See TracChangeset for help on using the changeset viewer.