Opened 16 months ago
Last modified 3 months ago
#19867 new defect (bug)
wp_dropdown_users() still not scalable
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Performance | Version: | 3.3.1 |
| Severity: | normal | Keywords: | ui-feedback has-patch needs-refresh |
| Cc: | xoodrew@…, Japh, kenton.jacobsen@…, kovshenin, mpvanwinkle77, info@… |
Description
#14572 made huge improvements to the performance of wp_dropdown_users(), however, on certain sites that have an unusually large set of authors, wp_dropdown_users() still isn't usable. It either causes a memory error on the server, or potentially crashes the client browser due to content size.
Attachments (4)
Change History (22)
prettyboymp — 16 months ago
comment:1
prettyboymp — 16 months ago
prettyboymp — 16 months ago
comment:2
prettyboymp — 16 months ago
attachment:ticket:19867:user_dropdown_filter.diff is alternative patch to at least allow a plugin to override the user dropdown before any queries are run.
prettyboymp — 16 months ago
comment:3
prettyboymp — 16 months ago
Just realized that my first patch didn't include the supporting js. Added attachment:ticket:19867:user_autocomplete.2.diff with it included.
+1 on the filter.
Additional +1 on autocomplete after a certain number of users. Since we are doing autocomplete for sites/users in the network admin for 3.4, the bits can likely be shared quite nicely.
comment:5
SergeyBiryukov — 15 months ago
Related: #19810
comment:6
DrewAPicture — 15 months ago
- Cc xoodrew@… added
comment:9
SergeyBiryukov — 10 months ago
#21286 closed as a duplicate.
comment:10
scribu — 7 months ago
- Milestone changed from Awaiting Review to Future Release
comment:11
brokentone — 5 months ago
- Cc kenton.jacobsen@… added
comment:12
SergeyBiryukov — 4 months ago
#23129 was marked as a duplicate.
comment:13
mpvanwinkle77 — 4 months ago
What's the status on this? Says targeted to 3.3.1 but it doesn't look like these changes ever made it through. I can help test if there's an approved patch for testing.
comment:14
follow-up:
↓ 15
helen — 4 months ago
Version is when something was reported/requested or the earliest a bug can be reproduced. Milestone is for the target, as it were.
Could probably use a patch that implements autocomplete the way it's done now for the network admin after a certain number of users. There's wp_is_large_network( 'users' ) to check for a large number of users but the default of 10k is probably still way too many for a dropdown.
comment:15
in reply to:
↑ 14
kovshenin — 4 months ago
- Cc kovshenin added
- Keywords needs-refresh added
Replying to helen: I think wp_is_large_network is actually used to prevent autocomplete because such searches would be really slow on large databases. Here's site-users.php:
if ( ! wp_is_large_network( 'users' ) ) wp_enqueue_script( 'user-suggest' );
We can probably just reuse the whole thing as is, with a different ajax callback.
mpvanwinkle77 — 4 months ago
comment:16
mpvanwinkle77 — 4 months ago
- Cc mpvanwinkle77 added
So here's a new approach. creates a new function wp_suggest_users ... allows for several criterion in wp_dropdown_users to initiate a bail to wp_suggest_users() ... minor updates to js and to wp-admin/includes/post.php required to make this work. There's still a lot to do to make this production ready, but wanted to get some general feed back on the approach before continuing.
comment:17
SergeyBiryukov — 3 months ago
#23439 was marked as a duplicate.
comment:18
toscho — 3 months ago
- Cc info@… added

attachment:ticket:19867:user_autocomplete.diff is a suggested solution using an autocomplete handling to replace the select box after a threshold of results is hit.
As an alternative, I'm working on a second patch that will just be a tweak to add a filter that will a plugin to add this functionality before the dropdown is generated, in case a built in solution isn't accepted.