reSmush.it Image Optimizer - Version 0.1.19

Version Description

  • Fix JS on "Optimize" button for a single picture
  • Provide a new "Force Optimization" for a single picture
Download this release

Release Info

Developer resmushit
Plugin Icon 128x128 reSmush.it Image Optimizer
Version 0.1.19
Comparing to
See all releases

Code changes from version 0.1.18 to 0.1.19

classes/resmushitUI.class.php CHANGED
@@ -353,6 +353,7 @@ Class reSmushitUI {
353
  else{
354
  $statistics = reSmushit::getStatistics($attachment_id);
355
  $output = __('Reduced by', 'resmushit') . " ". $statistics['total_saved_size_nice'] ." (". $statistics['percent_reduction'] . ' ' . __('saved', 'resmushit') . ")";
 
356
  }
357
 
358
  if($return)
353
  else{
354
  $statistics = reSmushit::getStatistics($attachment_id);
355
  $output = __('Reduced by', 'resmushit') . " ". $statistics['total_saved_size_nice'] ." (". $statistics['percent_reduction'] . ' ' . __('saved', 'resmushit') . ")";
356
+ $output .= '<input type="button" value="'. __('Force re-optimize', 'resmushit') .'" class="rsmt-trigger--optimize-attachment button media-button select-mode-toggle-button" name="resmushit" data-attachment-id="'. $attachment_id .'" class="button wp-smush-send" />';
357
  }
358
 
359
  if($return)
js/script.js CHANGED
@@ -115,8 +115,7 @@ function resmushit_bulk_resize(container_id) {
115
  var images = JSON.parse(response);
116
  if (images.nonoptimized.length > 0) {
117
  bulkTotalimages = images.nonoptimized.length;
118
-
119
-
120
  flag_removed = false;
121
  //start treating all pictures
122
  resmushit_bulk_process(images.nonoptimized, 0);
@@ -152,7 +151,8 @@ function updateStatistics() {
152
  * ajax post to disabled status (or remove)
153
  */
154
  function updateDisabledState() {
155
- jQuery('.rsmt-trigger--disabled-checkbox').change(function(){
 
156
  var current = this;
157
  jQuery(current).addClass('rsmt-disable-loader');
158
  jQuery(current).prop('disabled', true);
@@ -191,25 +191,22 @@ function updateDisabledState() {
191
  * ajax to Optimize a single picture
192
  */
193
  function optimizeSingleAttachment() {
194
- jQuery('.rsmt-trigger--optimize-attachment').each(function(){
195
- jQuery(this).on('mouseup', function(e){
196
- var current = this;
197
- jQuery(current).val('Optimizing...');
198
- jQuery(current).prop('disabled', true);
199
- var disabledState = jQuery(current).is(':checked');
200
- var postID = jQuery(current).attr('data-attachment-id');
201
- jQuery.post(
202
- ajaxurl, {
203
- action: 'resmushit_optimize_single_attachment',
204
- data: {id: postID}
205
- },
206
- function(response) {
207
- var statistics = jQuery.parseJSON(response);
208
- jQuery(current).parent().empty().append('Reduced by ' + statistics.total_saved_size_nice + ' (' + statistics.percent_reduction + ' saved)');
209
- }
210
- );
211
-
212
- e.preventDefault();
213
- });
214
  });
215
  }
115
  var images = JSON.parse(response);
116
  if (images.nonoptimized.length > 0) {
117
  bulkTotalimages = images.nonoptimized.length;
118
+ target.html('<div class="loading--bulk"><span class="loader"></span><br />' + bulkTotalimages + ' attachment(s) found, starting optimization...</div>');
 
119
  flag_removed = false;
120
  //start treating all pictures
121
  resmushit_bulk_process(images.nonoptimized, 0);
151
  * ajax post to disabled status (or remove)
152
  */
153
  function updateDisabledState() {
154
+ jQuery(document).delegate(".rsmt-trigger--disabled-checkbox","change",function(e){
155
+ e.preventDefault();
156
  var current = this;
157
  jQuery(current).addClass('rsmt-disable-loader');
158
  jQuery(current).prop('disabled', true);
191
  * ajax to Optimize a single picture
192
  */
193
  function optimizeSingleAttachment() {
194
+ jQuery(document).delegate(".rsmt-trigger--optimize-attachment","mouseup",function(e){
195
+ e.preventDefault();
196
+ var current = this;
197
+ jQuery(current).val('Optimizing...');
198
+ jQuery(current).prop('disabled', true);
199
+ var disabledState = jQuery(current).is(':checked');
200
+ var postID = jQuery(current).attr('data-attachment-id');
201
+ jQuery.post(
202
+ ajaxurl, {
203
+ action: 'resmushit_optimize_single_attachment',
204
+ data: {id: postID}
205
+ },
206
+ function(response) {
207
+ var statistics = jQuery.parseJSON(response);
208
+ jQuery(current).parent().empty().append('Reduced by ' + statistics.total_saved_size_nice + ' (' + statistics.percent_reduction + ' saved)');
209
+ }
210
+ );
 
 
 
211
  });
212
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: resmushit
3
  Tags: image, optimizer, image optimization, resmush.it, smush, jpg, png, gif, optimization, compression, Compress, Images, Pictures, Reduce Image Size, Smush, Smush.it
4
  Requires at least: 4.0.0
5
  Tested up to: 4.9.8
6
- Stable tag: 0.1.18
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -34,7 +34,7 @@ This plugin has initially been developped by [Maecia Agency](http://www.maecia.c
34
 
35
  = How great is reSmush.it ? =
36
 
37
- Since we've optimized more than 3,000,000,000 pictures, we've risen new skills. Our service is still in development to bring you new crazy functionalities.
38
 
39
  = Is there an "Optimize on upload" feature ? =
40
 
@@ -66,6 +66,10 @@ Yes ! Absolutely free, the only restriction is to send images below 5MB.
66
 
67
  == Changelog ==
68
 
 
 
 
 
69
  = 0.1.18 =
70
  * Avoid `filesize () : stat failed` errors if a picture file is missing
71
  * Log check file permissions
3
  Tags: image, optimizer, image optimization, resmush.it, smush, jpg, png, gif, optimization, compression, Compress, Images, Pictures, Reduce Image Size, Smush, Smush.it
4
  Requires at least: 4.0.0
5
  Tested up to: 4.9.8
6
+ Stable tag: 0.1.19
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
34
 
35
  = How great is reSmush.it ? =
36
 
37
+ Since we've optimized more than 4,000,000,000 pictures, we've risen new skills. Our service is still in development to bring you new crazy functionalities.
38
 
39
  = Is there an "Optimize on upload" feature ? =
40
 
66
 
67
  == Changelog ==
68
 
69
+ = 0.1.19 =
70
+ * Fix JS on "Optimize" button for a single picture
71
+ * Provide a new "Force Optimization" for a single picture
72
+
73
  = 0.1.18 =
74
  * Avoid `filesize () : stat failed` errors if a picture file is missing
75
  * Log check file permissions
resmushit.php CHANGED
@@ -10,8 +10,8 @@
10
  * Plugin Name: reSmush.it Image Optimizer
11
  * Plugin URI: https://resmush.it
12
  * Description: Image Optimization API. Provides image size optimization
13
- * Version: 0.1.18
14
- * Timestamp: 2018.11.04
15
  * Author: reSmush.it
16
  * Author URI: https://resmush.it
17
  * Author: Charles Bourgeaux
10
  * Plugin Name: reSmush.it Image Optimizer
11
  * Plugin URI: https://resmush.it
12
  * Description: Image Optimization API. Provides image size optimization
13
+ * Version: 0.1.19
14
+ * Timestamp: 2018.11.11
15
  * Author: reSmush.it
16
  * Author URI: https://resmush.it
17
  * Author: Charles Bourgeaux
resmushit.settings.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
 
4
  define('RESMUSHIT_ENDPOINT', 'http://api.resmush.it/');
5
- define('RESMUSHIT_VERSION', '0.1.18');
6
  define('RESMUSHIT_DEFAULT_QLTY', '92');
7
  define('RESMUSHIT_TIMEOUT', '10');
8
  define('RESMUSHIT_LOGS_PATH', 'resmushit.log');
2
 
3
 
4
  define('RESMUSHIT_ENDPOINT', 'http://api.resmush.it/');
5
+ define('RESMUSHIT_VERSION', '0.1.19');
6
  define('RESMUSHIT_DEFAULT_QLTY', '92');
7
  define('RESMUSHIT_TIMEOUT', '10');
8
  define('RESMUSHIT_LOGS_PATH', 'resmushit.log');