function __construct() { // Get The Registry $this->_settings = AVH_FDAS_Settings::getInstance(); $this->_classes = AVH_FDAS_Classes::getInstance(); // Initialize the plugin $this->_core = $this->_classes->load_class('Core', 'plugin', true); $this->_ipcachedb = $this->_classes->load_class('DB', 'plugin', true); $this->screen = 'avh_f_d_a_s_page_avh_first_defense_against_spam_ip_cache_'; $default_status = get_user_option('avhfdas_ip_cache_list_last_view'); if (empty($default_status)) { $default_status = 'all'; } $status = isset($_REQUEST['avhfdas_ip_cache_list_status']) ? $_REQUEST['avhfdas_ip_cache_list_status'] : $default_status; if (!in_array($status, array('all', 'ham', 'spam', 'search'))) { $status = 'all'; } if ($status != $default_status && 'search' != $status) { update_user_meta(get_current_user_id(), 'avhfdas_ip_cache_list_last_view', $status); } if (AVH_Common::getWordpressVersion() >= 3.2) { parent::__construct(array('plural' => 'ips', 'singular' => 'ip', 'ajax' => true)); } else { parent::WP_List_Table(array('plural' => 'ips', 'singular' => 'ip', 'ajax' => true)); } }
public function handleInitializePlugin() { // Get The Registry $this->_settings = AVH_FDAS_Settings::getInstance(); $this->_classes = AVH_FDAS_Classes::getInstance(); // Initialize the plugin $this->_core = $this->_classes->load_class('Core', 'plugin', true); $this->_spamcheck = $this->_classes->load_class('SpamCheck', 'plugin', true); $this->_core_options = $this->_core->getOptions(); // Public actions and filters if (1 == $this->_core_options['general']['commentnonce']) { add_action('comment_form', array($this, 'actionAddNonceFieldToComment')); add_filter('preprocess_comment', array($this, 'filterCheckNonceFieldToComment'), 1); } add_action('get_header', array($this, 'handleActionGetHeader')); add_action('pre_comment_on_post', array($this, 'handleActionPreCommentOnPost'), 1); add_filter('registration_errors', array($this, 'handleFilterRegistrationErrors'), 10, 3); add_filter('wpmu_validate_user_signup', array($this, 'handleFilterWPMUValidateUserSignup'), 1); if ($this->_core_options['php']['usehoneypot']) { add_action('comment_form', array($this, 'handleActionDisplayHoneypotUrl')); add_action('login_footer', array($this, 'handleActionDisplayHoneypotUrl')); } // Private actions for Cron add_action('avhfdas_clean_nonce', array($this, 'actionHandleCronCleanNonce')); add_action('avhfdas_clean_ipcache', array($this, 'actionHandleCronCleanIpCache')); /** * Hook in registration process for Events Manager */ if (defined('EM_VERSION')) { add_filter('em_registration_errors', array($this, 'handleFilterRegistrationErrors'), 10, 3); } }
/** * PHP5 Constructor */ public function __construct() { // Get The Registry $this->_settings = AVH_FDAS_Settings::getInstance(); $this->_classes = AVH_FDAS_Classes::getInstance(); // Initialize the plugin $this->_core = $this->_classes->load_class('Core', 'plugin', true); $this->_ipcachedb = $this->_classes->load_class('DB', 'plugin', true); $this->_visiting_ip = AVH_Visitor::getUserIp(); $this->_visiting_email = ''; $this->_core_options = $this->_core->getOptions(); $this->_core_data = $this->_core->getData(); $this->_spaminfo = null; $this->_spammer_detected = false; $this->_ip_in_white_list = false; $this->_ip_in_cache = false; $this->_spamcheck_functions_array[00] = 'Blacklist'; $this->_spamcheck_functions_array[02] = 'IpCache'; $this->_spamcheck_functions_array[05] = 'StopForumSpam'; $this->_spamcheck_functions_array[10] = 'ProjectHoneyPot'; $this->_spamcheck_functions_array[11] = 'Spamhaus'; }