#2853 closed defect (bug) (fixed)
Add Akismet "X-akismet-pro-tip" support
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Extend - Akismet | Keywords: | needs-patch |
Cc: |
Description
Via #BuddyPress6594
See the "spam response example" on http://akismet.com/development/api/#comment-check and http://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/
TL;DR: If the X-akismet-pro-tip
header is set to discard
, then Akismet has determined that the comment is blatant spam, and you can safely discard it without saving it in any spam queue.
Attachments (1)
Change History (15)
This ticket was mentioned in Slack in #forums by netweb. View the logs.
9 years ago
This ticket was mentioned in Slack in #forums by netweb. View the logs.
9 years ago
@
8 years ago
First draft for a patch. Saves the header data, eliminates the useless do_action_ref_array call and replaces with a filter, adds post data to the spam check action
#4
@
8 years ago
First draft for a patch. Saves the header data, eliminates the useless do_action_ref_array call and replaces with a filter, adds post data to the spam check action. This would make it possible for another plugin to get the headers from the akismet call and take some kind of action based on them.
#5
@
8 years ago
Hey @Otto42 @netweb,
Can we get some focus on this? Akismet is doing nothing for all the University Spam that we are getting at W.org and it seems we're simply using most of our time to handle that nowadays.
I can only imagine how hard they're spamming other bbPress sites.
Part of the problem making this difficult is that the Akismet code in bbPress is silently discarding the header information coming from Akismet.
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/extend/akismet.php#L429
The header information we want is in
$response[0]
, which is not saved.Additionally, the action hooks in this code are, well, kind of bizarre.
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/extend/akismet.php#L193
I can think of no sane reason to call
do_action_ref_array()
here, while passing it the$post_data
array. The post data will not be in array form and also will be in a random order. It can't really be manipulated at all this way. This needs to be ado_action
, not ado_action_ref_array
. As it stands, this filter is currently unusable.If these were done correctly, then either a separate plugin or a simple check of the headers could set the post_status to "trash" before the post was inserted.
Header check would likely go here:
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/extend/akismet.php#L196
Alternatively, if one wanted to wipe the post out entirely, before it ever saved to the database, then bbPress would need an alteration in these two places:
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/topics/functions.php#L341
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/replies/functions.php#L393
To allow something like a "false" coming back from this filter to bail and skip the wp_insert_post() call entirely.