private function __construct() { $this->fs = rw_fs(); $this->_options_manager = rw_fs_options(); if (WP_RW__DEBUG) { $this->InitLogger(); } // Load plugin options. $this->LoadDefaultOptions(); $this->LoadOptions(); // Give 2nd chance to logger after options are loaded. if (!RWLogger::IsOn() && $this->GetOption(WP_RW__LOGGER)) { $this->InitLogger(); } // If not in admin dashboard and account don't exist, don't continue with plugin init. if (!$this->fs->is_registered() && !is_admin()) { return; } // Load config after keys are loaded. require_once WP_RW__PLUGIN_DIR . "/lib/config.php"; // Load top-rated require_once WP_RW__PLUGIN_LIB_DIR . "rw-top-rated-widget.php"; }
/** * Loads the options for the workflows and add-ons. * * @author Leo Fajardo (@leorw) * @since 1.0.0 */ private function _load_options() { if (!isset($this->_options)) { $this->_options = rw_fs_options(); } // Load workflows $workflows = $this->_options->get_option('workflows'); if (!is_object($workflows)) { $workflows = new stdClass(); } // Load sorted workflows' IDs $workflows_id_order = $this->_options->get_option('workflows_id_order'); if (!is_array($workflows_id_order)) { $workflows_id_order = array(); } // Load the add-ons' settings $addons_settings = $this->_options->get_option('addons_settings'); if (!is_object($addons_settings)) { $addons_settings = new stdClass(); } $this->_workflows = $workflows; $this->_workflows_id_order = $workflows_id_order; $this->_addons_settings = $addons_settings; }
private function __construct() { $this->_options = rw_fs_options(); $this->optional_migration(); $this->load_account(); }