reGenerate Thumbnails Advanced - Version 1.5.2.2

Version Description

Fixed a javascript bug, made it work again, as it wasn't before. Removed the "plugin for sale ad, removed the donate button"

=

Download this release

Release Info

Developer turcuciprian
Plugin Icon 128x128 reGenerate Thumbnails Advanced
Version 1.5.2.2
Comparing to
See all releases

Code changes from version 1.5.0 to 1.5.2.2

inc/function_for_media.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function rta_fileName($images)
4
+ {
5
+ $arra = [];
6
+ foreach ($images as $key => $value) {
7
+ $url = $value;
8
+
9
+ $arr = strrpos($url, '/');
10
+ $arr2 = $arr + 1;
11
+ $file = substr($url, $arr2);
12
+ $arra[] = $file;
13
+ }
14
+ return $arra;
15
+ }
16
+
17
+
18
+
19
+ function rta_take_name($url)
20
+ {
21
+ $arr = strrpos($url, '/');
22
+ $arr2 = $arr + 1;
23
+ $file = substr($url, $arr2);
24
+ return $file;
25
+ }
26
+
27
+ function rta_getPath($path)
28
+ {
29
+ $partial_path = strrpos($path, '/');
30
+ $partial_path = substr($path, 0, $partial_path);
31
+ return $partial_path;
32
+ }
33
+
34
+ function rta__delete_thumbnails($id)
35
+ {
36
+ $get_path = get_attached_file($id);
37
+ // echo $get_path;
38
+ $file_name = rta_take_name($get_path);
39
+ $file_name = explode(".", $file_name)[0];
40
+ $finalpath = getPath($get_path);
41
+ $images = scandir($finalpath);
42
+ foreach ($images as $key => $value) {
43
+ $a = strpos($value, $file_name.'-');
44
+ echo $a." ";
45
+ $filetodelete='';
46
+ if ($a===0) {
47
+ $filetodelete = $finalpath.'/'.$value;
48
+ // echo "<pre>";
49
+ // print_r($filetodelete);
50
+ unlink($filetodelete);
51
+ }
52
+ }
53
+ }
readme.txt CHANGED
@@ -1,18 +1,20 @@
1
  === reGenerate Thumbnails Advanced ===
2
- Contributors: turcuciprian
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MU4RJNNF74QKY
4
  Tags: thumbnail, thumbnails, regenerate , easy, day, week, month, advanced, easy, intuitive, media, oneclick, singleclick, image, images, pdf
5
  Requires at least: 4.0
6
- Tested up to: 4.8
7
- Stable tag: 1.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Description: A plugin that makes regenerating thumbnails even easier than before and more flexible.
 
 
12
 
13
  == Description ==
14
 
15
- High Level Tutorial:
16
 
17
  https://www.youtube.com/watch?v=a5F5OsWZC28
18
 
@@ -21,9 +23,13 @@ If you install a new theme, it might have different image sizes it wants to use.
21
  the ones you already uploaded? They need to be regenerated, this is what this plugin does. It takes each image and generates the thumbnails for each and every one of them.You have the ability to regenerate thumbnails for a aspecific image
22
  by cicking a added button on the media page. You will not be redirected to another page, everything happens on that page with REST api and ajax.
23
 
 
 
 
24
 
25
  Features:
26
 
 
27
  * You can select a period in time for the images to be regenerated from
28
  * The period is last day, last week, last month or all
29
  * Clean simple interface where you have a progress bar showing you the percentage of images regenerated
@@ -154,6 +160,20 @@ Removed donate button
154
  = 1.5.0 =
155
  Added a notification message with a link when a theme is switched
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  == Upgrade Notice ==
159
 
@@ -259,3 +279,18 @@ Does not impact functionality
259
 
260
  = 1.5.0 =
261
  Does not impact functionality
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === reGenerate Thumbnails Advanced ===
2
+ Contributors: turcuciprian, ioanachichernea
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MU4RJNNF74QKY
4
  Tags: thumbnail, thumbnails, regenerate , easy, day, week, month, advanced, easy, intuitive, media, oneclick, singleclick, image, images, pdf
5
  Requires at least: 4.0
6
+ Tested up to: 4.8.3
7
+ Stable tag: 1.5.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Description: A plugin that makes regenerating thumbnails even easier than before and more flexible, removing unused thumbnails of existing files.
12
+
13
+
14
 
15
  == Description ==
16
 
17
+ Quick Tutorial:
18
 
19
  https://www.youtube.com/watch?v=a5F5OsWZC28
20
 
23
  the ones you already uploaded? They need to be regenerated, this is what this plugin does. It takes each image and generates the thumbnails for each and every one of them.You have the ability to regenerate thumbnails for a aspecific image
24
  by cicking a added button on the media page. You will not be redirected to another page, everything happens on that page with REST api and ajax.
25
 
26
+ NEW FEATURE:
27
+
28
+
29
 
30
  Features:
31
 
32
+ * Removes ( cleans up ) the thumbnails of the existing images that are no longer of any use (since version 1.5.2 )
33
  * You can select a period in time for the images to be regenerated from
34
  * The period is last day, last week, last month or all
35
  * Clean simple interface where you have a progress bar showing you the percentage of images regenerated
160
  = 1.5.0 =
161
  Added a notification message with a link when a theme is switched
162
 
163
+ = 1.5.1 =
164
+ Fixed a fatal error bug conflicting with Contact Form Maker
165
+
166
+ = 1.5.1.1 =
167
+ Added donate button
168
+
169
+ = 1.5.2 =
170
+ Removes (cleans up ) thumbnails that are not in use of existing images before it regenerates them.
171
+
172
+ = 1.5.2.1 =
173
+ Fixed a space bug.
174
+
175
+ = 1.5.2.2 =
176
+ Fixed a javascript bug, made it work again, as it wasn't before. Removed the "plugin for sale ad, removed the donate button"
177
 
178
  == Upgrade Notice ==
179
 
279
 
280
  = 1.5.0 =
281
  Does not impact functionality
282
+
283
+ = 1.5.1 =
284
+ Does not impact functionality
285
+
286
+ = 1.5.1.1 =
287
+ nothing effected in db
288
+
289
+ = 1.5.2 =
290
+ nothing effected in db
291
+
292
+ = 1.5.2.1 =
293
+ nothing effected in db
294
+
295
+ = 1.5.2.2 =
296
+ nothing effected in db
regenerate-thumbnails-advanced.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: reGenerate Thumbnails - advanced
4
  Plugin URI: http://ciprianturcu.com
5
  Description: A plugin that makes regenerating thumbnails even easier than before and more flexible.
6
- Version: 1.5.0
7
  Author: turcuciprian
8
  Author URI: http://ciprianturcu.com
9
  License: GPLv2 or later
@@ -13,6 +13,8 @@
13
  //Global variables for arguments
14
  require_once 'inc/rest.php';
15
  require_once 'mediaRows.php';
 
 
16
 
17
  class cc
18
  {
@@ -73,6 +75,18 @@ class cc
73
  ?></p>
74
  </div>
75
  <div id="js-works" class="hidden">
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
  <hr>
78
 
@@ -110,7 +124,7 @@ class cc
110
  <p><span><?php echo __('Start Date(including):', 'rta');
111
  ?><br/><input type="text" class="datepicker start" readonly /></span></p>
112
  <p><span><?php echo __('End Date(including):', 'rta');
113
- ?><br/><input type="text" class="datepicker end" readonly /></span></p>
114
  </div>
115
  <p class="submit">
116
  <button class="button button-primary RTA"><?php echo __('Regenerate Thumbnails', 'rta');
@@ -165,10 +179,10 @@ add_action("after_switch_theme", "mytheme_do_something");
165
 
166
  function mytheme_do_something () {
167
 
168
- add_action( 'admin_notices', 'sample_admin_notice__success' );
169
  }
170
 
171
- function sample_admin_notice__success() {
172
  ?>
173
  <div class="notice notice-success is-dismissible">
174
  <p><?php _e( 'You switched themes! Would you like to regenerate thumbnails so that all your thumbnails work on your theme? <a href="options-general.php?page=regenerate_thumbnails_advanced">YES</a>', 'sample-text-domain' ); ?></p>
3
  Plugin Name: reGenerate Thumbnails - advanced
4
  Plugin URI: http://ciprianturcu.com
5
  Description: A plugin that makes regenerating thumbnails even easier than before and more flexible.
6
+ Version: 1.5.2.2
7
  Author: turcuciprian
8
  Author URI: http://ciprianturcu.com
9
  License: GPLv2 or later
13
  //Global variables for arguments
14
  require_once 'inc/rest.php';
15
  require_once 'mediaRows.php';
16
+ require_once 'inc/function_for_media.php';
17
+
18
 
19
  class cc
20
  {
75
  ?></p>
76
  </div>
77
  <div id="js-works" class="hidden">
78
+ <h3>Help out. <span style="color:green;">DONATE how much you want!</span></h3>
79
+
80
+
81
+ <!-- Paypal donate button START-->
82
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
83
+ <input type="hidden" name="cmd" value="_s-xclick">
84
+ <input type="hidden" name="hosted_button_id" value="7EP625Y355BNS">
85
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
86
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
87
+ </form>
88
+
89
+ <!-- Paypal donate button END-->
90
 
91
  <hr>
92
 
124
  <p><span><?php echo __('Start Date(including):', 'rta');
125
  ?><br/><input type="text" class="datepicker start" readonly /></span></p>
126
  <p><span><?php echo __('End Date(including):', 'rta');
127
+ ?><br/><input type="text" class="datepicker end" readonly /></span></p>
128
  </div>
129
  <p class="submit">
130
  <button class="button button-primary RTA"><?php echo __('Regenerate Thumbnails', 'rta');
179
 
180
  function mytheme_do_something () {
181
 
182
+ add_action( 'admin_notices', 'rta_admin_notice__success' );
183
  }
184
 
185
+ function rta_admin_notice__success() {
186
  ?>
187
  <div class="notice notice-success is-dismissible">
188
  <p><?php _e( 'You switched themes! Would you like to regenerate thumbnails so that all your thumbnails work on your theme? <a href="options-general.php?page=regenerate_thumbnails_advanced">YES</a>', 'sample-text-domain' ); ?></p>
script.js CHANGED
@@ -15,6 +15,7 @@ jQuery(document).ready(function($) {
15
  var unique = true;
16
  var i = 0;
17
  var y = 0;
 
18
  while (val[i]) {
19
  unique = true;
20
  y = 0;
15
  var unique = true;
16
  var i = 0;
17
  var y = 0;
18
+ if(val && val[i])
19
  while (val[i]) {
20
  unique = true;
21
  y = 0;