Title: 500 error during bulk optimization
Last modified: January 2, 2023

---

# 500 error during bulk optimization

 *  Resolved [igortitarenko](https://wordpress.org/support/users/igortitarenko/)
 * (@igortitarenko)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/)
 * Hello,
 * I’m trying to bulk-optimize images, but displayed progress is always 0%.
   Error
   is returned in the Console:
 * > POST [https://example.com/wp-admin/admin-ajax.php](https://example.com/wp-admin/admin-ajax.php)
   > 
   > Status 500 Internal Server Error
 * Request:
 * > action “shortpixel_image_processing”
   > queues “media,custom”
 * Associated NGINX log:
 * > 247866 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error:
   > Call to a member function handleOptimizedFileType() on null in /public/wp-content/
   > plugins/shortpixel-image-optimiser/class/Model/Image/MediaLibraryModel.php:
   > 522
   > Stack trace:
   > **0 /public/wp-content/plugins/shortpixel-image-optimiser/class/Controller/
   > OptimizeController.php(611): ShortPixel\Model\Image\MediaLibraryModel->handleOptimized()**
   > **1 /public/wp-content/plugins/shortpixel-image-optimiser/class/Controller/
   > OptimizeController.php(409): ShortPixel\Controller\OptimizeController->handleAPIResult()**
   > **2 /public/wp-content/plugins/shortpixel-image-optimiser/class/Controller/
   > OptimizeController.php(374): ShortPixel\Controller\OptimizeController->runTick()**
   > **3 /public/wp-content/plugins/shortpixel-image-optimiser/class/Controller/
   > AjaxController.php(168): ShortPixel\Controller” while reading response header
   > from upstream, client: 194.36.25.38, server: example.com, request: “POST /wp-
   > admin/admin-ajax.php HTTP/2.0”, upstream: “fastcgi://unix:/var/lock/php-fpm-
   > 7.4-sftp_web_wiso3vi9:”, host: “”, referrer: “[https://example.com/wp-content/plugins/shortpixel-image-optimiser/res/js/shortpixel-worker.js&#8221](https://example.com/wp-content/plugins/shortpixel-image-optimiser/res/js/shortpixel-worker.js&#8221);**

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

 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16335016)
 * Hello [@igortitarenko](https://wordpress.org/support/users/igortitarenko/) and
   thanks for reporting this. 
   The error is a bit odd because it could show up when
   a specific thumbnail is somehow sent for optimization, but without being present
   in the WordPress metadata. But that’s how our plugin builds the list of images
   to sent for optimization, so it’s surely very odd.
 * In order to debug this further, we need a bit more details from you:
    - can you please send us the list of active plugins and the active theme? Ideally,
      we could use the entire debug information found in Tools -> Site Health ->
      Info
    - can you check the console and look above the error you mentioned? You should
      see which image was send for optimization and then check to see if there is
      anything weird going on with that image (is it a missing image, or does it
      have more or less thumbnails than it should, etc.?).
 * We’ll do our best to reproduce the same error on our test sites. Any additional
   information that you can send us would be really helpful!
 * Thank you!
 *  Thread Starter [igortitarenko](https://wordpress.org/support/users/igortitarenko/)
 * (@igortitarenko)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16335046)
 * Hi [@petredobrescu](https://wordpress.org/support/users/petredobrescu/) 
   I cannot
   see in the Console which image is sent for optimization.
 * > POST [https://example.com/wp-admin/admin-ajax.php](https://example.com/wp-admin/admin-ajax.php)
   > Worker.js reporting issue [object Response] [shortpixel-worker.js:104:15](https://englishcoachonline.com/wp-content/plugins/shortpixel-image-optimiser/res/js/shortpixel-worker.js)
   > Error without item – 500 Internal Server Error(undefined) [screen-bulk.js:637:12](https://englishcoachonline.com/wp-content/plugins/shortpixel-image-optimiser/res/js/screens/screen-bulk.js?ver=5.1.6)
   > updating Data : error
   > Object { message: “<div class=\”\”>500 Internal Server Error(undefined)</div
   > >” } undefined [screen-bulk.js:526:15](https://englishcoachonline.com/wp-content/plugins/shortpixel-image-optimiser/res/js/screens/screen-bulk.js?ver=5.1.6)
   > Error: 500 Internal Server Error [shortpixel-processor.js:573:19](https://englishcoachonline.com/wp-content/plugins/shortpixel-image-optimiser/res/js/shortpixel-processor.js?ver=5.1.6)
   > Stop Processing #242 [shortpixel-processor.js:246:17](https://englishcoachonline.com/wp-content/plugins/shortpixel-image-optimiser/res/js/shortpixel-processor.js?ver=5.1.6)
   > Shutting down Worker
 * Themes: Name Jupiter (jupiter2) Version 6.10.1
 * Plugins:
 * > Asset CleanUp: Page Speed Booster Version 1.3.8.9 by Gabe Livan | Auto-updates
   > disabled
   > Classic Editor Version 1.6.2 by WordPress Contributors | Auto-updates
   > enabledEasy Table of Contents Version 2.0.41 by Magazine3 | Auto-updates enabledECO
   > Custom Version 1.0 | Auto-updates disabledFixed Widget Version 6.2.3 by Thomas
   > Maier, Max Bond | Auto-updates enabledFormCraft Version 3.2.23 by nCrafts |
   > Auto-updates enabledJupiter Core Version 1.0.4 by Artbees | Auto-updates enabledJupiter
   > Donut Version 1.4.2 by Artbees | Auto-updates enabledMC4WP: Mailchimp for WordPress
   > Version 4.8.12 by ibericode | Auto-updates enabledPost Slider For Visual Composer
   > Version 1.1 by Nasir | Auto-updates enabledRedirection Version 5.3.6 by John
   > Godley | Auto-updates enabledShortPixel Image Optimizer Version 5.1.6 by ShortPixel
   > | Auto-updates enabledTablePress Version 2.0.2 by Tobias Bäthge | Auto-updates
   > enabledThrive Architect Version 2.6.10 by [Thrive Themes](http://www.thrivethemes.com)(
   > Latest version: 3.16.2) | Auto-updates enabledW3 Total Cache Version 2.2.9 
   > by BoldGrid | Auto-updates enabledWordfence Security Version 7.8.2 by Wordfence
   > | Auto-updates enabledWP-Sweep Version 1.1.5 by Lester ‘GaMerZ’ Chan | Auto-
   > updates enabledWPBakery Page Builder (Modified Version) Version 6.10.0 by Michael
   > M – WPBakery.com | Auto-updates enabledWPML Multilingual CMS Version 4.5.14
   > by OnTheGoSystems | Auto-updates enabledYoast SEO Version 19.13 by Team Yoast
   > | Auto-updates enabled
 *  Thread Starter [igortitarenko](https://wordpress.org/support/users/igortitarenko/)
 * (@igortitarenko)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16335097)
 * Right. So, I went into the plugin options, cleared the queue and started bulk
   optimization again. It works for now.
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16335772)
 * Thanks for the details [@igortitarenko](https://wordpress.org/support/users/igortitarenko/).
 * I see that you are also using WPML, but without the Media Translation extension
   plugin. Are you uploading all images to the same language? Because without the
   WPML Media plugin, all sort of situations may appear.
 * I’m glad the bulk is running now. However, if there’s an image with some issues,
   there’s a high change that it will get stuck again.
 * I’ll mark the ticket as Resolved for now and please let us know if the error 
   comes back!
 *  Thread Starter [igortitarenko](https://wordpress.org/support/users/igortitarenko/)
 * (@igortitarenko)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16336633)
 * [@petredobrescu](https://wordpress.org/support/users/petredobrescu/) Could you
   please elaborate on “all sort of situations may appear”? Is it related to WPML
   alone or to ShortPixel combined with WMPL?
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16338356)
 * We’ve seen many situations when things became at least weird when WPML was used,
   mostly from what’s stored in the DB perspective. And looking at the error you
   reported, there is a change that it is related to WPML, especially if you had
   operations like restoring from the backup, re-optimizing, while WPML was turned
   off. Or even image optimizations done with and without WPML active. 
   Please tell
   me if you’re still getting that error or the bulk finished successfully this 
   time.
 * Thanks!
 *  Thread Starter [igortitarenko](https://wordpress.org/support/users/igortitarenko/)
 * (@igortitarenko)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16339973)
 * I’m not getting that error anymore and the bulk was finished successfully this
   time.
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16342004)
 * That’s great news [@igortitarenko](https://wordpress.org/support/users/igortitarenko/),
   thanks for the confirmation!
 * We have actually been able to identify a potential cause of this error and it
   shows up only in certain situations (most likely when there are multiple PNG 
   file processed more or less at the same time and they also have thumbnails that
   are not listed in the WordPress metadata).
 * We’ll include a permanent fix for this in the upcoming version 5.2.0.
 * Please let us know if you have any other questions!

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

The topic ‘500 error during bulk optimization’ is closed to new replies.

 * ![](https://ps.w.org/shortpixel-image-optimiser/assets/icon-256x256.gif?rev=3245715)
 * [ShortPixel Image Optimizer - Optimize Images, Convert WebP & AVIF](https://wordpress.org/plugins/shortpixel-image-optimiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortpixel-image-optimiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortpixel-image-optimiser/)
 * [Active Topics](https://wordpress.org/support/plugin/shortpixel-image-optimiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortpixel-image-optimiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortpixel-image-optimiser/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/500-error-during-bulk-optimization/#post-16342004)
 * Status: resolved