WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

WP_Site_Health::get_test_https_status() public WP 5.2.0

Test if your site is serving content over HTTPS.

Many sites have varying degrees of HTTPS support, the most common of which is sites that have it enabled, but only if you visit the right site address.

Это метод класса: WP_Site_Health{}

Хуков нет.

Возвращает

Массив. The test results.

Использование

$WP_Site_Health = new WP_Site_Health();
$WP_Site_Health->get_test_https_status();

Список изменений

С версии 5.2.0 Введена.

Код WP_Site_Health::get_test_https_status() WP 5.5.1

wp-admin/includes/class-wp-site-health.php
<?php
public function get_test_https_status() {
	$result = array(
		'label'       => __( 'Your website is using an active HTTPS connection.' ),
		'status'      => 'good',
		'badge'       => array(
			'label' => __( 'Security' ),
			'color' => 'blue',
		),
		'description' => sprintf(
			'<p>%s</p>',
			__( 'An HTTPS connection is a more secure way of browsing the web. Many services now have HTTPS as a requirement. HTTPS allows you to take advantage of new features that can increase site speed, improve search rankings, and gain the trust of your visitors by helping to protect their online privacy.' )
		),
		'actions'     => sprintf(
			'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s <span class="screen-reader-text">%s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
			/* translators: Documentation explaining HTTPS and why it should be used. */
			esc_url( __( 'https://wordpress.org/support/article/why-should-i-use-https/' ) ),
			__( 'Learn more about why you should use HTTPS' ),
			/* translators: Accessibility text. */
			__( '(opens in a new tab)' )
		),
		'test'        => 'https_status',
	);

	if ( is_ssl() ) {
		$wp_url   = get_bloginfo( 'wpurl' );
		$site_url = get_bloginfo( 'url' );

		if ( 'https' !== substr( $wp_url, 0, 5 ) || 'https' !== substr( $site_url, 0, 5 ) ) {
			$result['status'] = 'recommended';

			$result['label'] = __( 'Only parts of your site are using HTTPS' );

			$result['description'] = sprintf(
				'<p>%s</p>',
				sprintf(
					/* translators: %s: URL to General Settings screen. */
					__( 'You are accessing this website using HTTPS, but your <a href="%s">WordPress Address</a> is not set up to use HTTPS by default.' ),
					esc_url( admin_url( 'options-general.php' ) )
				)
			);

			$result['actions'] .= sprintf(
				'<p><a href="%s">%s</a></p>',
				esc_url( admin_url( 'options-general.php' ) ),
				__( 'Update your site addresses' )
			);
		}
	} else {
		$result['status'] = 'recommended';

		$result['label'] = __( 'Your site does not use HTTPS' );
	}

	return $result;
}