One of my customers uses Akismet to protect his various blogs from the masses of spam.
Oddly torwards the end of last week, Akismet started to identify everything as spam, with no error message being returned on check of spam, and the admin dashboard showing the api key/akismet were happy.
I initially thought that perhaps Akismet was just having a bad day, and the problem would go away in a few hours/days time – but this hasn’t been the case. So today, I added in a WordPress plugin to debug the HTTP calls to Akismet to see if that would help identify the problem.
add_action( 'http_api_debug', '_custom_http_api_debug', 10, 5 ); function _custom_http_api_debug( $response, $type, $class, $args, $url ) { error_log( 'Request URL: ' . var_export( $url, true ) ); error_log( 'Request Args: ' . var_export( $args, true ) ); error_log( 'Request Response : ' . var_export( $response, true ) ); }
i.e. for a message which was known to be spam :
- http post to : http://xxxx.rest.akismet.com/1.1/comment-check
- Response body of ‘true’ (HTTP 200 status code etc) (which is correct as per http://akismet.com/development/api/#comment-check )
However, what gave me an idea that something was amiss is that if an administrator attempted to mark an incorrectly tagged comment as ham, the following was seen –
- Post to http://xxxxx.rest.akismet.com/1.1/submit-ham
- Response body of ‘Invalid Key’
- “Thanks for making the web a better place.” (as per http://akismet.com/development/api/#submit-ham )