/**
  * Save params, then delete plugin, for all plugins
  * in a given group
  *
  * @param $group the group to be deleted
  * @return none
  */
 private function _shSaveDeletePluginGroup($group)
 {
     $unsafe = array('authentication', 'content', 'editors', 'editors-xtd', 'search', 'system', 'xmlrpc');
     if (in_array($group, $unsafe)) {
         // safety net : we don't want to delete the whole system or content folder
         return false;
     }
     // read list of plugins from db
     $db =& JFactory::getDBO();
     // read plugin param from db
     try {
         $pluginList = Sh404sefHelperDb::selectAssocList('#__extensions', array('*'), array('type' => 'plugin', 'folder' => $group));
         if (empty($pluginList)) {
             return true;
         }
         // for each plugin
         foreach ($pluginList as $plugin) {
             // remove plugin db id
             unset($plugin['id']);
             // write everything on disk
             $this->_shWriteExtensionConfig($plugin['folder'] . '.' . $plugin['element'], array('shConfig' => $plugin));
             // now remove plugin details from db
             Sh404sefHelperDb::delete('#__extensions', array('type' => 'plugin', 'element' => $plugin['element'], 'folder' => $plugin['folder']));
         }
     } catch (Sh404sefExceptionDefault $e) {
         echo $e->getMessage() . '<br />';
     }
     // now delete the files for the whole group
     if (JFolder::exists(JPATH_ROOT . DS . 'plugins' . DS . $group)) {
         JFolder::delete(JPATH_ROOT . DS . 'plugins' . DS . $group);
     }
 }