Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 10 years ago

#1632 closed defect (bug) (worksforme)

Akismet post meta not found in bbp_new_reply action

Reported by: mweatherill 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)

#1 @cnorris23
10 years ago

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'.

#2 @johnjamesjacoby
10 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 @mweatherill
10 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 @mweatherill
10 years ago

Actually, it now seems that _bbp_akismet_result is empty in both scenarios.

For spam I am seeing _bbp_spam_meta_status=publish.

Last edited 10 years ago by mweatherill (previous) (diff)

#5 @johnjamesjacoby
10 years ago

Try changing your priority '10' to something like '100'. From what I can tell, Akismet meta is saving properly. Even testbp.org is continuing to catch spam as it comes in.

#6 @johnjamesjacoby
10 years ago

  • Keywords reporter-feedback added

#7 @johnjamesjacoby
10 years ago

  • Milestone 2.1 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I've seen bbPress + Akismet catch both topic and reply spam, with the occasional miss or false positive. Seems to be working okay?

Closing as 'worksforme' pending any additional information.

Note: See TracTickets for help on using tickets.