Site Health: Add description for a successful HTTPS check.

Props Clorith, xkon.
Fixes #46617.

git-svn-id: https://develop.svn.wordpress.org/trunk@45052 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-03-28 16:14:03 +00:00
parent 6f5651a9e4
commit aae789324f

View File

@ -1202,14 +1202,24 @@ class WP_Site_Health {
*/ */
public function get_test_https_status() { public function get_test_https_status() {
$result = array( $result = array(
'label' => '', 'label' => __( 'Your website is using an active HTTPS connection.' ),
'status' => '', 'status' => 'good',
'badge' => array( 'badge' => array(
'label' => 'Security', 'label' => 'Security',
'color' => 'red', 'color' => 'red',
), ),
'description' => '', 'description' => sprintf(
'actions' => '', '<p>%s</p>',
__( 'An HTTPS connection is needed for many features on the web today, it also gains the trust of your visitors by helping to protecting their online privacy.' )
),
'actions' => sprintf(
'<p><a href="%s">%s</a></p>',
esc_url(
/* translators: Website for explaining HTTPS and why it should be used. */
__( 'https://wordpress.org/support/article/why-should-i-use-https/' )
),
__( 'Read more about why you should use HTTPS' )
),
'test' => 'https_status', 'test' => 'https_status',
); );
@ -1231,34 +1241,16 @@ class WP_Site_Health {
) )
); );
$result['actions'] = sprintf( $result['actions'] .= sprintf(
'<a href="%s">%s</a>', '<p><a href="%s">%s</a></p>',
esc_url( admin_url( 'options-general.php' ) ), esc_url( admin_url( 'options-general.php' ) ),
__( 'Update your site addresses' ) __( 'Update your site addresses' )
); );
} else {
$result['status'] = 'good';
$result['label'] = __( 'Your website is using an active HTTPS connection.' );
} }
} else { } else {
$result['status'] = 'recommended'; $result['status'] = 'recommended';
$result['label'] = __( 'Your site does not use HTTPS' ); $result['label'] = __( 'Your site does not use HTTPS' );
$result['description'] = sprintf(
'<p>%s</p>',
__( 'An HTTPS connection is needed for many features on the web today, it also gains the trust of your visitors by helping to protecting their online privacy.' )
);
$result['actions'] = sprintf(
'<a href="%s">%s</a>',
esc_url(
/* translators: Website for explaining HTTPS and why it should be used. */
__( 'https://wordpress.org/support/article/why-should-i-use-https/' )
),
__( 'Read more about why you should use HTTPS.' )
);
} }
return $result; return $result;