[buddypress-trac] [BuddyPress Trac] #5950: Editing Pages / Posts in wp-admin creates 50, 000 SQL Queries

buddypress-trac noreply at wordpress.org
Sun Oct 12 04:04:11 UTC 2014


#5950: Editing Pages / Posts in wp-admin creates 50,000 SQL Queries
--------------------------+-----------------------------
 Reporter:  wcvendors     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  Awaiting Review
Component:  Core          |    Version:  2.1
 Severity:  critical      |   Keywords:
--------------------------+-----------------------------
 Crazy, I know! :)

 My BuddyPress site has around 49,000 members.  When I go to edit a page,
 or a post, as admin, there are 49,377 queries executing according to Query
 Monitor (a free WP Plugin).

 The queries being loaded are one for every single member on the site.

 98.
 Time: 0.44 ms
 Query: SELECT id, user_id, field_id, value, last_updated FROM
 wp_bp_xprofile_data WHERE field_id = 1 AND user_id IN (XXXXX) //(XXXXX
 changes based on user ID being looked up
 Function: require_once, require_once, do_action('admin_enqueue_scripts'),
 call_user_func_array, bp_admin_enqueue_scripts,
 do_action('bp_admin_enqueue_scripts'), call_user_func_array,
 bp_activity_mentions_script,
 do_action('bp_activity_mentions_prime_results'), call_user_func_array,
 bp_friends_prime_mentions_results, bp_core_get_user_displayname,
 bp_core_get_user_displaynames, BP_XProfile_ProfileData::get_value_byid

 This means about 60-80 seconds to edit a single page or a single post in
 wp-admin.  The rest of wp-admin is fine.

 Latest WP and latest BP are installed.

 When viewing the source of edit page or edit post, I see it is adding data
 from all of my "Friends" on the site (Which are 49,000 members, all
 members are automatic friends).

 var BP_Suggestions =
 {"friends":[{"ID":"----","image":"http:\/\/gravatar.com\/avatar\/964cd5d52e2eb1c31427e49202ed5d16?d=http:\/\/www.DOMAIN.com
 \/wp-content\/themes\/buddyboss\/images\/wpb-
 avatar.png&s=50&r=X","name":"----"}

 I dont know how to fix this, or why editing a post or a page wants to load
 my entire friends list

 Any suggestions or advice or a bug fix would be GREATLY appreciated!

 Regards,

 Ben

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5950>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list