文件操作 - SettingsSSL.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/ionos-security/inc/Controllers/Settings/SettingsSSL.php
编辑文件内容
<?php namespace Ionos\Security\Controllers\Settings; use Ionos\SettingsPage\SettingsBuilder; use Ionos\SettingsPage\Elements\SectionHeader; use Exception; /** * Class Settings */ class SettingsSSL { /** * Tab name. * * @since 1.0.0 * @var string */ private $tab_name = 'ssl-check'; /** * Name of the menu slug that is used in WordPress. * * @since 1.0.0 * * @var string */ const MENU_SLUG = 'ionos_security'; /** * SettingsBuilder instance. * * @since 1.0.0 * @var SettingsBuilder */ private $settings_builder; /** * Builds the settings page. * * @since 1.0.0 */ public function __construct() { try { $this->settings_builder = new SettingsBuilder( 'ionos-security', esc_html__( 'Security', 'ionos-security' ), 'ionos_security' ); $this->settings_builder->register_assets(); $this->settings_builder->add_tab( $this->tab_name, esc_html__( 'SSL', 'ionos-security' ), [ 'showSubmitButton' => false ] ); $this->get_info(); $this->merge_with_base(); } catch ( Exception $e ) { wp_die( esc_html( $e->getMessage() ) ); } } /** * Adds information to the settings builder. * * @since 1.0.0 * @throws Exception If add_element does not find the tab. */ public function get_info() { $this->settings_builder->add_element( $this->tab_name, new SectionHeader( [ 'heading' => esc_html__( 'SSL', 'ionos-security' ), 'description' => $this->get_description(), 'kses_for_description' => [ 'strong' => [], 'p' => [], 'br' => [], 'a' => [ 'href' => [], 'target' => [], 'class' => [], 'id' => [], 'rel' => [], ], ], ] ) ); } /** * Merges the feature-specific settings builder with that of the main plugin one. * * @since 1.0.0 */ private function merge_with_base() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound apply_filters( self::MENU_SLUG . '_merge_settings_page', $this->settings_builder ); } /** * Registers the sanitize-callback. * Called by action 'admin_init' * * @since 1.0.0 */ public function register_settings() { $this->settings_builder->add_sanitize_callback( 'ionos-security' ); } /** * Renders the settings page. * * @since 1.0.0 */ public function render_options_page() { $this->settings_builder->render(); } /** * Returns the description for the settings page. * * @since 1.0.0 * @return string */ private function get_description() { $label = esc_html__( 'Current SSL-Status', 'ionos-security' ); if ( is_ssl() ) { $description = __( 'Your WordPress website is currently <strong>with SSL</strong>, which means that the connection between your website and users\' browsers is encrypted. We will warn you if your website should no longer have SSL.', 'ionos-security' ); $status = esc_html__( 'Secure', 'ionos-security' ); } else { $description = __( 'Your WordPress website is currently <strong>without SSL</strong>, which means that the connection between your website and users\' browsers is not encrypted. It is highly <strong>recommended to activate SSL</strong> to protect sensitive information and to provide a secure browsing.', 'ionos-security' ); $description .= sprintf( '<p><a href="%s" class="button" target="_blank">%s</a></p>', esc_url( __( 'https://ionos.com/help', 'ionos-security' ) ), esc_html__( 'Learn more about SSL and how to activate it.', 'ionos-security' ) ); $status = esc_html__( 'Insecure', 'ionos-security' ); } return sprintf( '<p><strong>%s</strong>: %s</p><p>%s</p>', $label, $status, $description ); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件