Plugin Directory

Changeset 1448139


Ignore:
Timestamp:
07/03/2016 05:32:39 PM (10 years ago)
Author:
winsite
Message:

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

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

Legend:

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

    r1442501 r1448139  
    100100    public function settings_section_intro() {
    101101        ?>
    102         <p><?php _e( 'Control the way Winsite Image Optimizer works via the settings below.', 'wp_revisions_control' ); ?></p>
     102        <p id="winsite-image-optimizer"><?php _e( 'Control the way Winsite Image Optimizer works via the settings below.', 'wp_revisions_control' ); ?></p>
    103103        <?php
    104104    }
     
    151151
    152152    public function regenerate_interface() {
     153        $username_exists = (bool) $this->get_setting('imageoptim-username');
    153154        ?>
    154155        <div class="wrap">
    155             <?php screen_icon(); ?>
    156156            <h2><?php esc_html_e( 'Winsite Image Optimizer', 'mimi' ); ?></h2>
     157
     158            <?php if ( ! $username_exists ) : ?>
     159            <div class="error">
     160                <p><?php printf( __( 'Hey! Looks like you haven\'t set up your ImageOptim API yet. Head over to the <a href="%s">settings section</a> and follow the instructions there. It\'s easy!', 'wsi-image-optimizer' ), admin_url( 'options-media.php#winsite-image-optimizer' ) ); ?></p>
     161            </div>
     162            <?php endif; ?>
    157163
    158164            <form id="wsi-regeneretro" method="post">
     
    163169                <?php wp_nonce_field( 'wsi-regeneretro' ) ?>
    164170                <progress id='progress-bar' max='100'><span></span>%</progress>
    165                 <button class="button button-primary" type="submit"><?php esc_html_e( 'Regenerate Retroactive', 'wsi-image-optimizer' ); ?></button>
     171                <button class="button button-primary" <?php echo $username_exists ?: 'disabled'; ?> type="submit"><?php esc_html_e( 'Regenerate Retroactive', 'wsi-image-optimizer' ); ?></button>
    166172                <span class="status status-finished"><span class="dashicons dashicons-yes"></span> Finished</span>
    167173                <span class="spinner"></span>
     
    185191        #wsi-regeneretro .wsi-file-list {
    186192            overflow-y: auto;
    187             max-height: 70vh;
     193            max-height: 35vh;
    188194        }
    189195        progress{
     
    195201        progress:not([value]) {
    196202            display: none;
    197         }   
     203        }
    198204
    199205        </style>
     
    245251        $file = wp_handle_sideload( $file_array, $overrides, $time );
    246252
     253        // get image post
     254        $image->guid = $file['url'];
     255        $image->post_mime_type = $file['type'];
     256
    247257        // update original attachment
    248         $ia = wp_insert_attachment( array(
    249             'ID'             => $image->ID,
    250             'guid'           => $file['url'],
    251             'post_mime_type' => $file['type'],
    252         ), $file['file'] );
     258        $ia = wp_insert_attachment( $image, $file['file'] );
    253259
    254260        // update in meta that it got processed
  • winsite-image-optimizer/trunk/includes/engines/class-wsi-engine-imageoptim.php

    r1433017 r1448139  
    55     * String format for the ImageOptim base URI
    66     * Format: https://im2.io/<Username>/<Options>/<Image URL>
    7      * 
     7     *
    88     * @see  https://im2.io/api/post
    99     * @static
     
    3737    /**
    3838     * Filter the HTTP request method, since ImageOptim supports POST only
    39      * 
     39     *
    4040     * @param  [type] $args [description]
    4141     * @param  [type] $url  [description]
     
    8888            $settings_page,
    8989            $settings_section,
    90             array( 'option' => 'imageoptim-username', 'desc' => __( 'Get your username at <a href="https://im2.io/register">ImageOptim API</a>.', 'winsite-images' ) )
     90            array( 'option' => 'imageoptim-username', 'desc' => __( 'Get your username at <a href="https://im2.io/register" target="_blank">ImageOptim API</a>.', 'winsite-images' ) )
    9191        );
    9292    }
  • winsite-image-optimizer/trunk/readme.txt

    r1435731 r1448139  
    4848== Changelog ==
    4949
     50= 1.0.6 - July 3, 2016 =
     51* Bug fix: Fixed issue where attachment metadata would be overriden and cleared when using the Retroactive Generator
     52* Bug fix: Fixed a UI/UX nuance. Now showing a notice for when a user hasn't set API details.
     53* Added a bit of fresh salsa sauce
     54
     55
    5056= 1.0.2 - June 13, 2016 =
    5157* Bug fix: Fixed issue where JS wasn't loading in back-end, disabling use of the Retroactive Generator. Props [@maor](https://github.com/maor)
  • winsite-image-optimizer/trunk/winsite-image-optimizer.php

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