get_users/WP_User_Query is not scalable
|Reported by:||duck_||Owned by:|
|Milestone:||3.1||Priority:||highest omg bbq|
Use of get_users (and by extension WP_User_Query) is not scalable for sites with a large number of users. Fatal errors occur when caching all the resulting users to memory.
Example usage which causes fatal errors in 3.1 (no fatal error in 3.0.3 for a site with even more users):
- Deleting a user (wp-admin/users.php line 175)
- XML-RPC request for wp.getAuthors (wp-includes/class-wp-xmlrpc-server.php line 783)
- Creating a network (wp-admin/schema.php line 670)
- wp_list_authors (wp-includes/author-template.php line 287)
And probably others, grep for get_users.
Patches for first to examples attached, but I can't help but feel this is just papering over the issue.