• Resolved w-sky

    (@w-sky)


    Hello, when I try to switch our server to PHP 8, I am getting the following error message from WordPress. Any help with that?

    WordPress Version 6.0.1
    Active Theme: Deli (Version 2.0.15)
    Current Plugin: WooCommerce (Version 6.7.0)
    PHP Version 8.1.8

    Error Details
    =============
    An error of type E_ERROR was caused in line 234 of the file /usr/www/users/web1/wp-content/plugins/woocommerce/includes/class-wc-post-types.php. Error message: Uncaught ValueError: Missing format specifier at end of string in /usr/www/users/web1/wp-content/plugins/woocommerce/includes/class-wc-post-types.php:234
    Stack trace:
    #0 /usr/www/users/web1/wp-content/plugins/woocommerce/includes/class-wc-post-types.php(234): sprintf()
    #1 /usr/www/users/web1/wp-includes/class-wp-hook.php(307): WC_Post_Types::register_taxonomies()
    #2 /usr/www/users/web1/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 /usr/www/users/web1/wp-includes/plugin.php(476): WP_Hook->do_action()
    #4 /usr/www/users/web1/wp-settings.php(598): do_action()
    #5 /usr/www/users/web1/wp-config.php(96): require_once(‘/usr/www/users/…’)
    #6 /usr/www/users/web1/wp-load.php(50): require_once(‘/usr/www/users/…’)
    #7 /usr/www/users/web1/wp-admin/admin.php(34): require_once(‘/usr/www/users/…’)
    #8 /usr/www/users/web1/wp-admin/index.php(10): require_once(‘/usr/www/users/…’)
    #9 {main}
    thrown

Viewing 3 replies - 16 through 18 (of 18 total)
  • @w-sky “Alle %” was special to my case – at the same location in your error message I can see an empty ′sprintf()′, maybe an empty string which needs a parameter (%s) in a translation file is causing the error?

    Plugin Support Daniyal Ahmed (a11n)

    (@daniyalahmedk)

    Hi there,

    Thanks for reaching out.

    I need to better understand your site setup to help you further. It will be great if you could share your current System Status Report. You can get it by navigating to the WooCommerce / Status section of your site. Once there, click on the Get system report button and then copy it by clicking on the Copy for support button. Then paste it here in a comment.

    Best,

    Tim W

    (@timwhitlock)

    I searched for “Alle %” in woocommerce-de_DE.po and could not find any missing “s” from “%s” in our translations.

    Switch off zend.exception_ignore_args in your PHP config so you can see the actual string that is causing your problem. Otherwise you’re just guessing. This is how azragh is able to see what is getting passed into sprintf in his case.

    I guess an error like this in a translation file should not alone cause a critical error in WordPress. (And why with PHP 8 and not with PHP 7?)

    I don’t know what you mean in terms of what “should” happen, but this does happen. This is a caveat to translating any formatted strings. As I explained in my FAQ, PHP 8 is stricter than PHP 7.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Critical error with PHP 8’ is closed to new replies.