“Image Sizes to Krak” is misleading after adding a new image size
-
“Image Sizes to Krak” shows new sizes enabled even if they actually aren’t.
Steps to reproduce.
1. Go to Kraken settings panel.
2. Check all image sizes and save.
3. Add a new image size using add_image_size() in functions.php.
4. Go back to Kraken settings panel.
5. The new image size is shown enabled even if it actually isn’t.You can enable the new size by pressing save but this is a bit misleading to the user because the image is shown enabled before it actually is so I’m fairly sure this is a bug and not expected behavior.
This can be fixed by changing one line of code to make sizes disabled by default. There didn’t seem to be up-to-date version of this plugin on GitHub to create a pull request so here’s the necessary change as a patch file:
Index: wp-content/plugins/kraken-image-optimizer/kraken.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- wp-content/plugins/kraken-image-optimizer/kraken.php (revision 904515347c1a1b8aad887bb7d3901ced8cd3f466) +++ wp-content/plugins/kraken-image-optimizer/kraken.php (revision 42d4fbef9a8492db2b7a756c6d8a605acf4dac72) @@ -130,7 +130,7 @@ $sizes = array_keys($this->get_image_sizes()); foreach ($sizes as $size) { - $valid['include_size_' . $size] = isset( $settings['include_size_' . $size]) ? $settings['include_size_' . $size] : 1; + $valid['include_size_' . $size] = isset( $settings['include_size_' . $size]) ? $settings['include_size_' . $size] : 0; } $status = $this->get_api_status( $api_key, $api_secret );
- The topic ‘“Image Sizes to Krak” is misleading after adding a new image size’ is closed to new replies.