<?php
/**
 * Uninstall — removes options + tables.
 */

defined( 'WP_UNINSTALL_PLUGIN' ) || exit;

global $wpdb;

// Auth.
delete_option( 'pcd_pc_mcp_token' );
delete_option( 'pcd_pc_mcp_user_id' );

// Pairing.
delete_option( 'pcd_pc_backend_url' );
delete_option( 'pcd_pc_customer_id' );
delete_option( 'pcd_pc_connector_url' );
delete_option( 'pcd_pc_paired_at' );
delete_option( 'pcd_pc_pair_last_error' );

// Schema markers.
delete_option( 'pcd_pc_audit_db_version' );
delete_option( 'pcd_pc_snapshot_db_version' );

// phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}pcd_pc_audit" );
// phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}pcd_pc_snapshots" );
