[wp-trac] [WordPress Trac] #49889: Image.php - Wrap Error Suppressors in WP_DEBUG Conditionals

WordPress Trac noreply at wordpress.org
Sun Apr 12 16:01:47 UTC 2020


#49889: Image.php - Wrap Error Suppressors in WP_DEBUG Conditionals
------------------------------------+-------------------------------
 Reporter:  Howdy_McGee             |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  5.5
Component:  Media                   |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  coding-standards
------------------------------------+-------------------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 5.5


Comment:

 Thanks for the patch!

 With ~15 instances of `@getimagesize()` in core, I think it would make
 sense to introduce `wp_get_image_size()` as a wrapper with the `defined(
 'WP_DEBUG' ) && WP_DEBUG` check, to avoid repetition.

 `@iptcparse()` and `@exif_read_data()`, on the other hand, are only used
 once or twice, so probably don't need a wrapper at this point.

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


More information about the wp-trac mailing list