$key ] ), 'ait_aipseo_dismiss_' . $key ); } public function handle_dismiss() { if ( empty( $_GET['ait_aipseo_dismiss'] ) ) { return; } $key = sanitize_key( (string) $_GET['ait_aipseo_dismiss'] ); if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'ait_aipseo_dismiss_' . $key ) ) { return; } update_user_meta( get_current_user_id(), 'ait_aipseo_dismiss_' . $key, 1 ); } public function maybe_show_notices() { if ( ! current_user_can( 'manage_options' ) ) { return; } $screen = get_current_screen(); if ( ! $screen ) { return; } if ( ! isset($screen->id) || strpos($screen->id, 'ai-powered-seo_page_ait-aipseo-settings' ) === false ) { return; } // License upsell/activation notice $license = get_option( 'ait_aipseo_license', [] ); $status = isset( $license['license_status'] ) ? (string) $license['license_status'] : 'inactive'; $is_pro = (bool) apply_filters('ait_aipseo/can_pro', false); if ( 'valid' !== $status && ! $this->is_dismissed( 'license' ) ) { $this->notice( 'license', sprintf( /* translators: %s: settings url */ __( 'Activate your license to unlock AI meta generation, semantic keywords, schema assistant, and reports. %s', 'ai-powered-seo-suggestions' ), '' . esc_html__( 'Open Dashboard', 'ai-powered-seo-suggestions' ) . '' ), 'info' ); } // Compatibility nudge (Yoast/Rank Math/SEOPress/AIOSEO) $has_seo = defined( 'WPSEO_VERSION' ) || defined( 'RANK_MATH_VERSION' ) || defined( 'SEOPRESS_VERSION' ) || defined( 'AIOSEO_VERSION' ); if ( ! $has_seo && ! $this->is_dismissed( 'compat' ) ) { $this->notice( 'compat', __( 'For best results, use this plugin alongside a core SEO plugin (Yoast, Rank Math, All in One SEO, or SEOPress).', 'ai-powered-seo-suggestions' ) . ' ' . esc_html__( 'Browse SEO Plugins', 'ai-powered-seo-suggestions' ) . '', 'warning' ); } // Until midnight Nov 23rd, 2025 if ( ! $is_pro && time() < 1763960340 ) { echo '
' . esc_html__( 'Use the code early_adopter_pro to get a free 1-year pro license as a thank you for being an early adopter. Expires November 23rd, 2025.', 'ai-powered-seo-suggestions' ) . '
'; echo '' . wp_kses_post( $message ) . '
'; echo '' . esc_html__( 'Dismiss', 'ai-powered-seo-suggestions' ) . '
'; echo '