// make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
$comment =
get_comment( $comment_id );
if ( $comment && 'unapproved' ==
wp_get_comment_status( $comment_id ) ) { if ( $status == 'true'
) { wp_spam_comment( $comment_id );
} elseif ( $status == 'false'
) { // comment is good, but it's still in the pending queue. depending on the moderation settings
// we may need to change it to approved.
if ( check_comment($comment->comment_author,
$comment->comment_author_email,
$comment->comment_author_url,
$comment->comment_content,
$comment->comment_author_IP,
$comment->comment_agent,
$comment->comment_type
) ) wp_set_comment_status( $comment_id, 1
);
else if ( get_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true
) ) wp_notify_moderator( $comment_id );
} } delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email'
);
} else { // If this comment has been pending moderation for longer than MAX_DELAY_BEFORE_MODERATION_EMAIL,
// send a moderation email now.
if ( ( intval( gmdate( 'U'
) ) -
strtotime( $comment->comment_date_gmt
) ) < self::MAX_DELAY_BEFORE_MODERATION_EMAIL
) { delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email'
);
wp_notify_moderator( $comment_id );
}