PluginProbe ʕ •ᴥ•ʔ
Security Optimizer – The All-In-One Protection Plugin / 1.5.4
Security Optimizer – The All-In-One Protection Plugin v1.5.4
1.6.2 1.6.1 trunk 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0
sg-security / uninstall.php
sg-security Last commit date
assets 1 year ago core 1 year ago templates 1 year ago vendor 1 year ago react-strings.php 1 year ago readme.txt 1 year ago sg-security.php 1 year ago uninstall.php 1 year ago
uninstall.php
49 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 global $wpdb;
8
9 // The plugin tables.
10 $tables = array(
11 'sgs_log_visitors',
12 'sgs_log_events',
13 );
14
15 $user_2fa_meta = array(
16 'configured',
17 'secret',
18 'qr',
19 'backup_codes',
20 );
21
22 // Loop through all tables and delete them.
23 foreach ( $tables as $table ) {
24 $wpdb->query( // phpcs:ignore
25 'DROP TABLE IF EXISTS ' . $wpdb->dbname . '.' . $wpdb->prefix . $table // phpcs:ignore
26 );
27 }
28
29 // Reset all users 2FA.
30 foreach ( $user_2fa_meta as $meta ) {
31 delete_metadata( 'user', 0, 'sg_security_2fa_' . $meta, '', true );
32 }
33
34 // Delete encryption file.
35 wp_delete_file( defined( 'SGS_ENCRYPTION_KEY_FILE_PATH' ) ? SGS_ENCRYPTION_KEY_FILE_PATH : WP_CONTENT_DIR . '/sgs_encrypt_key.php' );
36
37 // Stop uninstall service if SG Optimizer plugin exists.
38 if ( file_exists( WP_PLUGIN_DIR . '/sg-cachepress/sg-cachepress.php' ) ) {
39 return;
40 }
41
42 // Stop collecting data.
43 require_once dirname( __FILE__ ) . '/vendor/siteground/siteground-data/src/Settings.php';
44
45 use SiteGround_Data\Settings;
46
47 $settings = new Settings();
48
49 $settings->stop_collecting_data();