Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
Akismet::update_comment_history($c['comment_ID'],sprintf(__('Akismet was unable to re-check this comment (response: %s)','akismet'),substr($response[1],0,50)),'check-error');
$time=date('D d M Y @ h:i:m a',$row['time']).' GMT';
$message='';
if(!empty($row['message'])){
// Old versions of Akismet stored the message as a literal string in the commentmeta.
// New versions don't do that for two reasons:
// 1) Save space.
// 2) The message can be translated into the current language of the blog, not stuck
// in the language of the blog when the comment was made.
$message=$row['message'];
}
// If possible, use a current translation.
switch($row['event']){
case'recheck-spam';
$message=__('Akismet re-checked and caught this comment as spam.','akismet');
break;
case'check-spam':
$message=__('Akismet caught this comment as spam.','akismet');
break;
case'recheck-ham':
$message=__('Akismet re-checked and cleared this comment.','akismet');
break;
case'check-ham':
$message=__('Akismet cleared this comment.','akismet');
break;
case'wp-blacklisted':
$message=__('Comment was caught by wp_blacklist_check.','akismet');
break;
case'report-spam':
if(isset($row['user'])){
$message=sprintf(__('%s reported this comment as spam.','akismet'),$row['user']);
}
elseif(!$message){
$message=__('This comment was reported as spam.','akismet');
}
break;
case'report-ham':
if(isset($row['user'])){
$message=sprintf(__('%s reported this comment as not spam.','akismet'),$row['user']);
}
elseif(!$message){
$message=__('This comment was reported as not spam.','akismet');
}
break;
case'cron-retry-spam':
$message=__('Akismet caught this comment as spam during an automatic retry.','akismet');
break;
case'cron-retry-ham':
$message=__('Akismet cleared this comment during an automatic retry.','akismet');
break;
case'check-error':
if(isset($row['meta'],$row['meta']['response'])){
$message=sprintf(__('Akismet was unable to check this comment (response: %s) but will automatically retry later.','akismet'),$row['meta']['response']);
}
break;
case'recheck-error':
if(isset($row['meta'],$row['meta']['response'])){
$message=sprintf(__('Akismet was unable to recheck this comment (response: %s).','akismet'),$row['meta']['response']);
self::update_comment_history($comment->comment_ID,__('Akismet caught this comment as spam','akismet'),'check-spam');
if($comment->comment_approved!='spam')
self::update_comment_history(
$comment->comment_ID,
'',
'status-changed-'.$comment->comment_approved
);
self::update_comment_history($comment->comment_ID,sprintf(__('Comment status was changed to %s','akismet'),$comment->comment_approved),'status-changed'.$comment->comment_approved);
self::update_comment_history($comment->comment_ID,sprintf(__('Comment status was changed to %s','akismet'),$comment->comment_approved),'status-changed-'.$comment->comment_approved);
self::update_comment_history($comment->comment_ID,sprintf(__('Akismet was unable to check this comment (response: %s), will automatically retry again later.','akismet'),substr(self::$last_comment['akismet_result'],0,50)),'check-error');
}
// record the complete original data as submitted for checking
...
...
@@ -365,15 +350,8 @@ class Akismet {
return$history;
}
/**
* Log an event for a given comment, storing it in comment_meta.
*
* @param int $comment_id The ID of the relevant comment.
* @param string $message The string description of the event. No longer used.
* @param string $event The event code.
* @param array $meta Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.
self::update_comment_history($comment->comment_ID,sprintf(__('%1$s changed the comment status to %2$s','akismet'),$reporter,$new_status),'status-'.$new_status);