hasApiKey() && $settings->hasSelectedAgents() ) || \get_option( Onboarding::OPTION, '' ) !== '' ) { return; } \update_option( Onboarding::OPTION, 'active', false ); if ( $networkWide || ( \defined( 'WP_CLI' ) && \WP_CLI ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- WordPress verifies the activation nonce before invoking this hook; only prevent bulk redirects here. || isset( $_GET['activate-multi'] ) || ! \current_user_can( 'manage_options' ) ) { return; } \set_transient( Onboarding::REDIRECT_TRANSIENT, \get_current_user_id(), 60 ); } public static function deactivate(): void { if ( \function_exists( 'as_unschedule_all_actions' ) ) { \as_unschedule_all_actions( ProductHooks::SYNC_HOOK, [], ProductHooks::ACTION_GROUP ); \as_unschedule_all_actions( SyncRunner::SYNC_HOOK, [], ProductHooks::ACTION_GROUP ); } DailySync::unschedule(); CachePurger::purgeAll(); \delete_transient( Onboarding::REDIRECT_TRANSIENT ); \delete_transient( SyncRunner::LOCK_TRANSIENT ); $progress = new SyncProgress(); if ( $progress->isRunning() ) { $progress->fail( \__( 'Synchronization stopped because the plugin was deactivated.', 'agent001-support-assistant-for-woocommerce' ) ); } } }