query("DROP TABLE IF EXISTS {$wpdb->prefix}{$table}"); } $wpdb->query($wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $wpdb->esc_like('wpmm_waf_rule_') . '%' )); $options = [ 'wpmm_api_key', 'wpmm_last_scan_time', 'wpmm_db_version', 'wpmm_default_scan_profile', 'wpmm_known_admin_ids', 'wpmm_security_baseline', 'wpmm_login_rate_limit', 'wpmm_notification_settings', 'wpmm_outbound_blocklist', 'wpmm_hardening_last_score', 'wpmm_incident_auto_block_critical', 'wpmm_last_file_backup_time', 'wpmm_fim_baseline_created_at', 'wpmm_fim_baseline_scope', 'wpmm_fim_last_check', 'wpmm_db_last_scan', 'wpmm_attack_surface_last_scan', 'wpmm_config_last_scan', 'wpmm_persistence_last_scan', 'wpmm_secret_last_scan', 'wpmm_vulnerability_last_scan', 'wpmm_threat_intel_last_check', 'wpmm_stego_last_scan', 'wpmm_js_last_scan', 'wpmm_2fa_enabled', 'wpmm_2fa_scope', 'wpmm_custom_login_enabled', 'wpmm_custom_login_slug', 'wpmm_fuzzy_signatures', 'wpmm_monitored_sites', 'wpmm_remote_cache', 'wpmm_sites_source', 'wpmm_sites_api_url', 'wpmm_sites_api_key_header', 'wpmm_sites_api_cache', 'wpmm_lockdown_active', 'wpmm_lockdown_pre_state', 'wpmm_honeypot_paths', 'wpmm_honeypot_actions', 'wpmm_honeypot_last_rotated', 'wpmm_file_guard_tier2_enabled', 'wpmm_file_guard_blocked_writes', 'wpmm_function_baseline', 'wpmm_vendor_manifests', 'wpmm_supply_chain_alerts', 'wpmm_blocklist_last_check', 'wpmm_blocklist_last_result', 'wpmm_google_safe_browsing_key', 'wpmm_trusted_ips', 'wpmm_password_policy_roles', 'wpmm_blocked_countries', 'wpmm_country_block_mode', 'wpmm_recaptcha_enabled', 'wpmm_recaptcha_site_key', 'wpmm_recaptcha_secret_key', 'wpmm_rate_limits', 'wpmm_scan_schedule_interval', 'wpmm_hub_max_concurrent', 'wpmm_child_last_connection', 'wpmm_child_remote_scan_count', 'wpmm_scan_themes', 'wpmm_scan_plugins', 'wpmm_scan_uploads', 'wpmm_auto_suspend_rogue_admins', 'wpmm_require_device_approval', 'wpmm_block_suspicious_usernames', 'wpmm_honeytoken_enabled', 'wpmm_honeytoken_triggers', 'wpmm_honeytoken_secret', 'wpmm_disable_public_registration', 'wpmm_harden_disable_plugin_theme_install', 'wpmm_waf_engine_enabled', 'wpmm_waf_exceptions', 'wpmm_waf_cve_rules', 'wpmm_new_user_approval_required', 'wpmm_registration_rate_limit_enabled', 'wpmm_registration_rate_limit_max', 'wpmm_registration_rate_limit_window', 'wpmm_block_disposable_email_registration', 'wpmm_email_digest_enabled', 'wpmm_email_digest_interval_hours', 'wpmm_email_digest_cron_healed', 'wpmm_email_digest_cron_heal_lock', 'wpmm_private_debug_log_name', '_transient_wpmm_update_info', '_transient_timeout_wpmm_update_info', 'wpmm_site_secret', 'wpmm_sig_feed', 'wpmm_waf_feed', 'wpmm_netbl_state', 'wpmm_network_share', 'wpmm_admin_recent_ips', 'wpmm_netbl_share_cursor', 'wpmm_netbl_table_ok', 'wpmm_integrity_state', '_transient_wpmm_bell_remote', '_transient_timeout_wpmm_bell_remote', 'wpmm_email_digest_overflow', 'wpmm_email_digest_scheduled_hours', 'wpmm_session_fingerprint_enabled', 'wpmm_session_fingerprint_strict', 'wpmm_weekly_report_email_enabled', 'wpmm_ip_reputation_enabled', 'wpmm_incident_containment_enabled', 'wpmm_incident_containment_policy', 'wpmm_security_control_disable_log', 'wpmm_daily_digest_email_enabled', 'wpmm_wpcli_recent_actions', 'wpmm_retention_days', 'wpmm_progressive_temp_blocks', 'wpmm_self_audit_last_results', 'wpmm_self_audit_last_run', 'wpmm_cve_correlation_last_scan', 'wpmm_playbooks', 'wpmm_canary_tokens', 'wpmm_bundled_dependency_last_scan', 'wpmm_community_blocklist_enabled', 'wpmm_community_blocklist_last_sync', 'wpmm_security_headers_enabled', 'wpmm_license_state', 'wpmm_license_pending_email', 'wpmm_7hour_migration_done', 'wpmm_install_override_until', 'wpmm_dns_baseline', 'wpmm_dns_last_check', 'wpmm_hub_mode_enabled', 'wpmm_child_mode_enabled', 'wpmm_child_api_key', 'wpmm_onboarding_progress', 'wpmm_wizard_hardening_results', ]; foreach ($options as $option) { delete_option($option); } $harden_options = $wpdb->get_col($wpdb->prepare( "SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE %s", $wpdb->esc_like('wpmm_harden_') . '%' )); foreach ($harden_options as $option) { delete_option($option); } $wpdb->query($wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like('_transient_wpmm_db_anomaly_notified_') . '%', $wpdb->esc_like('_transient_wpmm_drift_result_') . '%' )); $user_ids = get_users(['fields' => 'ID']); foreach ($user_ids as $uid) { delete_user_meta($uid, 'wpmm_2fa_backup_codes'); delete_user_meta($uid, 'wpmm_2fa_backup_codes_generated_at'); delete_user_meta($uid, 'wpmm_last_login'); delete_user_meta($uid, 'wpmm_session_fingerprints'); delete_user_meta($uid, 'wpmm_force_2fa_setup'); } $cron_hooks = [ 'wpmm_weekly_scan_event', 'wpmm_rotate_honeypots_event', 'wpmm_hub_process_queue', 'wpmm_wizard_triggered_scan', 'wpmm_child_remote_triggered_scan', 'wpmm_dns_check_event', 'wpmm_db_anomaly_check_event', 'wpmm_send_email_digest', 'wpmm_weekly_report_event', 'wpmm_correlation_event', 'wpmm_daily_digest_event', 'wpmm_retention_cleanup_event', 'wpmm_progressive_expire_temp_blocks_event', 'wpmm_self_audit_event', 'wpmm_cve_correlation_event', 'wpmm_bundled_dependency_scan_event', 'wpmm_community_blocklist_sync_event', 'wpmm_license_revalidate_event', 'wpmm_supply_chain_periodic_check_event', 'wpmm_backup_retention_event', 'wpmm_cleanup_hits_event', 'wpmm_fim_check_event', 'wpmm_threat_intel_cleanup_event', ]; foreach ($cron_hooks as $hook) { $timestamp = wp_next_scheduled($hook); if ($timestamp) { wp_unschedule_event($timestamp, $hook); } wp_clear_scheduled_hook($hook); } global $wpdb; $wpdb->query("DELETE FROM {$wpdb->usermeta} WHERE meta_key IN ('wpmm_suspended', 'wpmm_suspended_reason', 'wpmm_suspended_at')"); $wpmm_db_honeytoken_id = (int) get_option('wpmm_db_honeytoken_user_id', 0); if ($wpmm_db_honeytoken_id > 0 && get_user_meta($wpmm_db_honeytoken_id, '_wpmm_is_db_honeytoken', true)) { if (!function_exists('wp_delete_user')) require_once ABSPATH . 'wp-admin/includes/user.php'; wp_delete_user($wpmm_db_honeytoken_id); } delete_option('wpmm_db_honeytoken_user_id'); $wpmm_honeytoken_files = get_option('wpmm_honeytoken_planted_files', []); if (is_array($wpmm_honeytoken_files)) { foreach ($wpmm_honeytoken_files as $wpmm_bait_filename) { $wpmm_bait_path = ABSPATH . $wpmm_bait_filename; if (is_file($wpmm_bait_path)) { $wpmm_bait_content = @file_get_contents($wpmm_bait_path); if ($wpmm_bait_content !== false && strpos($wpmm_bait_content, 'WPMM_HONEYTOKEN_MARKER') !== false) { wp_delete_file($wpmm_bait_path); } } } } delete_option('wpmm_honeytoken_planted_files'); $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpmm\\_hardening\\_%'"); $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpmm\\_waf\\_rule\\_%'"); $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '\\_transient\\_wpmm\\_reg\\_attempts\\_%' OR option_name LIKE '\\_transient\\_timeout\\_wpmm\\_reg\\_attempts\\_%'"); $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '\\_transient\\_wpmm\\_ip\\_rep\\_%' OR option_name LIKE '\\_transient\\_timeout\\_wpmm\\_ip\\_rep\\_%'"); $wpmm_uploads = wp_upload_dir(); $wpmm_canary_decoy_path = (is_array($wpmm_uploads) && !empty($wpmm_uploads['basedir'])) ? $wpmm_uploads['basedir'] . '/.env.backup' : WP_CONTENT_DIR . '/uploads/.env.backup'; if (is_file($wpmm_canary_decoy_path)) { $wpmm_canary_content = @file_get_contents($wpmm_canary_decoy_path); if ($wpmm_canary_content !== false && strpos($wpmm_canary_content, 'Environment configuration backup') !== false) { wp_delete_file($wpmm_canary_decoy_path); } } delete_metadata('user', 0, 'wpmm_bell_seen_at', '', true); delete_metadata('user', 0, 'wpmm_theme', '', true); delete_metadata('user', 0, 'wpmm_addon_notice_dismissed_until', '', true); delete_option('wpmm_addon_download_url'); delete_transient('wpmm_after_purchase_lock'); delete_transient('wpmm_license_soft_refresh_lock'); wp_clear_scheduled_hook('wpmm_signature_feed_sync'); foreach (['wpmm_waf_feed_sync', 'wpmm_netbl_sync', 'wpmm_netbl_share'] as $wpmm_hook) wp_clear_scheduled_hook($wpmm_hook); global $wpdb; $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}wpmm_network_blocklist");