mirror of
https://gitlab.com/ArkHost/WP-Security-Pack.git
synced 2026-09-19 09:27:30 +02:00
34 lines
1.3 KiB
PHP
34 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Security Pack Uninstaller.
|
|
*
|
|
* @package Security_Pack
|
|
*/
|
|
|
|
// If uninstall not called from WordPress, exit.
|
|
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|
exit;
|
|
}
|
|
|
|
// Load the database class.
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpsp-db.php';
|
|
|
|
// Run uninstall.
|
|
WPSP_DB::uninstall();
|
|
|
|
// Clear any remaining transients.
|
|
global $wpdb;
|
|
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Cleanup during uninstall, caching not applicable.
|
|
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_wpsp_%'" );
|
|
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Cleanup during uninstall, caching not applicable.
|
|
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_timeout_wpsp_%'" );
|
|
|
|
// Clear scheduled events.
|
|
wp_clear_scheduled_hook( 'wpsp_daily_cleanup' );
|
|
wp_clear_scheduled_hook( 'wpsp_daily_file_scan' );
|
|
wp_clear_scheduled_hook( 'wpsp_weekly_malware_scan' );
|
|
|
|
// Delete user meta for 2FA.
|
|
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Cleanup during uninstall, caching not applicable.
|
|
$wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '_wpsp_%'" );
|