WP Smush Pro making site too slow.

I do have an online shop WordPress site and it's hosted on my VPS. I found that it becomes really slow when I turn the plugin smush on. It works fine after I turned it off. Especially when you click on the category and sometimes it gives 502.

Please help.

  • Adam Czajczyk

    Hello Wei

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

    I checked your site and server and I admit it's quite a "mistery" issue. Usually, the first thing that would be to check would be site configuraton and server resources (such as WP_MEMORY_LIMIT, PHP settings - max_execution_time etc) but those seem to be quite fine there. Also, when Smush is not performing bulk smush and the option of detecting incorrectly sized images is switched off, the plugin should actually "do nothing" - so it shouldn't put much load on server.

    However, on this site it seems to be somehow affecting site performance even though it, theoretically, should not. The second thing to check, usually, would be the number of files in media library as with thousands of them smush might slow down a bit - but again, only in back-end, not in front-end.

    That said, I think a full conflict test will be necessary in this case. It's a fundamental step to be done if the source of the issue is not "obvious" so would you please perform it? The procedure is basically to:

    1. disable all the plugins except smush and switch site to default theme such as Twenty Seventeen
    2. check if the issue is still happening and if not
    3. enable one plugin back and check again
    4. repeat step 3 until either all the plugins are active or until the issue starts to happen again
    5. if all the plugins are back and it's still fine, switch back on your theme and check again; if the issue occurred during plugin activation, the last enabled plugin would be the most likely source of the issue.

    Could you please give it a go and let me know about results? Please note: it's highly recommended to take a full backup of the site before performing such test, just in case :slight_smile:

    Best regards,
    Adam

  • Wei

    Hello Adam, I think I found the problem. Instead of disable all the plugins I installed smush on another site we hosted on the same VPS with a shopping cart. And then I found same issue. So I was sure they are smush and woocommerce. After turn off the "Automatically smush my images on upload" the problem seems to be fixed. Not sure why wordpress generates new images when I view the categories and products. Do you have any advises on that?

  • Predrag Dubajic

    Hi Wei,

    I see that you have a few Woocommerce add-ons, are those same ones installed on the other site you tested and have you tried without those active?

    Not sure why wordpress generates new images when I view the categories and products.

    Is this happening on the other installation as well?
    Could you enable support access to that other installation and is it ok if we disable plugins and switch theme there while we perform some tests?

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Wei

    If you have cloned those sites it would suffice for now to grant us a support access to them. You'd need to login to each of them and then just click on "Grant support access" button on the "WPMU DEV -> Support" page in sites' back-ends. Just let us know here once it's done.

    We'll then check these sites and in case we needed additional access (like FTP or database) we'll ask you for it here and tell you how to provide them to us securely :slight_smile:

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Wei

    Thanks for enabling access. I can actually confirm that on your site, when automatic smushing on upload is disabled they are both working fine. The "weird" thing is that while we had a similar report meanwhile, my colleague was able to partially replicate the "slow down" issue but only with certain settings (that are not the same as on your site) and I still wasn't able to replicate this on my end.

    I'd like to do some more tests, including switching themes and switching between WooCommerce versions - on your test sites. Would that be fine? If so, I'd also need an FTP or cPanel access to be able to access site files, check debugging and test with slight modifications. Since the support access to both these test sites is enabled, you could simply put those credentials in a text box below the "Access active for X days" box on "WPMU DEV -> Support" page on each of these sites.

    If that's fine for you, just let me know once it's done and I'll dig deeper.

    Best regards,
    Adam

    • Anton Vanyukov

      Wei,

      Could you please try this fix? In <smush folder>/lib/class-wp-smush.php on line 656 in function smush_image() replace:

      // Our async task runs when action is upload-attachment and post_id found. So do not run on these conditions.
      if ( ( ( ! empty( $_POST['action'] ) && 'upload-attachment' == $_POST['action'] ) || isset( $_POST['post_id'] ) )
           // And, check if Async is enabled.
           && defined( 'WP_SMUSH_ASYNC' ) && WP_SMUSH_ASYNC
      ) {
         return $meta;
      }

      with:

      // Our async task runs when action is upload-attachment and post_id found. So do not run on these conditions.
      $is_upload_attachment = ( ! empty( $_POST['action'] ) && 'upload-attachment' === $_POST['action'] ) || isset( $_POST['post_id'] );
      if ( ( $is_upload_attachment && defined( 'WP_SMUSH_ASYNC' ) && WP_SMUSH_ASYNC ) || ! is_admin() ) {
         return $meta;
      }

      Best regards,
      Anton

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.