/** * Do the HTTP call to and report the spammer * * @param string $username * @param string $email * @param string $ip_addr */ private function _handleReportSpammer($username, $email, $ip_addr) { if (!empty($email)) { $url = 'http://www.stopforumspam.com/add.php'; $call = wp_remote_post($url, array('user-agent' => 'WordPress/AVH ' . AVH_FDAS_Define::PLUGIN_VERSION . '; ' . get_bloginfo('url'), 'body' => array('username' => $username, 'ip_addr' => $ip_addr, 'email' => $email, 'api_key' => $this->_core->getOptionElement('sfs', 'sfsapikey')))); if (is_wp_error($call) || 200 != $call['response']['code']) { $to = get_option('admin_email'); $subject = sprintf('[%s] AVH First Defense Against Spam - ' . __('Error reporting spammer', 'avh-fdas'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)); if (is_wp_error($call)) { $message = $call->get_error_messages(); } else { $message[] = $call['body']; } AVH_Common::sendMail($to, $subject, $message, $this->_settings->getSetting('mail_footer')); } } }