Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 9 years ago

#5397 closed enhancement (wontfix)

Activity stats for wp-admin/Profile

Reported by: imath's profile imath Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Activity Keywords: 2nd-opinion has-patch
Cc: shane@…, mercijavier@…

Description

@hnla, in a comment to 5197, suggested to enhance the wp-admin/Profile stats metabox with some new ones using the activity types.

This patch is suggesting some new functions to get activity stats by type, or not.. Here's a screen capture of it :

http://farm3.staticflickr.com/2868/12510042604_6262afa34d_o.png

I think it can be useful for a community manager to see how a user is participating to the community, this might be interesting in this case.

Attachments (3)

5397.diff (12.4 KB) - added by imath 10 years ago.
5397.02.patch (6.4 KB) - added by imath 10 years ago.
5397.03.patch (7.4 KB) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (22)

@imath
10 years ago

This ticket was mentioned in IRC in #buddypress-dev by imathfromparis. View the logs.


10 years ago

#2 follow-up: @shanebp
10 years ago

  • Cc shane@… added

@imath - cool to see this functionality going into core. We've been doing similar things for awhile now in various plugins. It's very useful and clients love it.

It's one of those things that is seductive and can get quite elaborate.
See http://www.philopress.com/products/buddyreports/

At the bottom of the page, you'll see the basic stats we include on wp-admin/Profile pages.
[ I'll be removing those stats when 2.0 drops ]

So I'm suggesting that it would be trivial but helpful for you to add things like:

  • join date
  • blog articles count
  • blog comments count
  • bbpress check and then topic & replies counts
  • favorites count

#3 in reply to: ↑ 2 @imath
10 years ago

Replying to shanebp:

@imath - cool to see this functionality going into core.

So far it's just a suggestion. If other core team members think it's a good idea, then it should be ;)

We've been doing similar things for awhile now in various plugins. It's very useful and clients love it.

Very Nice.

So I'm suggesting that it would be trivial but helpful for you to add things like:

  • join date

It's already in the first metabox of wp-admin/profile BuddyPress tab

  • blog articles count
  • blog comments count
  • bbpress check and then topic & replies counts

In fact the patch attached to this ticket is getting all registered activity types and make a count of it. So all blog posts/comments/topics/replies that has generated an activity will be in the detailled by type count.

Types created by plugins can be in this stats metabox if they hook bp_register_activity_actions to register their types using the function bp_activity_set_action().

Thanks a lot for your feedback @shanebp

#4 follow-up: @shanebp
10 years ago

Oops, I should have looked at the diff before commenting - sorry.

I didn't know bp_displayed_user_id() would work in wp-admin/profile - thanks.

I think it's a great enhancement and hope it makes it into core.

#5 in reply to: ↑ 4 @imath
10 years ago

Replying to shanebp:

I didn't know bp_displayed_user_id() would work in wp-admin/profile - thanks.

Actually, it's not the case. But the stat functions can be used on front end too, that's why bp_activity_get_profile_stats() user_id args default to bp_displayed_user_id()

#6 follow-up: @shanebp
10 years ago

Okay - thanks for clarifying - too early here.

Types created by plugins can be in this stats metabox if they hook bp_register_activity_actions to register their types using the function bp_activity_set_action().

So if plugins aren't using the component api, the types won't appear?
A lot of plugins just use bp_blogs_record_post_post_types for cpts.

#7 in reply to: ↑ 6 @imath
10 years ago

Replying to shanebp:

So if plugins aren't using the component api, the types won't appear?
A lot of plugins just use bp_blogs_record_post_post_types for cpts.

In this case, i guess they also filter 'bp_blogs_activity_new_post_action' to use a "specific to their plugin" activity type.
They still can do that, but to have their type in the stats, types must be registered see this codex post

#8 @imath
10 years ago

  • Milestone changed from Awaiting Review to 2.1

Maybe we should see that in next version if some requests are coming on this feature.

#9 @mercime
10 years ago

  • Cc mercijavier@… added

#11 follow-up: @DJPaul
10 years ago

What does the EXPLAIN look like for that query?

#12 in reply to: ↑ 11 @imath
10 years ago

Hi mercime, thanks for your feedback :)

Replying to DJPaul:

What does the EXPLAIN look like for that query?

Hi DJPaul, it looks like this :

idselect_typetabletypepossible_keyskeykey_lenrefrowsExtra
1SIMPLEwp_bp_activityrefuser_id,typeuser_id8const9Using where; Using temporary; Using filesort

5397.02.patch is an update for latest trunk.

@imath
10 years ago

#13 @DJPaul
10 years ago

I don't think we should do this unless the query(s) can be made better; even if there's caching, that's still a potentially slow query.

#14 follow-up: @DJPaul
10 years ago

  • Milestone changed from 2.1 to 2.2

Moving to 2.2 as I think this needs more consideration. I'm very concerned about adding expensive queries and slowing down the dashboard (I'm not sure adding BP data to this widget is useful).

#15 in reply to: ↑ 14 @imath
10 years ago

Replying to DJPaul:

I'm very concerned about adding expensive queries and slowing down the dashboard (I'm not sure adding BP data to this widget is useful).

Just to be sure there's no confusion: this metabox would be in the wp-admin/profile of the member not in a dashboard widget.

The 'stats' metabox already exists in the wp-admin/profile of the member the ticket is suggesting to add activity stats to it.

#16 @DJPaul
9 years ago

  • Keywords needs-patch added; has-patch removed

I'm inclined to think we don't want to do this, because the patch doesn't cache the values, and I'm not sure that the proposed feature is worth the overhead. If other people really like the idea, I'm not going to stand in the way, but we do need caching for the raw SQL queries.

#17 @imath
9 years ago

Added caching in 5397.03.patch, but i'm ok with DJPaul's latest comment. Since the introduction of admin profiles, nobody requested such a feature. So unless this changes in a near future, i don't mind closing this ticket as invalid.

@imath
9 years ago

#18 @imath
9 years ago

  • Keywords has-patch added; needs-patch removed

#19 @boonebgorges
9 years ago

  • Milestone 2.2 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I'm not as concerned as DJPaul about the query overhead, but at the same time I don't see an overwhelming need for this data. I'd suggest packaging it (and maybe some other advanced admin stuff) in a plugin, and seeing if it gains any traction.

Note: See TracTickets for help on using tickets.