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