[wp-trac] [WordPress Trac] #61532: Improve the performance of `WP_Image_Editor_Imagick::supports_mime_type()`
WordPress Trac
noreply at wordpress.org
Fri Jun 28 16:50:18 UTC 2024
#61532: Improve the performance of `WP_Image_Editor_Imagick::supports_mime_type()`
--------------------------+-----------------------
Reporter: joemcgill | Owner: joemcgill
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.7
Component: Media | Version:
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------
`WP_Image_Editor_Imagick::supports_mime_type()` is called whenever
WordPress is choosing which image editor library to use via
`wp_image_editor_supports()` > `_wp_image_editor_choose()`.
To see if the current server's version of ImageMagick supports a specific
mime type, that method calls `Imagick::queryFormats()`, which can take a
long time to run.
In the editor, `wp_plupload_default_settings()` makes triggers this code
path to see if modern formats like WebP and AVIF are supported, which
leads to a slower editor load time.
Since these supports values rarely change except for when changing hosting
environments, we can cache these supports values for faster lookups.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61532>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list