<?php
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

global $wpdb;

$tables = [
	$wpdb->prefix . 'r2_offload_items',
	$wpdb->prefix . 'r2_offload_files',
	$wpdb->prefix . 'r2_offload_logs',
];

foreach ( $tables as $table ) {
	$wpdb->query( "DROP TABLE IF EXISTS {$table}" );
}

foreach ( [
	'r2_offload_settings',
	'r2_offload_scan_state',
	'r2_offload_migration_control',
	'r2_offload_deps_state',
] as $option ) {
	delete_option( $option );
}
