25 lines
1.1 KiB
PHP
25 lines
1.1 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('mozout_email_center_settings', 'mozout_email_center_api_key', 'mozout_email_center_api_key_hint', 'mozout_email_center_activity_log', 'mozout_email_center_db_version') as $opt) {
|
|
delete_option($opt);
|
|
}
|
|
foreach (array('mozout_email_center_token_info', 'mozout_email_center_domains', 'mozout_email_center_email_groups') as $t) {
|
|
delete_transient($t);
|
|
}
|
|
wp_clear_scheduled_hook('mozout_email_center_daily_cleanup');
|
|
|
|
global $wpdb;
|
|
$wpdb->query($wpdb->prepare(
|
|
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
|
|
$wpdb->esc_like('_transient_mozout_email_center_') . '%',
|
|
$wpdb->esc_like('_transient_timeout_mozout_email_center_') . '%'
|
|
));
|
|
|
|
// The sign-ups table keeps the proof of consent. Define MOZOUT_EMAIL_CENTER_KEEP_SIGNUPS in wp-config.php to keep it.
|
|
if (!defined('MOZOUT_EMAIL_CENTER_KEEP_SIGNUPS') || !MOZOUT_EMAIL_CENTER_KEEP_SIGNUPS) {
|
|
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'mozout_email_center_signups');
|
|
}
|