• Resolved deeveearr

    (@deeveearr)


    …is the notice that I just got following this afternoon’s upgrade.

    Renamed the plugin in cpanel and the website went back to normal – minus shortpixel being activated of course.

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Pedro

    (@petredobrescu)

    hello @deeveearr,

    I’m sorry to hear about this. Can you please give us some more details about this?
    – what is the critical error that you have in your logs?
    – how was the update done? Was it done through the standard WordPress way (either via the auto-update mechanism or manually by clicking on “Update now”), or through another method?

    If you did the update through another method, then can you please:
    – remove ShortPixel Image Optimizer by deleting the plugin (either from the plugins list or through FTP)
    – install the plugin again directly from the WordPress repository

    Some details: there are major code changes between versions 4 and 5, including the PHP autoloader. In case SPIO 5 was simply “dropped” on top of SPIO 4, without removing first the older files, then a critical error is possible. If the upgrade is done through standard WordPress ways, then this should not happen.

    Thanks, I look forward to getting your feedback!

    Thread Starter deeveearr

    (@deeveearr)

    Hi @petredobrescu

    It was updated, along with three other plugins, via the WordPress Updates page.

    Version 5 is still sitting there deactivated, but if it gets activated, the error comes back.

    I was just going to stop in to post about this.

    As soon as I updated to version 5 this morning I started receiving the following error.

    Edited for privacy.

    [14-Jun-2022 13:35:25 UTC] PHP Fatal error:  Uncaught Error: Call to a member function switch_to_locale() on null in /home/d******q/************.com/wp-includes/l10n.php:1679
    Stack trace:
    #0 /home/d******q/************.com/wp-admin/includes/misc.php(137): switch_to_locale('en_US')
    #1 /home/d******q/************.com/wp-content/plugins/shortpixel-image-optimiser/class/Tools.php(285): insert_with_markers('/home/d******q...', 'ShortPixelWebp', Array)
    #2 /home/d******q/************.com/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(44): ShortPixelTools::alterHtaccess(false, false)
    #3 /home/d******q/************.com/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(18): ShortPixel\Helper\InstallHelper::deactivatePlugin()
    #4 /home/d******q/************.com/wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(683): ShortPixel\Helper\InstallHelper::activatePlugin()
    #5 /home/d******q/************.com/wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(66): ShortPixel\S in /home/d******q/************.com/wp-includes/l10n.php on line 1679

    Rolling back to version 4.22.10 allowed my sites to return to normal.

    • This reply was modified 2 years, 4 months ago by dtremel.
    Plugin Author Pedro

    (@petredobrescu)

    thanks a lot @dtremel!

    We haven’t bumped into this error during our testing. We’re already looking into it! We’ll get back here with updates ASAP.

    Hi there

    Exactly the same problem here. As soon as the Plugin was updated to version 5 (via wordpress autoupdate) we’ve received the following error:

    Fatal error: Uncaught Error: Call to a member function switch_to_locale() on null in /home/httpd/vhosts/**************.ch/**************/wp-includes/l10n.php:1679 Stack trace: 
    #0 /home/httpd/vhosts/**************/**************/wp-admin/includes/misc.php(132): switch_to_locale('de_DE') 
    #1 /home/httpd/vhosts/**************/**************/wp-content/plugins/shortpixel-image-optimiser/class/Tools.php(285): insert_with_markers('/home/httpd/vho...', 'ShortPixelWebp', Array) 
    #2 /home/httpd/vhosts/**************/**************/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(44): ShortPixelTools::alterHtaccess(false, false) 
    #3 /home/httpd/vhosts/**************/**************/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(18): ShortPixel\Helper\InstallHelper::deactivatePlugin() 
    #4 /home/httpd/vhosts/**************/**************/wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(683): ShortPixe in /home/httpd/vhosts/**************/**************/wp-includes/l10n.php on line 1679

    Thanks for looking into this!

    Same here: ““There Has Been a Critical Error on Your Website” after update to version 5.0.0.
    Renamed the plugin via FTP, and the site was up again.
    I have disabled the plugin on all my sites. Waiting for 5.0.1 …

    Same here.

    I’m running PHP 8.0.18, just in case it turns out to be a PHP version compatibility thing.

    Here’s my WP_DEBUG output with the fatal error (largely the same as those above):

    Fatal error: Uncaught Error: Call to a member function switch_to_locale() on null in /wp-includes/l10n.php:1679 Stack trace:
    #0 /wp-admin/includes/misc.php(137): switch_to_locale('en_US')
    #1 /wp-content/plugins/shortpixel-image-optimiser/class/Tools.php(285): insert_with_markers('/usr/local/apac...', 'ShortPixelWebp', Array)
    #2 /wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(44): ShortPixelTools::alterHtaccess(false, false)
    #3 /wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(18): ShortPixel\Helper\InstallHelper::deactivatePlugin()
    #4 /wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(683): ShortPixel\Helper\InstallHelper::activatePlugin()
    #5 /wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(66): ShortPixel\ShortPixelPlugin->check_plugin_version()
    #6 /wp-includes/class-wp-hook.php(307): ShortPixel\ShortPixelPlugin->lowInit('')
    #7 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #8 /wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #9 /wp-settings.php(461): do_action('plugins_loaded')
    #10 /wp-config.php(113): require_once('/usr/local/apac...')
    #11 /wp-load.php(50): require_once('/usr/local/apac...')
    #12 /wp-admin/admin.php(34): require_once('/usr/local/apac...')
    #13 /wp-admin/index.php(10): require_once('/usr/local/apac...')
    #14 {main} thrown in /wp-includes/l10n.php on line 1679

    +1 same here. now scrambling to disable the wp auto-update on other sites.

    Now, bug-free! Just kidding

    ??

    +1

    Had to disable the plugin. ??

    The snippet below is from a client site. I have not had the chance yet to review all of my client sites, but I expect to find the same error. Here is my error log entry in case it helps:

    [14-Jun-2022 14:51:10 UTC] PHP Fatal error:  Uncaught Error: Call to a member function switch_to_locale() on null in /home/user/public_html/wp-includes/l10n.php:1679
    Stack trace:
    #0 /home/user/public_html/wp-admin/includes/misc.php(137): switch_to_locale('en_US')
    #1 /home/user/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Tools.php(285): insert_with_markers('/home/user/pub...', 'ShortPixelWebp', Array)
    #2 /home/user/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(44): ShortPixelTools::alterHtaccess(false, false)
    #3 /home/user/public_html/wp-content/plugins/shortpixel-image-optimiser/class/Helper/InstallHelper.php(18): ShortPixel\Helper\InstallHelper::deactivatePlugin()
    #4 /home/user/public_html/wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(683): ShortPixel\Helper\InstallHelper::activatePlugin()
    #5 /home/user/public_html/wp-content/plugins/shortpixel-image-optimiser/shortpixel-plugin.php(66): ShortPixel\ShortPixelPlugin->check_plugin_version()
    #6 /home/user/public_h in /home/user/public_html/wp-includes/l10n.php on line 1679

    Same here!!

    Ticket submit via support on Shortpixel’s website

    What I’m seeing that’s interesting is the fact that the insert_with_markers() being called has the last parameter being reported as an array per all of our fatal error stack traces.

    PHP 8.x became much more sensitive when it comes to the type being used. insert_with_markers() does call switch_to_locale() per the WP core, and I’m thinking it doesn’t like being handed an array for that parameter.

    Todd

    (@toddneufeld)

    I had the same error. Renamed Short Pixel via FTP to deactivate it and now the website is fine. I’m using the shortpixel website to manually crunch images until this is fixed.

    Plugin Author Pedro

    (@petredobrescu)

    Hello again,

    We haven’t been able to reproduce this in our test environments, but we have added a potential fix in this development version:

    https://shortpixel.com/downloads/shortpixel-image-optimiser-5.0.1-DEV01.zip

    Can you please test this version, preferably in a staging environment, and let us know if the error is still present?

    If not, please get in touch with us, because we’ll probably need access to one of the sites where we can reproduce and fix this error properly.

    Many thanks!

    Thread Starter deeveearr

    (@deeveearr)

    Lol @verathom

    Now, bug-free! Just kidding
    
    ??
    
    +1
    
    Had to disable the plugin. ??
Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Critical Error’ is closed to new replies.