Skipped due to a timeout error

Skipped due to a timeout error. You can increase the request timeout to make sure Smush has enough time to process larger files.
How do I increase?

  • Jordan

    Hello!

    Here is a solution I found from Sajid.

    Hello Alun,
    Hope you are doing good today :slight_smile:

    It appears that the maximum time requires for WP Smush to process the images runs out due to low limit set by your host.

    You can increase the time limit by adding following code in functions.php file of your child theme or use it as mu-plugin.

    add_filter('WP_SMUSH_API_TIMEOUT',  'wpmu_api_timeout');
    function wpmu_api_timeout() {
     return 300;
    }

    Take care and have a nice day!

    Best Regards,
    Sajid

    Here's a tutorial on how to easily setup a child theme.

  • Dimitris

    Hello there NCHS Thailand

    hope you're doing good today! :slight_smile:

    Jordan is right, you can either use the snippet he shared in a MU plugin file, like
    /wp-content/mu-plugins/smush-timeout.php (just create the /mu-plugins/ folder, if it doesn't exist already) and insert the following snippet in it:

    <?php
    add_filter('WP_SMUSH_API_TIMEOUT',  'wpmu_api_timeout');
    function wpmu_api_timeout() {
     return 300;
    }

    Or, edit wp-config.php and insert next line, just above the /* That's all, stop editing! Happy blogging. */ comment:
    define('WP_SMUSH_API_TIMEOUT', 300);

    Let us know, if that makes any difference!
    Warm regards,
    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.