Opened 12 years ago
Closed 12 years ago
#1632 closed defect (bug) (worksforme)
Akismet post meta not found in bbp_new_reply action
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Back-end | Keywords: | reporter-feedback |
Cc: |
Description
I wrote a plugin for supporting subscriptions for anonymous users (notify topic author when there are replies). It worked fine on 2.0-rc4 with the following check in the bbp_new_reply action:
if (get_post_meta($reply->ID, '_bbp_akismet_result', true) == "true") return;
With 2.0-rc5, _bbp_akismet_result is no longer getting set for spam. However the following does work:
if (get_post_meta($reply->ID, '_bbp_akismet_result', true) != "false") return;
Change History (7)
#2
@
12 years ago
- Milestone changed from Awaiting Review to 2.1
- Version 2.0 deleted
Can you see if '_bbp_akismet_error' is there in it's place? Do you have any idea where it's skipping the process or steps to duplicate?
#3
@
12 years ago
I just checked and _bbp_akismet_error is not being set. This is how I am verifying:
add_action('bbp_new_reply', 'my_new_reply_notify_admin', 10, 1); function my_new_reply_notify_admin($reply_id) { if (!$reply = bbp_get_reply($reply_id)) return; $message = sprintf( "_bbp_akismet_result: %1\$s\n\n_bbp_akismet_error: %2\$s", get_post_meta($reply->ID, '_bbp_akismet_result', true), get_post_meta($reply->ID, '_bbp_akismet_error', true) ); wp_mail( get_option( 'admin_email' ), $reply->post_title, $message ); }
When I submit a valid post, _bbp_akismet_result="false".
When I submit spam, both are empty.
I'm just new to bbpress so I haven't yet tried to debug the plugin code.
#4
@
12 years ago
My mistake, it seems that _bbp_akismet_result is empty in both scenarios.
For spam I am seeing _bbp_spam_meta_status=publish.
I'll test this later, but it's possible for '_bbp_akismet_result' to not be updated if Akismet returns an error during the spam check. The BBP Akismet plugin is not as fully featured as WP's Akismet at this time, so errors aren't properly handled at the moment. This will change in the future. Also, you're better off checking to see if the post status is spam rather than checking post meta for '_bbp_akismet_result'.