By default, BuddyPress does not include comments from non-members (or non-logged-in users more generally) in the sitewide activity stream. This plugin records activity items for those comments.
The plugin has been tested on version 1.1.3 of BP, as well as the 1.2 release candidate. If you want to use the plugin for 1.1.3 or lower, you will need to uncomment the first few add_action and add_filter lines in the plugin file.
Technical caveat: Non-logged-in commenters have BP user_id 0. When BP creates the activity stream, it decides whether or not to show the Delete button by checking to see whether the user_id for the currently logged in user is the same as the user_id of the person to whom the comment belongs. Presumably, though, you don’t want non-logged-in viewers of the activity stream to be able to delete items from the activity stream at all. BP’s core code is not currently set up to make it easy to remove these buttons, so I employed an ugly fix. If you have changed your theme significantly from the default, you might have to adjust the filter bp_nonmember_comment_content (near the end of the plugin) to remove the button properly.
BP Include Non-Member Comments has been downloaded 146 times. Are you using this plugin? Consider a donation.
Version history
- 1.0 – February 7, 2010
- Initial release
- 1.1 – February 22, 2010
- Normalized file structure to latest BP standards (bp_init)
- Fixed problem with deprecated bp_post_get_permalink

20 Comments
Cool! Does the “Visitor” button link to a visitor profile?
Hi Ray – No, I should have been more clear about the screenshot. It says “Visitor” because that’s the name I put in the blog comment box. The plugin inserts whatever name the commenter entered, which in turn links to the URL they entered.
Hey there Boone, good one there!
Wouldn’t it be more appropriate to link to the comment though? there they can still click the imo. The link to the post is just a link to the top of the post i’m assuming!
Hi iSimone –
Thanks!
The “View” button goes to the comment, while the post title links to the top of the post. I just copied what happens with comment activity items created by BP core. Or are you seeing something different?
Hey Boone,
It’s good that your plugin doesn’t create a visitor profile!
However, I do see the potential of people spamming a blog post’s comments just to put their backlink on the BP activity page.
I guess the issue lies with the WP blog admin and how s/he deals with allowing comments.
I figured the same thing, Ray. If you’ve got a spammer leaving porno links all over your comments section, the problem does not lie in BP, it lies in how you manage your comment spam.
Wow, thanks Boone. I guess I’m officially a fan of your work now. :)
Actually, the comments to delete are on lines 13 and 14 (not 12 and 13 like the readme.txt says).
Oh, one request. When a blog post mentions another blog post it ends up pinging iteself but when displayed in the sitewide activity stream it says “[insert the name of blog post] commented on the blog post [then insert the name of the blog post that was pinged]“.
Is there a way that could read “[name of the pinged blog post] was pinged by [name of the pinging blog post]“?
Thanks,
Paul
Hi Boone, great plugin-idea – I already wondered, if that is possible, because alot of commenters on our site are not logged in. GREAT & THANX!
I installed it on my test-Site (Subdirectories, WMPU 2.9.1.1. and BP 1.2RC) and it doesn’t seem to work… There are no settings, right? Do you have any idea why it’s not working? PS: I installed wordpress in a subblog – could that cause the troubles?
Another question: Would you make that plugin translatable? I would love to do it for german (doesn’t seem like alot of work :-) –>are your other bp-plugins translatable already? any POT-Files?)
Paul – I will take a look at making the “pinged” change. I’m not sure how ping objects are handled differently from trackbacks, but it should be easy enough.
Miguael – Not sure why it doesn’t work – the setup you describe is the same setup I used to develop it. There are no settings, it should just work. I don’t think subblog or subdirectory issues should affect anything, because the plugin activates with comment_post, which doesn’t care about URL. Do member blog comments appear on your activity stream without a problem?
The plugin shouldn’t need any translation. I didn’t change any of the strings from the buddypress defaults, so the bp text domain should do all the translation out of the box. That’ll change if I implement Paul’s suggestion, in which case I will make sure to generate a POT. My other plugins http://wordpress.org/extend/plugins/profile/boonebgorges are a mixed bag: Group Forum Subscription is fully translatable (and ships with a handful of languages, including German) but some of the others need some TLC in order to be localized. One of these weekends.
@Boone, oh so everything is fine. Seems I missunderstood your earlier comment. Btw. another good one on the new plugin!
Though is that not something that should be core material?
i always get a blank page after commenting, than the comment is posted to the blog, but there is nothing in the activity stream
What version of BP are you using?
1.2 final
So…
Here is the soultion to get this plugin to work with 1.2 final.
Replace
$comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . ‘#comment-’ . $comment_id;
with
$comment_link = get_permalink( $comment->comment_post_ID );
Thanks, unknown – I just found the problem myself, fixed it, checked it in, and then came here and read your comment! Could have saved myself a few minutes by coming here first :)
In any case, the new version should work correctly.
Actually there is still a bug, this bug is also in the bp-core. The link to the comment is wrong…
$comment_link = get_permalink( $comment->comment_post_ID ) . ‘#comment-’ . $comment_id;
should be
$comment_link = get_permalink( $comment->comment_post_ID );
Aha. That’s close, but I think it’s better to keep $comment_link how it is and change how $activity_content is built (otherwise the View link breaks). Just uploaded a fix – thanks for the help.
I habe the problem that when the plugin is turned on, comments that are pending in the admin area will be displayed on the activity stream, also comments that “spam karma” detected and correctly filed under spam will appear on the front page.
any ideas?
Hi ubik. You are the second person to report that problem, but I can’t seem to replicate it myself. What version of BP/WP are you using? Do you have any other plugins that affect how comments work?
Post a Comment