[buddypress-trac] [BuddyPress Trac] #6026: Single items for the Blogs component.

buddypress-trac noreply at wordpress.org
Mon Aug 1 14:33:10 UTC 2016


#6026: Single items for the Blogs component.
------------------------------------+-----------------------
 Reporter:  imath                   |       Owner:  imath
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  2.7
Component:  Blogs                   |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+-----------------------

Comment (by imath):

 Here comes step 4 and a first 'all steps' version of the patch.

 In 6026.smaller-steps.04.patch i'm adding:
 - Local avatar management for sites,
 - Cover image management for sites,
 - Cache functions for `bp_blogs_get_site()`
 - some fixes to bugs i've found in previous steps.

 There are 2 very important points:
 1. Avatars for site can be synchronized with the site icon feature:
 [[Image(https://cldup.com/BfRszm_AB2.png)]]
 A new nav item is available in the avatar UI to do so. If the site icon is
 removed, so will be the avatar, if the site icon is changed so will be the
 avatar.

 2. Spamming subscribers. I think WordPress is very severe. So i've
 suggested this patch on Core trac: #WP37538. What's the problem? It's
 `get_blogs_of_user()` :) The function is not checking for the user's
 impact on content, it just spams all sites the user is subscribed to.
 Which in the road i've took so far (using the subscriber role for
 subscriptions) is really annoying!
 So i've been doing some tests with a user who was a subscriber of 6 sites
 and it appears `BP_Site_Query` can do the same job than
 `get_blogs_of_user()` but 3 times faster! I've "fixed" point 2 using
 `BP_Site_Query` to only get the sites the user has a contributive role on
 for WP >= 4.6 and for the older versions, i'm removing the sites the user
 has no contributive role on of what returns `get_blogs_of_user()`.

 To come back to @boonebgorges concern about using the subscriber role for
 subscriptions. I think we have 2 choices:
 a. Use it, and override `get_blogs_of_user()` so that only the sites the
 user has a contributive role on will be listed into the network users
 administration screen.
 b. Or simply use the `bp_user_blogs` table to store the subscription eg:
 `is_contributor: 0` (that's what i'm doing when using the subscriber role
 anyway). In other words b. is a. minus the subscriber role.
 The problem with b, and one of the reason why i think it's best to use the
 subscriber role, is that as soon as the Network admin will run the Blogs
 repair tool, every sites will loose their subscriptions.

 There's still a step to add about notifications when a sites is
 subscribed. But i'll wait for your feedbacks about this alternative before
 working on it.

 To ease testing, i'm attaching 6026.smaller-steps.all.patch. It includes
 steps 1 to 4.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6026#comment:43>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list