do NOT fire the legacy plugins' deactivation hooks, // so their (unknown) cleanup routines never run. if ( is_multisite() ) { // Clear both network-wide and per-site activation records. deactivate_plugins( $legacy, true, true ); deactivate_plugins( $legacy, true, false ); } else { deactivate_plugins( $legacy, true ); } set_transient( self::NOTICE_TRANSIENT, $legacy, HOUR_IN_SECONDS ); } /** * Render the post-deactivation notice at most once per event. */ public static function maybe_render_deactivation_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } $deactivated = get_transient( self::NOTICE_TRANSIENT ); if ( empty( $deactivated ) ) { return; } // Consume the flag so the notice shows once per deactivation event. delete_transient( self::NOTICE_TRANSIENT ); echo '
'; echo esc_html__( 'AI Workflow Automation: an older version (Lite or Pro) was deactivated automatically. Your workflows and settings are intact. You can safely remove the old plugin folder from wp-content/plugins via FTP; avoid its Delete button on the Plugins screen.', 'ai-workflow-automation-lite' ); echo '
'; echo esc_html__( 'AI Workflow Automation: another copy of this plugin (an older Lite or Pro version) is already active, so this copy did not load. The older copy is being deactivated automatically. Your workflows and settings are intact.', 'ai-workflow-automation-lite' ); echo '