Files
hub-insurance/wp-content/plugins/esp-instanda-integration/uninstall.php
T
2026-07-02 15:54:39 -06:00

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());
}
}