'ids', 'number' => 0, ) ) as $spinxqm_blog_id ) { switch_to_blog( (int) $spinxqm_blog_id ); \SpinxQM\Database_Migrations::run(); restore_current_blog(); } return; } \SpinxQM\Database_Migrations::run(); } ); /** * A site created while the plugin is network-active gets the schema too. */ add_action( 'wp_initialize_site', static function ( $spinxqm_new_site ): void { if ( ! function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if ( ! is_plugin_active_for_network( plugin_basename( SPINXQM_FILE ) ) ) { return; } require_once SPINXQM_PATH . 'includes/class-database-migrations.php'; switch_to_blog( (int) $spinxqm_new_site->blog_id ); \SpinxQM\Database_Migrations::run(); restore_current_blog(); }, 99 ); /** * Deactivate. Clear the dormant cron fallbacks; never delete user data here * (uninstall.php handles removal). */ register_deactivation_hook( __FILE__, static function (): void { foreach ( array( 'spinxqm_run_export_job', 'spinxqm_run_backup_job', 'spinxqm_run_find_replace_job', 'spinxqm_purge_storage' ) as $spinxqm_cron_hook ) { wp_clear_scheduled_hook( $spinxqm_cron_hook ); } } ); // Single-instance guard: only one SPINX Quick Migrate instance boots per request, so the // admin menu and REST routes can't register twice if another copy of the engine // is loaded in the same request. if ( defined( 'SPINXQM_INSTANCE_BOOTED' ) ) { return; } define( 'SPINXQM_INSTANCE_BOOTED', true ); require_once SPINXQM_PATH . 'includes/class-plugin.php'; SpinxQM\Plugin::instance()->boot();