示例#1
0
 /**
  * Remove the old Sucuri plugins considering that with the new version (after
  * 1.6.0) all the functionality of the others will be merged here, this will
  * remove duplicated functionality, duplicated bugs and/or duplicated
  * maintenance reports allowing us to focus in one unique project.
  *
  * @return void
  */
 public static function handle_old_plugins()
 {
     if (class_exists('SucuriScanFileInfo')) {
         $file_info = new SucuriScanFileInfo();
         $file_info->ignore_files = false;
         $file_info->ignore_directories = false;
         $plugins = array('sucuri-wp-plugin/sucuri.php', 'sucuri-cloudproxy-waf/cloudproxy.php');
         foreach ($plugins as $plugin) {
             $plugin_directory = dirname(WP_PLUGIN_DIR . '/' . $plugin);
             if (file_exists($plugin_directory)) {
                 if (is_plugin_active($plugin)) {
                     deactivate_plugins($plugin);
                 }
                 $plugin_removed = $file_info->remove_directory_tree($plugin_directory);
             }
         }
     }
 }