<?php
/**
 * Uninstall Panelra — removes all plugin data from the database.
 *
 * This file is called automatically by WordPress when the plugin is deleted
 * from the Plugins screen. It must be a standalone file (not a hook).
 *
 * @package Panelra
 */

// Security: abort if not called by WordPress uninstall routine.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

// ---------------------------------------------------------------------------
// Remove all Free options.
// ---------------------------------------------------------------------------
$pnlrdb_free_options = array(
	'pnlrdb_menu_width',
	'pnlrdb_dashboard_colors',
	'pnlrdb_active_theme_preset',
	'pnlrdb_dashboard_font',
	'pnlrdb_dashboard_font_size',
	'pnlrdb_dashboard_font_color',
	'pnlrdb_button_text_color',
	'pnlrdb_dark_mode_global',
	'pnlrdb_menu_names',
	'pnlrdb_hide_notices',
	'pnlrdb_hide_admin_bar_roles',
	'pnlrdb_role_menu_visibility',
	'pnlrdb_maintenance_enabled',
	'pnlrdb_maintenance_title',
	'pnlrdb_maintenance_message',
	'pnlrdb_hidden_dashboard_widgets',
	'pnlrdb_logs',
	'pnlrdb_dashboard_layout',
);

foreach ( $pnlrdb_free_options as $pnlrdb_option ) {
	delete_option( $pnlrdb_option );
}

// ---------------------------------------------------------------------------
// Remove per-user meta (dark mode preference).
// ---------------------------------------------------------------------------
delete_metadata( 'user', 0, 'pnlrdb_dark_mode', '', true );
