Plugin Directory

Changeset 1435729


Ignore:
Timestamp:
06/13/2016 10:18:34 AM (10 years ago)
Author:
winsite
Message:

Update to commit 84aac03 from git@…:win-site/winsite-image-optimizer.git

Location:
winsite-image-optimizer
Files:
22 added
4 edited

Legend:

Unmodified
Added
Removed
  • winsite-image-optimizer/trunk/includes/class-wsi-hooks.php

    r1432975 r1435729  
    128128        add_filter( 'wp_handle_upload', array($this, __FUNCTION__), 10, 2 );
    129129
    130         // Important! Unlink the temp file, but measure size beforehand
    131         if ( winsite_image_optimizer()->retro->get_setting( 'should-keep-original' ) != '1' && file_exists( $orig_file['file'] ) ) {
     130        if ( file_exists( $orig_file['file'] ) ) {
     131            // Measure size beforehand
    132132            $this->last_file_size = filesize( $orig_file['file'] );
    133             // Goodbye.
    134             unlink( $orig_file['file'] );
     133
     134            // Important! Unlink the temp file if noted so in settings
     135            if ( winsite_image_optimizer()->retro->get_setting( 'should-keep-original' ) != '1' ) {
     136                // Goodbye.
     137                unlink( $orig_file['file'] );
     138            }
    135139        }
    136140
  • winsite-image-optimizer/trunk/includes/class-wsi-retro-processor.php

    r1433017 r1435729  
    5959    public function page_load() {
    6060        // Enqueue assets
    61         wp_enqueue_script( 'wsi-main', plugins_url( 'assets/js/winsite-image-optimizer.js', dirname( __FILE__ ) ), array( 'jquery' ) );
     61        wp_enqueue_script( 'wsi-main', plugins_url( 'static/js/winsite-image-optimizer.js', dirname( __FILE__ ) ), array( 'jquery' ) );
    6262
    6363        $args = array(
     
    164164                <button class="button button-primary" type="submit">Regenerate Retroactive</button>
    165165                <span class="status status-finished"><span class="dashicons dashicons-yes"></span> Finished</span>
     166                <span class="spinner"></span>
    166167            </form>
    167168        </div>
     
    169170        <style>
    170171        #wsi-regeneretro .status { display: none; }
     172        #wsi-regeneretro .status-active { display: inline-block; }
     173        #wsi-regeneretro .spinner {
     174            float: none;
     175            display: inline-block; 
     176        }
    171177        #wsi-regeneretro .status.status-display {
    172178            display: inline-block;
     
    232238
    233239        // update in meta that it got processed
    234         update_post_meta( $image->ID, 'wsi_photonized', '1' );
     240        update_post_meta( $image->ID, '_wsi_photonized', '1' );
    235241
    236242        if ( file_exists( $fullsizepath ) ) {
    237243            update_post_meta( $image->ID, '_wsi_original_filesize', filesize( $fullsizepath ) );
    238244
    239             // Delete old image while we're at it
    240             unlink( $fullsizepath );
     245            // Should we unlink this file?
     246            if ( winsite_image_optimizer()->retro->get_setting( 'should-keep-original' ) != '1' ) {
     247                // Delete old image while we're at it
     248                unlink( $fullsizepath );
     249            }
    241250        }
    242251
     
    266275    }
    267276
     277    /**
     278     * @todo update with WP new JSON functions
     279     */
    268280    public function die_json_error_msg( $id, $message ) {
    269281        die( json_encode( array( 'error' => sprintf( __( '&quot;%1$s&quot; (ID %2$s) failed to resize. The error message was: %3$s', 'regenerate-thumbnails' ), esc_html( get_the_title( $id ) ), $id, $message ) ) ) );
  • winsite-image-optimizer/trunk/readme.txt

    r1433031 r1435729  
    4848== Changelog ==
    4949
     50= 1.0.2 - June 13, 2016
     51* Bug fix: Fixed issue where JS wasn't loading in back-end, disabling use of the Retroactive Generator. Props [@maor](https://github.com/maor)
     52* Improved UX on Retroactive Image Generator page by adding an spinner/indicator when process runs. Props [@maor](https://github.com/maor)
     53* Bug fix: Fixed issue where images that got processed would be able to get procesed again with the Retroactive Gen. Props [@maor](https://github.com/maor)
     54
    5055= 1.0.1 - June 8, 2016 =
    5156Allow inputting ImageOptim username via Media settings page. Props [@maor](https://github.com/maor)
  • winsite-image-optimizer/trunk/winsite-image-optimizer.php

    r1433017 r1435729  
    44 * Plugin URI: http://win-site.co.il
    55 * Description: Optimize your images, period.
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: Winsite
    88 * Author URI: http://win-site.co.il
Note: See TracChangeset for help on using the changeset viewer.