Title: Complete plugin functioning problem
Last modified: February 7, 2021

---

# Complete plugin functioning problem

 *  Resolved [stefanodg](https://wordpress.org/support/users/stefanodg/)
 * (@stefanodg)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/)
 * Hi, SG Optimizer plugin fails to optimize images but crashes. Also when I go 
   to update the site theme it gives me the following errors
 * Warning: scandir(): Directory name cannot be empty in /home/customer/www/locchiodelcineasta.
   com/public_html/wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher.
   php on line 374
 * Warning: array_diff(): Argument #1 is not an array in /home/customer/www/locchiodelcineasta.
   com/public_html/wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher.
   php on line 377
 * Warning: Invalid argument supplied for foreach() in /home/customer/www/locchiodelcineasta.
   com/public_html/wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher.
   php on line 379
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcomplete-plugin-functioning-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/#post-14017452)
 * Hey [@stefanodg](https://wordpress.org/support/users/stefanodg/)
 * The plugin uses the wp cron functionality to optimize the images.
 * Please enable the wp cron and the images will be optimized.
 * Regards,
    Stanimir
 *  [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/#post-14020815)
 * [@sstoqnov](https://wordpress.org/support/users/sstoqnov/),
 * Please clarify. We use a Real Cron and are not experiencing any issues with the
   image optimizer.
 * Based on what you stated above, are you saying we’re getting a false positive
   when using a Real Cron? Do we have to switch to WP Cron every time we upload 
   a new image in the backend and/or click the optimization button?
 * Cheers!
 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/#post-14034432)
 * Hey [@jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Yes and no 🙂
 * The new image optimization uses a WordPress hook, and once a new image is uploaded,
   it’s automatically optimized/converted to webp.
 * But, when you want to optimize the existing images, the plugin uses the wp cron
   functionality. We need the cron, because we optimize the images on batches.
    
   Each batch optimizes ~200 images from the media gallery and all image sizes generated
   by plugins/themes.
 * Once a batch is completed, another one is started by scheduling a new cron job.
   
   We do this because if we optimize all images in a single process, the chances
   to hit max_execution_time are high.
 * Regards,
    Stanimir
 *  [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * (@jetxpert)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/#post-14036954)
 * [@sstoqnov](https://wordpress.org/support/users/sstoqnov/),
 * Thanks for the explanation. We though it was as easy as clicking your optimization
   button. Apparently, we’ve been doing it wrong.
 * So, if you don’t mind, what are the steps for optimizing our images under the
   following condition?
 * **(1) cPanel Users**
 * (a) Using WP Cron
    (b) Using Real Cron
 * (**2) Site Tools User:**
 * (a) Using WP Cron
    (b) Using Real Cron
 * Is their a blog that explains the above? (conditions and process for optimizing
   images using SG optimizer?)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Complete plugin functioning problem’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [jetxpert](https://wordpress.org/support/users/jetxpert/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/complete-plugin-functioning-problem/#post-14036954)
 * Status: resolved