PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / trunk
Image Optimizer – Compress Images and Convert to WebP or AVIF vtrunk
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | modules/optimization/assets/js/classes/control/control-sync.js +6 -0 1.6.4 → trunk View file →
@@ -29,8 +29,9 @@
29 29
30 30 return;
31 31 }
32 32
33 + // Required check as the status endpoint doesn't return validation errors
33 34 if ( currentStatus === 'error' && ! new ControlMeta( controlWrapper ).allowRetry() ) {
34 35 return;
35 36 }
36 37
@@ -56,8 +57,9 @@
56 57 break;
57 58
58 59 case 'optimized':
59 60 const statsData = {
61 + sizesTotal: imageData.stats.total_image_count,
60 62 sizesOptimized: imageData.stats.optimized_image_count,
61 63 saved: {
62 64 absolute: imageData.stats.initial_image_size - imageData.stats.current_image_size,
63 65 relative: Math.max( 100 - Math.round( imageData.stats.current_image_size / imageData.stats.initial_image_size * 100 ), 0 ),
@@ -70,9 +72,11 @@
70 72
71 73 case 'optimization-failed':
72 74 controlStates.renderError( {
73 75 message: imageData.message,
76 + errorType: imageData.error_type,
74 77 imagesLeft: imageData.images_left,
78 + allowRetry: new ControlMeta( controlWrapper ).allowRetry(),
75 79 action: 'optimize',
76 80 } );
77 81
78 82 break;
@@ -79,9 +83,11 @@
79 83
80 84 case 'reoptimizing-failed':
81 85 controlStates.renderError( {
82 86 message: imageData.message,
87 + errorType: imageData.error_type,
83 88 imagesLeft: imageData.images_left,
89 + allowRetry: new ControlMeta( controlWrapper ).allowRetry(),
84 90 action: 'reoptimize',
85 91 } );
86 92
87 93 break;