2026-02-05 17:08:59 +03:00

28 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Class OnecomCheckSsl
*/
class OnecomCheckSsl extends OnecomHealthMonitor {
public function oc_sh_check_ssl() {
$this->log_entry( 'Checking if SSL enabled' );
$url = str_replace( 'http://', 'https://', get_site_url() );
$headers = $this->get_curl_header( $url );
if ( empty( $headers ) ) {
$status = $this->flag_open;
$guide_link = sprintf( "<a href='https://www.one.com/%s/chat' target='_blank'>", onecom_generic_locale_link( '', get_locale(), 1 ) );
$title = __( 'SSL certificate', 'onecom-wp' );
$desc = sprintf( __( 'Your site isnt using HTTPS. Visitors on your site might get a warning that your website isnt secure and it can also have a negative effect on your SEO rating. %sContact support%s', 'onecom-wp' ), $guide_link, '</a>' );
} else {
$status = $this->flag_resolved;
$desc = '';
$title = __( 'Your site has valid SSL certificate!', 'onecom-wp' );
}
$this->log_entry( 'Finished checking for SSL' );
//@todo oc_sh_save_result( 'ssl_certificate', $result[ $this->status_key ] );
return $this->format_result( $status, $title, $desc );
}
}