WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 8 days ago

#33296 new enhancement

Allow sites to skip a query in meta_form() that can delay loading the page

Reported by: kitchin Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Administration Keywords: has-patch needs-refresh needs-unit-tests
Focuses: performance Cc:

Description

Follow-up to #24998 (and its duplicates #32361, #32449). See also #18979.

Edit post loads slowly on sites with large tables. Sites should be able to bypass the meta drop-down query. I'm attaching a simple patch using the existing filter postmeta_form_limit.

Some sites do not need the drop-down, or have too many custom metas to make a drop-down useful. The drop-down is great for me though. I can easily add features without creating a custom meta box. Once an option is in the drop-down, my authors know it is available.

Attachments (1)

33296.patch (1.3 KB) - added by kitchin 6 years ago.

Download all attachments as: .zip

Change History (6)

@kitchin
6 years ago

#1 @MikeHansenMe
6 years ago

  • Keywords has-patch added

#2 @kitchin
6 years ago

By the way, a workaround is foreach ( get_post_types() as $type ) remove_post_type_support( $type, 'custom-fields' );. But my patch is sensible and keeps the meta box.

#3 in reply to: ↑ description @kitchin
6 years ago

Correction: Follow-up to #24498 not #24998

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


8 days ago

#5 @peterwilsoncc
8 days ago

  • Keywords needs-refresh needs-unit-tests added

This was discussed in a triage session today.

Avoiding connecting to the database for a LIMIT 0 query makes sense.

For sites that do set the limit to display zero keys using the postmeta_form_limit filter, the MySQL optimizer will skip the reading the table so the sub-optimal where clause won't slow things down.

33296.patch no longer applies cleanly so adding the needs-refresh keywords.

Note: See TracTickets for help on using tickets.