[WP Smush Pro] Breaking Smush Pro, 10 thousand images at the time

Dear support team,

I have recently started a new project, rebuilding a website that is getting old and slow.

Before I start the new version, I wanted to make some quick speed improvements, mainly by using HB and Smush Pro.

When I try to Bulk Smush images, Smush Pro times out. Same goes for the "directory smush".

This multisite is quite huge and there are several thousand images to improve.

I wandered how necessary was image smushing, since I enabled the Smush CDN.
Is there a way to launch a full image optimisation on all folders, running in the background as a cronjob or something ?

Also, I installed HB in order to perform some cleanup and quick improvements (I won't dive into asset optimisation, as there is more than a hundred websites to test).
Is there a way to add "cleaning orphan meta-data" in the DB cleanup tool ?

Also, I granted support access because I'd like to know if you could help me remove ZenCache and replace it with HB caches ?

Is there a way, in a WP multisite, to identify unused themes ? (filtering out those that have a child-theme in use)

Thank you very much for your help.
Greg

  • Dimitris

    Hello there Greg,

    hope you're doing well today and thanks for reaching us! :slight_smile:

    When I try to Bulk Smush images, Smush Pro times out. Same goes for the "directory smush".

    In order to try to surpass the timeout errors, you can either use the following snippet 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 exact snippet in it:

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

    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', 900);

    I wandered how necessary was image smushing, since I enabled the Smush CDN.

    There's no need to bulk smush your images if you're using the Smush CDN, as all images are now being served via the CDN and they are already optimized.
    Bulk smush will be useful for optimizing the images themselves (the procedure is that each image thumbnails are being uploaded to our Smush server, where they are being optimized, then they return to your server).

    Is there a way to launch a full image optimisation on all folders, running in the background as a cronjob or something ?

    There's a WP-CLI command that we introduced recently, so you can use this to quickly smush images via some SSH access to your server.
    You can find some usage examples in /wp-smush-pro/core/class-wp-smush-cli-command.php.

    * ## 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

    Is there a way to add "cleaning orphan meta-data" in the DB cleanup tool ?

    There isn't this functionality at the moment. You can always create a new thread in our Features&Feedback section about it though.
    https://premium.wpmudev.org/hub/support/#get-support ("Feature Request")

    Also, I granted support access because I'd like to know if you could help me remove ZenCache and replace it with HB caches ?

    I'd say to completely deactivate ZenCache and then navigate to network admin area in HummingBird -> Caching and enable both Page and Browser caching (these should be pretty straight forward, no strange settings). Please do let me know if you're having any issues doing that.

    Is there a way, in a WP multisite, to identify unused themes ? (filtering out those that have a child-theme in use)

    Not really sure of a way to check this. I guess you should manually check which themes are being used in the main site and all subsites and then remove all others from the network.

    Warm regards,
    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.