'ids', 'number' => 0 ) ) as $blog_id ) { switch_to_blog( (int) $blog_id ); try { self::deactivate_current_site(); } finally { restore_current_blog(); } } return; } self::deactivate_current_site(); } /** * @return void */ private static function deactivate_current_site() { $log_cleaner = new JobLogCleaner(); $log_cleaner->unschedule(); $review_cleaner = new ContentReviewCleaner(); $review_cleaner->unschedule(); $rate_limit_cleaner = new RateLimiterCleaner(); $rate_limit_cleaner->unschedule(); $request_claim_cleaner = new RequestClaimCleaner(); $request_claim_cleaner->unschedule(); ( new McpAuditLogCleaner() )->unschedule(); ( new McpCredentialCleaner() )->unschedule(); ( new McpOAuthClientGc() )->unschedule(); ( new McpConnectionCapabilitySweeper() )->unschedule(); ( new BlueprintCleanup() )->unschedule(); wp_clear_scheduled_hook( \AIPT\Core\Services\PricingFeedManager::CRON_HOOK ); wp_clear_scheduled_hook( \AIPT\Core\FsManager::BUSINESS_PRICING_REFRESH_HOOK ); \AIPT\Core\Services\UsageTracker::unschedule(); \AIPT\Core\ContentSnapshots\SnapshotStore::unschedule(); \AIPT\Admin\Dashboard\GapDashboardWidget::unschedule(); wp_clear_scheduled_hook('aipt_credit_sync'); wp_clear_scheduled_hook( 'aipt_chatbot_queue_cleanup' ); self::unschedule_automation_jobs_crons(); try { ChatbotJobWorker::unscheduleStaleRecovery(); } catch ( \Throwable $throwable ) { } try { ChatbotJobWorker::unscheduleProcessJobActions(); } catch ( \Throwable $throwable ) { } self::unschedule_store_index_jobs(); if (function_exists('as_unschedule_all_actions')) { try { as_unschedule_all_actions('', [], 'aipt-catalog-watch'); } catch (\Throwable $throwable) { } } update_option('aipt_needs_setup', true, false); update_option('aipt_setup_completed', false, false); } /** * Automation jobs ile ilgili cron görevlerini durdurur * * @return void */ private static function unschedule_automation_jobs_crons() { try { \AIPT\Api\AutomationJobs\JobScheduler::clearCronSchedules(); } catch (\Exception $e) { } wp_clear_scheduled_hook('aipt_reap_stuck_jobs'); } /** * AI Store Index ile ilgili Action Scheduler işlerini durdurur * * @return void */ private static function unschedule_store_index_jobs() { if (!function_exists('as_unschedule_all_actions')) { return; } try { $group = 'aipt-store-index'; as_unschedule_all_actions('aipt_build_store_index', [], $group); as_unschedule_all_actions('aipt_scheduled_index_rebuild', [], $group); update_option('aipt_store_index_status', 'idle', false); update_option('aipt_store_index_build_progress', 0, false); update_option('aipt_store_index_build_job_id', 0, false); delete_transient('aipt_index_build_data'); } catch (\Exception $e) { } } }