/**
  *
  */
 function w3tc_default_remove_add_in()
 {
     $module = Util_Request::get_string('w3tc_default_remove_add_in');
     // in the case of missing permissions to delete
     // environment will use that to try to override addin via ftp
     set_transient('w3tc_remove_add_in_' . $module, 'yes', 600);
     switch ($module) {
         case 'pgcache':
             Util_WpFile::delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
             $src = W3TC_INSTALL_FILE_ADVANCED_CACHE;
             $dst = W3TC_ADDIN_FILE_ADVANCED_CACHE;
             try {
                 Util_WpFile::copy_file($src, $dst);
             } catch (Util_WpFile_FilesystemOperationException $ex) {
             }
             break;
         case 'dbcache':
             Util_WpFile::delete_file(W3TC_ADDIN_FILE_DB);
             break;
         case 'objectcache':
             Util_WpFile::delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
             break;
     }
     Util_Admin::redirect(array('w3tc_note' => 'add_in_removed'), true);
 }
 /**
  * Deletes add-in
  *
  * @throws Util_WpFile_FilesystemOperationException
  */
 private function delete_addin()
 {
     if ($this->is_dbcache_add_in()) {
         Util_WpFile::delete_file(W3TC_ADDIN_FILE_DB);
     }
 }
 /**
  * Checks if addins in wp-content are available and deletes them.
  *
  * @param Util_Environment_Exceptions $exs
  */
 private function delete_required_files($exs)
 {
     try {
         if ($this->is_advanced_cache_add_in()) {
             Util_WpFile::delete_file(W3TC_ADDIN_FILE_ADVANCED_CACHE);
         }
     } catch (Util_WpFile_FilesystemOperationException $ex) {
         $exs->push($ex);
     }
 }
 /**
  * Deletes add-in
  *
  * @throws Util_WpFile_FilesystemOperationException
  */
 private function delete_addin()
 {
     if ($this->is_objectcache_add_in()) {
         Util_WpFile::delete_file(W3TC_ADDIN_FILE_OBJECT_CACHE);
     }
 }
 /**
  * Deletes maintenance mode file
  */
 public static function disable_maintenance_mode()
 {
     Util_WpFile::delete_file(Util_Environment::site_path() . '/.maintenance');
 }