Title: undefined constant &#039;sizes&#039; bugfix
Last modified: August 20, 2016

---

# undefined constant 'sizes' bugfix

 *  Resolved [Brayyy](https://wordpress.org/support/users/brayyy/)
 * (@brayyy)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/undefined-constant-sizes-bugfix/)
 * Hey, I just wanted to let you know that I noticed a bug in wp-retina-2x.php, 
   line 354.
 * `if ( !sizes || !is_array( $sizes ) )`
 * should be
 * `if ( !$sizes || !is_array( $sizes ) )`
 * It wasn’t a big problem, but it was throwing an undefined constant error. This
   should solve that. Otherwise, love the plugin. Thanks for the hard work.
 * [http://wordpress.org/extend/plugins/wp-retina-2x/](http://wordpress.org/extend/plugins/wp-retina-2x/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/undefined-constant-sizes-bugfix/#post-3233315)
 * Oh you right! This has been unnoticed for quite a long while… thanks for finding
   this! I will include the correction in the next update. Thanks a lot!
 *  Thread Starter [Brayyy](https://wordpress.org/support/users/brayyy/)
 * (@brayyy)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/undefined-constant-sizes-bugfix/#post-3233316)
 * Sure, not a problem. While working on my own plugin, I have PHP outputting every
   Error, Notice and Warning.
 * Additionally, I think the wr2x_vt_resize should be wrapped with a function exists.
   I wrote scripts that generate multiple posts at once, which would previously 
   fail, since it was already defined.
 *     ```
       if (!function_exists('wr2x_vt_resize')){
         function wr2x_vt_resize( $file_path, $width, $height, $newfile ) {
           ...code...
         }
       }
       ```
   
 * Thanks! Your plugin has been very helpful.
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/undefined-constant-sizes-bugfix/#post-3233334)
 * Okay, super, I did added that check and it will be included in the next version(
   which will be released at the same time as WP 3.5).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘undefined constant 'sizes' bugfix’ is closed to new replies.

 * ![](https://ps.w.org/wp-retina-2x/assets/icon-256x256.png?rev=2597316)
 * [Perfect Images: Regenerate Thumbnails, Image Sizes, WebP & AVIF](https://wordpress.org/plugins/wp-retina-2x/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-retina-2x/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-retina-2x/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-retina-2x/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-retina-2x/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-retina-2x/reviews/)

## Tags

 * [bugfix](https://wordpress.org/support/topic-tag/bugfix/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/undefined-constant-sizes-bugfix/#post-3233334)
 * Status: resolved