/** * Check an IP with Stop Forum Spam * */ private function _doIpCheckStopForumSpam() { if ($this->_core_options['general']['use_sfs']) { $time_start = microtime(true); $result = $this->_core->handleRestCall($this->_core->getRestIPLookup($this->_visiting_ip, $this->_visiting_email)); $time_end = microtime(true); $this->_spaminfo['sfs'] = $this->_convertStopForumSpamCall($result); $time = $time_end - $time_start; $this->_spaminfo['sfs']['time'] = $time; if (isset($this->_spaminfo['sfs']['Error'])) { if ($this->_core_options['sfs']['error']) { $error = $this->_core->getHttpError($this->_spaminfo['sfs']['Error']); $to = get_option('admin_email'); $subject = sprintf('[%s] AVH First Defense Against Spam - ' . __('Error detected', 'avh-fdas'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)); $message[] = __('An error has been detected', 'avh-fdas'); $message[] = sprintf(__('Error: %s', 'avh-fdas'), $error); $message[] = ''; $message[] = sprintf(__('IP: %s', 'avh-fdas'), $this->_visiting_ip); $message[] = sprintf(__('Accessing: %s', 'avh-fdas'), $_SERVER['REQUEST_URI']); $message[] = sprintf(__('Call took: %s', 'avh-fdas'), $time); AVH_Common::sendMail($to, $subject, $message, $this->_settings->getSetting('mail_footer')); } $this->_spaminfo['sfs'] = null; } else { $this->_spaminfo['sfs']['appears'] = false; if ($this->_spaminfo['sfs']['ip']['appears'] || $this->_spaminfo['sfs']['email']['appears']) { $this->_spaminfo['sfs']['appears'] = true; } if (true === $this->_spaminfo['sfs']['appears']) { $this->_spammer_detected = $this->_spaminfo['sfs']['ip']['frequency'] >= $this->_core_options['sfs']['whentodie'] || $this->_spaminfo['sfs']['email']['frequency'] >= $this->_core_options['sfs']['whentodie_email']; } } } }