• Resolved tristanleboss

    (@tristanleboss)


    Hello,

    Just to inform you that an error prevent accessing the dashboard with latest version of the plugin (0.17.2) and latest version of WordPress (5.2.4) WHEN an (unfortunately) unknown old version of WebP Express is present.

    Indeed, it tries to update the settings (?) and fails:

    Uncaught Error: Call to a member function switch_to_locale() on null in wp-includes/l10n.php on line 1582
    switch_to_locale()
    wp-admin/includes/misc.php:125
    insert_with_markers()
    wp-content/plugins/webp-express/lib/classes/HTAccess.php:249
    saveHTAccessRulesToFile()
    wp-content/plugins/webp-express/lib/classes/HTAccess.php:318
    deactivateHTAccessRules()
    wp-content/plugins/webp-express/lib/classes/HTAccess.php:392
    saveRules()
    wp-content/plugins/webp-express/lib/classes/Config.php:695
    saveConfigurationAndHTAccess()
    wp-content/plugins/webp-express/lib/migrate/migrate11.php:59
    WebPExpress\webpexpress_migrate11()
    wp-content/plugins/webp-express/lib/migrate/migrate11.php:77
    include()
    wp-content/plugins/webp-express/lib/migrate/migrate.php:39
    include()
    wp-content/plugins/webp-express/lib/classes/AdminInit.php:39
    runMigrationIfNeeded()
    wp-content/plugins/webp-express/lib/classes/AdminInit.php:18
    init()
    wp-content/plugins/webp-express/webp-express.php:34
    include_once()
    wp-settings.php:360
    require_once()
    wp-config.php:188
    require_once()
    wp-load.php:37
    require_once()
    wp-admin/admin.php:34
    require_once()
    wp-admin/index.php:10
Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter tristanleboss

    (@tristanleboss)

    Options value in DB:

    webp-express-migration-version
    10

    webp-express-messages-pending
    1

    webp-express-state
    {“pendingMessages”:[{“level”:”success”,”message”:”<p>Rewrite rules were saved to the following files:</p><i>/home/loipinelgo/site.fr/wp-content/themes/.htaccess</i> (themes)<br><i>/home/loipinelgo/site.fr/wp-content/uploads/.htaccess</i> (uploads)<br><i>/home/loipinelgo/site.fr/wp-content/webp-express/webp-images/.htaccess</i> (cache)<br>”}],”last-ewww-optimize-attempt”:1553620291,”configured”:true,”htaccess-rules-saved-at-some-point”:true,”active-htaccess-dirs”:[“wp-content”,”themes”,”uploads”,”cache”],”dismissableMessageIds”:[“0.14.0/suggest-wipe-because-lossless”,”0.14.0/say-hello-to-vips”]}

    webp-express-alter-html-hooks
    ob

    webp-express-alter-html-replacement
    picture

    webp-express-alter-html-add-picturefill-js
    1

    webp-express-alter-html-options
    {“replacement”:”picture”,”hooks”:”ob”,”only-for-webp-enabled-browsers”:true,”only-for-webps-that-exists”:false,”alter-html-add-picturefill-js”:true,”hostname-aliases”:[],”destination-folder”:”separate”,”destination-extension”:”append”,”destination-structure”:”doc-root”,”bases”:{“uploads”:[“/home/loipinelgo/site.fr/wp-content/uploads”,”https://www.site.fr/wp-content/uploads”%5D,”themes&#8221;:[“/home/loipinelgo/site.fr/wp-content/themes”,”https://www.site.fr/wp-content/themes”%5D},”image-types”:3}
    yes

    CK MacLeod

    (@ck-macleod)

    Just last night encountered a similar error, and had to disable WebP to restore the site:

    [14-Nov-2019 07:43:16 UTC] PHP Fatal error: Uncaught Error: Call to a member function switch_to_locale() on null in /home/ckm/ckmswp.com/wp-includes/l10n.php:1582
    Stack trace:
    #0 /home/ckm/ckmswp.com/wp-admin/includes/misc.php(125): switch_to_locale(‘en_US’)
    #1 /home/ckm/ckmswp.com/wp-content/plugins/webp-express/lib/classes/HTAccess.php(249): insert_with_markers(‘/home/ckm/ckmsw…’, ‘WebP Express’, Array)
    #2 /home/ckm/ckmswp.com/wp-content/plugins/webp-express/lib/classes/HTAccess.php(318): WebPExpress\HTAccess::saveHTAccessRulesToFile(‘/home/ckm/ckmsw…’, Array, false)
    #3 /home/ckm/ckmswp.com/wp-content/plugins/webp-express/lib/classes/HTAccess.php(392): WebPExpress\HTAccess::deactivateHTAccessRules(‘# The rules hav…’)
    #4 /home/ckm/ckmswp.com/wp-content/plugins/webp-express/lib/classes/Config.php(695): WebPExpress\HTAccess::saveRules(Array, false)
    #5 /home/ckm/ckmswp.com/wp-content/plugins/webp-express/lib/migrate/migrate11.php(59): WebPExpress\Config::saveConfigurationAndHTAccess(Array, true)
    #6 /home/ckm/ckmswp.com/wp-content/plugins/webp-expre in /home/ckm/ckmswp.com/wp-includes/l10n.php on line 1582

    I’m now holding off on updates at other sites where I’ve been using the plug-in, with success and satisfaction, I might add!

    • This reply was modified 5 years ago by CK MacLeod.
    jasonridesabike

    (@jasonridesabike)

    Same issue. Broke on update.

    MarcGuay

    (@marcguay)

    Same here – seems to be a problem with the code running before init.

    I had the same issue. I was not able to log in to the admin panel. I disabled the plugin by editing option active_plugins in wp_options table usnig phpMyAdmin.

    CK MacLeod

    (@ck-macleod)

    I’m a fan of the plugin, and have it in use at a number of sites, but I’m wondering now if I’m going to have to switch to something else. It’s not a good sign for a plugin when a fatal error on update issue isn’t at least rolled back via new updates until solved.

    Same issue here.

    • This reply was modified 4 years, 12 months ago by Francois.

    Same problem on several sites, just after upgrading to WP 5.3 and then upgrading WebP Express from version 0.14.22 to 0.17.2.

    I solved it by disable any image compression plugins like Smush or Imagify

    Though I’m able to install and use fresh versions at multiple sites, in addition to the already-reported issues I also ran across an issue of not being able to install it via function, when other plugins using the same function (the widely used tgmpa.php class) install fine.

    • This reply was modified 4 years, 11 months ago by CK MacLeod.
    Plugin Author rosell.dk

    (@roselldk)

    Found the bug. The migration is run too early. It must wait for the admin_init hook. A similar problem was encountered here:
    https://wordpress.stackexchange.com/questions/352896/error-call-to-a-member-function-switch-to-locale-on-null-during-insert-with

    In ‘lib/classes/AdminInit.php’, the line saying “self::runMigrationIfNeeded();” must be moved into the “addHooksAfterAdminInit” function.

    I shall create an update.

    Sorry btw. for not reacting to this promptly. Something else has been requiring all my attention and I saw it necessary to pause development and support on this plugin. This other thing still requires a lot of my attention, but I hope to be able to at least fix serious issues like this

    Still a great plugin – looking forward to getting the fix. My unsolicited advice to you would be to come up with some “pro” features – to incentivize people to pay you for it and yourself to stay on top of things. Thanks!

    Plugin Author rosell.dk

    (@roselldk)

    Just published the fix in 0.17.3.

    @ck-macleod: I have considered a PRO version. But right now, it is more time than money that is the low resource. As creating a PRO version takes time, it is not going to help me stay on top of things ??

    Hello, we are using WP 5.3.2 and tried to update the webp plugin and it crashed the site as with the others… I then deleted the plugin dir, was able to get back in, then installed the plugin, 1.7.3 by uploading it from plugin site and get same result it crashes the site.

    Any ideas what to check.
    I do not have any smush plugins on the site.

    Thanks..
    Have a great day!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Fatal error on update’ is closed to new replies.