Plugin Directory

Changeset 2226839


Ignore:
Timestamp:
01/13/2020 11:54:52 PM (6 years ago)
Author:
hifipix
Message:

Version 1.5.7 release

Location:
wp-quickdraw
Files:
567 added
25 edited

Legend:

Unmodified
Added
Removed
  • wp-quickdraw/trunk/assets/css/admin.css

    r2225557 r2226839  
    359359
    360360.wpqd-library-status-outer .wpqd-chart-container .processed-value {
     361    display: inline-block;
     362    margin-bottom: 5px;
    361363    font-family: 'Raleway', sans-serif;
    362364    font-size: 38px;
     
    634636}
    635637
     638.wp-core-ui .wpqd-settings #redux_save-footer {
     639    display: none;
     640}
     641
    636642.admin-color-fresh .wpqd-settings .noUi-connect {
    637643    background-color: #5d6dbe !important;
     
    767773/* Fix Label Vertical Alignment */
    768774body.wp-admin .compat-attachment-fields .compat-field-wpqd_enabled input {
    769     vertical-align: bottom;
     775    vertical-align: text-bottom;
    770776}
    771777
     
    875881}
    876882
    877 .wpqd-regenerate-images-wrapper {
    878     position: relative;
     883.redux-container.wpqd-settings .wpqd-cache-notice {
     884    background-color: #eeeeee;
     885    color: #818181;
     886    padding: 5px 20px 4px;
     887    margin-bottom: 15px;
     888}
     889
     890.redux-container.wpqd-settings .wpqd-cache-notice p {
     891    font-size: 16px;
     892}
     893
     894.compat-field-wpqd_enabled .wpqd-incompatible {
     895    margin-top: 6px;
     896    display: inline-block;
     897}
     898
     899.compat-field-wpqd_enabled .wpqd-incompatible input {
     900    display: none;
    879901}
    880902
     
    919941 }
    920942
     943 @media screen and (max-width: 1478px) {
     944    .wpqd-library-status-outer .wpqd-chart-container .processed-value {
     945        font-size: 28px;
     946    }
     947
     948    .wpqd-library-status-outer .wpqd-chart-container .processed-label {
     949        font-size: 13px;
     950    }
     951 }
     952
    921953 @media screen and (max-width: 1412px) and (min-width: 1351px) {
    922954    .wpqd-library-status-outer .highcharts-data-label {
  • wp-quickdraw/trunk/assets/css/index.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/assets/images/index.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/assets/js/admin-highcharts.js

    r2225557 r2226839  
    7575                yAxis: {
    7676                    labels: {
    77                         distance: -5
     77                        distance: -10
     78                    }
     79                }
     80            } 
     81        },
     82        {
     83            condition: { 
     84              maxWidth: 221
     85            }, 
     86            chartOptions: { 
     87                series: {
     88                    dataLabels: {
     89                        padding: 0,
     90                        crop: false,
     91                        overflow: 'allow'
    7892                    }
    7993                }
  • wp-quickdraw/trunk/assets/js/admin.js

    r2223196 r2226839  
    33        e.preventDefault();
    44        $('#redux_save-footer').trigger('click');
    5     });
    6 
    7     $( document ).ajaxComplete(function( event, xhr, settings ) {
    8         if ( typeof settings.data === 'undefined' ) {
    9             return;
    10         }
    11        
    12         // Force page refresh on settings save
    13         if ( settings.data.indexOf( 'action=wpqd_data_ajax_save' ) !== -1 ) {
    14             window.location.reload( true );
    15         }
    165    });
    176
  • wp-quickdraw/trunk/assets/js/index.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/assets/js/plugin-state.js

    r2225557 r2226839  
    288288            data: {
    289289                'action': 'wpqd_dismiss_admin_import_success'
     290            },
     291            success: function(data) {
     292                if ( data !== '1' ) {
     293                    return;
     294                }
     295                $('#wpqd-import-success').hide();
    290296            }
    291297        });
     
    360366                var result = JSON.parse(data),
    361367                    $container = $('#wpqd-import-success'),
    362                     $button = $('.wpqd-progress-pauser'),
    363368                    $message = $('#wpqd-progress-message'),
    364369                    $downloadFile = $('.wpqd-current-status .download'),
    365370                    $currentProgress = $('.current', $message),
    366                     $totalCount = $('.total', $message),
    367371                    $spinner = $('#wpqd-progress-message .wpqd-spinner-inline');
    368372
     
    378382                }
    379383               
    380                 $currentProgress.html( result.processed.total );
    381                 $totalCount.html( result.total );
     384                $currentProgress.html( result.countdown );
    382385                $downloadFile.html( statusMsg );
    383386                window.hifipixBatchImporter.updateAdminCharts();
     
    407410                    $container.removeClass('hide-dismiss');
    408411                    $spinner.hide();
    409                     $button.parent().hide();
    410412                    window.hifipixBatchImporter.dismissAdminProgress();
    411413                }
  • wp-quickdraw/trunk/readme.txt

    r2225557 r2226839  
    55Tested up to: 5.3.2
    66Requires PHP: 5.5
    7 Stable tag: 1.5.6
     7Stable tag: 1.5.7
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
    1010 
    11 Highly accelerated page loading and rendering for image-rich websites. Compatible with caching and image optimization plugins for the highest SEO.
     11Highly accelerated page loading and rendering for image-rich websites. Compatible with caching and image optimization plugins.
    1212
    1313== Description ==
     
    4747
    4848== Changelog ==
     49
     50= 1.5.7 =
     51* Release date: January 13, 2020
     52* All images at least 768px wide will now be processed (regardless of height dimension).
     53* Minor bug fixes: addressed several PHP notices.
     54* Updated image progress bar logic to use countdown instead of # of total.
     55* Fixed image regeneration on plugin update trigger so that it will not run on a new install.
     56* Improved messaging added to Media Library "WPQD Enabled" option.
     57* Responsive style fixes and added message about flushing cache in admin dashboard.
    4958
    5059= 1.5.6 =
  • wp-quickdraw/trunk/wpqd-admin-dashboard.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    7070        add_filter( 'wpqd_processing_status_data', array( $this, 'get_processing_status_data' ) );
    7171
    72         // Pro Upgrade Section
    73         add_action( 'redux/page/' . WPQD_OPTIONS . '/section/after', array( $this, 'get_pro_upgrade_section' ) );
     72        // Sections Below Settings
     73        add_action( 'redux/page/' . WPQD_OPTIONS . '/section/after', array( $this, 'get_cache_notice' ), 10, 1 );
     74        add_action( 'redux/page/' . WPQD_OPTIONS . '/section/after', array( $this, 'get_pro_upgrade_section' ), 20, 1 );
    7475       
    7576        // High Charts Scripts
     
    223224
    224225    /**
     226     * Display notice about clearing cache in dashboard
     227     *
     228     * @param   array $section
     229     * @return  void
     230     */
     231    public function get_cache_notice( $section ) {
     232        if ( $section['id'] !== 'dashboard' ) {
     233            return;
     234        }
     235        ?>
     236        <div class="wpqd-cache-notice">
     237            <p><?php _e('<strong>*</strong>Remember to clear any plugin or browser caches to apply changes made to WP QuickDraw settings in your Dashboard, Media Library Images, or webpages.', 'wpqd'); ?></p>
     238        </div>
     239        <?php
     240    }
     241
     242    /**
    225243     * Output Pro Upgrade call-to-action
    226244     *
  • wp-quickdraw/trunk/wpqd-api-connector.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-batch-importer.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    249249    // Get image data
    250250    $post_id = key($images);
    251     $path = array_shift( array_values($images) );
     251    $values = array_values($images);
     252    $path = array_shift( $values );
    252253    $metadata = new ImageMetadata( $post_id );
    253254    $uid = $metadata->get_uid();
     
    995996      $height = $attachment['height'];
    996997
    997       if ( $width < self::MIN_WIDTH || $height < self::MIN_HEIGHT ) {
    998         $metadata->set_enabled( false );
    999         $metadata->set_failed( true );
    1000         $metadata->set_under_min_limit( true );
    1001         $this->remove_queue_item( $queue, $id );
    1002         unset( $images[$id] );
    1003         continue;
    1004       }
    1005 
    1006998      if ( $width < self::BREAKPOINT_MIN ) {
    1007999        $metadata->set_enabled( false );
  • wp-quickdraw/trunk/wpqd-buffer-manager.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-buffer.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-cdn-uploader.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-core.php

    r2225557 r2226839  
    33Plugin Name: WP QuickDraw
    44Description: Highly accelerated page loading and rendering for image-rich websites. Compatible with caching and image optimization plugins for the highest SEO.
    5 Version:     1.5.6
    6 Author:      Hifipix
     5Version:     1.5.7
     6Author:      HifiPix
    77Author URI:  https://www.wpquickdraw.com/
    88License:     GPLv3
     
    3232define( 'WPQD_URL', plugins_url( '/', WPQD_PLUGIN_FILE ) );
    3333define( 'WPQD_NAME', 'WP QuickDraw');
    34 define( 'WPQD_VERSION' , '1.5.6' );
     34define( 'WPQD_VERSION' , '1.5.7' );
    3535define( 'WPQD_OPTIONS', 'wpqd_data');
    3636define( 'WPQD_BASENAME', plugin_basename( WPQD_PLUGIN_FILE ) );
  • wp-quickdraw/trunk/wpqd-disable-metabox.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    8181        ?>
    8282        <label class="selectit">
    83             <input id="<?php echo self::FIELD_KEY; ?>" name="<?php echo self::FIELD_KEY; ?>" type="checkbox" <?php echo $checked; ?> value="true" <?php disabled( ! current_user_can( 'edit_post' ) ); ?> />
     83            <input id="<?php echo self::FIELD_KEY; ?>" name="<?php echo self::FIELD_KEY; ?>" type="checkbox" <?php echo $checked; ?> value="true" <?php disabled( ! current_user_can( 'edit_post', $post->ID ) ); ?> />
    8484            <?php _e( 'Disable WP QuickDraw on this page', 'wpqd' ); ?>
    8585        </label>
  • wp-quickdraw/trunk/wpqd-image-generator.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-image-metadata.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-image-status-list.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-image-status-page.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-importer-progress.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    8989     */
    9090    public function set_upload_message( $file ) {
    91       return update_option( self::QUEUE_DOWNLOAD_MESSAGE, 'Uploading: ' . $file );
     91      return update_option( self::QUEUE_DOWNLOAD_MESSAGE, 'Processing: ' . $file );
    9292  }
    9393
     
    9898     */
    9999    public function set_download_message( $file ) {
    100         return update_option( self::QUEUE_DOWNLOAD_MESSAGE, 'Downloading: ' . $file );
     100        return update_option( self::QUEUE_DOWNLOAD_MESSAGE, 'Processing: ' . $file );
    101101    }
    102102
     
    202202   */
    203203  public function add_admin_notice() {
    204     if ( ! $this->is_in_progress() ) {
     204    $updater = PluginUpdater::get_instance();
     205    if ( ! $this->is_in_progress() && ! $updater->is_update_required() ) {
    205206        return;
    206207    }
     
    208209    $progress = $this->get_current_progress();   
    209210    $message = sprintf(
    210       'Processed <span class="current">%1$s</span> of <span class="total">%2$s</span> files <span class="wpqd-spinner-inline"></span>',
    211       isset( $progress['processed']['total'] ) ? $progress['processed']['total'] : 0,
    212       $progress['total']
     211      'WP QuickDraw has detected changes to the Media Library or needs to regenerate images. Analyzing <span class="current">%s</span> files. <span class="wpqd-spinner-inline"></span>',
     212      isset( $progress['countdown'] ) ? $progress['countdown'] : 0
    213213    );
    214214    $status_message = '';
     
    235235          <?php _e( $current_status, 'wpqd' ); ?>
    236236        </ul>
    237         <p>
    238             <a href="#" class="button button-primary button-large wpqd-progress-pauser">
    239               <?php if ( $this->is_paused() ): ?>
    240                 <?php _e( 'Resume Import', 'wpqd' ); ?>
    241               <?php else: ?>
    242                 <?php _e( 'Pause Import', 'wpqd' ); ?>
    243               <?php endif; ?>
    244             </a>
    245         </p>
    246237    </div>
    247238    <script>
     
    288279      ),
    289280      'total' => $this->status_data['totals']['total'],
     281      'countdown' => (int) ( $this->status_data['totals']['total'] - $this->status_data['totals']['generated'] ),
    290282      'download' => $this->status_data['download'],
    291283      'download_complete' => $this->status_data['download_complete'],
     
    393385      $data = array(
    394386        'download' => '',
    395         'download_complete' => false
     387        'download_complete' => false,
     388        'quota_exceeded' => false
    396389      );
    397390      $sql = sprintf(
  • wp-quickdraw/trunk/wpqd-logger.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
  • wp-quickdraw/trunk/wpqd-media-library.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    7474        $wpqd_incompatible = $image_metadata->get_under_min_limit() || $image_metadata->get_over_max_limit();
    7575        $enabled_html = sprintf(
    76             '<label><input type="checkbox"%1$s value="1" name="attachments[%2$s][%3$s]"%4$s> Enabled</label>%5$s<br/>',
     76            '<label%7$s><input type="checkbox"%1$s value="1" name="attachments[%2$s][%3$s]"%4$s> %5$s %6$s</label><br/>',
    7777            ( $wpqd_enabled == 1 ) ? ' checked' : '',
    7878            $post->ID,
    7979            ImageMetadata::KEY_ENABLED,
    8080            ( $wpqd_incompatible ) ? ' disabled' : '',
    81             ( $wpqd_incompatible ) ? ' (Image outside WPQD parameters)' : '<span class="wpqd_ml_advanced_toggle wpqd_ml_advanced_toggle_closed">Show Advanced</span>'
     81            ( $wpqd_incompatible ) ? 'Disabled' : 'Enabled',
     82            ( $wpqd_incompatible ) ? ' (Image outside WPQD parameters)' : '<span class="wpqd_ml_advanced_toggle wpqd_ml_advanced_toggle_closed">Show Advanced</span>',
     83            ( $wpqd_incompatible ) ? ' class="wpqd-incompatible"' : ''
    8284        );
    8385        $form_fields[ImageMetadata::KEY_ENABLED] = array(
  • wp-quickdraw/trunk/wpqd-plugin-state.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    8383     * @var string
    8484     */
    85     const TRANSIENT_KEY_CACHE = 'wpqd-cache-notice';
    86 
    87     /**
    88      * @var string
    89      */
    9085    const OPTION_KEY_INIT = 'wpqd_image_import_initialized';
    9186
     
    105100        add_filter( 'wpqd_admin_error_auth_buttons', array( $this, 'render_error_auth_buttons' ), 999, 1 );
    106101
    107         add_action( 'redux/options/' . WPQD_OPTIONS . '/saved', array( $this, 'set_cache_notice' ), 10, 2 );
    108         add_action( 'admin_notices', array( $this, 'admin_cache') );
    109102        add_action( 'admin_notices', array( $this, 'admin_welcome') );
    110103        add_action( 'admin_notices', array( $this, 'admin_error') );
     
    275268        }
    276269        wp_die();
    277     }
    278 
    279     /**
    280      * Set flag for notice about cache flush to be displayed in admin
    281      *
    282      * @param   array $settings
    283      * @param   array $changed_values
    284      * @return  void
    285      */
    286     public function set_cache_notice( $settings, $changed_values ) {
    287         if ( ! $changed_values || empty($changed_values) ) {
    288             return;
    289         }
    290         set_transient( self::TRANSIENT_KEY_CACHE, true );
    291     }
    292 
    293     /**
    294      * Print cache flush notice in admin after settings save
    295      *
    296      * @return void
    297      */
    298     public function admin_cache() {
    299         $flag = get_transient( self::TRANSIENT_KEY_CACHE );
    300 
    301         if ( ! $flag ) {
    302             return;
    303         }
    304         ?>
    305         <div class="notice notice-success is-dismissible">
    306             <p><strong><?php _e( 'WP QuickDraw Settings Changed', 'wpqd' ); ?></strong></p>
    307             <p><?php _e( 'You sucessfully saved your WP QuickDraw settings. In order to see your settings changes in effect, please flush your page cache (if you are using one).', 'wpqd' ); ?></p>
    308         </div>
    309         <?php
    310         delete_transient( self::TRANSIENT_KEY_CACHE );
    311270    }
    312271
  • wp-quickdraw/trunk/wpqd-plugin-updater.php

    r2225557 r2226839  
    1313 *
    1414 * @package     WP_QuickDraw
    15  * @author      hifipix
     15 * @author      HifiPix
    1616 * @copyright   2020 HifiPix, Inc.
    1717 * @license     http://www.gnu.org/licenses/gpl.html  GNU GPL, Version 3
    18  * @version     1.5.6
     18 * @version     1.5.7
    1919 */
    2020 
     
    3737     */
    3838    protected static $instance;
     39
     40    /**
     41     * @var BatchImporter
     42     */
     43    protected $importer;
    3944
    4045    /**
     
    6570     */
    6671    public function __construct() {
    67         add_action( 'admin_notices', array( $this, 'add_update_notice' ) );
     72        add_action( 'init', array( $this, 'maybe_run_update' ) );
    6873    }
    6974
     
    8893            break;
    8994        }
     95
     96        if ( $db_version === '0' ) {
     97            $needs_update = false;
     98        }
    9099         
    91100        if ( ! $needs_update ) {
     
    101110     * @return  void
    102111     */
    103     public function add_update_notice() {
     112    public function maybe_run_update() {
    104113        if ( ! $this->is_update_required() ) {
    105114            return;
    106115        }
    107         ?>
    108         <div class="notice notice-info">
    109             <p><strong><?php _e( 'WP QuickDraw Image Regeneration Required', 'wpqd' ); ?></strong></p>
    110             <p><?php printf(
    111                 'Thank you for updating to version %s of WP QuickDraw. This update requires regeneration of your image sets. Please click the button below to initiate this process.',
    112                 WPQD_VERSION
    113             ); ?></p>
    114             <div class="wpqd-regenerate-images-wrapper">
    115                 <a href="#" class="button button-primary button-large" id="wpqd-regenerate-images" >
    116                     <?php _e( 'Regenerate Image Sets', 'wpqd' ); ?>
    117                 </a>
    118             </div>
    119             <p id="wpqd-regenerate-images-feedback" style="display:none;"></p>
    120         </p>
    121         </div>
    122         <?php
     116        $this->get_importer()->reimport_all();
     117        $this->update_db_version();
    123118    }
    124119
     
    140135        return get_option( self::WPQD_DB_VERSION, '0' );
    141136    }
     137
     138    /**
     139     * Get BatchImporter singleton
     140     *
     141     * @return  BatchImporter
     142     */
     143    protected function get_importer() {
     144        if ( is_null( $this->importer ) ) {
     145            $this->importer = BatchImporter::get_instance();
     146        }
     147        return $this->importer;
     148    }
    142149}
Note: See TracChangeset for help on using the changeset viewer.