chore: uninstall cleanup, WP readme

This commit is contained in:
Vladimir Bryzgalov
2026-04-17 22:51:33 +05:00
parent f5816e4648
commit 6eb2844429
2 changed files with 49 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
// If uninstall not called from WordPress, exit.
if (!defined('WP_UNINSTALL_PLUGIN')) exit;
global $wpdb;
$table = $wpdb->prefix . 'cf7stg_queue';
$wpdb->query("DROP TABLE IF EXISTS {$table}");
$options = [
'cf7stg_bot_token_enc',
'cf7stg_chat_id',
'cf7stg_site_title',
'cf7stg_last_test',
'cf7stg_db_version',
];
foreach ($options as $opt) {
delete_option($opt);
}
wp_clear_scheduled_hook('cf7stg_dispatch');
wp_clear_scheduled_hook('cf7stg_cleanup');