PluginProbe
Atomic Edge Security – Firewall, Malware Scan and Login Security / 2.2.2
Atomic Edge Security – Firewall, Malware Scan and Login Security v2.2.2
trunk 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 All 29 releases
atomic-edge-security / uninstall.php

uninstall.php in Atomic Edge Security – Firewall, Malware Scan and Login Security 2.2.2, at uninstall.php

54 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall Atomic Edge Security
4 *
5 * Removes all plugin data when the plugin is deleted.
6 *
7 * @package AtomicEdge
8 */
9
10 // If uninstall not called from WordPress, exit.
11 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12 exit;
13 }
14
15 // Delete all plugin options.
16 $atomicedge_options_to_delete = array(
17 'atomicedge_api_key',
18 'atomicedge_api_url',
19 'atomicedge_connected',
20 'atomicedge_site_data',
21 'atomicedge_last_scan',
22 'atomicedge_scan_results',
23 );
24
25 foreach ( $atomicedge_options_to_delete as $atomicedge_option ) {
26 delete_option( $atomicedge_option );
27 }
28
29 // Delete all transients.
30 global $wpdb;
31
32 // Drop scanner queue table.
33 $atomicedge_table_name = $wpdb->prefix . 'atomicedge_scan_queue';
34 if ( preg_match( '/^[A-Za-z0-9_]+$/', $atomicedge_table_name ) ) {
35 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.NotPrepared,PluginCheck.Security.DirectDB.UnescapedDBParameter
36 $wpdb->query( 'DROP TABLE IF EXISTS `' . $atomicedge_table_name . '`' );
37 }
38
39 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
40 if ( preg_match( '/^[A-Za-z0-9_]+$/', $wpdb->options ) ) {
41 $wpdb->query(
42 $wpdb->prepare(
43 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,PluginCheck.Security.DirectDB.UnescapedDBParameter
44 'DELETE FROM `' . $wpdb->options . '` WHERE option_name LIKE %s OR option_name LIKE %s',
45 '_transient_atomicedge_%',
46 '_transient_timeout_atomicedge_%'
47 )
48 );
49 }
50
51 // Clear any scheduled cron events.
52 wp_clear_scheduled_hook( 'atomicedge_daily_scan' );
53 wp_clear_scheduled_hook( 'atomicedge_sync_settings' );
54