Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#25184 closed defect (bug) (duplicate)

confirm_delete_users() causes fatal error on site with large userbase

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

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 11 years ago.
Fetch only the required field in confirm_delete_users()

Download all attachments as: .zip

Change History (2)

@rodrigosprimo
11 years ago

Fetch only the required field in confirm_delete_users()

#1 @duck_
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.