query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_aiforya_sm_schema_%' OR option_name LIKE '_transient_timeout_aiforya_sm_schema_%'" ); if ( ! $cleanup ) { // PAR DÉFAUT : on préserve les données pour permettre une réinstallation propre. return; } // OPT-IN explicite uniquement : suppression définitive. $option_keys = array( 'aiforya_sm_db_version', 'aiforya_sm_settings', 'aiforya_sm_type_mappings', 'aiforya_sm_advanced', ); foreach ( $option_keys as $key ) { delete_option( $key ); delete_site_option( $key ); } $tables = array( $wpdb->prefix . 'aiforya_sm_schemas', $wpdb->prefix . 'aiforya_sm_detected_types', $wpdb->prefix . 'aiforya_sm_validation_log', ); foreach ( $tables as $table ) { $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery } } )();