Support » Plugin: Compress JPEG & PNG images » Possible WooCommerce Conflict

  • Resolved wpdv

    (@wpdv)


    Hi, I’ve been using your plugin for a long time now. Over the past several weeks we have had problems with our WooCommerce page taking over 40 seconds to load a 1.2MB page. Tonight, I narrowed it done to your plugin. Not sure why this is happening, but when I deactivated it, the page now loads under 2 seconds. Happy to help if I can, just let me know.

    • This topic was modified 5 months, 2 weeks ago by  wpdv.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author TinyPNG

    (@tinypng)

    Hi @wpdv, thank you for sharing your issue with WooCommerce.

    It sounds strange though, because the Compress JPEG & PNG plugin does not live in the website front-end so it should not have any effect on page loading times.

    That said, maybe there is something in your particular set-up that results in the slowness. We indeed would very much like to rule out any possible issues. Would it be possible for you to let us reproduce? We would need a copy of your WordPress site and a copy of the database, or an FTP login and WordPress admin login.

    You may also share this information through support@tinypng.com by email.

    Just sent email. Thanks.

    wpdv

    (@wpdv)

    Wondered if you were able to discover where the conflict was occurring? Thanks for everything you do.

    Plugin Author TinyPNG

    (@tinypng)

    Hi wpdv,

    We have done some more investigation. For one WooCommerce shop we found out that wp_generate_attachment_metadata was triggered on the base shop page for each of the product category images and that this also happens for users logged in as a customer.

    If the plugin has background compression enabled, this then results in multiple admin-ajax.php calls.

    A temporary workaround right now for the above issue is to switch to “Compress new images during upload” or “Do not compress new images automatically”.

    We will fix this issue with the next release.

    If you have other scenario’s, please share!

    Plugin Author TinyPNG

    (@tinypng)

    Hi @wpdv, we have done more research and found out that there is a clear issue with WooCommerce when an original image from your media library is smaller and with different aspect ratio than the size defined in your WooCommerce store.

    In that scenario WooCommerce will try to regenerate the image attachment metadata over and over again on each page visit. This process which generates image thumbnail sizes in WordPress should not be called so often. The error comes from a function called maybe_resize_image in class-wc-regenerate-images.php.

    It looks like other users of WooCommerce have reported similar issues and it seems to happen up to the latest WooCommerce version 3.5.3.

    The easiest fix which we can recommend is to add the following line of code somewhere in your WordPress WooCommerce site:

    add_filter( 'woocommerce_resize_images', '__return_false' );

    And when doing so you may also want to add one more line which will block WooCommerce background regeneration of thumbnails, as this can also slow down the speed of your store:

    add_filter( 'woocommerce_background_image_regeneration', '__return_false' );

    We will share this issue with Automattic, the creators of the Woocommerce plugin, as it does affect all WooCommerce users.

    Thank you! You are awesome!!

    @tinypng: Is it safe to enable auto compression for TinyPNG on WooCommerce 3.5.3 now?

    Plugin Author TinyPNG

    (@tinypng)

    Hi Minh, we would strongly advice to add

    add_filter( 'woocommerce_resize_images', '__return_false' );

    to any WooCommerce websites or at least until Automattic fixes the issue.

    You can add this line for example right at the end of your wp-config.php file.

    Thanks, @tinypng. After update to WooCommerce 3.5.3, the issue seems to be there still. I will add the filter to the theme to disable image resize function from WooCommerce to see if it fix the issue.

    Cheers,
    Minh

    jesperh95

    (@jesperh95)

    Hi,

    I was about to compress all images on my woocommerce webshop through Bulk Optimization, when I ran into this thread – so now I have second thoughts about compressing the images if this can have a negative impact? It doesn’t seem ideal to have to add codes of line in functions.php for it to work?

    Best,
    Jesper

    Plugin Author TinyPNG

    (@tinypng)

    Hi @jesperh95, This is the work around that we can recommend for now, up until WooCommerce has been updated with a bug fix.

    Insert

    add_filter( 'woocommerce_resize_images', '__return_false' );

    to the last line in your wp-config.php

    Is this now resolved as of Woocommerce 3.5.5 or is the code still needed?
    Thanks

    • This reply was modified 1 month, 3 weeks ago by  smellcoffee.
    Plugin Author TinyPNG

    (@tinypng)

    Hi @smellcoffee,

    We checked the changelog for 3.5.5, and we believe that this is not resolved yet.

    …hurry up and wait 😉
    Thanks

    • This reply was modified 1 month, 3 weeks ago by  smellcoffee.
    mdaan

    (@mdaan)

    I’m having the same issue! I searched for hours what was causing the long wait time. I could not believe that TinyPng was thee issue :-O I’m using this plugin for all my clients and never noticed this problem, however on every page with woocommerce products on the site loads extremely slow!

    I had to deactivate the plugin 🙁

Viewing 15 replies - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.