reGenerate Thumbnails Advanced - Version 2.0.1

Version Description

Release date: 17th April 2019 * Fix warnings related to corrupted metadata in some cases

Download this release

Release Info

Developer ShortPixel
Plugin Icon 128x128 reGenerate Thumbnails Advanced
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

classes/rta_admin_controller.php CHANGED
@@ -5,7 +5,7 @@ class rtaAdminController
5
  protected $controller;
6
 
7
  /** Settings saved in the option table. Being set on construct. Refreshed on save */
8
- protected $custom_image_sizes;
9
  protected $process_image_sizes = false;
10
  protected $process_image_options = array();
11
  protected $jpeg_quality = 90;
@@ -39,16 +39,16 @@ class rtaAdminController
39
  protected function setOptionData()
40
  {
41
  $options = get_option('rta_image_sizes');
42
- if (isset($options['image_sizes']))
43
  $this->custom_image_sizes = $options['image_sizes'];
44
 
45
  if (isset($options['jpeg_quality']))
46
  $this->jpeg_quality = $options['jpeg_quality'];
47
 
48
- if (isset($options['process_image_sizes']))
49
  $this->process_image_sizes = $options['process_image_sizes'];
50
 
51
- if (isset($options['process_image_options']))
52
  $this->process_image_options = $options['process_image_options'];
53
  }
54
 
@@ -138,7 +138,7 @@ class rtaAdminController
138
 
139
  // redo the thumbnail options, apply changes
140
  $sizes = isset($formpost['regenerate_sizes']) ? $formpost['regenerate_sizes'] : array();
141
- $sizes_options = array();
142
  foreach($sizes as $rsize)
143
  {
144
  if (isset($formpost['keep_' . $rsize]))
5
  protected $controller;
6
 
7
  /** Settings saved in the option table. Being set on construct. Refreshed on save */
8
+ protected $custom_image_sizes = array();
9
  protected $process_image_sizes = false;
10
  protected $process_image_options = array();
11
  protected $jpeg_quality = 90;
39
  protected function setOptionData()
40
  {
41
  $options = get_option('rta_image_sizes');
42
+ if (isset($options['image_sizes']) && is_array($options['image_sizes']))
43
  $this->custom_image_sizes = $options['image_sizes'];
44
 
45
  if (isset($options['jpeg_quality']))
46
  $this->jpeg_quality = $options['jpeg_quality'];
47
 
48
+ if (isset($options['process_image_sizes']) && is_array($options['process_image_sizes']))
49
  $this->process_image_sizes = $options['process_image_sizes'];
50
 
51
+ if (isset($options['process_image_options']) && is_array($options['process_image_options']) )
52
  $this->process_image_options = $options['process_image_options'];
53
  }
54
 
138
 
139
  // redo the thumbnail options, apply changes
140
  $sizes = isset($formpost['regenerate_sizes']) ? $formpost['regenerate_sizes'] : array();
141
+ $size_options = array();
142
  foreach($sizes as $rsize)
143
  {
144
  if (isset($formpost['keep_' . $rsize]))
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ShortPixel
3
  Donate link: https://www.paypal.me/resizeImage
4
  Tags: regenerate, thumbnail, thumbnails, thumb, thumbs, easy, media, force regenerate, image, images, pics, date
5
  Requires at least: 4.0
6
- Tested up to: 5.1
7
- Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -30,7 +30,7 @@ Features:
30
  * Resume function - the regeneration process will continue from where it was left in case you accidentally close the processing tab in your browser.
31
 
32
  Support:
33
- For support please conctact us <a href="https://shortpixel.com/contact">here</a> making sure you mention RTA plugin.
34
 
35
 
36
  == Installation ==
@@ -54,10 +54,15 @@ The script stops but it will resume after you open the settings page of the plug
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
57
  = 2.0.0 =
58
 
59
  Release date: 16th April 2019
60
- * Plugin completelly rewritten with additional features added:
61
  * Add custom thumbnails
62
  * Select which thumbnails to regenerate
63
  * Regenerate thumbnails only for the featured images
3
  Donate link: https://www.paypal.me/resizeImage
4
  Tags: regenerate, thumbnail, thumbnails, thumb, thumbs, easy, media, force regenerate, image, images, pics, date
5
  Requires at least: 4.0
6
+ Tested up to: 5.2
7
+ Stable tag: 2.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
30
  * Resume function - the regeneration process will continue from where it was left in case you accidentally close the processing tab in your browser.
31
 
32
  Support:
33
+ For support please contact us <a href="https://shortpixel.com/contact">here</a> making sure you mention RTA plugin.
34
 
35
 
36
  == Installation ==
54
 
55
  == Changelog ==
56
 
57
+ = 2.0.1 =
58
+
59
+ Release date: 17th April 2019
60
+ * Fix warnings related to corrupted metadata in some cases
61
+
62
  = 2.0.0 =
63
 
64
  Release date: 16th April 2019
65
+ * Plugin completely rewritten with additional features added:
66
  * Add custom thumbnails
67
  * Select which thumbnails to regenerate
68
  * Regenerate thumbnails only for the featured images
regenerate-thumbnails-advanced.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Regenerate Thumbnails Advanced
4
  Description: Regenerate thumbnails fast and easy while removing unused thumbnails of existing images; very useful when changing a theme.
5
- Version: 2.0.0
6
  Author: ShortPixel
7
  Author URI: https://shortpixel.com/
8
  License: GPLv2 or later
@@ -15,7 +15,7 @@ if ( !function_exists( 'add_action' ) ) {
15
  exit;
16
  }
17
 
18
- define( 'RTA_PLUGIN_VERSION', '2.0.0');
19
  define( 'RTA_PLUGIN_PATH', plugin_dir_path(__FILE__) );
20
  define( 'RTA_PLUGIN_URL', plugin_dir_url(__FILE__) );
21
  define( 'RTA_SITE_BASE_URL', rtrim(get_bloginfo('url'),"/")."/");
2
  /*
3
  Plugin Name: Regenerate Thumbnails Advanced
4
  Description: Regenerate thumbnails fast and easy while removing unused thumbnails of existing images; very useful when changing a theme.
5
+ Version: 2.0.1
6
  Author: ShortPixel
7
  Author URI: https://shortpixel.com/
8
  License: GPLv2 or later
15
  exit;
16
  }
17
 
18
+ define( 'RTA_PLUGIN_VERSION', '2.0.1');
19
  define( 'RTA_PLUGIN_PATH', plugin_dir_path(__FILE__) );
20
  define( 'RTA_PLUGIN_URL', plugin_dir_url(__FILE__) );
21
  define( 'RTA_SITE_BASE_URL', rtrim(get_bloginfo('url'),"/")."/");
rta_front.php CHANGED
@@ -41,22 +41,16 @@ class RTA_Front extends RTA
41
 
42
  public function rta_image_size_names_choose( $sizes ) {
43
 
44
- $options = get_option( 'rta_image_sizes' );
45
- $image_sizes = $options['image_sizes'];
46
- $rta_sizes = array();
 
 
47
 
48
- // if user has selected custom thumbnails to use, remove the rest.
49
- if (isset($options['process_image_sizes']))
50
- {
51
- $sizes = $options['process_image_sizes'];
52
- return;
53
- }
54
 
55
- if (count($image_sizes) == 0)
56
- {
57
- return $sizes;
58
- }
59
- if(is_array($image_sizes) && sizeof($image_sizes) > 0 && isset($image_sizes['name'])){
60
  for($i=0;$i<sizeof($image_sizes['name']);$i++){
61
  $slug = $image_sizes['name'][$i];
62
  $name = $image_sizes['pname'][$i];
@@ -64,13 +58,19 @@ class RTA_Front extends RTA
64
  }
65
 
66
  }
67
- return array_merge( $sizes, $rta_sizes );
 
 
68
  }
69
 
70
  public function rta_after_theme_setup() {
71
 
72
- $rta_image_sizes = get_option( 'rta_image_sizes' );
73
- $image_sizes = isset($rta_image_sizes['image_sizes']) ? $rta_image_sizes['image_sizes'] : array();
 
 
 
 
74
  if(count($image_sizes) > 0 && count($image_sizes['name']) > 0){
75
  for($i=0;$i<sizeof($image_sizes['name']);$i++){
76
  $crop = false;
41
 
42
  public function rta_image_size_names_choose( $sizes ) {
43
 
44
+ $rta_image_sizes = get_option( 'rta_image_sizes', false );
45
+ if (! $rta_image_sizes) // option not set
46
+ return $sizes;
47
+ if (! isset($rta_image_sizes['image_sizes']))
48
+ return $sizes;
49
 
50
+ $image_sizes = $rta_image_sizes['image_sizes'];
 
 
 
 
 
51
 
52
+ $rta_sizes = array();
53
+ if(is_array($image_sizes) && count($image_sizes) > 0 && sizeof($image_sizes['name']) > 0){
 
 
 
54
  for($i=0;$i<sizeof($image_sizes['name']);$i++){
55
  $slug = $image_sizes['name'][$i];
56
  $name = $image_sizes['pname'][$i];
58
  }
59
 
60
  }
61
+
62
+ $new_sizes = array_merge( $sizes, $rta_sizes );
63
+ return $new_sizes;
64
  }
65
 
66
  public function rta_after_theme_setup() {
67
 
68
+ $rta_image_sizes = get_option( 'rta_image_sizes', false);
69
+ if (! $rta_image_sizes)
70
+ return $rta_image_sizes;
71
+
72
+ $image_sizes = isset($rta_image_sizes['image_sizes']) && is_array($rta_image_sizes['image_sizes']) ? $rta_image_sizes['image_sizes'] : array();
73
+
74
  if(count($image_sizes) > 0 && count($image_sizes['name']) > 0){
75
  for($i=0;$i<sizeof($image_sizes['name']);$i++){
76
  $crop = false;