{"id":4701,"date":"2013-03-01T11:09:40","date_gmt":"2013-03-01T10:09:40","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=4701"},"modified":"2013-03-01T11:52:53","modified_gmt":"2013-03-01T10:52:53","slug":"automatic-smushing-has-been-disabled-temporarily-due-to-an-error","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/automatic-smushing-has-been-disabled-temporarily-due-to-an-error\/","title":{"rendered":"WP Smush.it &#8211; Automatic smushing has been disabled temporarily due to an error"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 0px 0px 0px 10px; display: inline; float: right\" title=\"Yahoo! YSlow Smush.it\" alt=\"Yahoo! YSlow Smush.it\" align=\"right\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Yahoo-YSlow-Smush.it_.jpg\" width=\"115\" height=\"46\" \/>The performance (loading speed and bytes sent) of a website can be optimized using Yahoo\u2019s API \u201cSmush.it\u201d by optimizing images in several losless ways:<\/p>\n<ul>\n<li>stripping meta data from JPEGs <\/li>\n<li>optimizing JPEG compression <\/li>\n<li>converting certain GIFs to indexed PNGs <\/li>\n<li>stripping the un-used colours from indexed images <\/li>\n<\/ul>\n<p>The WordPress plugin \u201c<a href=\"https:\/\/wordpress.org\/extend\/plugins\/wp-smushit\/\" target=\"_blank\">WP Smush.it<\/a>\u201d does an awesome job by automating this process and offering a bulk action to <em>smush<\/em> all images. Unfortunately the Yahoo service isn\u2019t very reliable nor fast, and that\u2019s an understatement. <\/p>\n<p>A lot of users are experiencing delays causing the plugin to be disabled. The following error is thrown:<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Automatic-smushing-has-been-disabled-temporarily-due-to-an-error.-Operation-timed-out-after-20002.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"\" border=\"0\" alt=\"Automatic smushing has been disabled temporarily due to an error. Operation timed out after 20000 milliseconds with 0 bytes received\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Automatic-smushing-has-been-disabled-temporarily-due-to-an-error.-Operation-timed-out-after-20003.png\" width=\"602\" height=\"85\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<h1>Timeout<\/h1>\n<p>I found out that the delay of 20 seconds is not enough 90% of the cases. After increasing the timeout to 180 seconds (3 minutes) the automatic smushing didn\u2019t got disabled anymore (after 6 months testing).<\/p>\n<p>Currently there\u2019s no setting in the WordPress plugin to change the timeout, I\u2019ve contacted the author and requested this feature. For now you need to edit the file <strong><em>wp-content\/plugins\/wp-smushit\/wp-smushit.php <\/em><\/strong>and change the timeout in <strong>line 280 <\/strong>from 20 seconds to 180 seconds.<\/p>\n<p>   <br clear=\"all\" \/><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Edit-Wordpress-plugin-WP-Smush.it_.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Edit WordPress plugin - WP Smush.it\" border=\"0\" alt=\"Edit WordPress plugin - WP Smush.it\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Edit-Wordpress-plugin-WP-Smush.it_thumb.png\" width=\"604\" height=\"56\" \/><\/a>    <br clear=\"all\" \/><\/p>\n<p> <strong>Original: <\/strong>  <\/p>\n<pre lang=\"php\">    $response = wp_remote_get($req, array('user-agent' =&gt; WP_SMUSHIT_UA, 'timeout' =&gt; 20));<\/pre>\n<p><strong>Example: <\/strong><\/p>\n<pre lang=\"php\">    $response = wp_remote_get($req, array('user-agent' =&gt; WP_SMUSHIT_UA, 'timeout' =&gt; 180));<\/pre>\n<p>&#160;<\/p>\n<p><em>Keep in mind that increasing the timeout could delay the process of smushing the images and therefor uploading your article.<\/em><\/p>\n<p><em><\/em><\/p>\n<p><em><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Smush.it-Reduced-by.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"\" border=\"0\" alt=\"Smush.it - reduced by\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/03\/Smush.it-Reduced-by_thumb.png\" width=\"604\" height=\"98\" \/><\/a><\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>The performance (loading speed and bytes sent) of a website can be optimized using Yahoo\u2019s API \u201cSmush.it\u201d by optimizing images in several losless ways: stripping meta data from JPEGs optimizing JPEG compression converting certain GIFs to indexed PNGs stripping the un-used colours from indexed images The WordPress plugin \u201cWP Smush.it\u201d does an awesome job by [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[288],"tags":[538,537,539],"class_list":["post-4701","post","type-post","status-publish","format-standard","hentry","category-other","tag-plugin","tag-smush-it","tag-timeout"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=4701"}],"version-history":[{"count":5,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4701\/revisions"}],"predecessor-version":[{"id":4712,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/4701\/revisions\/4712"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=4701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=4701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=4701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}