WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/23/2020 07:11:20 PM (3 weeks ago)
Author:
flixos90
Message:

Security, Site Health: Detect HTTPS support and encourage switching.

This changeset modifies the Site Health panel for HTTPS to provide more accurate recommendations based on whether the environment is already set up for HTTPS.

  • Introduces wp_is_using_https() to check whether the site is configured to use HTTPS (via its Site Address and WordPress Address).
  • Introduces wp_is_https_supported() to check whether the environment supports HTTPS. This relies on a cron job which periodically checks support using a loopback request.

Props Clorith, flixos90, miinasikk, westonruter.
Fixes #47577.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r49226 r49904  
    337337    add_action( 'init', 'wp_cron' );
    338338}
     339
     340// HTTPS detection.
     341add_action( 'init', 'wp_schedule_https_detection' );
     342add_action( 'wp_https_detection', 'wp_update_https_detection_errors' );
     343add_filter( 'cron_request', 'wp_cron_conditionally_prevent_sslverify', 9999 );
    339344
    340345// 2 Actions 2 Furious.
Note: See TracChangeset for help on using the changeset viewer.