WordPress.org

Plugin Directory


Ignore:
Timestamp:
11/29/10 03:26:14 (3 years ago)
Author:
Viper007Bond
Message:

Version 2.1.2

  • When regenerating all images, newest images are done first rather than the oldest.
  • Fixed a bug with regeneration error reporting in some browsers. Thanks to pete-sch for reporting the error.
  • Supress PHP errors in the AJAX handler to avoid sending an invalid JSON response. Thanks to pete-sch for reporting the error.
  • Better and more detailed error reporting for when wp_generate_attachment_metadata() fails.
Location:
regenerate-thumbnails/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • regenerate-thumbnails/trunk/readme.txt

    r314036 r316344  
    3131 
    3232== ChangeLog == 
     33 
     34= Version 2.1.2 = 
     35 
     36* When regenerating all images, newest images are done first rather than the oldest. 
     37* Fixed a bug with regeneration error reporting in some browsers. Thanks to pete-sch for reporting the error. 
     38* Supress PHP errors in the AJAX handler to avoid sending an invalid JSON response. Thanks to pete-sch for reporting the error. 
     39* Better and more detailed error reporting for when `wp_generate_attachment_metadata()` fails. 
    3340 
    3441= Version 2.1.1 = 
  • regenerate-thumbnails/trunk/regenerate-thumbnails.php

    r314036 r316344  
    66Plugin URI:   http://www.viper007bond.com/wordpress-plugins/regenerate-thumbnails/ 
    77Description:  Allows you to regenerate all thumbnails after changing the thumbnail sizes. 
    8 Version:      2.1.1 
     8Version:      2.1.2 
    99Author:       Viper007Bond 
    1010Author URI:   http://www.viper007bond.com/ 
     
    145145                // of the API functions will return the full post objects which will 
    146146                // suck up lots of memory. This is best, just not as future proof. 
    147                 if ( ! $images = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%' ORDER BY ID" ) ) { 
     147                if ( ! $images = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%' ORDER BY ID DESC" ) ) { 
    148148                    echo '  <p>' . sprintf( __( "Unable to find any images. Are you sure <a href='%s'>some exist</a>?", 'regenerate-thumbnails' ), admin_url( 'upload.php?post_mime_type=image' ) ) . "</p></div>"; 
    149149                    return; 
     
    274274                        } 
    275275                    }, 
    276                     error: function() { 
     276                    error: function( response ) { 
    277277                        RegenThumbsUpdateStatus( id, false, response ); 
    278278 
     
    340340            $this->die_json_error_msg( $image->ID, sprintf( __( 'The originally uploaded image file cannot be found at %s', 'regenerate-thumbnails' ), '<code>' . esc_html( $fullsizepath ) . '</code>' ) ); 
    341341 
    342         set_time_limit( 900 ); 
     342        set_time_limit( 900 ); // 5 minutes per image should be PLENTY, lol 
     343        error_reporting( 0 ); // Don't break the JSON result 
    343344 
    344345        $metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath ); 
     346 
     347        if ( is_wp_error( $metadata ) ) 
     348            $this->die_json_error_msg( $image->ID, $metadata->get_error_message() ); 
    345349        if ( empty( $metadata ) ) 
    346350            $this->die_json_error_msg( $image->ID, __( 'Unknown failure reason.', 'regenerate-thumbnails' ) ); 
Note: See TracChangeset for help on using the changeset viewer.