Skip to:

Opened 13 years ago

Closed 12 years ago

Last modified 8 years ago

#3660 closed enhancement (fixed)

Add Akismet to activity stream

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile DJPaul
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Activity Keywords:


Add Akismet into the activity stream. Involves creating backend pages in wp-admin.

Change History (39)

#1 @DJPaul
13 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

Per the dev meeting, this one's mine; there's a proof of concept in the BP Labs plugin.

#2 @djpaul
13 years ago

(In [5259]) First pass of Akismet support for the Activity component. See #3660

#3 @DJPaul
13 years ago

First pass at the front-end changes are in. Specifically:


  • Added bp_dtheme_spam_activity().
  • Updated global.js for activity spam button AJAX.
  • Updated bp_dtheme_new_activity_comment() for the new hide_spam param.
  • r5255 and r5256.


  • Added new "is_spam" column to the bp_activity DB table; incremented DB version number to force schema upgrade.
  • Akismet support is only loaded when the WordPress Akismet plugin is active and configured.
  • Added new "hide_spam" parameter to the entire Activity template loop stack; defaults to true, except if specific activity items have been requested (for backpat reasons).
  • "Mark as spam" buttons are added to activity stream items and comments, for site admins (filterable - "bp_activity_akismet_user_can_mark_spam").
  • By default, only status updates and comments are checked for spam (filterable - "bp_akismet_get_activity_types").
  • Removed a few old PHP4 constructors and general code tidy up.


  • wp-admin screens for the Activity component.
  • If a status update is marked as spam, and it has activity comments against it, the activity comments aren't visible. Consider adding something like a "this comment is pending notification" placeholder in the output so that those activity comments aren't hidden.

#4 @DJPaul
13 years ago

Still working on admin UI. I'm also refactoring the hide_spam stuff to be more flexible, so we can request spam, ham, or all items in the template loops. I'm also moving some of the mark_as_spam stuff out of the Akismet class into the general Activity functions so people are able to plug in their own spam detection systems.

#5 @DJPaul
12 years ago

Second pass is in:


  • Added Activity admin screen into wp-admin. Lists/searches/filters activity. Action links aren't implemented yet.


  • Refactored main "mark as spam" functions out of Akismet class into Activity core; allows implementation with other spam checking services and plugins.
  • Updated hide_spam parameter on entire Activity template loop stack; values are now "ham_only" (default), "spam_only", and "all".


  • "Mark as spam" button on activity stream entries is now functional.


  • Hook up action links in the admin screen.
  • Implement "edit" and "reply" functionality into admin screen

If anyone wants to contribute help towards any of this, let me know :)

#6 @djpaul
12 years ago

(In [5262]) Second pass of Akismet support for the Activity component. See #3660

#7 @DJPaul
12 years ago

r5280 added the following:

Add Akismet history information to the Activity admin page's items.
Use new wrapper functions to get user's UA and IP for Akismet calls.
Rename Activity admin page slug.

#8 @DJPaul
12 years ago

This might need to go into its own ticket, but if a post is spammed (or hammed), that post's activity stream item should be spammed (or hammed), too.

#9 @djpaul
12 years ago

(In [5325]) See #3660. Activity admin iteration.

  • Update automatic Akismet submission hook priority (r5276).
  • Update "In Response To" column.
  • Update Contextual Help.
  • Spam, un-spam and delete action buttons work.
  • Small styling tweaks.
  • Switched some $bp global and BP_VERSION to use the new wrapper functions.

#10 @djpaul
12 years ago

(In [5327]) Use the user name in Activity Akismet history, rather than their display name, to avoid possible confusion if/when users switch their names. See #3660

#11 @djpaul
12 years ago

(In [5328]) When a blog comment status transition occurs, update the relevant activity's status. See #3660

#12 @DJPaul
12 years ago

Todo looks like:

  • Add javascript "Reply" form.
  • Add "Edit" screen.
  • Todo: Marked "if we're viewing a specific activity, check/merge $activity->children into the main list (recursive)."
  • Todo: Marked "Get comment count from a specific node"

#13 @djpaul
12 years ago

(In [5339]) See #3660. Activity admin iteration.

  • "Reply" button now works.
  • Fixed incorrect HTML markup.
  • Improve error handling when an update on an activity fails.

#14 @djpaul
12 years ago

(In [5341]) See #3660. Activity admin iteration.

  • Activity comment counts now show from non-zero non-root comments

#15 @djpaul
12 years ago

(In [5343]) See #3660. Tidy markup and fix number i18n.

#16 @djpaul
12 years ago

(In [5368]) When marking a user as a spammer, flag all of their activity items as spam instead of deleting them. See #3660

#17 @djpaul
12 years ago

(In [5396]) See #3660. Activity admin iteration.

  • Updated use of old, incorrect bp_activity_get_specific() spam parameter to new name.
  • Updated contextual help.
  • Updated In Reply To column; now correctly shows details of that activity.
  • Made speech bubble appearance consistent between root activities vs. non-root activities.

#18 @DJPaul
12 years ago

(In [5408]) In the Activity admin, fix certain activity types showing incorrect "In Reply To" information.

#19 @djpaul
12 years ago

(In [5410]) When marking a user as not a spammer, mark all their activity as not spam, too.
Also removes legacy behaviour of changing activities' hide_sitewide when marking a user as a spammer.
See #3660.

#20 @djpaul
12 years ago

(In [5419]) On the Activity admin screen, when filtered to show a specific activity (via speech bubble), display all its child activities on the same screen. See #3660. Props Tom J Nowell and Lee Willis

#21 @djpaul
12 years ago

(In [5426]) Activity admin iteration. See #3660.

  • Pluralise the name of top-level Activity menu to match other menus' titles.
  • Update contextual help for Activity index screen, and fix deprecated function use.
  • Move index/edit screen generation into separate functions; restructure bp_activity_admin().
  • Change the In Response To column to only show speech bubble when item is a root activity, rather than for any node that contains children. This changes the single activity filter screen to match BP-Default's activity permalink screen.

#22 @djpaul
12 years ago

(In [5427]) Revert part of r5426 (See #3660). Reinstates part of r5408.

#23 @DJPaul
12 years ago

Just to note that I'm aware of the bug where the "activities per screen" option isn't working.

#25 @j.conti
12 years ago

I think you need to add a Enable/disable option for Akismet on BuddyPress.

Many people could want Akismet for comments but not for buddypress.

#26 follow-up: @DJPaul
12 years ago

I'm happy to add a filter in which could be used to prevent the Akismet support being loaded for the Activity component. But I would need convincing that there needs to be a UI option for this, or that there's a meaningful use case somewhere where you want Akismet for comments, but not for anything else (e.g. bbPress forums, activity).

#27 @djpaul
12 years ago

(In [5435]) Activity admin iteration. See #3660.

  • Fix "n activities per screen" option not working (and only load on the index screen).
  • Fix activity type filter drop down.
  • Fix PHP warnings when the index screen tried to truncate activity item's contents.
  • Add "bp_activity_use_akismet" filter to allow Akismet integration with Activity to be disabled.
  • Add first version of the Activity edit screen, and its contextual help text.

#28 @DJPaul
12 years ago

I could do with some help testing the activity edit screen, specifically from sites that aren't using the GMT timezone. If you edit an activity and set its timestamp to e.g. 5pm local, does the time it displays on the front of the site match 5pm local? If you're able to look in the database, it shouldn't say 5pm, but would say 5pm plus/minus your timezone offset from GMT.

#29 @djpaul
12 years ago

(In [5437]) Switch the "filter by" drop down on the Activity admin screen to get its values from the registered activity list. Adds missing core activity types to that list. See #3660.

#30 in reply to: ↑ 26 @j.conti
12 years ago

Replying to DJPaul:

But I would need convincing that there needs to be a UI option for this, or that there's a meaningful use case somewhere where you want Akismet for comments, but not for anything else (e.g. bbPress forums, activity).

Akismet has a free query limit.

You coult have 10, 20, 30 comments day, but you can have hundreds of activities each day. That means that many people may find that the exhaust it.

That can mean two different things, one that more people pay for Akismet. Two, there will be many people who uninstall Akismet to not have that problem.

Another reason, I had Akismet in bbPress. I uninstalled Akismet because 25% of legitimate post ended in Akismet moderation. I was all day marking legitimate post as not spam.

If it will be going to be the same with BuddyPress activities, this can become a hell.

#31 @DJPaul
12 years ago

A filter was added in [r5435] per your request. It would be extremely easy for a plugin dev to create a plugin to disable Akismet for the activity component.

#32 @j.conti
12 years ago


thank's a lot

#33 @DJPaul
12 years ago

I also need to go back through all of this and add/check we've got enough useful actions and filters around the screens.

#34 @djpaul
12 years ago

(In [5484]) Activity admin iteration. See #3660.

  • Add remaining activity properties to the edit screen.
  • Add new contextual help to the edit screen.
  • Add support for 2 columns to the edit screen.
  • Fix a typo (props fanquake, see #3822).
  • Update BP_Activity_Activity::save() method to fix a bug where an update operation with no changes was reported as an error.
  • Update activity admin CSS, bump version number.

#35 @djpaul
12 years ago

(In [5487]) Add a bunch of actions and filters for plugin authors to the Activity Admin screen. See #3660

#36 @DJPaul
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

#37 @djpaul
12 years ago

(In [5623]) Add 'history' meta box to admin edit activity screen. See #3660.

#38 @djpaul
12 years ago

(In [5624]) Add i18n support missed from r5623. See #3660

#39 @DJPaul
8 years ago

  • Type changed from task to enhancement
Note: See TracTickets for help on using tickets.