Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#25184 closed defect (bug) (duplicate)

confirm_delete_users() causes fatal error on site with large userbase

Reported by: rodrigosprimo Owned by:
Priority: normal Milestone:
Component: Multisite Version: 3.6
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

I have a site running WordPress MS, with 14000+ registered users and memory_limit at 256M. If I go to delete an user there is a fatal error (Allowed memory size of 268435456 bytes exhausted) when trying to generate the select box with the list of users inside confirm_delete_users() in wp-admin/network/users.php.

It seems to me that this is happening because the call to get_users() is too generic and the function is trying to return all users fields (including meta data) and only the ID and user login are necessary to populate the select box.

I'm attaching a patch that makes get_users() fetch only the required fields and this dramatically reduces the number of queries executed by this function. Thus preventing the fatal error from occurring.

Attachments (1)

users.php.patch​ (869 bytes ) - added by rodrigosprimo 13 years ago.
Fetch only the required field in confirm_delete_users()

Download all attachments as: .zip

Change History (2)

@rodrigosprimo
13 years ago

Fetch only the required field in confirm_delete_users()

#1 @duck_
13 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Thanks for the report. However, a duplicate was opened a few hours earlier at #25178.

Note: See TracTickets for help on using tickets.