Title: Adding default value constants
Last modified: March 20, 2019

---

# Adding default value constants

 *  Resolved [Tii](https://wordpress.org/support/users/tii/)
 * (@tii)
 * [7 years ago](https://wordpress.org/support/topic/adding-default-value-constants/)
 * You plugin is very nice, it would be nicer if we could setup default size via
   constants in the wp-config.php
 * It’s a simple change like this that would make a big change when managing many
   wordpress in multisite environments for examples…
 *     ```
       if (!defined('JR_RESIZEUPLOAD_WIDTH')) {
           define('JR_RESIZEUPLOAD_WIDTH', '1200');
       }
       if (!defined('JR_RESIZEUPLOAD_HEIGHT')) {
           define('JR_RESIZEUPLOAD_HEIGHT', '1200');
       }
       if (!defined('JR_RESIZEUPLOAD_QUALITY')) {
           define('JR_RESIZEUPLOAD_QUALITY', '90');
       }
       if (!defined('JR_RESIZEUPLOAD_RESIZE')) {
           define('JR_RESIZEUPLOAD_RESIZE', 'yes');
       }
       if (!defined('JR_RESIZEUPLOAD_RECOMPRESS')) {
           define('JR_RESIZEUPLOAD_RECOMPRESS', 'no');
       }
       if (!defined('JR_RESIZEUPLOAD_CONVERTBMP')) {
           define('JR_RESIZEUPLOAD_CONVERTBMP', 'no');
       }
       if (!defined('JR_RESIZEUPLOAD_CONVERTPNG')) {
           define('JR_RESIZEUPLOAD_CONVERTPNG', 'no');
       }
       if (!defined('JR_RESIZEUPLOAD_CONVERTGIF')) {
           define('JR_RESIZEUPLOAD_CONVERTGIF', 'no');
       }
   
       // Default plugin values
       if(get_option('jr_resizeupload_version') != $PLUGIN_VERSION) {
   
         add_option('jr_resizeupload_version', 			$PLUGIN_VERSION, '','yes');
         add_option('jr_resizeupload_width', 				JR_RESIZEUPLOAD_WIDTH, '', 'yes');
         add_option('jr_resizeupload_height',				JR_RESIZEUPLOAD_HEIGHT, '', 'yes');
         add_option('jr_resizeupload_quality',				JR_RESIZEUPLOAD_QUALITY, '', 'yes');
         add_option('jr_resizeupload_resize_yesno', 		JR_RESIZEUPLOAD_RESIZE, '','yes');
         add_option('jr_resizeupload_recompress_yesno', 	JR_RESIZEUPLOAD_RECOMPRESS, '','yes');
         add_option('jr_resizeupload_convertbmp_yesno', 	JR_RESIZEUPLOAD_CONVERTBMP, '', 'yes');
         add_option('jr_resizeupload_convertpng_yesno', 	JR_RESIZEUPLOAD_CONVERTPNG, '', 'yes');
         add_option('jr_resizeupload_convertgif_yesno', 	JR_RESIZEUPLOAD_CONVERTGIF, '', 'yes');
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [ShortPixel](https://wordpress.org/support/users/shortpixel/)
 * (@shortpixel)
 * [7 years ago](https://wordpress.org/support/topic/adding-default-value-constants/#post-11338087)
 * Hey [@tii](https://wordpress.org/support/users/tii/) thank you for using RIAU
   and thank you for your suggestion! 🙂
    Would you mind making a pull request with
   this change here [https://github.com/short-pixel-optimizer/resize-image-after-upload](https://github.com/short-pixel-optimizer/resize-image-after-upload)
 * We’ll be happy to include it afterwards.
 * Thank you,
    Alex

Viewing 1 replies (of 1 total)

The topic ‘Adding default value constants’ is closed to new replies.

 * ![](https://ps.w.org/resize-image-after-upload/assets/icon-256x256.png?rev=1940740)
 * [Resize Image After Upload](https://wordpress.org/plugins/resize-image-after-upload/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/resize-image-after-upload/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/resize-image-after-upload/)
 * [Active Topics](https://wordpress.org/support/plugin/resize-image-after-upload/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/resize-image-after-upload/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/resize-image-after-upload/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ShortPixel](https://wordpress.org/support/users/shortpixel/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/adding-default-value-constants/#post-11338087)
 * Status: resolved