Changeset 1092463
- Timestamp:
- 02/17/2015 02:12:20 PM (11 years ago)
- Location:
- wp-image-shrinker
- Files:
-
- 2 edited
- 3 copied
-
tags/1.0.2 (copied) (copied from wp-image-shrinker/trunk)
-
tags/1.0.2/hetworkstinypng.php (copied) (copied from wp-image-shrinker/trunk/hetworkstinypng.php) (5 diffs)
-
tags/1.0.2/readme.txt (copied) (copied from wp-image-shrinker/trunk/readme.txt) (2 diffs)
-
trunk/hetworkstinypng.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-image-shrinker/tags/1.0.2/hetworkstinypng.php
r1092414 r1092463 4 4 * Plugin URI: http://www.hetworks.nl 5 5 * Description: Reduce image file sizes drastically and improve performance and Pagespeed score using the TinyPNG API within WordPress. Works for both PNG and JPG images. 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Author: HETWORKS 8 8 * Author URI: http://www.hetworks.nl … … 128 128 'action': 'hetworkstinypng_ajaxaction_tinypngimage', 129 129 'url': url, 130 'id': id 130 'id': id, 131 'dataType': 'json' 131 132 }; 132 jQuery.ajax({133 jQuery.ajax({ 133 134 type: 'POST', 134 135 url: ajaxurl, … … 138 139 }, 139 140 success: completeHandler = function(response) { 140 res = jQuery.parseJSON(response); 141 if (typeof res.error === 'undefined') { 141 try { 142 res = jQuery.parseJSON(response); 143 } catch(error) { 144 console.log(error); 145 } 146 if (typeof res !== 'undefined' && typeof res.error === 'undefined' && typeof error === 'undefined') { 142 147 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<table class="intable"><tr><td>From:</td><td>' + bytesToSize(res.input.size) + '</td></tr><tr><td colspan="2"><span class="dashicons dashicons-yes"></span></td></tr><tr><td>To:</td><td>' + bytesToSize(res.output.size) + '</td></tr></table>'); 143 148 voor = voor + res.input.size; … … 161 166 }); 162 167 } 163 } else {168 } else if (typeof res !== 'undefined' && typeof res.error !== 'undefined') { 164 169 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<span class="dashicons dashicons-no-alt"></span><br />' + res.message); 165 170 if (res.error == 'TooManyRequests') { … … 167 172 } else { 168 173 console.log(res.error); 174 if (size == 'full') { 175 hetworkstinypng_ajax_sendnextimage(); 176 } 177 } 178 } else if (typeof res === 'undefined') { 179 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<span class="dashicons dashicons-no-alt"></span>'); 180 if (size == 'full') { 181 hetworkstinypng_ajax_sendnextimage(); 169 182 } 170 183 } -
wp-image-shrinker/tags/1.0.2/readme.txt
r1092414 r1092463 4 4 Plugin URI: https://wordpress.org/plugins/wp-image-shrinker/ 5 5 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=6JSXUB6Q9SD2U&lc=NL&item_name=HETWORKS&item_number=TinyPNG%20for%20WordPress¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted 6 Version: 1.0. 16 Version: 1.0.2 7 7 Tested up to: 4.1 8 8 Author: Anne Rozema … … 71 71 = 1.0.1 = 72 72 * Bugfixes 73 74 = 1.0.2 = 75 * Better error handling -
wp-image-shrinker/trunk/hetworkstinypng.php
r1092414 r1092463 4 4 * Plugin URI: http://www.hetworks.nl 5 5 * Description: Reduce image file sizes drastically and improve performance and Pagespeed score using the TinyPNG API within WordPress. Works for both PNG and JPG images. 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Author: HETWORKS 8 8 * Author URI: http://www.hetworks.nl … … 128 128 'action': 'hetworkstinypng_ajaxaction_tinypngimage', 129 129 'url': url, 130 'id': id 130 'id': id, 131 'dataType': 'json' 131 132 }; 132 jQuery.ajax({133 jQuery.ajax({ 133 134 type: 'POST', 134 135 url: ajaxurl, … … 138 139 }, 139 140 success: completeHandler = function(response) { 140 res = jQuery.parseJSON(response); 141 if (typeof res.error === 'undefined') { 141 try { 142 res = jQuery.parseJSON(response); 143 } catch(error) { 144 console.log(error); 145 } 146 if (typeof res !== 'undefined' && typeof res.error === 'undefined' && typeof error === 'undefined') { 142 147 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<table class="intable"><tr><td>From:</td><td>' + bytesToSize(res.input.size) + '</td></tr><tr><td colspan="2"><span class="dashicons dashicons-yes"></span></td></tr><tr><td>To:</td><td>' + bytesToSize(res.output.size) + '</td></tr></table>'); 143 148 voor = voor + res.input.size; … … 161 166 }); 162 167 } 163 } else {168 } else if (typeof res !== 'undefined' && typeof res.error !== 'undefined') { 164 169 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<span class="dashicons dashicons-no-alt"></span><br />' + res.message); 165 170 if (res.error == 'TooManyRequests') { … … 167 172 } else { 168 173 console.log(res.error); 174 if (size == 'full') { 175 hetworkstinypng_ajax_sendnextimage(); 176 } 177 } 178 } else if (typeof res === 'undefined') { 179 nextimage.find("td[data-tdsize='"+size+"']").html('').append('<span class="dashicons dashicons-no-alt"></span>'); 180 if (size == 'full') { 181 hetworkstinypng_ajax_sendnextimage(); 169 182 } 170 183 } -
wp-image-shrinker/trunk/readme.txt
r1092414 r1092463 4 4 Plugin URI: https://wordpress.org/plugins/wp-image-shrinker/ 5 5 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=6JSXUB6Q9SD2U&lc=NL&item_name=HETWORKS&item_number=TinyPNG%20for%20WordPress¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted 6 Version: 1.0. 16 Version: 1.0.2 7 7 Tested up to: 4.1 8 8 Author: Anne Rozema … … 71 71 = 1.0.1 = 72 72 * Bugfixes 73 74 = 1.0.2 = 75 * Better error handling
Note: See TracChangeset
for help on using the changeset viewer.