<?php
/**
 * Uninstall cleanup.
 *
 * @package TechDexSearchScrapeGuard
 */

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

global $wpdb;

delete_option( 'tdssg_settings' );
delete_option( 'tdssg_summary_counters' );
delete_option( 'tdssg_log_schema_version' );

$table_names = array(
	$wpdb->prefix . 'tdssg_rate_slots',
	$wpdb->prefix . 'tdssg_events',
);

foreach ( $table_names as $table_name ) {
	$wpdb->query( "DROP TABLE IF EXISTS {$table_name}" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
