[wp-trac] [WordPress Trac] #33306: Only Query for author ID if user is member of blog

WordPress Trac noreply at wordpress.org
Mon Sep 7 03:13:14 UTC 2015


#33306: Only Query for author ID if user is member of blog
-------------------------+-------------------------------------
 Reporter:  sboisvert    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  4.3
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  multisite, performance
-------------------------+-------------------------------------

Comment (by sboisvert):

 Thanks jeremyfelt, boonebgorges,
 I did notice that the call to `is_user_member_of_blog()` was "slow"(ish)
 and that's why I stuck the is_multisite() in front of it originally. I
 haven't looked in the code of the read permission but it does sound like
 an easy check to do that would be faster than is_user_member_of_blog
 (since that functions pulls all of the permissions on all of the sites
 that user is part of), the original intention of this was not to change
 behaviour but to allow for MySQL to better use the indexes by not having
 it pull both post statuses & author when we 'know' that those won't return
 true.
 Now again with the read permissions I think we still have the edge case of
 someone was an author / contributor and got their permissions changes. But
 as mentioned above I don't think this is a feature.

 If there's consesus that this is the best way forward I'll try to give a
 patch as well as some performance numbers this week.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33306#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list