Skip to:

Opened 14 years ago

Closed 6 years ago

#2372 closed enhancement (maybelater)

@mention in wordpress post comment

Reported by: intimez's profile intimez Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5
Component: Blogs Keywords: trac-tidy-2018
Cc: mercijavier@…


If a person is @mention on the buddypress side, it will send an email notification if enabled.

This does not happen when leaving a comment on a wordpress post.

Is there any way to tie it to the buddypress system or even have a wordpress post recognize it as a buddypress command?

Attachments (1)

2372.01.patch (648 bytes) - added by r-a-y 11 years ago.

Download all attachments as: .zip

Change History (19)

#1 @intimez
14 years ago

  • Type changed from enhancement to defect

It correctly link to the buddypress profile so from that we know it's picking it up but no notification is sent.

#2 @boonebgorges
14 years ago

  • Resolution set to invalid
  • Status changed from new to closed

As you confirm, @-mention linking is already working correctly.

Notifications for @-mentions were added is [3403]

#3 @intimez
13 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version set to 1.3


I've tested this using trunk r3717 and it's not working.

Is 3403 for wordpress comment or only for buddypress? It sounds like only for buddypress so I'm reopening as my defect report is different.

#4 @boonebgorges
13 years ago

  • Milestone changed from 1.3 to 1.4
  • Type changed from defect to enhancement

You're right, this should be added. Switching to an enhancement and bumping to 1.4, as it's unlikely that the core team will have time to tackle this for 1.3.

#5 @boonebgorges
12 years ago

  • Cc djpaul removed
  • Keywords @mention comment notification removed
  • Milestone changed from 1.6 to Future Release
  • Severity set to normal

Currently, the way that content like blog comments is this:

  • They are processed as activity items, which contain an excerpt of the first sentence or two of the original content (eg, the comment)
  • If that excerpt contains an @-mention, then notifications will be processed. If the @-mentions appear after the excerpt cut, then nothing happens.

Ideally, we would be more consistent about how this works - generating @-mentions from the original content, or perhaps even storing all original content in the activity table - but that would require a substantial rewrite of the way that @-mentions are processed.

#6 @mercime
11 years ago

  • Cc mercijavier@… added

11 years ago

#7 @r-a-y
11 years ago

  • Component changed from Core to Blogs
  • Keywords has-patch added
  • Milestone changed from Future Release to 1.8

Attached a patch to fix this problem.

Tentatively moving to 1.8, but could make its way back to 1.7 if the other devs agree.

#8 @boonebgorges
11 years ago

Definitely not for 1.7. I don't know if there would be negative repercussions from storing all blog content in wp_bp_activity like this. Needs more research.

#9 @boonebgorges
11 years ago

  • Milestone changed from 1.8 to Future Release

Preliminarily, I think it's unwise to make the change suggested by r-a-y in 2372.01.patch. If we're going to store the full content of blog comments, then we should by the same logic store the full content of blog posts and content types that we currently excerpt for activity (like forum posts). But this will grow our activity table in big ways, which will add to the already painfully slow @-mention queries; see #4018. Moreover, storing full content will cause backward compatibility problems for plugins/themes that are currently displaying the full 'content' field of activity items.

A proper solution would be to store @-mention details as some sort of structured metadata (perhaps in activitymeta? perhaps as its own datatype?), to run the full content of the source content through a filter that detects and records @-mentions based on that full content, and _then_ to create and store an excerpt. But this is beyond what we can do for 1.8.

#10 @henrywright
11 years ago

I have been giving some thought to r-a-y's patch. I don't think it would have any impact on @-mentions in blog comments when the activity component is disabled. See the following statement earlier in the bp_blogs_record_activity() function:

if ( ! bp_is_active( 'activity' ) )
    return false;

Are @-mentions in blog posts and comments currently dependent on the activity component being active?

Last edited 11 years ago by henrywright (previous) (diff)

#11 @boonebgorges
11 years ago

Are @-mentions in blog posts and comments currently dependent on the activity component being active?

Yes. @-mentions in general are dependent on the Activity component.

The problem with r-a-y's patch is not that it'll have any ill effects when activity is *disabled* (in which case it'll in fact have no effect at all), but instead when activity is *enabled*. We currently store only short excerpts of blog posts in the 'content' column of the activity table - only a few hundred characters - but storing the full text of blog posts would mean that we're storing many, many times that. This will slow down the activity table in a number of important ways. The key issue in this case is that @-mention are fetched by a LIKE query, and the performance of those kinds of queries will degrade at least linearly with the increasing size of the haystack.

#12 @henrywright
11 years ago

Hi boone. That was my point. "I don't think it will have any impact on @-mentions when activity is disabled" - here I was trying to say it wouldn't have any effect at all. I was thinking along the lines of - the solution that is taken should avoid being dependent on the activity component being active as installations that have activity disabled will lose @-mention functionality.

#13 @henrywright
11 years ago

We currently store only short excerpts of blog posts in the 'content' column of the activity table

I'm wondering why @-mention content (excerpt or full text) has to be stored at all? A lightweight approach to blog post and comment @-mentioning could be taken:

  1. At the point which the blog post or comment is successfully submitted and saved, parse the text for @-usernames maybe using preg_match_all
  1. Check the found usernames are active members
  1. Trigger a BP core notification and an email alert to all valid members receiving the mention.

This would avoid:

  1. Activity table bloat and big haystacks
  2. Activity component dependency (unless the triggering of BP core notifications is currently dependant on activity?)
  3. Performance issues due to laborious LIKE queries

#14 @boonebgorges
10 years ago

henrywright - The issue is that when you go to view the "Mentions" tab on a user activity page, it's powered by a LIKE query on the content column of the activity table. If we don't store the content of the source item (or if we don't store *enough* of the content, as in the case of blog excerpts), the mention won't show up in that list.

#15 @DJPaul
9 years ago

  • Keywords has-patch removed

#16 @DJPaul
8 years ago

I think it makes sense to:

1) remove the "my mentions" tab from the template pack, given poor scaling at medium quantities of items (~10K).
2) What @boonebgorges said: that when we generate the activity item for a blog post and then parse it for @-mentions, to run that on the original blog post. And don't worry if the excerpt doesn't show the @-mention when viewing it in the Activity Stream.

#17 @DJPaul
6 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see
or find us on Slack, in the #buddypress channel:

#18 @DJPaul
6 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.