Skip to:
Content

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#3660 closed task (fixed)

Add Akismet to activity stream

Reported by: DJPaul Owned by: DJPaul
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Activity Keywords:
Cc:

Description

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

Change History (38)

comment:1 DJPaul3 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.

comment:2 djpaul2 years ago

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

comment:3 DJPaul2 years ago

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

BP-Default

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

Activity

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

Todo

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

comment:4 DJPaul2 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.

comment:5 DJPaul2 years ago

Second pass is in:

Admin

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

Activity

  • 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".

BP-Default

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

Todo

  • 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 :)

comment:6 djpaul2 years ago

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

comment:7 DJPaul2 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.

comment:8 DJPaul2 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.

comment:9 djpaul2 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.

comment:10 djpaul2 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

comment:11 djpaul2 years ago

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

comment:12 DJPaul2 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"

comment:13 djpaul2 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.

comment:14 djpaul2 years ago

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

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

comment:15 djpaul2 years ago

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

comment:16 djpaul2 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

comment:17 djpaul2 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.

comment:18 DJPaul2 years ago

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

comment:19 djpaul2 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.

comment:20 djpaul2 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

comment:21 djpaul2 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.

comment:22 djpaul2 years ago

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

comment:23 DJPaul2 years ago

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

comment:24 fanquake2 years ago

Related: #2254

comment:25 j.conti2 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.

comment:26 follow-up: DJPaul2 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).

comment:27 djpaul2 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.

comment:28 DJPaul2 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.

comment:29 djpaul2 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.

comment:30 in reply to: ↑ 26 j.conti2 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.

comment:31 DJPaul2 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.

comment:32 j.conti2 years ago

Ok,

thank's a lot

comment:33 DJPaul2 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.

comment:34 djpaul2 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.

comment:35 djpaul2 years ago

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

comment:36 DJPaul2 years ago

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

comment:37 djpaul2 years ago

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

comment:38 djpaul2 years ago

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

Note: See TracTickets for help on using tickets.