WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 months ago

#21286 closed enhancement (duplicate)

Add filter to wp_dropdown_users to help huge networks

Reported by: wonderboymusic Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: Users Keywords: has-patch
Focuses: Cc:

Description

wp_dropdown_users( ) currently has a filter, but it only filters the output. The query args need to be filterable, otherwise sites with a huge number of users cannot turn off or limit this function.

Gravity Forms calls this function in the admin, which causes PHP to run out of memory easily when you have 1,000,000 users. Other plugins can call this at will.

I have added a new filter for dropdown_users_args in my patch

Attachments (1)

dropdown-users.diff (525 bytes) - added by wonderboymusic 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 @wonderboymusic3 years ago

  • Type changed from defect (bug) to enhancement

comment:2 @johnbillion3 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

See #19867 which has a similar patch plus one for autocomplete functionality.

comment:3 follow-up: @alexvorn23 years ago

I don't understand how scalable will help... having many users means having a big database, so splitting the table of the users to many other databases on different servers will help, but I could not figure out how to do this...
Like facebook having 500 million users... build on a farm of thousand servers that do the same task...

comment:4 @ocean903 years ago

  • Milestone Awaiting Review deleted

comment:5 in reply to: ↑ 3 @wonderboymusic3 years ago

Replying to alexvorn2:

I don't understand how scalable will help... having many users means having a big database, so splitting the table of the users to many other databases on different servers will help, but I could not figure out how to do this...
Like facebook having 500 million users... build on a farm of thousand servers that do the same task...

Most of the WordPress queries for users completely fall apart when you have a large number of users - this was trying to address one of those instances.

comment:6 @johnjamesjacoby6 months ago

Just bumped into this. The attached patch provides a helpful way for developers to circumvent the issue without affecting existing core behavior. +1

comment:7 @DrLightman2 months ago

This must be fixed asap, please.

Note: See TracTickets for help on using tickets.