Vigiar
1
0
Derivar
Você já tinha feito uma derivação do repositório wordpress-plugin, anteriormente
0
wordpress-plugin/interweb-mz-connect/uninstall.php
2026-11-28 15:28:06 +02:00

23 linhas
1,2 KiB
PHP

<?php
// Runs when the plugin is deleted from WordPress: removes its settings, the saved key and its table.
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
foreach (array('interweb_mz_connect_settings', 'interweb_mz_connect_api_key', 'interweb_mz_connect_api_key_hint', 'interweb_mz_connect_activity_log', 'interweb_mz_connect_db_version') as $opt) {
delete_option($opt);
}
foreach (array('interweb_mz_connect_token_info', 'interweb_mz_connect_domains', 'interweb_mz_connect_email_groups', 'interweb_mz_connect_sms_groups') as $t) {
delete_transient($t);
}
wp_clear_scheduled_hook('interweb_mz_connect_daily_cleanup');
// Caches of the domain search, prices and help articles.
global $wpdb;
$wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'acc\_kb\_stale\_%' OR option_name LIKE '\_transient\_acc\_%' OR option_name LIKE '\_transient\_timeout\_acc\_%'");
// The sign-ups table keeps the proof of consent. Define INTERWEB_MZ_CONNECT_KEEP_SIGNUPS in wp-config.php to keep it.
if (!defined('INTERWEB_MZ_CONNECT_KEEP_SIGNUPS') || !INTERWEB_MZ_CONNECT_KEEP_SIGNUPS) {
global $wpdb;
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'interweb_mz_connect_signups');
}