PluginProbe
WebTotem Security / 2.3.44
WebTotem Security v2.3.44
3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 2.2.4 All 109 releases
wt-security / uninstall.php

uninstall.php in WebTotem Security 2.3.44, at uninstall.php

58 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if( ! defined('WP_UNINSTALL_PLUGIN') )
3 exit;
4
5 if( ! defined('WTSEC_PLUGIN_PREFIX') )
6 define("WTSEC_PLUGIN_PREFIX", 'wtsec_');
7
8 wtsec_deleteAllAgentsFiles();
9 deleteOptions();
10
11 function wtsec_deleteAllAgentsFiles(){
12 global $wp_filesystem;
13
14 if (empty($wp_filesystem)) {
15 require_once(ABSPATH . '/wp-admin/includes/file.php');
16 WP_Filesystem();
17 }
18 $target_dir = $wp_filesystem->find_folder($wp_filesystem->abspath());
19 $list = $wp_filesystem->dirlist($target_dir);
20
21 foreach ($list as $item){
22 $target_item = trailingslashit($target_dir) . $item['name'];
23 $recursive = ($item['type'] == 'd') ? true : false;
24 if( wtsec_multineedle_stripos( $item['name'], ['.am.php','.waf.php','.av.php','.wtotem_'] ) ){
25 $wp_filesystem->delete($target_item, $recursive, $item['type']);
26 }
27 }
28 }
29
30
31 function wtsec_multineedle_stripos($haystack, $needles, $offset = 0) {
32 foreach($needles as $needle) {
33 if(stripos($haystack, $needle, $offset)){
34 return true;
35 }
36 }
37 return false;
38 }
39
40 function deleteOptions(){
41 $options = [
42 'api_key', 'api_key_safe', 'api_key_activated', 'authorized', 'authToken',
43 'waf_installed_file','am_installed_file','am_installed', 'logout',
44 'av_installed', 'waf_installed', 'agents_installed', 'api_url',
45 'color_scheme' ,'time_zone',
46 'token_expired','deactivated', 'antivirus_event','antivirus_permissions_changed',
47 'antivirus_endCursor', 'antivirus_hasNextPage',
48 'firewall_endCursor', 'firewall_hasNextPage',
49 'reports_endCursor', 'reports_hasNextPage'];
50
51 foreach ($options as $option) {
52 delete_option(WTSEC_PLUGIN_PREFIX.$option);
53 delete_site_option(WTSEC_PLUGIN_PREFIX.$option);
54 }
55 }
56
57
58