[Smush Pro] Smush gets stuck at compressing images

Smush Pro gets stuck after processing 1000 images.

  • Dimitris Kalliris
    • Support Team Lead

    Hello there Kolten,

    hope you’re doing well today! :slight_smile:

    This shouldn’t be happening in the first place, but you might hit some server limits. In order to try to surpass that, could you please edit the wp-config.php file and insert the following line just above the /* That’s all, stop editing! Happy blogging. */ comment:

    define('WP_SMUSH_API_TIMEOUT', 600);

    Additionally and if you can have some SSH access to your server, you could use the WP_CLI commands that come with the recent Smush versions:

    /**
    * Optimize image.
    *
    * ## OPTIONS
    *
    *
    * : Optimize single image, batch or all images.
    * ---
    * default: all
    * options:
    * - all
    * - single
    * - batch
    * ---
    *
    *
    * : Attachment ID to compress.
    * ---
    * default: 0
    * ---
    *
    * ## EXAMPLES
    *
    * # Smush all images.
    * $ wp smush compress
    *
    * # Smush single image with ID = 10.
    * $ wp smush compress --type=single --image=10
    *
    * # Smush first 5 images.
    * $ wp smush compress --type=batch --image=5
    */

    Warm regards,

    Dimitris