File: /home/mahdetej/www/wp-content/plugins/Melli-shild/uninstall.php
<?php
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
require_once plugin_dir_path( __FILE__ ) . 'includes/class-melli-shield-config.php';
global $wpdb;
$tables = array(
Melli_Shield_Config::log_table(),
Melli_Shield_Config::scan_table(),
$wpdb->prefix . 'darkshield_log',
$wpdb->prefix . 'darkshield_scan_results',
);
foreach ( array_unique( $tables ) as $table ) {
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$wpdb->query( "DROP TABLE IF EXISTS {$table}" );
}
$options = array(
Melli_Shield_Config::OPTION_MODE,
Melli_Shield_Config::OPTION_SETTINGS,
Melli_Shield_Config::OPTION_WHITELIST,
Melli_Shield_Config::OPTION_ALLOWED_SERVICES,
Melli_Shield_Config::OPTION_VERSION,
Melli_Shield_Config::OPTION_LAST_SCAN,
'darkshield_mode',
'darkshield_settings',
'darkshield_whitelist',
'melli_shield_allowed_services',
'darkshield_version',
'darkshield_last_scan',
'melli_shield_migration_2_0_done',
);
foreach ( $options as $opt ) {
delete_option( $opt );
}
delete_transient( Melli_Shield_Config::ACTIVATION_TRANSIENT );
delete_transient( 'darkshield_activation_notice' );
wp_clear_scheduled_hook( Melli_Shield_Config::CRON_CLEANUP );
wp_clear_scheduled_hook( 'darkshield_daily_cleanup' );