- $response = Akismet::http_post( Akismet::build_query( $c ), 'comment-check' );
-
- if ( 'true' == $response[1] ) {
- wp_set_comment_status( $c['comment_ID'], 'spam' );
- update_comment_meta( $c['comment_ID'], 'akismet_result', 'true' );
- delete_comment_meta( $c['comment_ID'], 'akismet_error' );
- delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
- Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-spam' );
-
- } elseif ( 'false' == $response[1] ) {
- update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' );
- delete_comment_meta( $c['comment_ID'], 'akismet_error' );
- delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
- Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-ham' );
- // abnormal result: error
- } else {
- update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' );
- Akismet::update_comment_history(
- $c['comment_ID'],
- '',
- 'recheck-error',
- array( 'response' => substr( $response[1], 0, 50 ) )
- );
- }