33 lines
909 B
PHP
33 lines
909 B
PHP
<?php
|
|
/**
|
|
* Uninstall - explicit teardown of the plugin's own data. The Gravity Forms
|
|
* Add-On Framework removes its settings and feeds; we drop our transaction table
|
|
* and options. Fails safe - a teardown error never blocks uninstalling.
|
|
*
|
|
* @package ESP\Instanda
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
|
exit;
|
|
}
|
|
|
|
try {
|
|
global $wpdb;
|
|
|
|
$table = $wpdb->prefix . 'esp_instanda_transactions';
|
|
// Table name is a trusted internal constant, not user input.
|
|
$wpdb->query("DROP TABLE IF EXISTS {$table}");
|
|
|
|
delete_option('espinstanda_db_version');
|
|
delete_option('espinstanda_operating_mode_audit');
|
|
|
|
// Clear any scheduled cleanup that may still be queued.
|
|
wp_clear_scheduled_hook('esp_instanda_cleanup');
|
|
} catch (\Throwable $e) {
|
|
if (function_exists('error_log')) {
|
|
error_log('ESP INSTANDA uninstall: ' . $e->getMessage());
|
|
}
|
|
}
|