/** * @internal Load the rest of the system. */ public function Load() { $optionsTable = new WSAL_Models_Option(); if (!$optionsTable->IsInstalled()) { $optionsTable->Install(); //setting the prunig date with the old value or the default value $pruningDate = $this->settings->GetPruningDate(); $this->settings->SetPruningDate($pruningDate); $pruningEnabled = $this->settings->IsPruningLimitEnabled(); $this->settings->SetPruningLimitEnabled($pruningEnabled); //setting the prunig limit with the old value or the default value $pruningLimit = $this->settings->GetPruningLimit(); $this->settings->SetPruningLimit($pruningLimit); } // load translations load_plugin_textdomain('wp-security-audit-log', false, basename(dirname(__FILE__)) . '/languages/'); // tell the world we've just finished loading $s = $this->profiler->Start('WSAL Init Hook'); do_action('wsal_init', $this); $s->Stop(); // hide plugin if ($this->settings->IsIncognito()) { add_action('admin_head', array($this, 'HidePlugin')); } }
/** * Initialize plugin. */ public function __construct() { // profiler has to be loaded manually require_once 'classes/SimpleProfiler.php'; $this->profiler = new WSAL_SimpleProfiler(); // load autoloader and register base paths require_once 'classes/Autoloader.php'; $this->autoloader = new WSAL_Autoloader($this); $this->autoloader->Register(self::PLG_CLS_PRFX, $this->GetBaseDir() . 'classes' . DIRECTORY_SEPARATOR); // load dependencies $this->views = new WSAL_ViewManager($this); $this->alerts = new WSAL_AlertManager($this); $this->sensors = new WSAL_SensorManager($this); $this->settings = new WSAL_Settings($this); $this->constants = new WSAL_ConstantManager($this); $this->licensing = new WSAL_LicenseManager($this); $this->widgets = new WSAL_WidgetManager($this); // listen for installation event register_activation_hook(__FILE__, array($this, 'Install')); // listen for cleanup event add_action('wsal_cleanup', array($this, 'CleanUp')); // render wsal header add_action('admin_enqueue_scripts', array($this, 'RenderHeader')); // render wsal footer add_action('admin_footer', array($this, 'RenderFooter')); // hide plugin if ($this->settings->IsIncognito()) { add_action('admin_head', array($this, 'HidePlugin')); } }