| Linux hosting5.siteguarding.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64 Path : /home/devsafetybis/j4412.dev.safetybis.com/tmp/install_67d9771048888/ |
| Current File : /home/devsafetybis/j4412.dev.safetybis.com/tmp/install_67d9771048888/script.php |
<?php
/**
* @package BadBot Protection
* @copyright Copyright (C) 2018 SiteGuarding.com. All rights reserved.
* @GNU General Public License
*/
defined('_JEXEC') or die('Restricted access');
class com_badbotprotectionInstallerScript
{
function install($parent)
{
jimport('joomla.installer.installer');
$src_plugins = dirname(__FILE__). DIRECTORY_SEPARATOR .'plugin';
$installer = new JInstaller;
$result = $installer->install($src_plugins);
$status->plugins[] = array('name'=>'badbotprotection','group'=>'content', 'result'=>$result);
$db = JFactory::getDBO();
$db->setQuery("UPDATE #__extensions SET enabled = '1' WHERE `element` = 'badbotprotection' AND `type` = 'plugin'");
$db->query();
}
function uninstall($parent)
{
$tools_file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'siteguarding_tools.php';
$tools_folder = JPATH_ROOT . DIRECTORY_SEPARATOR . 'webanalyze';
if (JFolder::exists($tools_folder)) JFolder::delete($tools_folder);
if (JFile::exists($tools_file)) JFile::delete($tools_file);
jimport('joomla.installer.installer');
$db = JFactory::getDBO();
$db->setQuery('SELECT `extension_id` FROM #__extensions WHERE `type` = "plugin" AND `element` = "badbotprotection" AND `folder` = "content"');
$id = $db->loadResult();
if($id)
{
$installer = new JInstaller;
$result = $installer->uninstall('plugin', $id , 1);
}
}
}