• Resolved ilovecake

    (@ilovecake)


    Hi there,
    Im having problem with the auto Smush not working. I can only manually smush, but the images do not auto optimize on upload. Images do upload successfully.

    The site is a staging site hosted on a PHP7/MariaDB10/Apache/reverse proxy NGINX server on Digital Ocean. The site is behind an http authentication (htpasswd) gate if that matters.

    I’ve disabled the following plugins in order to troubleshoot if they are the culprit, they’re not:
    – Wordfence Security (7.3.1)
    – WP Hide & Security Enhancer (1.5.7)
    – WP Rocket (3.3.1.1)

    All other plugins are really nothing that would cause a problem. Any ideas on why the auto Smush doesnt work?

Viewing 12 replies - 1 through 12 (of 12 total)
  • @ilovecake,

    Could you please check if there are any errors in php debug log?

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    hi @vanyukov ,
    I added the following to check for log outputs:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_LOG’, true );

    But see no errors when i upload a new image.

    Hi @ilovecake,

    If there are no errors you’d need to debug what’s going on in your server configuration. My guess is that Smush is not even trying to optimize on upload, because the async call is not firing. It could be for a number of reasons – maybe staging has limited php worker or resources. On our staging we had a similar issue and increasing fastcgi_buffers/fastcgi_buffer_size seems to have fixed the issue. In any case, my recommendation would be to enable more verbose debugging on Apache/Nginx and PHP and try to catch any errors/warnings related to Smush that would allow to narrow down the issue.

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    I was able to increase the fastcgi_buffers and fastcgi_buffer_size values, but did not see any change in behavior. Do you know of any other possible changes we can take? Thanks.

    @ilovecake,

    Could you try and add

    define( 'WP_SMUSH_ASYNC', false );

    to wp-config.php?

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    Ah that worked! SHould i keep it there?

    @ilovecake, for staging – yes. Probably best to remove it on production.

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    ok thanks, i’ll try and remember that. What do you think the cause of this problem is, that is resolved by this setting?

    @ilovecake, it’s hard to say without properly debugging. I think it’s some limitation of staging that does not allow php to run multiple threads at once. Probably because staging is used to test out a feature and does not need the resources that are usually allocated to a production site.

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    Hm ok, this server is actually going to be the production server once we cut over the dns. It’s pretty powerful, at 4GB ram.

    @ilovecake,

    So the staging is basically production, but with different DNS? You’re not using cPanel/Plesk or any other control panel?

    Best regards,
    Anton

    Thread Starter ilovecake

    (@ilovecake)

    That’s correct. We’re not using CPanel/Plesk. We’re running a Digital Ocean server behind Cloudways.com hosting service. So you can say that Cloudways acts like a cPanel/Plesk middleman.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Automatic Smush not working’ is closed to new replies.