' . esc_html__( 'Dismiss', 'litespeed-cache' ) . '' . '
'; } echo wp_kses_post( $msg ); } } if ( empty( $_GET['page'] ) || 0 !== strpos( sanitize_text_field( wp_unslash( $_GET['page'] ) ), 'litespeed' ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended global $pagenow; if ( 'plugins.php' !== $pagenow ) { return; } } if ( ! $this->conf( self::O_NEWS ) ) { return; } // Show promo from cloud Cloud::cls()->show_promo(); /** * Check promo msg first * * @since 2.9 */ GUI::cls()->show_promo(); // Show version news Cloud::cls()->news(); } /** * Dismiss pinned msg. * * @since 3.5.2 * @return void */ public static function dismiss_pin() { if ( ! isset( $_GET['msgid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return; } $messages = self::get_option( self::DB_MSG_PIN, array() ); $msgid = sanitize_text_field( wp_unslash( $_GET['msgid'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! is_array( $messages ) || empty( $messages[ $msgid ] ) ) { return; } unset( $messages[ $msgid ] ); if ( ! $messages ) { $messages = -1; } self::update_option( self::DB_MSG_PIN, $messages ); } /** * Dismiss pinned msg by msg content. * * @since 7.0 * * @param string $content Message content. * @param string $color Color CSS class. * @param bool $irremovable Is irremovable. * @return void */ public static function dismiss_pin_by_content( $content, $color, $irremovable ) { $content = self::build_notice( $color, $content, $irremovable ); $messages = self::get_option( self::DB_MSG_PIN, array() ); $hit = false; if ( -1 !== $messages ) { foreach ( $messages as $k => $v ) { if ( $v === $content ) { unset( $messages[ $k ] ); $hit = true; self::debug( '✅ pinned msg content hit. Removed' ); break; } } } if ( $hit ) { if ( ! $messages ) { $messages = -1; } self::update_option( self::DB_MSG_PIN, $messages ); } else { self::debug( '❌ No pinned msg content hit' ); } } /** * Hooked to the in_widget_form action. * Appends LiteSpeed Cache settings to the widget edit settings screen. * This will append the esi on/off selector and ttl text. * * @since 1.1.0 * * @param \WP_Widget $widget The widget instance (passed by reference). * @param mixed $return_val Return param (unused). * @param array $instance The widget instance's settings. * @return void */ public function show_widget_edit( $widget, $return_val, $instance ) { require LSCWP_DIR . 'tpl/esi_widget_edit.php'; } /** * Outputs a notice when the plugin is installed via WHM. * * @since 1.0.12 * @return void */ public function show_display_installed() { require_once LSCWP_DIR . 'tpl/inc/show_display_installed.php'; } /** * Display error cookie msg. * * @since 1.0.12 * @return void */ public static function show_error_cookie() { require_once LSCWP_DIR . 'tpl/inc/show_error_cookie.php'; } /** * Display warning if lscache is disabled. * * @since 2.1 * @return void */ public function cache_disabled_warning() { include LSCWP_DIR . 'tpl/inc/check_cache_disabled.php'; } /** * Display conf data upgrading banner. * * @since 2.1 * @access private * @return void */ private function _in_upgrading() { include LSCWP_DIR . 'tpl/inc/in_upgrading.php'; } /** * Output LiteSpeed form open tag and hidden fields. * * @since 3.0 * * @param string|false $action Router action. * @param string|false $type Router type. * @param bool $has_upload Whether form has file uploads. * @return void */ public function form_action( $action = false, $type = false, $has_upload = false ) { if ( ! $action ) { $action = Router::ACTION_SAVE_SETTINGS; } if ( ! defined( 'LITESPEED_CONF_LOADED' ) ) { echo '