Home
/
WordPress
/
Plugins
/
Speed Optimizer Media Compression Progress Stalling

Speed Optimizer Media Compression Progress Stalling

The Speed Optimizer plugin is a powerful tool that provides many performance optimization techniques and one of them is the optimization of your images by compressing them and thus reducing their size, making them load faster. However, you may encounter an issue where the image optimization process gets stuck at random images, displaying a message such as “COMPRESSING IMAGE XX OF XX“. This issue can be caused by your WordPress configuration or specific plugins.

Understanding the Problem

The image optimization process can get stuck due to various reasons. It could be due to a conflict with other plugins, server limitations, or issues with the WordPress cron system. The stalling message is an indication that the process has been interrupted and is unable to proceed.

Solution: Running WordPress Cron Events via wp-cli

To resolve this problem, you need to ensure that two WordPress cron events are run properly using WP-CLI. These cron events are:

wp cron event schedule siteground_optimizer_start_image_optimization_cron now
wp cron event schedule siteground_optimizer_start_webp_conversion_cron now

These commands will schedule the image optimization and webp conversion processes to start immediately.

Step-by-Step Guide

Here is a step-by-step guide on how to run these cron events:

Step 1: Access your WordPress directory via SSH

You need to access your WordPress directory via SSH. Once you are logged in, navigate to the root directory of your WordPress installation.

Step 2: Run the cron events

In the command line, enter the following commands one after the other

wp cron event schedule siteground_optimizer_start_image_optimization_cron now
wp cron event schedule siteground_optimizer_start_webp_conversion_cron now

This will run the required cron events once, which should make the image compression proceed with processing your images.

Step 3: Create a loop

If you have a lot of images on your website, running the cron events once may not be enough to process all of the images. If that happens, you need to create a loop that will allow these cron events to run until all images are processed correctly. Here is an example of how you can do this:

while true; do sleep 30; wp cron event schedule siteground_optimizer_start_image_optimization_cron now; wp cron event schedule siteground_optimizer_start_webp_conversion_cron now; wp cron event run --due-now; done

The above command is a loop that runs the cron events every 30 seconds until you stop it (ctrl+c or cmd+c).

Step 4: Monitor the process

Follow the optimization process in the wp-admin page to ensure that it progresses properly. If the process gets stuck again, you may need to investigate further to identify any conflicting plugins or server limitations. If you continue to experience problems, contact our Support team for further assistance.

Share This Article