Force Regenerate Thumbnails - Version 2.0.4

Version Description

  • Fix issue when "opendir()" return FALSE (thanks Krody Robert)
Download this release

Release Info

Developer Pedro Elsner
Plugin Icon 128x128 Force Regenerate Thumbnails
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

Files changed (2) hide show
  1. force-regenerate-thumbnails.php +24 -18
  2. readme.txt +4 -1
force-regenerate-thumbnails.php CHANGED
@@ -1,9 +1,10 @@
1
  <?php
 
2
  /*
3
  Plugin Name: Force Regenerate Thumbnails
4
  Plugin URI: http://pedroelsner.com/2012/08/forcando-a-atualizacao-de-thumbnails-no-wordpress
5
  Description: Delete and REALLY force the regenerate thumbnail.
6
- Version: 2.0.3
7
  Author: Pedro Elsner
8
  Author URI: http://www.pedroelsner.com/
9
  */
@@ -534,16 +535,19 @@ class ForceRegenerateThumbnails {
534
  */
535
  $files = array();
536
  $path = opendir($file_info['dirname']);
537
- while (false !== ($thumb = readdir($path))) {
538
- if (!(strrpos($thumb, $file_info['filename']) === false)) {
539
- $files[] = $thumb;
540
- }
 
 
 
 
 
541
  }
542
- closedir($path);
543
- sort($files);
544
- foreach ($files as $thumb) {
545
- $thumb_fullpath = $file_info['dirname'] . DIRECTORY_SEPARATOR . $thumb;
546
- $thumb_info = pathinfo($thumb_fullpath);
547
  $valid_thumb = explode($file_info['filename'], $thumb_info['filename']);
548
  if ($valid_thumb[0] == "") {
549
  $dimension_thumb = explode('x', $valid_thumb[1]);
@@ -579,14 +583,16 @@ class ForceRegenerateThumbnails {
579
  */
580
  $files = array();
581
  $path = opendir($file_info['dirname']);
582
- while (false !== ($thumb = readdir($path))) {
583
- if (!(strrpos($thumb, $file_info['filename']) === false)) {
584
- $files[] = $thumb;
585
- }
 
 
 
 
586
  }
587
- closedir($path);
588
- sort($files);
589
- foreach ($files as $thumb) {
590
  $thumb_fullpath = $file_info['dirname'] . DIRECTORY_SEPARATOR . $thumb;
591
  $thumb_info = pathinfo($thumb_fullpath);
592
  $valid_thumb = explode($file_info['filename'], $thumb_info['filename']);
@@ -696,4 +702,4 @@ function ForceRegenerateThumbnails() {
696
  add_action('init', 'ForceRegenerateThumbnails');
697
 
698
 
699
- ?>
1
  <?php
2
+
3
  /*
4
  Plugin Name: Force Regenerate Thumbnails
5
  Plugin URI: http://pedroelsner.com/2012/08/forcando-a-atualizacao-de-thumbnails-no-wordpress
6
  Description: Delete and REALLY force the regenerate thumbnail.
7
+ Version: 2.0.4
8
  Author: Pedro Elsner
9
  Author URI: http://www.pedroelsner.com/
10
  */
535
  */
536
  $files = array();
537
  $path = opendir($file_info['dirname']);
538
+
539
+ if ( false !== $path ) {
540
+ while (false !== ($thumb = readdir($path))) {
541
+ if (!(strrpos($thumb, $file_info['filename']) === false)) {
542
+ $files[] = $thumb;
543
+ }
544
+ }
545
+ closedir($path);
546
+ sort($files);
547
  }
548
+ foreach ($files as $thumb) {
549
+ $thumb_fullpath = $file_info['dirname'] . DIRECTORY_SEPARATOR . $thumb;
550
+ $thumb_info = pathinfo($thumb_fullpath);
 
 
551
  $valid_thumb = explode($file_info['filename'], $thumb_info['filename']);
552
  if ($valid_thumb[0] == "") {
553
  $dimension_thumb = explode('x', $valid_thumb[1]);
583
  */
584
  $files = array();
585
  $path = opendir($file_info['dirname']);
586
+ if ( false !== $path ) {
587
+ while (false !== ($thumb = readdir($path))) {
588
+ if (!(strrpos($thumb, $file_info['filename']) === false)) {
589
+ $files[] = $thumb;
590
+ }
591
+ }
592
+ closedir($path);
593
+ sort($files);
594
  }
595
+ foreach ($files as $thumb) {
 
 
596
  $thumb_fullpath = $file_info['dirname'] . DIRECTORY_SEPARATOR . $thumb;
597
  $thumb_info = pathinfo($thumb_fullpath);
598
  $valid_thumb = explode($file_info['filename'], $thumb_info['filename']);
702
  add_action('init', 'ForceRegenerateThumbnails');
703
 
704
 
705
+ ?>
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Force Regenerate Thumbnails ===
2
  Contributors: Pedro Elsner
3
  Requires at least: 2.8
4
- Tested up to: 3.8
5
  Stable tag: trunk
6
  Tags: force, regenerate thumbnails, thumbnail, thumbnails
7
 
@@ -27,6 +27,9 @@ See the [screenshots tab](http://wordpress.org/extend/plugins/force-regenerate-t
27
 
28
  == ChangeLog ==
29
 
 
 
 
30
  = 2.0.3 =
31
  * Add debug information on regenerate
32
  * Fix issue with update "_wp_attachment_metadata" and "_wp_attached_file" on windows
1
  === Force Regenerate Thumbnails ===
2
  Contributors: Pedro Elsner
3
  Requires at least: 2.8
4
+ Tested up to: 4.0
5
  Stable tag: trunk
6
  Tags: force, regenerate thumbnails, thumbnail, thumbnails
7
 
27
 
28
  == ChangeLog ==
29
 
30
+ = 2.0.4 =
31
+ * Fix issue when "opendir()" return FALSE (thanks Krody Robert)
32
+
33
  = 2.0.3 =
34
  * Add debug information on regenerate
35
  * Fix issue with update "_wp_attachment_metadata" and "_wp_attached_file" on windows