PluginProbe
Vision – Interactive Image Map with Hotspots Builder / 1.6.2
Vision – Interactive Image Map with Hotspots Builder v1.6.2
1.12.2 1.12.1 1.12.0 1.11.0 1.6.0 1.6.1 1.6.2 1.7.1 1.7.2 1.7.3 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 All 33 releases
vision / includes / deactivator.php

deactivator.php in Vision – Interactive Image Map with Hotspots Builder 1.6.2, at includes/deactivator.php

43 lines 957 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined('ABSPATH') || exit;
3
4 if(!class_exists('Vision_Deactivator')) :
5
6 class Vision_Deactivator {
7 public function deactivate() {
8 global $wpdb;
9 $table = $wpdb->prefix . VISION_PLUGIN_NAME;
10
11 $sql = "SELECT COUNT(*) FROM {$table}";
12 $count = $wpdb->get_var($sql);
13
14 if($count > 0) {
15 return;
16 }
17
18 // delete all if our tables are empty
19 $table = $wpdb->prefix . VISION_PLUGIN_NAME;
20 $sql = "DROP TABLE IF EXISTS {$table}";
21 $wpdb->query($sql);
22
23 delete_option('vision_db_version');
24 delete_option('vision_activated');
25 delete_option('vision_settings');
26
27 $this->delete_files(VISION_PLUGIN_UPLOAD_DIR . '/');
28 }
29
30 private function delete_files($target) {
31 if(is_dir($target)) {
32 $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned
33 foreach($files as $file) {
34 $this->delete_files($file);
35 }
36 rmdir($target);
37 } else if(is_file($target)) {
38 unlink($target);
39 }
40 }
41 }
42
43 endif;