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

global $wpdb;

// Delete tables with proper escaping
$table_names = [
    $wpdb->prefix . 'eb_plugin_users',
    $wpdb->prefix . 'events',
    $wpdb->prefix . 'eb_feature_events',
    $wpdb->prefix . 'customized_events'
];

foreach ($table_names as $table_name) {
    $wpdb->query($wpdb->prepare("DROP TABLE IF EXISTS %i", $table_name));
}

// Remove plugin options if any
delete_option('eventbookings_client_id');
delete_option('eventbookings_client_secret');
