'ids' ); if ( $batch_size ) { $args['number'] = $batch_size; } $offset = 0; do { $args['offset'] = $offset; $site_ids = get_sites( $args ); foreach ( $site_ids as $site_id ) { switch_to_blog( $site_id ); Image_AI_SEO_History_Handler::create_table(); Image_AI_SEO_Redirect_Manager::create_table(); Image_AI_SEO_Activation::prefill_welcome_settings(); restore_current_blog(); } $batch_count = count( $site_ids ); $offset += $batch_count; } while ( $batch_size && $batch_count === $batch_size ); } /** * Deactivation hook: removes the scheduled history cleanup event (QUAL-07), so * no orphaned recurring event survives the deactivation. * * @return void */ function image_ai_seo_deactivate() { $timestamp = wp_next_scheduled( 'image_ai_seo_history_cleanup_cron' ); if ( $timestamp ) { wp_unschedule_event( $timestamp, 'image_ai_seo_history_cleanup_cron' ); } } /** * Admin-init callback of the one-shot redirect to the Welcome tab (2.2.0). * * @return void */ function image_ai_seo_activation_redirect() { Image_AI_SEO_Activation::maybe_redirect(); }