/**
  * Delete a plugin
  *
  * @access	private
  */
 private function delete()
 {
     if (VPost::delete(false) && VPost::plg_id() && $this->_user['delete_content']) {
         try {
             $plg = new Setting(VPost::plg_id());
             $plg->_data = json_decode($plg->_data, true);
             foreach ($plg->_data['admin'] as $file) {
                 File::delete('includes/' . $plg->_data['namespace'] . '/' . $file);
             }
             foreach ($plg->_data['site'] as $file) {
                 File::delete(PATH . 'includes/' . $file);
             }
             foreach ($plg->_data['library'] as $file) {
                 File::delete('library/' . $plg->_data['namespace'] . '/' . $file);
             }
             foreach ($plg->_data['uninstall'] as $query) {
                 $this->_db->query(str_replace('{{prefix}}', DB_PREFIX, $query));
             }
             File::delete(PATH . 'css/' . $plg->_data['namespace'] . '.css', false);
             $plg->delete();
             $result = true;
         } catch (Exception $e) {
             $result = $e->getMessage();
         }
         $this->_action_msg = ActionMessages::deleted($result);
     } elseif (VPost::delete(false) && !$this->_user['delete_content']) {
         $this->_action_msg = ActionMessages::action_no_perm();
     }
 }