• Resolved megaphonejon

    (@megaphonejon)


    Since installing 9.0.13, one of my sites returns the following error when I run wp-cli to update a plugin:

    After running: wp plugin update bp-better-messages

    I receive:

    PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in /mysite/web/wp-includes/functions.php:626
    Stack trace:
    #0 /mysite/web/wp-includes/functions.php(626): serialize(Array)
    #1 /mysite/web/wp-content/plugins/stops-core-theme-and-plugin-updates/includes/MPSUM_Logs.php(256): maybe_serialize(Array)
    #2 /mysite/web/wp-includes/class-wp-hook.php(307): MPSUM_Logs->log_updates(Object(Plugin_Upgrader), Array)
    #3 /mysite/web/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #4 /mysite/web/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #5 /mysite/web/wp-admin/includes/class-plugin-upgrader.php(371): do_action('upgrader_proces...', Object(Plugin_Upgrader), Array)
    #6 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(430): Plugin_Upgrader->bulk_upgrade(Array)
    #7 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php(661): WP_CLI\C in /mysite/web/wp-includes/functions.php on line 626
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

    I can see that the “maybe_serialize()” code was introduced in 9.0.13, but I don’t see the closure that’s being complained about – `debug_backtrace() returns an array. It also doesn’t affect a site that has an identical codebase, so it likely isn’t triggered in all scenarios and is somewhat dependent on db state.

Viewing 1 replies (of 1 total)
  • Hi @megaphonejon

    Thanks for reporting. Using the same plugin (Better Messages – Live Chat for WordPress) we’re unable to reproduce the issue on our side, so yes it doesn’t happen in all scenarios. Going deeper with the issue, we believe this is due to the debug_backtrace() returning call stack entries which one of them has a function in which a Closure object/type is listed as an argument and then an exception is thrown by PHP because serialize function doesn’t allow Closure to be serialised.

    Our development team is still investigating this issue, and will work on a fix for the next release.

    Thanks
    Anthon

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Error introduced in 9.0.13’ is closed to new replies.