id ) ) { return; } // Screen id for our submenu is `_page_guardpress-upgrade`. if ( strpos( $screen->id, 'guardpress-upgrade' ) === false ) { return; } $hooks = array( 'admin_notices', 'all_admin_notices', 'network_admin_notices', 'user_admin_notices' ); foreach ( $hooks as $hook ) { self::strip_foreign_callbacks_from_hook( $hook ); } } /** * Walk the registered callbacks on $hook and unset every one that is * not owned by GuardPress. Uses the global $wp_filter so we mutate the * exact array WordPress will iterate at fire time. */ private static function strip_foreign_callbacks_from_hook( $hook ) { global $wp_filter; if ( empty( $wp_filter[ $hook ] ) || empty( $wp_filter[ $hook ]->callbacks ) ) { return; } foreach ( $wp_filter[ $hook ]->callbacks as $priority => $callbacks ) { if ( ! is_array( $callbacks ) ) { continue; } foreach ( $callbacks as $key => $cb ) { if ( self::is_guardpress_callback( $cb['function'] ?? null ) ) { continue; } // ACG-149-R37-L (pre-submission review): NEVER SUPPRESS WORDPRESS CORE'S OWN NOTICES. // // This exists to stop third-party MARKETING banners wrecking the upgrade page's layout. // It was removing core's callbacks too — and the list matters: wp_recovery_mode_nag // ("your site is in recovery mode"), paused_plugins_notice / paused_themes_notice ("a // plugin was paused after a fatal error"), update_nag (a WordPress SECURITY update is // available), maintenance_nag, default_password_nag. A security plugin hiding "your site // is broken" or "you are running an outdated WordPress" behind its own sales page is // indefensible on its own terms, and it is the shape WordPress.org guideline 11 exists // to catch. Scoping it to one screen makes it rarer, not acceptable. // // The layout motive is preserved exactly: everything that is not ours and not core still // goes. Core's list is taken from wp-admin/includes/admin-filters.php, not from memory. if ( self::is_core_notice_callback( $cb['function'] ?? null ) ) { continue; } unset( $wp_filter[ $hook ]->callbacks[ $priority ][ $key ] ); } } } /** * ACG-149-R37-L — is this one of WordPress core's own admin notices? * * Verbatim from wp-admin/includes/admin-filters.php (WP 7.0): the callbacks core registers on * admin_notices / all_admin_notices / network_admin_notices / user_admin_notices. Read from the * source, not recalled. An unknown core notice added by a future release is not in this list and * would still be stripped — so the list is a floor, not a guarantee; it covers every notice that * tells the user their site is broken or out of date, which is the part that must never be hidden. */ private static function is_core_notice_callback( $cb ) { static $core = array( 'update_nag' => true, // a WordPress update — often a security release 'maintenance_nag' => true, 'wp_recovery_mode_nag' => true, // "your site is in recovery mode" 'paused_plugins_notice' => true, // a plugin fatally errored and was paused 'paused_themes_notice' => true, 'deactivated_plugins_notice' => true, 'default_password_nag' => true, // "you are still using the generated password" 'new_user_email_admin_notice'=> true, 'site_admin_notice' => true, ); if ( is_string( $cb ) ) { return isset( $core[ $cb ] ); } // array( 'WP_Privacy_Policy_Content', 'notice' ) and any other core class callback. if ( is_array( $cb ) && isset( $cb[0] ) ) { $class = is_object( $cb[0] ) ? get_class( $cb[0] ) : (string) $cb[0]; return ( 0 === strpos( $class, 'WP_' ) ); } return false; } /** Heuristic: does this callback belong to GuardPress? */ private static function is_guardpress_callback( $cb ) { if ( is_array( $cb ) && isset( $cb[0] ) ) { $class = is_object( $cb[0] ) ? get_class( $cb[0] ) : (string) $cb[0]; if ( stripos( $class, 'GuardPress' ) === 0 ) { return true; } if ( stripos( $class, 'GP_' ) === 0 ) { return true; } return false; } if ( is_string( $cb ) && $cb !== '' ) { if ( stripos( $cb, 'guardpress' ) !== false ) { return true; } if ( stripos( $cb, 'gp_' ) === 0 ) { return true; } return false; } // Closures, Invocables, etc. — treat as foreign. return false; } /** * Check if PRO is active (via license) */ private static function is_pro_active() { if ( class_exists( 'GuardPress_License' ) && GuardPress_License::is_pro() ) { return true; } return false; } public function register_pro_menu() { $menu_title = self::is_pro_active() ? __( '⭐ PRO Active', 'ai-cyberguard' ) : __( '⭐ Get Pro', 'ai-cyberguard' ); add_submenu_page( 'ai-cyberguard', __( 'AI CyberGuard PRO', 'ai-cyberguard' ), $menu_title, 'manage_options', 'guardpress-upgrade', array( $this, 'render_pro_page' ) ); } public function enqueue_pro_assets( $hook ) { if ( strpos( $hook, 'ai-cyberguard' ) === false ) { return; } wp_enqueue_style( 'guardpress-pro-css', GUARDPRESS_PLUGIN_URL . 'admin/css/pro.css', array(), defined('GUARDPRESS_VERSION') ? GUARDPRESS_VERSION : time() ); // Only show PRO banner for FREE users if ( ! self::is_pro_active() ) { wp_enqueue_script( 'guardpress-pro-ui-js', GUARDPRESS_PLUGIN_URL . 'admin/js/pro-ui.js', array(), defined('GUARDPRESS_VERSION') ? GUARDPRESS_VERSION : time(), true ); } } public function render_pro_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $is_pro = self::is_pro_active(); ?>

🛡️ AI CyberGuard PRO


🧠 ⚡ 🎯 🪶
⭐ →
✅

• ' . esc_html( ucfirst( $license['plan'] ) ) . '' ); // FIX (audit 2026-06-10): escape the dynamic plan value ?>

🔑

$179/year', '' . esc_html__( 'every feature below', 'ai-cyberguard' ) . '' ); ?>
 ·   ·   · 

↓

⭐ →

💳  ·  🔒

$179–299
$70–149
$99
$108
$149
$700+*
$179
⚡

*

👇

🚀

🆘

🧬

🤖

📞

🔁

🐦

🔮

🕵️

⏰

🧪

📋

✅

📦

🔗

🛡️

'🔥', 'bg' => '#fef3c7', 'title' => __( 'Web Application Firewall', 'ai-cyberguard' ), 'desc' => __( 'Block SQLi, XSS, LFI — with safe Monitor mode first', 'ai-cyberguard' ) ), array( 'icon' => '🌍', 'bg' => '#dbeafe', 'title' => __( 'Country Blocking', 'ai-cyberguard' ), 'desc' => __( 'Block traffic from specific countries', 'ai-cyberguard' ) ), array( 'icon' => '🔒', 'bg' => '#f3e8ff', 'title' => __( 'Two-Factor Auth (2FA)', 'ai-cyberguard' ), 'desc' => __( 'Google Authenticator + backup codes', 'ai-cyberguard' ) ), array( 'icon' => '🚫', 'bg' => '#fee2e2', 'title' => __( 'Brute Force Protection', 'ai-cyberguard' ), 'desc' => __( 'Block repeated login attempts', 'ai-cyberguard' ) ), array( 'icon' => '🔗', 'bg' => '#ecfdf5', 'title' => __( 'Hide Login URL', 'ai-cyberguard' ), 'desc' => __( 'Custom login page address', 'ai-cyberguard' ) ), array( 'icon' => '🤖', 'bg' => '#fef3c7', 'title' => __( 'CAPTCHA Integration', 'ai-cyberguard' ), 'desc' => __( 'reCAPTCHA, hCaptcha, Turnstile', 'ai-cyberguard' ) ), array( 'icon' => '🍯', 'bg' => '#fff7ed', 'title' => __( 'Honeypot Fields', 'ai-cyberguard' ), 'desc' => __( 'Invisible bot traps', 'ai-cyberguard' ) ), array( 'icon' => '📋', 'bg' => '#f0fdf4', 'title' => __( 'Security Headers', 'ai-cyberguard' ), 'desc' => __( 'CSP, X-Frame, HSTS headers', 'ai-cyberguard' ) ), array( 'icon' => '🛠️', 'bg' => '#e0f2fe', 'title' => __( 'Hardening Wizard', 'ai-cyberguard' ), 'desc' => __( 'Step-by-step security hardening', 'ai-cyberguard' ) ), array( 'icon' => '🔧', 'bg' => '#ecfdf5', 'title' => __( 'Self-Healing Core', 'ai-cyberguard' ), 'desc' => __( 'Auto-repair WordPress core files', 'ai-cyberguard' ) ), array( 'icon' => '🛡️', 'bg' => '#fef3c7', 'title' => __( 'Upload Scanner', 'ai-cyberguard' ), 'desc' => __( 'Block malicious file uploads', 'ai-cyberguard' ) ), array( 'icon' => '🔍', 'bg' => '#f3e8ff', 'title' => __( 'Login Anomaly Detection', 'ai-cyberguard' ), 'desc' => __( 'AI detects unusual login patterns', 'ai-cyberguard' ) ), array( 'icon' => '📡', 'bg' => '#dbeafe', 'title' => __( 'Live IP Threat Feed', 'ai-cyberguard' ), 'desc' => __( 'Auto-block known-malicious IPs from a live feed', 'ai-cyberguard' ) ), ); foreach ( $security_features as $f ) : ?>

🤖

'🧠', 'bg' => '#ede9fe', 'title' => __( '500 AI Analyses', 'ai-cyberguard' ), 'desc' => __( 'Deep code analysis per year', 'ai-cyberguard' ) ), array( 'icon' => '🔬', 'bg' => '#fce7f3', 'title' => __( 'Malware Detection', 'ai-cyberguard' ), 'desc' => __( 'AI identifies malicious code', 'ai-cyberguard' ) ), array( 'icon' => '💡', 'bg' => '#fef3c7', 'title' => __( 'AI Remediation', 'ai-cyberguard' ), 'desc' => __( 'Smart fix suggestions', 'ai-cyberguard' ) ), array( 'icon' => '📊', 'bg' => '#dbeafe', 'title' => __( 'Risk Classification', 'ai-cyberguard' ), 'desc' => __( 'Auto-classify threat levels', 'ai-cyberguard' ) ), array( 'icon' => '🤖', 'bg' => '#ecfdf5', 'title' => __( 'AI Security Assistant', 'ai-cyberguard' ), 'desc' => __( 'Chat with AI about security issues', 'ai-cyberguard' ) ), array( 'icon' => '📑', 'bg' => '#fff7ed', 'title' => __( 'AI Security Reports', 'ai-cyberguard' ), 'desc' => __( 'AI-generated security reports', 'ai-cyberguard' ) ), array( 'icon' => '🧬', 'bg' => '#f3e8ff', 'title' => __( 'Code DNA Fingerprinting', 'ai-cyberguard' ), 'desc' => __( 'Detect malware by code structure', 'ai-cyberguard' ) ), array( 'icon' => '🔮', 'bg' => '#fee2e2', 'title' => __( 'Predictive Threat Score', 'ai-cyberguard' ), 'desc' => __( 'AI predicts future threats', 'ai-cyberguard' ) ), ); foreach ( $ai_features as $f ) : ?>

📡

'👁️', 'bg' => '#ecfdf5', 'title' => __( 'Real-time Monitoring', 'ai-cyberguard' ), 'desc' => __( 'Instant file change detection', 'ai-cyberguard' ) ), array( 'icon' => '🗺️', 'bg' => '#fee2e2', 'title' => __( 'Live Attack Map', 'ai-cyberguard' ), 'desc' => __( 'Visual map of attack origins', 'ai-cyberguard' ) ), array( 'icon' => '🔔', 'bg' => '#fef3c7', 'title' => __( 'Toast Notifications', 'ai-cyberguard' ), 'desc' => __( 'Real-time popup alerts', 'ai-cyberguard' ) ), array( 'icon' => '📱', 'bg' => '#dbeafe', 'title' => __( 'SMS Alerts', 'ai-cyberguard' ), 'desc' => __( 'Twilio, Vonage, AWS SNS', 'ai-cyberguard' ) ), array( 'icon' => '💬', 'bg' => '#dcfce7', 'title' => __( 'WhatsApp Alerts', 'ai-cyberguard' ), 'desc' => __( 'Instant WhatsApp messages', 'ai-cyberguard' ) ), array( 'icon' => '✈️', 'bg' => '#e0f2fe', 'title' => __( 'Telegram Alerts', 'ai-cyberguard' ), 'desc' => __( 'Telegram bot notifications', 'ai-cyberguard' ) ), array( 'icon' => '💼', 'bg' => '#fef3c7', 'title' => __( 'Slack Integration', 'ai-cyberguard' ), 'desc' => __( 'Alerts to Slack channels', 'ai-cyberguard' ) ), array( 'icon' => '📞', 'bg' => '#fee2e2', 'title' => __( 'Voice Call Alerts', 'ai-cyberguard' ), 'desc' => __( 'Automated phone calls for critical events', 'ai-cyberguard' ) ), array( 'icon' => '📈', 'bg' => '#f3e8ff', 'title' => __( 'Uptime Monitoring', 'ai-cyberguard' ), 'desc' => __( 'Know when site goes down', 'ai-cyberguard' ) ), array( 'icon' => '🚦', 'bg' => '#fee2e2', 'title' => __( 'Live Traffic Monitor', 'ai-cyberguard' ), 'desc' => __( 'See visitors in real-time', 'ai-cyberguard' ) ), array( 'icon' => '📄', 'bg' => '#e0e7ff', 'title' => __( 'Live File Changes', 'ai-cyberguard' ), 'desc' => __( 'Watch file changes live', 'ai-cyberguard' ) ), array( 'icon' => '📝', 'bg' => '#f0fdf4', 'title' => __( 'Security Log', 'ai-cyberguard' ), 'desc' => __( 'Complete audit trail', 'ai-cyberguard' ) ), array( 'icon' => '📊', 'bg' => '#dbeafe', 'title' => __( 'Security Insights', 'ai-cyberguard' ), 'desc' => __( 'Live charts of attacks blocked & threats stopped', 'ai-cyberguard' ) ), array( 'icon' => '🕵️', 'bg' => '#1e293b', 'title' => __( 'Dark Web Monitor', 'ai-cyberguard' ), 'desc' => __( 'Credential breach detection', 'ai-cyberguard' ) ), array( 'icon' => '🚫', 'bg' => '#fef3c7', 'title' => __( 'Blacklist Check', 'ai-cyberguard' ), 'desc' => __( 'Google Safe Browsing check', 'ai-cyberguard' ) ), ); foreach ( $monitoring_features as $f ) : ?>

🔍

'🐦', 'bg' => '#fef3c7', 'title' => __( 'Canary Files', 'ai-cyberguard' ), 'desc' => __( 'Honeytokens for breach detection', 'ai-cyberguard' ) ), array( 'icon' => '⚠️', 'bg' => '#fee2e2', 'title' => __( 'Vulnerability Scanner', 'ai-cyberguard' ), 'desc' => __( 'Check plugins for CVEs', 'ai-cyberguard' ) ), array( 'icon' => '🗄️', 'bg' => '#e0e7ff', 'title' => __( 'Database Malware Scan', 'ai-cyberguard' ), 'desc' => __( 'Scan DB for injected malware, redirects & SEO spam', 'ai-cyberguard' ) ), array( 'icon' => '📦', 'bg' => '#dbeafe', 'title' => __( 'Plugin Risk Analysis', 'ai-cyberguard' ), 'desc' => __( 'Supply chain risk scoring', 'ai-cyberguard' ) ), array( 'icon' => '🔄', 'bg' => '#ecfdf5', 'title' => __( 'Auto Baseline Refresh', 'ai-cyberguard' ), 'desc' => __( 'Update after verified changes', 'ai-cyberguard' ) ), array( 'icon' => '🏗️', 'bg' => '#f3e8ff', 'title' => __( '7-Layer Ultimate Scanner', 'ai-cyberguard' ), 'desc' => __( 'Enterprise-grade multi-layer scanning', 'ai-cyberguard' ) ), array( 'icon' => '🧬', 'bg' => '#fef3c7', 'title' => __( 'Code DNA Fingerprinting', 'ai-cyberguard' ), 'desc' => __( 'Structure-based malware detection', 'ai-cyberguard' ) ), ); foreach ( $scanning_features as $f ) : ?>

💾

'☁️', 'bg' => '#dbeafe', 'title' => __( 'Cloud Backup', 'ai-cyberguard' ), 'desc' => __( 'Google Drive, Dropbox, S3', 'ai-cyberguard' ) ), array( 'icon' => '🔙', 'bg' => '#ecfdf5', 'title' => __( 'Auto-Restore', 'ai-cyberguard' ), 'desc' => __( 'Restore from clean baseline', 'ai-cyberguard' ) ), array( 'icon' => '🗂️', 'bg' => '#fef3c7', 'title' => __( 'Quarantine', 'ai-cyberguard' ), 'desc' => __( 'Isolate suspicious files', 'ai-cyberguard' ) ), array( 'icon' => '🆘', 'bg' => '#fee2e2', 'title' => __( 'Emergency Recovery', 'ai-cyberguard' ), 'desc' => __( 'Recover even when WP is down', 'ai-cyberguard' ) ), array( 'icon' => '🧪', 'bg' => '#f3e8ff', 'title' => __( 'Restore Sandbox', 'ai-cyberguard' ), 'desc' => __( 'Test restore before going live', 'ai-cyberguard' ) ), array( 'icon' => '📸', 'bg' => '#e0f2fe', 'title' => __( 'Clean Snapshots', 'ai-cyberguard' ), 'desc' => __( 'Core + plugins + themes snapshots', 'ai-cyberguard' ) ), array( 'icon' => '⏰', 'bg' => '#fff7ed', 'title' => __( 'Time Machine', 'ai-cyberguard' ), 'desc' => __( 'Full file version history with diff', 'ai-cyberguard' ) ), array( 'icon' => '💻', 'bg' => '#dcfce7', 'title' => __( 'Download to Computer', 'ai-cyberguard' ), 'desc' => __( 'Save backups locally to your PC', 'ai-cyberguard' ) ), ); foreach ( $backup_features as $f ) : ?>

⚙️

'🏆', 'bg' => '#fef3c7', 'title' => __( 'Security Score', 'ai-cyberguard' ), 'desc' => __( 'Track security posture', 'ai-cyberguard' ) ), array( 'icon' => '📊', 'bg' => '#dbeafe', 'title' => __( 'Dashboard', 'ai-cyberguard' ), 'desc' => __( 'Visual security overview', 'ai-cyberguard' ) ), array( 'icon' => '🌐', 'bg' => '#ecfdf5', 'title' => __( 'Multi-site Support', 'ai-cyberguard' ), 'desc' => __( 'Manage all sites centrally', 'ai-cyberguard' ) ), array( 'icon' => '🎮', 'bg' => '#f3e8ff', 'title' => __( 'Gamification', 'ai-cyberguard' ), 'desc' => __( 'Achievements, streaks & badges', 'ai-cyberguard' ) ), array( 'icon' => '✅', 'bg' => '#fee2e2', 'title' => __( 'Change Approval', 'ai-cyberguard' ), 'desc' => __( 'Approval workflow for teams', 'ai-cyberguard' ) ), array( 'icon' => '📋', 'bg' => '#e0f2fe', 'title' => __( 'Compliance Manager', 'ai-cyberguard' ), 'desc' => __( 'GDPR, PCI-DSS', 'ai-cyberguard' ) ), array( 'icon' => '📏', 'bg' => '#fff7ed', 'title' => __( 'Industry Benchmark', 'ai-cyberguard' ), 'desc' => __( 'Compare your security posture', 'ai-cyberguard' ) ), array( 'icon' => '🗃️', 'bg' => '#dcfce7', 'title' => __( 'Data Retention Controls', 'ai-cyberguard' ), 'desc' => __( 'Manage logs & system data', 'ai-cyberguard' ) ), ); foreach ( $management_features as $f ) : ?>

📊

⭐ →
⭐ PRO
🔍
✓ ✓
✓ ✓
✓ ✓
✓ ✓
✓
✗ ✓
🤖
20 500/
✓ ✓
✓ ✓
🛡️
✓ ✓
✓
✗ ✓
✓
✓
✗ ✓
✓
✗ ✓
✗ ✓
✓
🔔
✓ ✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
💾
✗ ✓
✗ ✓
✓
✗ ✓
✗ ✓
✓
✗ ✓
✓
✗ ✓
🧠
✗ ✓
✗ ✓
✓
✗ ✓
✗ ✓
✓
✓
✗ ✓
🚀
✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
✗ ✓
✓
✗ ✓
🏆
✓ ✓
✓ ✓
✗ ✓
✗ ✓
✗ ✓
💬
✓ ✓
✗ ✓
$179/
⭐ →
render_pro_page(); } }