Plugin Directory

Changeset 1973177


Ignore:
Timestamp:
11/12/2018 06:50:32 PM (7 years ago)
Author:
webbamboo
Message:

Some bugfixes and new contributor

Location:
ez-optimize-media-optimizer
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • ez-optimize-media-optimizer/trunk/assets/js/imageoptimizer.js

    r1955610 r1973177  
    6060
    6161                    var item = lastValue;
    62                     var data = {
    63                         'action': 'ez_optimize',
    64                         'apikey': vueInstance.apikey,
    65                         'path': item.path
    66                     };
    67                     $.post(ajaxurl, data, function(response) {
    68                         var response = JSON.parse(response);
    69                         console.log(response);
    70                         if(response.state == 'success')
    71                         {
    72                             vueInstance.queue = response.vueData.queue;
    73                             vueInstance.optimized = response.vueData.optimized;
    74                             vueInstance.doQuery();
    75                         }
    76                         else if(response.state == 'error')
    77                         {
    78                             swal({
    79                                 type: 'error',
    80                                 title: 'Error',
    81                                 html: response.message
    82                             });
    83                         }
    84                     });
     62                    if(vueInstance.skip.indexOf(item.name) !== -1)
     63                    {
     64                        delete vueInstance.queue[lastKey];
     65                        vueInstance.doQuery();
     66                    }
     67                    else
     68                    {
     69                        var data = {
     70                            'action': 'ez_optimize',
     71                            'apikey': vueInstance.apikey,
     72                            'path': item.path
     73                        };
     74                        $.post(ajaxurl, data, function(response) {
     75                            var response = JSON.parse(response);
     76                            console.log(response);
     77                            if(response.state == 'success')
     78                            {
     79                                vueInstance.queue = response.vueData.queue;
     80                                vueInstance.optimized = response.vueData.optimized;
     81                                vueInstance.doQuery();
     82                            }
     83                            else if(response.state == 'error')
     84                            {
     85                                swal({
     86                                    title: "There was an error",
     87                                    text: `The following image failed to process: ${item.name} - ${item.size.toFixed(1)}kb
     88                                    Error: ${response.message}`,
     89                                    type: "warning",
     90                                    showCancelButton: true,
     91                                    confirmButtonColor: '#DD6B55',
     92                                    confirmButtonText: 'Continue with the other images',
     93                                    cancelButtonText: "Cancel"
     94                                }).then(function(isConfirm) {
     95                                    if (isConfirm) {
     96                                        vueInstance.skip.push(item.name);
     97                                        delete vueInstance.queue[lastKey];
     98                                        vueInstance.doQuery();
     99                                    } else {
     100                                       
     101                                    }
     102                                });
     103                            }
     104                        });
     105                    }
    85106                }
    86107                else
  • ez-optimize-media-optimizer/trunk/optimizer.php

    r1955908 r1973177  
    44Plugin URI: http://ezoptimize.com
    55Description: Automatically optimize all your media to get the minimum possible size without affecting the quality of the images. The easiest way to take care of Google PageSpeed "Optimize images" notification
    6 Version: 1.0.2
     6Version: 1.0.3
    77Author: Pavel Petrov
    88Author URI: http://webbamboo.net
     
    147147                    $ezOptimize->apikey = $apiKey;
    148148                    $ezOptimize->auto = $autoOptimize;
     149                    $ezOptimize->skip = [];
    149150
    150151                    $vueData = json_encode($ezOptimize);
  • ez-optimize-media-optimizer/trunk/readme.txt

    r1955908 r1973177  
    11=== EZOptimize Image Optimizer ===
    2 Contributors: webbamboo
     2Contributors: themediashop
    33Tags: image optimization, pagespeed optimize images, seo optimize images, reduce image size
    44Requires at least: 4.0.0
Note: See TracChangeset for help on using the changeset viewer.