HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/aaa-option-optimizer/uninstall.php
<?php
/**
 * Uninstall the plugin.
 *
 * Delete the plugin option and custom table.
 *
 * @package Progress_Planner\OptionOptimizer
 */

// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

global $wpdb;

// Drop the custom table.
$aaa_option_optimizer_table = $wpdb->prefix . 'option_optimizer_tracked';
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is safe (from constant prefix).
$wpdb->query( "DROP TABLE IF EXISTS {$aaa_option_optimizer_table}" );

// Delete the batch transient.
delete_transient( 'option_optimizer_batch' );

// Delete the plugin option.
delete_option( 'option_optimizer' );