WP Smush Pro is Abnormally Slow

I've been trying to optimize images for days - the plugin seems to be running at about 1 image per minute, which seems super slow. Is there anything that can be done, or maybe that I am doing incorrectly on my side to speed it up a bit? At this rate, with a library of 240,000 images I'm looking at 5 months (at non stop optimization). I have the S3 offload plugin running, maybe that is interfering or maybe some tuning needs to be done?

  • Adam Czajczyk

    Hello Nick,

    I hope you're well today and thank you for your question!

    The WP Smush Pro plugin should work with S3 offload plugin but it may be indeed affected in terms of speed by this. I'm not quite sure about it though so can you also tell me please what's an average size of an image file of your site?

    Also, could you please enable WP debugging on your site? To do this, add following lines to the "wp-config.php" fle:

    define('WP_DEBUG',true);
    define('WP_DEBUG_LOG',true);
    define('WP_DEBUG_DISPLAY',false);

    Once this is done, please run "bulk smushing" again for a while (just a few minutes would suffice) and then download the "debug.log" file from the "/wp-content/" folder on your server, rename it to "debug.txt" and attach to your replay here.

    I'll review the file and hopefully it will point me in a right direction.

    Best regards,
    Adam

  • Dimitris

    Hey there Nick,

    hope you're doing good today and don't mind chiming in!

    I just inspected the debug file you kindly provided and the only errors I can see in there are about caching and W3TC. Could you please deactivate your caches and resmush?

    You can also proceed by deactivating all other plugins and resmush. If time spans between images get lesser then activate the rest of the plugins one-by-one until you get the conflict.

    If none of these make any change, please grant us with support access as described here https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/
    in order to have a better look inside.

    Cheers,
    Dimitris

  • Dimitris

    Hey there Nick,

    hope everything's going well for you!

    I just went ahead and accessed your website. I noticed that it's generally kind of slow even at the /wp-admin pages. This is most probably due to server resources. Is this under a shared hosting package? Please advise!

    As I started a "bulk smush" procedure, I can see that some extra time is needed per image.
    What I can propose is to narrow down the image sizes that you're using and get rid of the rest of them. This may require some custom coding and the use of remove_image_size() function as long as a force regenaration of your thumbnails using this plugin https://wordpress.org/plugins/force-regenerate-thumbnails/.
    Then each image could be smushed for less copies than the ~15 which is now. This is a procedure which will also require an extended time period due to the vast number of images that you're hosting though.

    Warm regards,
    Dimitris

  • Nick

    Hi, it's hosted on a large ec2 server - specs are enormous and I'm not seeing anything indicating a lack of resources. My CPU and memory utilization are pretty low across the board.

    You're right about the admin panel being slow - I'm trying to pinpoint that as well.

    As for image sizes, I'm not quite sure what the easiest way to narrow it down is. We have such a huge library and I don't think the sizes are standard across the board. Do you have a recommendation on how we could do that?

    As for an extended period of time, I totally get it. The library is huge and images have never been optimized so that's understandable. I just don't want to have to wait 6 months for this operation to finish as I'm sure you can imagine.

  • Milan

    Hello Nick ,

    Hope you are well today and won't mind me chiming here.

    As for image sizes, I'm not quite sure what the easiest way to narrow it down is. We have such a huge library and I don't think the sizes are standard across the board. Do you have a recommendation on how we could do that?

    Actually it depends how you are utilising those images. You would need to analyse your site to figure out what image sizes you are not using. Its quite attentive job so you would need to focus on these area of your site where most probably you are using most of your images.

    #1) Posts,
    #2) Pages
    #3) Other plugin's custom data if you are uploading images for those post types too.

    You can use "unattached" filter to filer out images which are not attached to any post/page. See this screenshot.

    As for an extended period of time, I totally get it. The library is huge and images have never been optimized so that's understandable. I just don't want to have to wait 6 months for this operation to finish as I'm sure you can imagine.

    Yes I totally understand you here. I also noticed your admin panel is super slow. So did you get any information about it from your host ? If you have not already contacted your hosting provider about this, please do contact them and then update us here what they say you about this.

    Look forward to hearing back.
    Best Regards,
    Milan