0; ( new Store() )->migrate(); do_action( 'antivirus_ai_activated' ); add_option( 'antivirus_ai_settings', array( 'online_references' => false, 'vulnerability_feed' => false, 'daily' => false, 'email' => false, 'login_limit' => false, 'telemetry' => false, ), '', false ); Welcome::activate( $existing_installation ); // Explicit owner scan/schedule action starts work; activation is local and lightweight. if ( ! $existing_installation && current_user_can( 'manage_options' ) && get_current_user_id() > 0 ) { set_transient( 'antivirus_ai_setup_welcome_' . get_current_user_id(), true, 600 ); } } public static function deactivate(): void { Welcome::stop(); RuleUpdates::stop(); ExposureChecks::stop(); ReputationFeed::stop(); BotControls::stop(); PasswordRisk::stop(); do_action( 'antivirus_ai_deactivated' ); foreach ( array( 'antivirus_ai_tick', 'antivirus_ai_daily', 'antivirus_ai_notify', 'antivirus_ai_repair_verify' ) as $hook ) { wp_clear_scheduled_hook( $hook ); } DataRemoval::deactivated(); } public static function boot(): void { if ( is_multisite() ) { return; } DataRemoval::register(); if ( is_admin() && class_exists( Admin::class ) ) { Admin::register(); } if ( class_exists( Scheduler::class ) ) { Scheduler::register(); } if ( class_exists( Notifications::class ) ) { Notifications::register(); } ReviewPrompt::register(); if ( class_exists( LoginLimiter::class ) ) { LoginLimiter::register(); } Firewall::register(); RuleUpdates::register(); SecurityCenter::register(); ExposureChecks::register(); ThreatSettings::register(); PasswordRisk::register(); VirtualPatches::register(); ReputationFeed::register(); BotControls::register(); if ( class_exists( AccountSecurity::class ) ) { AccountSecurity::register(); DeviceTrust::register(); } if ( class_exists( AccountMonitor::class ) ) { AccountMonitor::register(); } Privacy::register(); Welcome::register(); if ( defined( 'WP_CLI' ) && WP_CLI && class_exists( Cli::class ) ) { \WP_CLI::add_command( 'antivirus-ai', Cli::class ); } add_action( 'admin_init', static function () { if ( current_user_can( 'manage_options' ) && (int) get_option( 'antivirus_ai_schema', 0 ) < 1 ) { try { ( new Store() )->migrate(); } catch ( \Throwable $e ) { add_action( 'admin_notices', static function () use ( $e ) { echo '
' . esc_html( $e->getMessage() ) . '