diff --git a/antispam.admin.inc b/antispam.admin.inc
index 35b4697..72b16a7 100644
--- a/antispam.admin.inc
+++ b/antispam.admin.inc
@@ -1,4 +1,10 @@
 <?php
+/**
+ * @file
+ * The antispam admin theme.
+ *
+ * Administration functions for managing the module.
+ */
 
 /**
  * Truncate size of content body for the tooltip
@@ -54,7 +60,7 @@ function antispam_settings_form() {
   $service_provider = antispam_get_service_provider();
 
   // Provide the AntiSpam administration JavaScript.
-  drupal_add_js(drupal_get_path('module', 'antispam') .'/antispam.js');
+  drupal_add_js(drupal_get_path('module', 'antispam') . '/antispam.js');
 
   $service_fieldset_collapsed = FALSE; // always show 
 
@@ -207,7 +213,7 @@ function antispam_settings_form() {
         '@admin-nodes' => t('administer nodes'),
         '!admin-access' => url('admin/access'),
       ))
-      .'<br />'. t('<strong>Note:</strong> To interact fully with the antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use these links to submit missed spam and false positives (ham), otherwise antispam service will never learn from its mistakes. Thank you.'),
+      . '<br />' . t('<strong>Note:</strong> To interact fully with the antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use these links to submit missed spam and false positives (ham), otherwise antispam service will never learn from its mistakes. Thank you.'),
   );
 
   if (module_exists('comment')) {
@@ -244,7 +250,7 @@ function antispam_settings_form() {
           '@admin-comments' => t('administer comments'),
           '!admin-access' => url('admin/access'),
         ))
-        .'<br />'. t('<strong>Note:</strong> To interact fully with the selected antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use these links to submit missed spam and false positives (ham), otherwise the antispam service will never learn from its mistakes. Thank you.'),
+        . '<br />' . t('<strong>Note:</strong> To interact fully with the selected antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use these links to submit missed spam and false positives (ham), otherwise the antispam service will never learn from its mistakes. Thank you.'),
     );
   }
 
@@ -316,7 +322,7 @@ function antispam_settings_form() {
   );
   $anti_spambot_actions = array(
     'none' => t('None (only the delay specified above, if any).'),
-    '503' => t('HTTP error 503 (Service Unavailable), showing a simple blank page.'),
+    '503' => t('HTTP error 503 (Service Unavailable), showing a simple blank page. '),
     '403' => t('HTTP error 403 (Forbidden), showing a simple blank page.'),
     '403d' => t('HTTP error 403 (Forbidden), showing a Drupal generated page.')
   );
@@ -368,7 +374,7 @@ function antispam_moderator_operations($mode, $submode) {
       )
     );
   }
-  else if ($mode == 'comments') {
+  elseif ($mode == 'comments') {
     $operations = array(
       'submit-spam' => array(
         'title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit selected comments as spam') : t('Mark selected comments as spam')),
@@ -406,10 +412,10 @@ function antispam_moderator_operations($mode, $submode) {
   if ($submode == 'spam') {
     unset($operations['submit-spam']);
   }
-  else if ($submode == 'unpublished') {
+  elseif ($submode == 'unpublished') {
     unset($operations['unpublish']);
   }
-  else if ($submode == 'published') {
+  elseif ($submode == 'published') {
     unset($operations['publish']);
   }
   else { // Unknown submode!
@@ -438,7 +444,7 @@ function antispam_generate_statistics_graph() {
             . '&cht=p'  // char type: line chart
             . '&chs=' . $chart_width . 'x' . ($chart_width / 2) // chart size
             . '&chds=0,' . $total
-            . '&chl=' . t('Spam') . '|' . t('Ham') .'|'
+            . '&chl=' . t('Spam') . '|' . t('Ham') . '|'
               . t('False Negative') . '|' . t('False Positive') // legend
             . '&chd=t:' . $counts['total_spam'] . ',' . $counts['total_ham'] . ','
               . $counts['total_fnegative'] . ',' . $counts['total_fpositive']
@@ -454,7 +460,9 @@ function antispam_generate_statistics_graph() {
 
 
   // get oldest and latest date within the range
-  $rec = db_query("SELECT MIN(date) AS oldest, MAX(date) AS latest FROM {antispam_counter} ORDER BY date DESC LIMIT 365")->fetchObject();
+  $rec = db_query_range("SELECT MIN(date) AS oldest, MAX(date) AS latest FROM {antispam_counter} ORDER BY date DESC", 0, 365)->fetchObject();
+
+
   $oldest = $rec ? date('M-d', strtotime($rec->oldest)) : '';
   $latest = $rec ? date('M-d', strtotime($rec->latest)) : date('M-d');
 
@@ -473,7 +481,7 @@ function antispam_generate_statistics_graph() {
             . '&chd=t:';
   $spam = $ham = array();
   // max 1 year
-  $result = db_query("SELECT * FROM {antispam_counter} ORDER BY date DESC LIMIT 365");
+  $result = db_query_range("SELECT * FROM {antispam_counter} ORDER BY date DESC", 0, 365);
   foreach ($result as $rec) {
     $spam[] = $rec->spam_detected;
     $ham[] = $rec->ham_detected;
@@ -508,14 +516,14 @@ function antispam_callback_queue($mode = '', $submode = '') {
   if (empty($mode)) {
     $mode = 'overview';
   }
-  else if (!in_array($mode, $valid_modes)) {
+  elseif (!in_array($mode, $valid_modes)) {
     drupal_not_found();
     return;
   }
   if (empty($submode)) {
     $submode = 'spam';
   }
-  else if (!isset($valid_submodes[$submode])) {
+  elseif (!isset($valid_submodes[$submode])) {
     drupal_not_found();
     return;
   }
@@ -549,10 +557,10 @@ function antispam_callback_queue($mode = '', $submode = '') {
         if ($key == 'spam') {
           $query->isNotNull('s.content_id');            
         }
-        else if ($key == 'unpublished') {
+        elseif ($key == 'unpublished') {
           $query->condition('n.status', COMMENT_NOT_PUBLISHED);
         }
-        else if ($key == 'published') {
+        elseif ($key == 'published') {
           $query->condition('n.status', COMMENT_PUBLISHED);
         }
         $query->addTag('node_access');
@@ -561,11 +569,11 @@ function antispam_callback_queue($mode = '', $submode = '') {
         $sql_cnt = str_replace('%cond', $sql_nodes_cond[$key], $sql_nodes_cnt);
         $count = db_query(db_rewrite_sql($sql_cnt))->fetchField();
 */
-        $path = 'admin/content/antispam/nodes'. ($key == 'spam' ? '' : '/'. $key);
+        $path = 'admin/content/antispam/nodes' . ($key == 'spam' ? '' : '/' . $key);
         $label = ($count > 0 ? l($title, $path) : $title);
-        $subitems[] = '<p><strong>'. $label .': '. $count .'</strong></p>';
+        $subitems[] = '<p><strong>' . $label . ': ' . $count . '</strong></p>';
       }
-      $items[] = '<h4>'. t('Nodes') .'</h4>'. theme('item_list', array('items' => $subitems));
+      $items[] = '<h4>' . t('Nodes') . '</h4>' . theme('item_list', array('items' => $subitems));
     }
     //------ comment ------
     if ($allowed_comments) {
@@ -577,19 +585,19 @@ function antispam_callback_queue($mode = '', $submode = '') {
         if ($key == 'spam') {
           $query->isNotNull('s.content_id');            
         }
-        else if ($key == 'unpublished') {
+        elseif ($key == 'unpublished') {
           $query->condition('c.status', 0);
         }
-        else if ($key == 'published') {
+        elseif ($key == 'published') {
           $query->condition('c.status', 1);
         }
         $query->addTag('node_access');
         $count = $query->countQuery()->execute()->fetchField();
-        $path = 'admin/content/antispam/comments'. ($key == 'spam' ? '' : '/'. $key);
+        $path = 'admin/content/antispam/comments' . ($key == 'spam' ? '' : '/' . $key);
         $label = ($count > 0 ? l($title, $path) : $title);
-        $subitems[] = '<p><strong>'. $label .': '. $count .'</strong></p>';
+        $subitems[] = '<p><strong>' . $label . ': ' . $count . '</strong></p>';
       }
-      $items[] = '<h4>'. t('Comments') .'</h4>'. theme('item_list', array('items' => $subitems));
+      $items[] = '<h4>' . t('Comments') . '</h4>' . theme('item_list', array('items' => $subitems));
     }
     return '<h3>' . t('Summary of content:') . '</h3>' . theme('item_list', array('items' => $items));
   }
@@ -659,15 +667,15 @@ function antispam_get_submode_menu($mode, $submode) {
   if ($submode == 'spam') {
     $spam_li = '<li class="active">'; 
   }
-  else if ($submode == 'unpublished') {
+  elseif ($submode == 'unpublished') {
     $unpublished_li = '<li class="active">'; 
   }
-  else if ($submode == 'published') {
+  elseif ($submode == 'published') {
     $published_li = '<li class="active">'; 
   }
-  $out .= $spam_li . l(t('Spam'), 'admin/content/antispam/'.$mode.'/spam') . '</li>';
-  $out .= $unpublished_li . l(t('Unpublished'), 'admin/content/antispam/'.$mode.'/unpublished') . '</li>';
-  $out .= $published_li . l(t('Published'), 'admin/content/antispam/'.$mode.'/published') . '</li>';
+  $out .= $spam_li . l(t('Spam'), 'admin/content/antispam/' . $mode . '/spam') . '</li>';
+  $out .= $unpublished_li . l(t('Unpublished'), 'admin/content/antispam/' . $mode . '/unpublished') . '</li>';
+  $out .= $published_li . l(t('Published'), 'admin/content/antispam/' . $mode . '/published') . '</li>';
   $out .= '</ul></div>';
   return $out;
 }
@@ -728,10 +736,10 @@ function antispam_moderation_form($form, &$form_state, $mode = '', $submode = ''
     if ($submode == 'spam') {
       $query->isNotNull('s.content_id');            
     }
-    else if ($submode == 'unpublished') {
+    elseif ($submode == 'unpublished') {
       $query->condition('n.status', 0);
     }
-    else if ($submode == 'published') {
+    elseif ($submode == 'published') {
       $query->condition('n.status', 1);
     }
     if (antispam_get_service_provider() == DEFENSIO_SERVICE) {
@@ -771,10 +779,10 @@ function antispam_moderation_form($form, &$form_state, $mode = '', $submode = ''
     if ($submode == 'spam') {
       $query->isNotNull('s.content_id');            
     }
-    else if ($submode == 'unpublished') {
+    elseif ($submode == 'unpublished') {
       $query->condition('c.status', COMMENT_NOT_PUBLISHED);
     }
-    else if ($submode == 'published') {
+    elseif ($submode == 'published') {
       $query->condition('c.status', COMMENT_PUBLISHED);
     }
     if (antispam_get_service_provider() == DEFENSIO_SERVICE) {
@@ -811,16 +819,16 @@ function antispam_moderation_form($form, &$form_state, $mode = '', $submode = ''
       $items[$content->nid] = '';
       $content->name = $content->uid ? $content->registered_name : $content->name;
       $form['title'][$content->nid] = array(
-        '#value' => l($content->title, 'node/'. $content->nid, array(
+        '#value' => l($content->title, 'node/' . $content->nid, array(
           'attributes' => array(
             'title' => truncate_utf8(render($content->body), BODY_TOOLTIP_LEN),
           )
         )
-      ) .' '. theme('mark', array('type' => node_mark($content->nid, $content->changed))));
+      ) . ' ' . theme('mark', array('type' => node_mark($content->nid, $content->changed))));
       $form['type'][$content->nid] = array('#value' => node_type_get_name($content));
       $form['author'][$content->nid] = array('#value' => theme('username', array('name' => $content->name)));
       $form['status'][$content->nid] = array('#value' => ($content->status ? t('published') : t('not published')));
-      if(empty($content->spam_mark)) $content->spam_mark = 0;
+      if (empty($content->spam_mark)) $content->spam_mark = 0;
       if ($content->spam_mark) {
         $form['status'][$content->nid]['#value'] .= '/' . t('spam');
       }
@@ -833,12 +841,12 @@ function antispam_moderation_form($form, &$form_state, $mode = '', $submode = ''
       $items[$content->cid] = '';
       $content->name = $content->uid ? $content->registered_name : $content->name;
       $form['title'][$content->cid] = array(
-        '#value' => l($content->subject, 'node/'. $content->nid, array(
+        '#value' => l($content->subject, 'node/' . $content->nid, array(
           'attributes' => array(
             'title' => truncate_utf8(render($content->body), BODY_TOOLTIP_LEN)
           ), 
           'fragment' => 'comment-' . $content->cid,
-         )) .' '. theme('mark', array('type' => node_mark($content->cid, $content->created))));
+         )) . ' ' . theme('mark', array('type' => node_mark($content->cid, $content->created))));
       $form['author'][$content->cid] = array('#value' => theme('username', array('name' => $content->name)));
       $form['status'][$content->cid] = array('#value' => ($content->status == COMMENT_PUBLISHED ? t('published') : t('not published')));
       if ($content->spam_mark) {
@@ -889,9 +897,9 @@ function theme_antispam_moderation_form($variables) {
   }
   else {
     if ($submode == 'spam') {
-      $message = ($mode == 'nodes' ? t('There is no spam in the nodes moderation queue.') : t('There is no spam in the comments moderation queue.')) .'<br />'. t('It must be your lucky day! ;-)');
+      $message = ($mode == 'nodes' ? t('There is no spam in the nodes moderation queue.') : t('There is no spam in the comments moderation queue.')) . '<br />' . t('It must be your lucky day! ;-)');
     }
-    else if ($submode == 'unpublished') {
+    elseif ($submode == 'unpublished') {
       $message = ($mode == 'nodes' ? t('There are no unpublished nodes in the moderation queue.') : t('There are no unpublished comments in the moderation queue.'));
     }
     else { // published
@@ -946,9 +954,9 @@ function antispam_confirm_multiple_operation($form, &$form_state, $mode = '', $s
     return;
   }
 
-  $confirm_message = '<strong>'. $valid_operations[$operation]['confirm'] .'</strong>';
+  $confirm_message = '<strong>' . $valid_operations[$operation]['confirm'] . '</strong>';
   $confirm_button = $valid_operations[$operation]['button'];
-  $confirm_warning = '<p>'. (isset($valid_operations[$operation]['warning']) ? $valid_operations[$operation]['warning'] : '') .'</p>';
+  $confirm_warning = '<p>' . (isset($valid_operations[$operation]['warning']) ? $valid_operations[$operation]['warning'] : '') . '</p>';
   $content_type = ($mode == 'nodes' ? 'node' : 'comment');
 
   $form = array();
@@ -956,8 +964,8 @@ function antispam_confirm_multiple_operation($form, &$form_state, $mode = '', $s
   // array_filter() returns only elements with actual values
   foreach (array_filter($edit['items']) as $content_id => $value) {
     if ($content = antispam_content_load($content_type, $content_id)) {
-      $title = '&quot;'. check_plain($content_type == 'node' ? $content->title : $content->subject) .'&quot;, '. t('by') .' '. theme('username', array('name' => $content->name));
-      $form['items'][$content_id] = array('#type' => 'hidden', '#value' => $content_id, '#prefix' => '<li>', '#suffix' => $title .'</li>');
+      $title = '&quot;' . check_plain($content_type == 'node' ? $content->title : $content->subject) . '&quot;, ' . t('by') . ' ' . theme('username', array('name' => $content->name));
+      $form['items'][$content_id] = array('#type' => 'hidden', '#value' => $content_id, '#prefix' => '<li>', '#suffix' => $title . '</li>');
     }
   }
   $form['mode'] = array('#type' => 'hidden', '#value' => $mode);
@@ -967,9 +975,9 @@ function antispam_confirm_multiple_operation($form, &$form_state, $mode = '', $s
   // Redirect to a non-existent menu item to make tabs disappear.
   menu_set_active_item('');
 
-  $path = 'admin/content/antispam/'. $mode;
+  $path = 'admin/content/antispam/' . $mode;
   if ($submode != 'spam') {
-    $path .= '/'. $submode;
+    $path .= '/' . $submode;
   }
   return confirm_form($form, $confirm_message, $path, $confirm_warning, $confirm_button, t('Cancel'));
 }
@@ -996,7 +1004,7 @@ function antispam_confirm_multiple_operation_submit($form, &$form_state) {
         antispam_content_delete($content_type, $content_id);
         $message = ($mode == 'nodes' ? t('The nodes have been deleted.') : t('The comments have been deleted.'));
       }
-      else if ($content = antispam_content_load($content_type, $content_id)) {
+      elseif ($content = antispam_content_load($content_type, $content_id)) {
         if ($content_type == 'node') {
           $is_published = ($content->status ? TRUE : FALSE);
         }
@@ -1009,7 +1017,7 @@ function antispam_confirm_multiple_operation_submit($form, &$form_state) {
           antispam_content_spam_operation($content_type, $content, 'submit-spam', TRUE);
           antispam_increase_counter(ANTISPAM_COUNT_FALSE_NEGATIVE);
         }
-        else if ($operation == 'submit-ham' && $is_spam) {
+        elseif ($operation == 'submit-ham' && $is_spam) {
           antispam_content_spam_operation($content_type, $content, 'submit-ham', TRUE);
           antispam_increase_counter(ANTISPAM_COUNT_FALSE_POSITIVE);
         }
@@ -1017,7 +1025,7 @@ function antispam_confirm_multiple_operation_submit($form, &$form_state) {
         if (in_array($operation, array('unpublish', 'submit-spam')) && $is_published) {
           antispam_content_publish_operation($content_type, $content, 'unpublish');
         }
-        else if (in_array($operation, array('publish', 'submit-ham')) && !$is_published) {
+        elseif (in_array($operation, array('publish', 'submit-ham')) && !$is_published) {
           antispam_content_publish_operation($content_type, $content, 'publish');
         }
 
@@ -1027,9 +1035,9 @@ function antispam_confirm_multiple_operation_submit($form, &$form_state) {
     drupal_set_message($message);
   }
 
-  $form_state['redirect'] = 'admin/content/antispam/'. $mode;
+  $form_state['redirect'] = 'admin/content/antispam/' . $mode;
   if ($submode != 'spam') {
-    $form_state['redirect'] .= '/'. $submode;
+    $form_state['redirect'] .= '/' . $submode;
   }
   return;
 }
diff --git a/antispam.cron.inc b/antispam.cron.inc
index 2d1ff29..93a4a14 100644
--- a/antispam.cron.inc
+++ b/antispam.cron.inc
@@ -1,4 +1,10 @@
 <?php
+/**
+ * @file
+ * The antispam cron code.
+ *
+ * Module crone functions.
+ */
 
 /**
  * Shutdown function executed at cron time.
@@ -58,8 +64,8 @@ function antispam_cron_shutdown() {
       }
     }
     if ($delete_count > 0) {
-      $message = t('AntiSpam housekeeping') .': '. format_plural($delete_count, '1 expired spam node removed from database', '@count expired spam nodes removed from database').
-        '<br />'.t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));
+      $message = t('AntiSpam housekeeping') . ': ' . format_plural($delete_count, '1 expired spam node removed from database', '@count expired spam nodes removed from database') .
+        '<br />' . t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));
       watchdog('cron', $message);
       $clear_cache = TRUE;
     }
@@ -74,8 +80,8 @@ function antispam_cron_shutdown() {
       }
     }
     if ($delete_count > 0) {
-      $message = t('AntiSpam housekeeping') .': '. format_plural($delete_count, '1 expired spam comment removed from database', '@count expired spam comments removed from database').
-        '<br />'.t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));
+      $message = t('AntiSpam housekeeping') . ': ' . format_plural($delete_count, '1 expired spam comment removed from database', '@count expired spam comments removed from database') .
+        '<br />' . t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));
       watchdog('cron', $message);
       $clear_cache = TRUE;
     }
@@ -102,12 +108,12 @@ function antispam_cron_shutdown() {
       ->execute();
   }
   if ($spam_marks_removed > 0) {
-    $message = t('AntiSpam housekeeping') .': '. format_plural($spam_marks_removed, '1 spam mark removed from database', '@count spam marks removed from database');
+    $message = t('AntiSpam housekeeping') . ': ' . format_plural($spam_marks_removed, '1 spam mark removed from database', '@count spam marks removed from database');
     if (isset($spam_nids_list)) {
-      $message .= '<br />'. t('Node ID List: %nids', array('%nids' => $spam_nids_list));
+      $message .= '<br />' . t('Node ID List: %nids', array('%nids' => $spam_nids_list));
     }
     if (isset($spam_cids_list)) {
-      $message .= '<br />'. t('Comment ID List: %cids', array('%cids' => $spam_cids_list));
+      $message .= '<br />' . t('Comment ID List: %cids', array('%cids' => $spam_cids_list));
     }
     watchdog('cron', $message);
     $clear_cache = TRUE;
diff --git a/antispam.info b/antispam.info
index 922f894..e1e24f6 100644
--- a/antispam.info
+++ b/antispam.info
@@ -3,7 +3,8 @@ name = AntiSpam
 description = Use the anti-spam service to protect your site from spam
 core = "7.x"
 
-configure = admin/config/antispam
+configure = admin/config/spamprevention/antispam
+
 
 files[] = antispam.module
 files[] = antispam.admin.inc
diff --git a/antispam.install b/antispam.install
index c2950ee..2568f3d 100644
--- a/antispam.install
+++ b/antispam.install
@@ -1,4 +1,10 @@
 <?php
+/**
+ * @file
+ * The antispam install module.
+ *
+ * Install module for antispam.
+ */
 
 /**
  * Implements hook_schema().
diff --git a/antispam.module b/antispam.module
index 296f4e2..9be4a10 100644
--- a/antispam.module
+++ b/antispam.module
@@ -6,7 +6,7 @@
 define('ANTISPAM_DRUPAL_VERSION', '6');
 define('ANTISPAM_MODULE_VERSION', '1.0');
 define('ANTISPAM_MODULE_HOMEURL', 'http://www.drupal.org/project/antispam');
-define('ANTISPAM_MODULE_USERAGENT', 'Drupal/'. ANTISPAM_DRUPAL_VERSION .' | antispam.module/'. ANTISPAM_MODULE_VERSION);
+define('ANTISPAM_MODULE_USERAGENT', 'Drupal/' . ANTISPAM_DRUPAL_VERSION . ' | antispam.module/' . ANTISPAM_MODULE_VERSION);
 
 
 /**
@@ -18,7 +18,7 @@ define('DEFENSIO_API_HOST', 'api.defensio.com');
 define('ANTISPAM_API_PORT', 80);
 define('AKISMET_API_VERSION', '1.1');
 define('DEFENSIO_API_VERSION', '1.2');
-define('ANTISPAM_API_USERAGENT', 'Drupal/'. ANTISPAM_DRUPAL_VERSION .' | antispam.module/'. ANTISPAM_MODULE_VERSION);
+define('ANTISPAM_API_USERAGENT', 'Drupal/' . ANTISPAM_DRUPAL_VERSION . ' | antispam.module/' . ANTISPAM_MODULE_VERSION);
 define('ANTISPAM_API_RESULT_ERROR', -1);
 define('ANTISPAM_API_RESULT_SUCCESS', 0);
 define('ANTISPAM_API_RESULT_IS_SPAM', 1);
@@ -40,9 +40,8 @@ define('ANTISPAM_COUNT_FALSE_POSITIVE', 4);
 /**
  * Debug function
  */
-function antispam_debug($str)
-{
-  if(is_array($str) || is_object($str)) {
+function antispam_debug($str) {
+  if (is_array($str) || is_object($str)) {
     error_log(print_r($str, TRUE) . "\r\n", 3, "/tmp/antispam.txt");
   }
   else {
@@ -70,13 +69,13 @@ function antispam_help($path, $arg) {
         '!akismet' => url('http://akismet.com'),
         '!typepad' => url('http://antispam.typepad.com'),
         '!defensio' => url('http://defensio.com'),
-        '!antispam-settings' => url('admin/config/antispam'),
+        '!antispam-settings' => url('admin/config/spamprevention/antispam'),
         '!permission' => url('admin/people/permissions'),
         '%no-check-perm' => t('post with no antispam checking')
       ));
       return $output;
     case 'admin/help/antispam':
-    case 'admin/config/antispam':
+    case 'admin/config/spamprevention/antispam':
       $output = t('<p>The <a href="!antispam-module-home">AntiSpam module</a> for <a href="!drupal">Drupal</a> allows you to use either one of the <a href="!akismet">Akismet</a>, <a href="!typepad">TypePad AntiSpam</a> or <a href="!defensio">Defensio</a> service to protect your site from being spammed.</p>',
       array(
         '!antispam-module-home' => url(ANTISPAM_MODULE_HOMEURL),
@@ -89,31 +88,31 @@ function antispam_help($path, $arg) {
       return $output;
     case 'admin/content/antispam/nodes/unpublished':
       $output = t('Below is the list of <strong>unpublished nodes</strong> awaiting for moderation.');
-      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      $output .= ' ' . t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
       break;
     case 'admin/content/antispam/nodes/published':
       $output = t('Below is the list of <strong>published nodes</strong>.');
-      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      $output .= ' ' . t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
       break;
     case 'admin/content/antispam/nodes': // spam
       $output = t('Below is the list of <strong>nodes marked as spam</strong> awaiting for moderation.');
-      $output .= ' '. t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
+      $output .= ' ' . t('Click on the titles to see the content of the nodes or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the nodes upon your needs.');
       break;
     case 'admin/content/antispam/comments/unpublished':
       $output = t('Below is the list of <strong>unpublished comments</strong> awaiting for moderation.');
-      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      $output .= ' ' . t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
       break;
     case 'admin/content/antispam/comments/published':
       $output = t('Below is the list of <strong>published comments</strong>.');
-      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      $output .= ' ' . t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
       break;
     case 'admin/content/antispam/comments': // spam
       $output = t('Below is the list of <strong>comments marked as spam</strong> awaiting for moderation.');
-      $output .= ' '. t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
+      $output .= ' ' . t('Click on the subjects to see the comments or the author\'s name to view the author\'s user information. You may also wish to click on the headers to order the comments upon your needs.');
       break;
   }
   if (arg(0) == 'admin' && arg(1) == 'content '&& arg(2) == 'antispam' && !isset($_POST) && !empty($output)) {
-    $output .= '<br />'. t('<strong>Note:</strong> To interact fully with the antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use the submit <em>ham</em> operation rather than simply publishing content that was identified as spam (false positives). This is necessary in order to let the antispam service learn from its mistakes. Thank you.');
+    $output .= '<br />' . t('<strong>Note:</strong> To interact fully with the antispam service, you really should try putting data back into the system as well as just taking it out. If it is at all possible, please use the submit <em>ham</em> operation rather than simply publishing content that was identified as spam (false positives). This is necessary in order to let the antispam service learn from its mistakes. Thank you.');
   }
 }
 
@@ -135,14 +134,14 @@ function antispam_requirements($phase) {
           array(
             '!wpapikey' => url('http://akismet.com/signup/'),
             '!akismet-com' => url('http://akismet.com'),
-            '!antispam-settings' => url('admin/config/antispam'),
+            '!antispam-settings' => url('admin/config/spamprevention/antispam'),
           )),
           'severity' => REQUIREMENT_ERROR,
         );
         return $requirements;
       }
     }
-    else if ($provider == TYPEPAD_SERVICE) {
+    elseif ($provider == TYPEPAD_SERVICE) {
       if (variable_get('antispam_tpapikey', '') == '') {
         $requirements['antispam_key'] = array(
           'title' => t('TypePad AntiSpam API key'),
@@ -151,14 +150,14 @@ function antispam_requirements($phase) {
           array(
             '!tpapikey' => url('http://antispam.typepad.com/info/get-api-key.html'),
             '!typepad-com' => url('http://typepad.com/connect/register'),
-            '!antispam-settings' => url('admin/config/antispam'),
+            '!antispam-settings' => url('admin/config/spamprevention/antispam'),
           )),
           'severity' => REQUIREMENT_ERROR,
         );
         return $requirements;
       }
     }
-    else if ($provider == DEFENSIO_SERVICE) {
+    elseif ($provider == DEFENSIO_SERVICE) {
       if (variable_get('antispam_deapikey', '') == '') {
         $requirements['antispam_key'] = array(
           'title' => t('Defensio AntiSpam API key'),
@@ -167,7 +166,7 @@ function antispam_requirements($phase) {
           array(
             '!defensio-com' => url('http://defensio.com/'),
             '!defensio-key' => url('http://defensio.com/signup/'),
-            '!antispam-settings' => url('admin/config/antispam'),
+            '!antispam-settings' => url('admin/config/spamprevention/antispam'),
           )),
           'severity' => REQUIREMENT_ERROR,
         );
@@ -202,7 +201,7 @@ function antispam_permission() {
   );
   $permissions['post with no antispam checking'] = array(
       'title' => t('Post with no spam checking'),
-      'description' => 'Allow to post nodes/comments without being checked by AntiSpam module.',
+      'description' => 'Allow to post nodes/comments without being checked by AntiSpam module. ',
   );
   return $permissions;
 }
@@ -396,8 +395,8 @@ function antispam_set_counter($counter_type, $count) { // for today
     db_insert('antispam_counter')
       ->fields(array(
         'date' => strtotime(date('Y-m-d 00:00:00')),
-	    'provider' => $provider,
-	    $field => $count,
+        'provider' => $provider,
+        $field => $count,
       ))
       ->execute();  
   }
@@ -480,34 +479,36 @@ function antispam_menu() {
   $items = array();
   $moderator_types = antispam_get_moderator_types();
 
-  $items['admin/config/antispam'] = array(
+  // New Menu Block
+  $items['admin/config/spamprevention'] = array(
+    'title' => 'AntiSpam',
+    'description' => 'Use the anti-spam service to protect your site from spam.', 
+    'position' => 'right',
+    'page callback' => 'system_admin_menu_block_page',
+    'access arguments' => array('access administration pages'),
+    'file' => 'system.admin.inc',
+    'file path' => drupal_get_path('module', 'system'),
+  );
+
+  // A menu item for the menu block
+  $items['admin/config/spamprevention/antispam'] = array(
     'title' => t('AntiSpam'),
     'description' => t('Use the anti-spam service to protect your site from spam.'),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('antispam_settings_form'),
     'access arguments' => array('administer antispam settings'),
     'file' => 'antispam.admin.inc',
-    'type' => MENU_LOCAL_TASK,
+    'type' => MENU_NORMAL_ITEM,  // Needs to be normal to show up
   );
 
-  $items['admin/content/antispam'] = array(
-    'title' => t('AntiSpam moderation queue'),
-    'description' => t('Manage the AntiSpam spam queue, appropving or deleting content in need of moderation.'),
-    'page callback' => 'antispam_callback_queue',
-    'access callback' => '_antispam_is_moderator',
-    'access arguments' => array($moderator_types),
-    'file' => 'antispam.admin.inc',
-    'type' => MENU_LOCAL_TASK,
-    'weight' => 10,
-  );
   $items['admin/content/antispam/overview'] = array(
-    'title' => t('Overview'),
+    'title' => 'Overview',
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => 0,
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/nodes'] = array(
-    'title' => t('Nodes'),
+    'title' => 'Nodes',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('nodes'),
     'access callback' => '_antispam_is_node_moderator',
@@ -517,7 +518,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/nodes/spam'] = array(
-    'title' => t('Spam'),
+    'title' => 'Spam',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('nodes'),
     'access callback' => '_antispam_is_node_moderator',
@@ -527,7 +528,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/nodes/unpublished'] = array(
-    'title' => t('Unpublished nodes'),
+    'title' => 'Unpublished nodes',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('nodes', 'unpublished'),
     'access callback' => '_antispam_is_node_moderator',
@@ -537,7 +538,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/nodes/published'] = array(
-    'title' => t('Published nodes'),
+    'title' => 'Published nodes',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('nodes', 'published'),
     'access callback' => '_antispam_is_node_moderator',
@@ -547,7 +548,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/comments'] = array(
-    'title' => t('Comments'),
+    'title' => 'Comments',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('comments'),
     'access callback' => '_antispam_is_moderator',
@@ -557,7 +558,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/comments/spam'] = array(
-    'title' => t('Spam'),
+    'title' => 'Spam',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('comments'),
     'access callback' => '_antispam_is_moderator',
@@ -567,7 +568,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/comments/unpublished'] = array(
-    'title' => t('Unpublished comments'),
+    'title' => 'Unpublished comments',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('comments', 'unpublished'),
     'access callback' => '_antispam_is_moderator',
@@ -577,7 +578,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/comments/published'] = array(
-    'title' => t('Published comments'),
+    'title' => 'Published comments',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('comments', 'published'),
     'access callback' => '_antispam_is_moderator',
@@ -587,7 +588,7 @@ function antispam_menu() {
     'file' => 'antispam.admin.inc',
   );
   $items['admin/content/antispam/statistics'] = array(
-    'title' => t('Statistics'),
+    'title' => 'Statistics',
     'page callback' => 'antispam_callback_queue',
     'page arguments' => array('statistics'),
     'access callback' => '_antispam_is_moderator',
@@ -605,7 +606,7 @@ function antispam_menu() {
     'access arguments' => array(0, 1, 2, 3),
   );
   foreach (array('publish', 'unpublish', 'submit-spam', 'submit-ham') as $op) {
-    $items['antispam/%antispam/%/'. $op] = $item;
+    $items['antispam/%antispam/%/' . $op] = $item;
   }
   return $items;
 }
@@ -631,7 +632,7 @@ function antispam_load($arg, &$map, $index) {
   if ($op == 'publish' || $op == 'unpublish') {
     $map[0] = 'antispam_callback_set_published_status';
   }
-  else if ($op == 'submit-spam' || $op == 'submit-ham') {
+  elseif ($op == 'submit-spam' || $op == 'submit-ham') {
     $map[0] = 'antispam_callback_set_spam_status';
   }
   return $map[$index];
@@ -646,7 +647,7 @@ function antispam_access_callback($callback, $content_type, $object, $op) {
   if ($content_type == 'node') {
     $content_id = $object->nid;
   }
-  else if($content_type == 'comment') {
+  elseif ($content_type == 'comment') {
     $content_id = $object->cid;
   }
   if (function_exists($callback && !antispam_is_spam_moderator(antispam_content_get_moderator_type($content_type, $content_id)))) {
@@ -667,9 +668,9 @@ function antispam_page($callback, $content_type, $object, $op) {
 /**
 * Menu callback; publish/unpublish content.
 *
-* @param string Content type; it can be 'node' or 'comment'.
+* @param string Content type; it can be 'node' or 'comment' .
 * @param integer Content ID; can be either a nid or a cid.
-* @param string Operation; it can be 'publish' or 'unpublish'.
+* @param string Operation; it can be 'publish' or 'unpublish' .
 */
 function antispam_callback_set_published_status($content_type, $object, $op) {
   // TODO: Should we be passing the object around or just the ID, or should we have antispam_content_load at all?
@@ -687,15 +688,15 @@ function antispam_callback_set_published_status($content_type, $object, $op) {
   if ($op == 'publish' && !$is_published) {
     antispam_content_publish_operation($content_type, $content, 'publish');
   }
-  else if ($op == 'unpublish' && $is_published) {
+  elseif ($op == 'unpublish' && $is_published) {
     antispam_content_publish_operation($content_type, $content, 'unpublish');
   }
 
   if ($content_type == 'node') {
-    drupal_goto('node/'. $content->nid);
+    drupal_goto('node/' . $content->nid);
   }
   else { // comment
-    drupal_goto('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
+    drupal_goto('node/' . $content->nid, array('fragment' => 'comment-' . $content->cid));
   }
 }
 
@@ -704,9 +705,9 @@ function antispam_callback_set_published_status($content_type, $object, $op) {
 *
 * When content is marked as spam, it is also unpublished (if necessary) and vice-versa.
 *
-* @param string Content type; it can be 'node' or 'comment'.
+* @param string Content type; it can be 'node' or 'comment' .
 * @param integer Content ID; can be either a nid or a cid.
-* @param string Operation; it can be 'submit-spam' or 'submit-ham'.
+* @param string Operation; it can be 'submit-spam' or 'submit-ham' .
 */
 function antispam_callback_set_spam_status($content_type, $object, $op) {
   if ($content_type == 'node') {
@@ -732,7 +733,7 @@ function antispam_callback_set_spam_status($content_type, $object, $op) {
       antispam_content_publish_operation($content_type, $content, 'unpublish');
     }
   }
-  else if ($op == 'submit-ham') {
+  elseif ($op == 'submit-ham') {
     if ($is_spam) {
       antispam_content_spam_operation($content_type, $content, 'submit-ham');
       antispam_increase_counter(ANTISPAM_COUNT_FALSE_POSITIVE);
@@ -743,10 +744,10 @@ function antispam_callback_set_spam_status($content_type, $object, $op) {
   }
 
   if ($content_type == 'node') {
-    drupal_goto('node/'. $content->nid);
+    drupal_goto('node/' . $content->nid);
   }
   else { // comment
-    drupal_goto('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
+    drupal_goto('node/' . $content->nid, array('fragment' => 'comment-' . $content->cid));
   }
 }
 
@@ -840,13 +841,13 @@ function _antispam_node_save(&$node) {
     
     // Record the event to watchdog.
     if ($api_result[0] == ANTISPAM_API_RESULT_ERROR) {
-      watchdog('content', 'AntiSpam service seems to be down, %content-type-name queued for manual approval: %title', array('%content-type-name' => $content_type_name, '%title' => $node->title), WATCHDOG_WARNING, l(t('view'), 'node/'. $node->nid));
+      watchdog('content', 'AntiSpam service seems to be down, %content-type-name queued for manual approval: %title', array('%content-type-name' => $content_type_name, '%title' => $node->title), WATCHDOG_WARNING, l(t('view'), 'node/' . $node->nid));
     }
     else {
-      watchdog('content', 'Spam detected by AntiSpam in %content-type-name: %title', array('%content-type-name' => $content_type_name, '%title' => $node->title), WATCHDOG_WARNING, l(t('view'), 'node/'. $node->nid));
+      watchdog('content', 'Spam detected by AntiSpam in %content-type-name: %title', array('%content-type-name' => $content_type_name, '%title' => $node->title), WATCHDOG_WARNING, l(t('view'), 'node/' . $node->nid));
       // If requested to, generate a delay so the spammer has to wait for a while.
       if (($seconds = variable_get('antispam_antispambot_delay', 60)) > 0) {
-	    sleep($seconds);
+        sleep($seconds);
       }
     }
   }
@@ -924,19 +925,19 @@ function antispam_node_view($node, $view_mode, $langcode) {
     // adding publish/unpublish links
     if (variable_get('antispam_node_publish_links', 0)) {
       if ($node->status) {
-	    $links['antispam_node_unpublish'] = array('title' => t('Unpublish'), 'href' => 'antispam/node/'. $node->nid .'/unpublish');
+        $links['antispam_node_unpublish'] = array('title' => t('Unpublish'), 'href' => 'antispam/node/' . $node->nid . '/unpublish');
       }
       else {
-	    $links['antispam_node_publish'] = array('title' => t('Publish'), 'href' => 'antispam/node/'. $node->nid .'/publish');
+        $links['antispam_node_publish'] = array('title' => t('Publish'), 'href' => 'antispam/node/' . $node->nid . '/publish');
       }
     }
     // adding submit ham/submit spam links
     if (variable_get('antispam_node_spam_links', 0)) {
       if (antispam_content_is_spam('node', $node->nid)) {
-        $links['antispam_node_ham'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit ham') : t('Mark as ham')), 'href' => 'antispam/node/'. $node->nid .'/submit-ham');
+        $links['antispam_node_ham'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit ham') : t('Mark as ham')), 'href' => 'antispam/node/' . $node->nid . '/submit-ham');
       }
       else {
-	    $links['antispam_node_spam'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit spam') : t('Mark as spam')), 'href' => 'antispam/node/'. $node->nid .'/submit-spam');
+        $links['antispam_node_spam'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit spam') : t('Mark as spam')), 'href' => 'antispam/node/' . $node->nid . '/submit-spam');
       }
     }
     $node->content['links']['node']['#links'] = 
@@ -1008,11 +1009,17 @@ function antispam_comment_presave($comment) {
     $debug_info['E-mail'] = $comment->mail;
     $num_condition++;
   }
-  if ($antispambot_rules['body'] && !empty($comment->comment_body)) {
+
+/* Forum comment section seems to be broken & needs to be further investigated.
+ * see - http://drupal.org/node/1129902
+if ($antispambot_rules['body'] && !empty($comment->comment_body)) {
     $query->condition('c.comment', render($comment->comment_body[$comment->language][0]['value']));
-    $debug_info['Content'] = $comment->mail[$comment->language][0]['value'];
+    if (!is_string($comment->mail)) {
+      $debug_info['Content'] = $comment->mail[$comment->language][0]['value'];
+    }
     $num_condition++;
-  }
+  } 
+*/
 
   if ($num_condition) {
     $has_rows = $query->execute()->fetchField();
@@ -1087,13 +1094,13 @@ function _antispam_comment_save($comment) {
 
     // Record the event to watchdog.
     if ($api_result[0] == ANTISPAM_API_RESULT_ERROR) {
-      watchdog('content', 'AntiSpam service seems to be down, comment queued for manual approval: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
+      watchdog('content', 'AntiSpam service seems to be down, comment queued for manual approval: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)));
     }
     else {
-      watchdog('content', 'Spam detected by AntiSpam in comment: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
+      watchdog('content', 'Spam detected by AntiSpam in comment: %subject', array('%subject' => $comment->subject), WATCHDOG_WARNING, l(t('view'), 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)));
       // If requested to, generate a delay so the spammer has to wait for a while.
       if (($seconds = variable_get('antispam_antispambot_delay', 60)) > 0) {
-	    sleep($seconds);
+        sleep($seconds);
       }
     }
   }
@@ -1121,18 +1128,18 @@ function antispam_comment_view($comment, $view_mode, $langcode) {
 
     if (variable_get('antispam_comment_publish_links', 1)) {
       if ($comment->status == COMMENT_PUBLISHED) {
-	    $links['antispam_comment_unpublish'] = array('title' => t('Unpublish'), 'href' => 'antispam/comment/'. $comment->cid .'/unpublish');
+        $links['antispam_comment_unpublish'] = array('title' => t('Unpublish'), 'href' => 'antispam/comment/' . $comment->cid . '/unpublish');
       }
-      else if ($comment->status == COMMENT_NOT_PUBLISHED) {
-	    $links['antispam_comment_publish'] = array('title' => t('Publish'), 'href' => 'antispam/comment/'. $comment->cid .'/publish');
+      elseif ($comment->status == COMMENT_NOT_PUBLISHED) {
+        $links['antispam_comment_publish'] = array('title' => t('Publish'), 'href' => 'antispam/comment/' . $comment->cid . '/publish');
       }
     }
     if (variable_get('antispam_comment_spam_links', 1)) {
       if (antispam_content_is_spam('comment', $comment->cid)) {
-	    $links['antispam_comment_ham'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit ham') : t('Mark as ham')), 'href' => 'antispam/comment/'. $comment->cid .'/submit-ham');
+        $links['antispam_comment_ham'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit ham') : t('Mark as ham')), 'href' => 'antispam/comment/' . $comment->cid . '/submit-ham');
       }
       else {
-	    $links['antispam_comment_spam'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit spam') : t('Mark as spam')), 'href' => 'antispam/comment/'. $comment->cid .'/submit-spam');
+        $links['antispam_comment_spam'] = array('title' => (variable_get('antispam_connection_enabled', 1) ? t('Submit spam') : t('Mark as spam')), 'href' => 'antispam/comment/' . $comment->cid . '/submit-spam');
       }
     }
     $comment->content['links']['comment']['#links'] 
@@ -1195,7 +1202,7 @@ function antispam_anti_spambot_action($debug_info) {
 
   $items = array();
   foreach ($debug_info as $label => $value) {
-    $items[] = '<strong>'. check_plain($label) .'</strong>: '. check_plain($value);
+    $items[] = '<strong>' . check_plain($label) . '</strong>: ' . check_plain($value);
   }
 
   // From here on, the request is killed using different methods.
@@ -1203,7 +1210,7 @@ function antispam_anti_spambot_action($debug_info) {
     drupal_access_denied();
     $message = t('Spambot detected (action: 403 Forbidden).');
   }
-  else if ($antispambot_action == '403') {
+  elseif ($antispambot_action == '403') {
     @header('HTTP/1.0 403 Forbidden');
     print t('Access denied');
     $message = t('Spambot detected (action: 403 Forbidden).');
@@ -1241,7 +1248,7 @@ function _antispam_translate_query($query) {
 /**
  * Check if specified content is marked as spam.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param integer Content ID; can be either a nid or a cid.
  * @return boolean TRUE if content is marked as spam; FALSE otherwise.
  */
@@ -1252,7 +1259,7 @@ function antispam_content_is_spam($content_type, $content_id) {
 /**
  * Get moderator type required for specified content.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param integer Content ID; can be either a nid or a cid.
  * @return string Moderator Type or empty string if content is not found.
  */
@@ -1264,7 +1271,7 @@ function antispam_content_get_moderator_type($content_type, $content_id) {
       $moderator_type = '';
     }
   }
-  else if ($content_type == 'comment') {
+  elseif ($content_type == 'comment') {
     $has_rows = db_query_range('SELECT 1 FROM {comment} WHERE cid=:cid', 0, 1, array(':cid' => $content_id))->fetchField();
     $moderator_type = $has_rows ? 'comments' : '';
   }
@@ -1304,7 +1311,7 @@ function antispam_get_moderator_types($account = NULL) {
     }
     else {
       foreach ($node_types as $type => $name) {
-        if (user_access('moderate spam in nodes of type '. $node_types[$type], $account)) {
+        if (user_access('moderate spam in nodes of type ' . $node_types[$type], $account)) {
           $moderator_types[$account->uid][$type] = $name;
         }
       }
@@ -1339,7 +1346,7 @@ function antispam_is_spam_moderator($moderator_type = NULL, $account = NULL) {
 /**
  * Notify moderators of new/updated content, only content needing approval or nothing at all.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param object Content object.
  * @param boolean TRUE if content is in published status.
  * @param boolean TRUE if content has been marked as spam.
@@ -1362,17 +1369,17 @@ function antispam_notify_moderators($content_type, $content, $is_published, $is_
   }
   else {
     $moderator_types = antispam_get_moderator_types();
-    $moderator_permission = 'moderate spam in nodes of type '. $moderator_types[$content->type];
+    $moderator_permission = 'moderate spam in nodes of type ' . $moderator_types[$content->type];
     $administer_permission = 'administer nodes';
   }
 
   // Obtain list of moderators of the specified content type.
-  $sql = 'SELECT u.uid, u.name, u.mail, m.email_for'.
-          ' FROM {role_permission} p'.
-         ' INNER JOIN {users_roles} r ON r.rid = p.rid'.
-         ' INNER JOIN {users} u ON u.uid = r.uid OR u.uid = 1'.
-          ' LEFT JOIN {antispam_moderator} m ON m.uid = u.uid'.
-         ' WHERE p.permission LIKE \'%:perm1%\''.
+  $sql = 'SELECT u.uid, u.name, u.mail, m.email_for' .
+          ' FROM {role_permission} p' .
+         ' INNER JOIN {users_roles} r ON r.rid = p.rid' .
+         ' INNER JOIN {users} u ON u.uid = r.uid OR u.uid = 1' .
+          ' LEFT JOIN {antispam_moderator} m ON m.uid = u.uid' .
+         ' WHERE p.permission LIKE \'%:perm1%\'' .
             ' OR p.permission LIKE \'%:perm2%\'';
   $result = db_query($sql, array(':perm1' => $moderator_permission, ':perm2' => $administer_permission));
   $moderators = array();
@@ -1388,9 +1395,9 @@ function antispam_notify_moderators($content_type, $content, $is_published, $is_
     }
   }
   // check to see if we need to add the admin to the notification moderator list
-  $sql = 'SELECT u.uid, u.name, u.mail, m.email_for'.
-         ' FROM {users} u'.
-         ' LEFT JOIN {antispam_moderator} m ON m.uid = u.uid'.
+  $sql = 'SELECT u.uid, u.name, u.mail, m.email_for' .
+         ' FROM {users} u' .
+         ' LEFT JOIN {antispam_moderator} m ON m.uid = u.uid' .
          ' WHERE u.uid=1';
   $u = db_query($sql)->fetchObject();
   if ($u) {
@@ -1422,14 +1429,14 @@ function antispam_notify_moderators($content_type, $content, $is_published, $is_
   $site_name = variable_get('site_name', t('Drupal'));
   if ($content_type == 'comment') {
     if (!($node = antispam_content_load('node', $content->nid))) {
-      watchdog('antispam', 'An error has ocurred while trying to notify moderators about a comment. The associated node could not be loaded.', array(), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid)));
+      watchdog('antispam', 'An error has ocurred while trying to notify moderators about a comment. The associated node could not be loaded. ', array(), WATCHDOG_NOTICE, l(t('view'), 'node/' . $content->nid, array('fragment' => 'comment-' . $content->cid)));
       return;
     }
     $message_args = array(
       '@title-label' => t('Subject'),
       '@content-title' => $content->subject,
       '@content-type' => t('comment'),
-      '!content-link' => url('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid, 'absolute' => TRUE))
+      '!content-link' => url('node/' . $content->nid, array('fragment' => 'comment-' . $content->cid, 'absolute' => TRUE))
     );
   }
   else {
@@ -1437,10 +1444,10 @@ function antispam_notify_moderators($content_type, $content, $is_published, $is_
       '@title-label' => t('Title'),
       '@content-title' => $content->title,
       '@content-type' => $moderator_types[$content->type],
-      '!content-link' => url('node/'. $content->nid, array('absolute' => TRUE))
+      '!content-link' => url('node/' . $content->nid, array('absolute' => TRUE))
     );
   }
-  $message_args['@content-status'] = ($is_published ? t('published') : t('not published')) . ($is_spam ? ' ('. t('marked as spam') .')' : '');
+  $message_args['@content-status'] = ($is_published ? t('published') : t('not published')) . ($is_spam ? ' (' . t('marked as spam') . ')' : '');
   $message_args['@site-name'] = $site_name;
   $message_args['!site-link'] = $base_url . base_path();
 
@@ -1676,11 +1683,11 @@ function antispam_block_configure($delta = '') {
     $form = array();
     $form['description'] = array(
       '#type' => 'item',
-      '#markup' => '<div class="description">'. t('These options allow to customize the look of this <em>antispam spam counter</em> block.') .'</div>'
+      '#markup' => '<div class="description">' . t('These options allow to customize the look of this <em>antispam spam counter</em> block.') . '</div>'
     );
-    $block_settings = variable_get('antispam_blocks_'. $delta, FALSE);
+    $block_settings = variable_get('antispam_blocks_' . $delta, FALSE);
     foreach ($block_fields as $field_key => $field_info) {
-      $field_name = 'antispam_blocks_'. $delta .'_'. $field_key;
+      $field_name = 'antispam_blocks_' . $delta . '_' . $field_key;
       $form[$field_name] = array();
       foreach ($field_info as $key => $value) {
         $form[$field_name][$key] = $value;
@@ -1701,10 +1708,10 @@ function antispam_block_save($delta = '', $edit = array()) {
   if ($delta >= 0 && $delta < variable_get('antispam_blocks_counter', 1)) {
     $block_settings = array();
     foreach ($block_fields as $field_key => $field_info) {
-      $field_name = 'antispam_blocks_'. $delta .'_'. $field_key;
+      $field_name = 'antispam_blocks_' . $delta . '_' . $field_key;
       $block_settings[$field_key] = $edit[$field_name];
     }
-    variable_set('antispam_blocks_'. $delta, $block_settings);
+    variable_set('antispam_blocks_' . $delta, $block_settings);
   }
 }
 
@@ -1714,7 +1721,7 @@ function antispam_block_save($delta = '', $edit = array()) {
 function antispam_block_view($delta = '') {
   $block_fields = _antispam_get_block_fields();
   if ($delta >= 0 && $delta < variable_get('antispam_blocks_counter', 1)) {
-    $block_settings = variable_get('antispam_blocks_'. $delta, FALSE);
+    $block_settings = variable_get('antispam_blocks_' . $delta, FALSE);
     if (!$block_settings) {
       $block_settings = array();
     }
@@ -1742,11 +1749,11 @@ function antispam_block_view($delta = '') {
       'html' => t('@site_name is proudly protected by <a href="!antispam"@target>AntiSpam</a>, %spams caught since @since', array('@site_name' => $sitename, '!antispam' => url('http://drupal.org/project/antispam'), '@target' => $target, '%spams' => format_plural($block_args['counter'], '1 spam', '@count spams'), '@since' => $block_args['since']))
     );
     $title_text = $block_args['text']['plain'];
-    $image_url = base_path() . drupal_get_path('module', 'antispam') .'/antispam.png';
-    $block_args['image'] = '<img src="'. $image_url .'" title="'. $title_text .'" alt="'. $title_text .'" />';
+    $image_url = base_path() . drupal_get_path('module', 'antispam') . '/antispam.png';
+    $block_args['image'] = '<img src="' . $image_url . '" title="' . $title_text . '" alt="' . $title_text . '" />';
 
     if ($block_settings['type'] == 'image') {
-      $block_args['content'] = '<a href="http://drupal.org/project/antispam" title="'. $title_text .'"'. $target .'>'. $block_args['image'] .'</a>';
+      $block_args['content'] = '<a href="http://drupal.org/project/antispam" title="' . $title_text . '"' . $target . '>' . $block_args['image'] . '</a>';
     }
     else {
       $block_args['content'] = $block_args['text']['html'];
@@ -1807,7 +1814,7 @@ function theme_antispam_counter_block($args) {
 /**
  * Load a node or a comment.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param integer Content ID; can be either a nid or a cid.
  * @return mixed An object with requested content; FALSE on failure.
  */
@@ -1827,7 +1834,7 @@ function antispam_content_load($content_type, $content_id) {
 /**
  * Delete a node or a comment.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param integer Content ID; can be either a nid or a cid.
  * @return boolean TRUE if specified was there; FALSE otherwise.
  */
@@ -1838,7 +1845,7 @@ function antispam_content_delete($content_type, $content_id) {
     node_delete($content_id);
     return TRUE;
   }
-  else if ($content_type == 'comment') {
+  elseif ($content_type == 'comment') {
     comment_delete($content_id);
     return TRUE;
   }
@@ -1862,32 +1869,32 @@ function antispam_clear_cache() {
 /**
  * Mark content as spam or remove the mark.
  *
- * @param string Content type; can be either 'node' or 'comment'.
+ * @param string Content type; can be either 'node' or 'comment' .
  * @param object Content object.
- * @param string Operation; it can be 'submit-spam' or 'submit-ham'.
+ * @param string Operation; it can be 'submit-spam' or 'submit-ham' .
  * @param boolean TRUE to log action (default); FALSE otherwise (ie. the caller logs the action).
  * @param string Signature; Currently DEFENSIO is the only one that returns this.
  * @param float Spaminess; Currently DEFENSIO is the only one that returns this.
  */
 function antispam_content_spam_operation($content_type, $content, $op, $log_action = TRUE) {
-  watchdog('antispam', 'antispam_content_spam_operation: type=' . $content_type . '. op=' . $op);
+  watchdog('antispam', 'antispam_content_spam_operation: type=' . $content_type . ' . op=' . $op);
   if ($content_type == 'node') {
     global $user;
     $content_id = $content->nid;
     $content_title = $content->title;
-    $content_link = l(t('view'), 'node/'. $content->nid);
+    $content_link = l(t('view'), 'node/' . $content->nid);
     $user_mail = (isset($user->mail) ? $user->mail : '');
   }
   else { // comment
     $content_id = $content->cid;
     $content_title = $content->subject;
-    $content_link = l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
+    $content_link = l(t('view'), 'node/' . $content->nid, array('fragment' => 'comment-' . $content->cid));
     $user_mail = $content->mail;
   }
 
   watchdog('antispam', 'antispam_content_spam_operation: content_id=' . $content_id);
-  if(!isset($content->signature)) $content->signature = '';
-  if(!isset($content->spaminess)) $content->spaminess = 0.0;
+  if (!isset($content->signature)) $content->signature = '';
+  if (!isset($content->spaminess)) $content->spaminess = 0.0;
 
   if ($op == 'submit-spam') {
 
@@ -1955,9 +1962,9 @@ function antispam_content_spam_operation($content_type, $content, $op, $log_acti
 /**
  * Execute content publish/unpublish operations.
  *
- * @param string Content type; it can be 'node' or 'comment'.
+ * @param string Content type; it can be 'node' or 'comment' .
  * @param object Content object.
- * @param string Operation; it can be 'publish' or 'unpublish'.
+ * @param string Operation; it can be 'publish' or 'unpublish' .
  * @param boolean TRUE to log action (default); FALSE otherwise (ie. the caller logs the action).
  */
 function antispam_content_publish_operation($content_type, $content, $op, $log_action = TRUE) {
@@ -1977,7 +1984,7 @@ function antispam_content_publish_operation($content_type, $content, $op, $log_a
 
     if ($log_action) {
       $action = ($op == 'publish' ? t('Content published') : t('Content unpublished'));
-      watchdog('content', '@action: @title', array('@action' => $action, '@title' => $content->title), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid));
+      watchdog('content', '@action: @title', array('@action' => $action, '@title' => $content->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $content->nid));
     }
   }
   else { // comment
@@ -1986,7 +1993,7 @@ function antispam_content_publish_operation($content_type, $content, $op, $log_a
       comment_publish_action($content, array('cid' => $content->cid));
       module_invoke_all('comment_published', $content);
     }
-    else if ($op == 'unpublish') {
+    elseif ($op == 'unpublish') {
       comment_unpublish_action($content, array('cid' => $content->cid));
       // Allow modules to respond to the updating of a comment.
       module_invoke_all('comment_unpublished', $content);
@@ -1996,7 +2003,7 @@ function antispam_content_publish_operation($content_type, $content, $op, $log_a
 
     if ($log_action) {
       $action = ($op == 'publish' ? t('Comment published') : t('Comment unpublished'));
-      watchdog('content', '@action: %subject', array('@action' => $action, '%subject' => $content->subject), WATCHDOG_NOTICE, l(t('view'), 'node/'. $content->nid, array('fragment' => 'comment-'. $content->cid)));
+      watchdog('content', '@action: %subject', array('@action' => $action, '%subject' => $content->subject), WATCHDOG_NOTICE, l(t('view'), 'node/' . $content->nid, array('fragment' => 'comment-' . $content->cid)));
     }
   }
   antispam_clear_cache();
@@ -2036,7 +2043,7 @@ function antispam_prepare_comment_data($content_type, $content, $provider) {
         'comment-author' => $content->name,
       );
       if ($content_type == 'comment') {
-        $comment_data['permalink'] = url('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
+        $comment_data['permalink'] = url('node/' . $content->nid, array('fragment' => 'comment-' . $content->cid));
         $comment_data['comment-author-email'] = $content->mail;
         $comment_data['comment-author-url'] = $content->homepage;
         $comment_data['comment-content'] = render($content->comment_body[$content->language][0]['value']);
@@ -2045,8 +2052,8 @@ function antispam_prepare_comment_data($content_type, $content, $provider) {
         $comment_data['article-date'] = date("Y/m/d", $node_created);
         $comment_data['comment-type'] = 'comment';
       }
-      else if ($content_type == 'node') {
-        $comment_data['permalink'] = url('node/'. $content->nid);
+      elseif ($content_type == 'node') {
+        $comment_data['permalink'] = url('node/' . $content->nid);
         $comment_data['comment-author_email'] = (isset($user->mail) ? $user->mail : '');
         $comment_data['comment-author_url'] = '';
         $comment_data['comment-content'] = render($content->body[$content->language][0]['value']);
@@ -2089,13 +2096,13 @@ function antispam_prepare_comment_data($content_type, $content, $provider) {
       'comment_author' => $content->name,
     );
     if ($content_type == 'comment') {
-      $comment_data['permalink'] = url('node/'. $content->nid, array('fragment' => 'comment-'. $content->cid));
+      $comment_data['permalink'] = url('node/' . $content->nid, array('fragment' => 'comment-' . $content->cid));
       $comment_data['comment_author_email'] = $content->mail;
       $comment_data['comment_author_url'] = $content->homepage;
       $comment_data['comment_content'] = render($content->comment_body[$content->language][0]['value']);
     }
-    else if ($content_type == 'node') {
-      $comment_data['permalink'] = url('node/'. $content->nid);
+    elseif ($content_type == 'node') {
+      $comment_data['permalink'] = url('node/' . $content->nid);
       $comment_data['comment_author_email'] = (isset($user->mail) ? $user->mail : '');
       $comment_data['comment_author_url'] = '';
       $comment_data['comment_content'] = render($content->body[$content->language][0]['value']);
@@ -2152,8 +2159,8 @@ function antispam_api_cmd_verify_key($key, $provider) {
   $api_host = antispam_get_api_host($provider);
   if ($provider == DEFENSIO_SERVICE) {
     // DEFENSIO
-    $request = 'owner-url='. $base_url . base_path();
-    $response = _antispam_api_http_post($request, $api_host, '/blog/'. DEFENSIO_API_VERSION .'/validate-key/' . $key . '.yaml');
+    $request = 'owner-url=' . $base_url . base_path();
+    $response = _antispam_api_http_post($request, $api_host, '/blog/' . DEFENSIO_API_VERSION . '/validate-key/' . $key . ' .yaml');
     if (!isset($response[1])) {
       watchdog('antispam', "verifying a key: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2162,8 +2169,8 @@ function antispam_api_cmd_verify_key($key, $provider) {
   }
   else {
     // AKISMET, TYPEPAD
-    $request = 'key='. $key .'&blog='. $base_url . base_path();
-    $response = _antispam_api_http_post($request, $api_host, '/'. AKISMET_API_VERSION .'/verify-key');
+    $request = 'key=' . $key . '&blog=' . $base_url . base_path();
+    $response = _antispam_api_http_post($request, $api_host, '/' . AKISMET_API_VERSION . '/verify-key');
     if (!isset($response[1])) {
       watchdog('antispam', "verifying a key: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2197,7 +2204,7 @@ function antispam_api_cmd_spam_check($body, $name = NULL, $mail = NULL, $homepag
   if ($api_result[0] == ANTISPAM_API_RESULT_IS_HAM) {
     return 0; // Ham
   }
-  else if ($api_result[0] == ANTISPAM_API_RESULT_IS_SPAM) {
+  elseif ($api_result[0] == ANTISPAM_API_RESULT_IS_SPAM) {
     return 1; // Spam
   }
   else {
@@ -2234,7 +2241,7 @@ function antispam_api_cmd_comment_check($content_type, $content) {
     // DEFENSIO
     $comment_data = array_merge(_antispam_api_prepare_request_data(), $comment_data);
     $query_string = _antispam_api_build_query_string($comment_data);
-    $response = _antispam_api_http_post($query_string, $api_host, '/app/'. DEFENSIO_API_VERSION .'/audit-comment/' . $api_key . '.yaml');
+    $response = _antispam_api_http_post($query_string, $api_host, '/app/' . DEFENSIO_API_VERSION . '/audit-comment/' . $api_key . ' .yaml');
     if (!isset($response[1])) {
       watchdog('antispam', "cheking a content failed: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return array(ANTISPAM_API_RESULT_ERROR);
@@ -2257,8 +2264,8 @@ function antispam_api_cmd_comment_check($content_type, $content) {
     // AKISMET, TYPEPAD
     $comment_data = array_merge(_antispam_api_prepare_request_data(), $comment_data);
     $query_string = _antispam_api_build_query_string($comment_data);
-    $host = $api_key .'.'. $api_host;
-    $response = _antispam_api_http_post($query_string, $host, '/'. AKISMET_API_VERSION .'/comment-check');
+    $host = $api_key . ' . ' . $api_host;
+    $response = _antispam_api_http_post($query_string, $host, '/' . AKISMET_API_VERSION . '/comment-check');
 
     if (!isset($response[1])) {
       watchdog('antispam', "cheking a content failed: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
@@ -2294,7 +2301,7 @@ function antispam_api_cmd_submit_spam($content_type, $content) {
   if ($provider == DEFENSIO_SERVICE) {
     // DEFENSIO
     $query_string = _antispam_api_build_query_string($comment_data);
-    $response = _antispam_api_http_post($query_string, $api_host, '/blog/'. DEFENSIO_API_VERSION .'/report-false-negatives/' . $api_key . '.yaml');
+    $response = _antispam_api_http_post($query_string, $api_host, '/blog/' . DEFENSIO_API_VERSION . '/report-false-negatives/' . $api_key . ' .yaml');
     if (!isset($response[1])) {
       watchdog('antispam', "submitting spam: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2304,8 +2311,8 @@ function antispam_api_cmd_submit_spam($content_type, $content) {
   else {
     // AKISMET, TYPEPAD
     $query_string = _antispam_api_build_query_string($comment_data);
-    $host = $api_key .'.'. $api_host;
-    $response = _antispam_api_http_post($query_string, $host, '/'. AKISMET_API_VERSION .'/submit-spam');
+    $host = $api_key . ' . ' . $api_host;
+    $response = _antispam_api_http_post($query_string, $host, '/' . AKISMET_API_VERSION . '/submit-spam');
     if (!isset($response[1])) {
       watchdog('antispam', "submitting spam: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2339,7 +2346,7 @@ function antispam_api_cmd_submit_ham($content_type, $content) {
   if ($provider == DEFENSIO_SERVICE) {
     // DEFENSIO
     $query_string = _antispam_api_build_query_string($comment_data);
-    $response = _antispam_api_http_post($query_string, $api_host, '/blog/'. DEFENSIO_API_VERSION .'/report-false-positives/' . $api_key . '.yaml');
+    $response = _antispam_api_http_post($query_string, $api_host, '/blog/' . DEFENSIO_API_VERSION . '/report-false-positives/' . $api_key . ' .yaml');
     if (!isset($response[1])) {
       watchdog('antispam', "submitting ham: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2349,8 +2356,8 @@ function antispam_api_cmd_submit_ham($content_type, $content) {
   else {
     // AKISMET, TYPEPAD
     $query_string = _antispam_api_build_query_string($comment_data);
-    $host = $api_key .'.'. $api_host;
-    $response = _antispam_api_http_post($query_string, $host, '/'. AKISMET_API_VERSION .'/submit-ham');
+    $host = $api_key . ' . ' . $api_host;
+    $response = _antispam_api_http_post($query_string, $host, '/' . AKISMET_API_VERSION . '/submit-ham');
     if (!isset($response[1])) {
       watchdog('antispam', "submitting ham: can not get a response back from the service provider " . antispam_get_provider_name($provider, FALSE));
       return ANTISPAM_API_RESULT_ERROR;
@@ -2367,9 +2374,10 @@ function antispam_api_cmd_submit_ham($content_type, $content) {
  * @return array Relevant information extracted from $_SERVER superglobal.
  */
 function _antispam_api_prepare_request_data() {
-  // You may add more elements here, but they are often related to internal server
-  // data that makes little sense to check whether a comment is spam or not.
-  // Be sure to not send HTTP_COOKIE as it may compromise your user's privacy!
+  // You may add more elements here, but they are often related to internal 
+  // server data that makes little sense to check whether a comment is spam or 
+  // not. Be sure to not send HTTP_COOKIE as it may compromise your user's 
+  // privacy!
   static $safe_to_send = array(
     'CONTENT_LENGTH',
     'CONTENT_TYPE',
@@ -2419,7 +2427,7 @@ function _antispam_api_build_query_string($array) {
   }
   else {
     // AKISMET, TYPEPAD
-    $string = 'blog='. $base_url . base_path();
+    $string = 'blog=' . $base_url . base_path();
   }
   foreach ($array as $key => $value) {
     $string .= '&' . $key . '=' . urlencode(stripslashes($value));
@@ -2439,12 +2447,12 @@ function _antispam_api_http_post($request, $host, $path) {
   $fsock_timeout = (int)variable_get('antispam_connection_timeout', 10);
 
   $http_request = "POST $path HTTP/1.0\r\n"
-    ."Host: $host\r\n"
-    ."Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n"
-    .'Content-Length: '. strlen($request) ."\r\n"
-    .'User-Agent: '. ANTISPAM_API_USERAGENT ."\r\n"
-    ."\r\n"
-    .$request;
+    . "Host: $host\r\n"
+    . "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n"
+    . 'Content-Length: ' . strlen($request) . "\r\n"
+    . 'User-Agent: ' . ANTISPAM_API_USERAGENT . "\r\n"
+    . "\r\n"
+    . $request;
 
   $response = '';
   if (false !== ($fs = @fsockopen($host, ANTISPAM_API_PORT, $errno, $errstr, $fsock_timeout))) {
