[wp-trac] [WordPress Trac] #56815: Massive (potential) performance issues within get_default_block_editor_settings

WordPress Trac noreply at wordpress.org
Wed Nov 9 00:28:47 UTC 2022


#56815: Massive (potential) performance issues within
get_default_block_editor_settings
-------------------------------------------------+-------------------------
 Reporter:  janthiel                             |       Owner:  flixos90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1.1
Component:  Editor                               |     Version:  6.0
 Severity:  major                                |  Resolution:  fixed
 Keywords:  2nd-opinion has-patch commit has-    |     Focuses:  multisite,
  unit-tests                                     |  performance
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54769" 54769]:
 {{{
 #!CommitTicketReference repository="" revision="54769"
 Editor: Improve frontend performance for
 `get_default_block_editor_settings()`.

 The `wp_max_upload_size()` function can be expensive to call, especially
 for large sites or multisites. For the frontend usage of
 `get_default_block_editor_settings()` knowing the allowed upload size is
 typically unnecessary.

 This changeset adds a condition so that `wp_max_upload_size()` is only
 called if the current user can actually `upload_files`. It keeps the data
 present when it is actually needed while avoiding the execution overhead
 when it is not needed.

 Props janthiel, Clorith, flixos90, spacedmonkey.
 Fixes #56815.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56815#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list