• Resolved laaau89

    (@laaau89)


    Hi there,

    since a few months my file php_errorlog gets filled with thousands and thousands of rows (on average 1 to 5 rows created per minute!) saying:

    PHP Warning: Undefined array key "in_span" in /home/customer/www/[SITE_URL]/public_html/wp-content/plugins/woocommerce/includes/wc-formatting-functions.php on line 645

    The issue is created by the row:

    if ( $args['in_span'] ) {

    If I replace it with:

    if ( isset($args['in_span']) ) {

    then I don’t get the error warning anymore. But then WooCommerce gets updated and I have the same issue again.

    It seems like a general WooCommerce error, but I haven’t found much information on the Internet about that, so could it be specific to my installation?

    System Status Report

    ### WordPress Environment ###

    WordPress address (URL): [Redacted]
    Site address (URL): [Redacted]
    WC Version: 10.4.0
    Legacy REST API Package Version: ✔ 1.0.5
    Action Scheduler Version: ✔ 3.9.3
    Log Directory Writable: ✔
    WP Version: 6.9
    WP Multisite: –
    WP Memory Limit: 768 MB
    WP Debug Mode: –
    WP Cron: –
    Language: en_US
    External object cache: –

    ### Server Environment ###

    Server Info: Apache
    Server Architecture: Linux 6.6.63-MCIclouder663-c9 x86_64
    PHP Version: 8.2.29
    PHP Post Max Size: 256 MB
    PHP Time Limit: 120
    PHP Max Input Vars: 3000
    cURL Version: 8.9.1
    OpenSSL/3.2.6

    SUHOSIN Installed: –
    MySQL Version: 8.0.43-34
    Max Upload Size: 256 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔

    ### Database ###

    [REDACTED]

    ### Post Type Counts ###

    attachment: 11721
    cookielawinfo: 6
    custom_css: 1
    flamingo_contact: 1222
    flamingo_inbound: 1200
    foogallery: 24
    gs_testimonial: 2
    nav_menu_item: 1084
    oembed_cache: 2
    page: 70
    post: 1
    premium_shipping: 9
    product: 3301
    product_variation: 12612
    rcb-cookie: 2
    revision: 1841
    shop_coupon: 803
    shop_order: 20669
    shop_order_refund: 836
    testimonial: 11
    tss-sc: 1
    vxc_zoho: 3
    wpcf7_contact_form: 2
    wplconsentlogs: 465
    wpmm_theme: 3
    wp_global_styles: 1

    ### Security ###

    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔

    ### Active Plugins (26) ###

    Complianz | GDPR/CCPA Cookie Consent: by Complianz – 7.4.4.1
    Contact Form 7: by Rock Lobster Inc. – 6.1.4
    Disk Usage Insights: by Marcel Gleis – 1.9
    GTM4WP - A Google Tag Manager (GTM) plugin for WordPress: by Thomas Geiger – 1.22.2
    FooBox Image Lightbox: by FooPlugins – 2.7.35
    FooGallery: by FooPlugins – 3.1.1
    Fr Custom Payment Gateway Icon for WooCommerce: by Fahri Rusliyadi – 1.1.2
    Max Mega Menu: by megamenu.com – 3.6.2
    Multilingual Comments: by Yame – 1.0.1
    MultiSafepay: by MultiSafepay – 6.10.0
    Speed Optimizer: by SiteGround – 7.7.5
    Side Cart WooCommerce: by XootiX – 2.7.2
    Simple CAPTCHA Alternative with Cloudflare Turnstile: by Elliot Sowersby
    RelyWP – 1.35.0

    WPML Multilingual CMS: by OnTheGoSystems – 4.9.0-b.1
    Super Socializer: by Team Heateor – 7.14.5
    WooCommerce Additional Variation Images: by WooCommerce – 2.3.2
    WooCommerce All in One Currency Converter: by Dev49.net – 2.12.1
    WooCommerce EU VAT Number: by WooCommerce – 2.9.2 (update to version 3.0.3 is available)
    Google Analytics for WooCommerce: by WooCommerce – 2.1.19
    WooCommerce Legacy REST API: by WooCommerce – 1.0.5
    WPML Multilingual & Multicurrency for WooCommerce: by OnTheGoSystems – 5.5.3.1
    WooCommerce PayPal Payments: by PayPal – 3.3.1
    WooCommerce: by Automattic – 10.4.0
    WP Paint - WordPress Image Editor: by ZetaMatic – 0.5.3
    WPML String Translation: by OnTheGoSystems – 3.5.0-b.1
    Yoast SEO: WooCommerce: by Team Yoast – 13.2

    ### Inactive Plugins (3) ###

    CookieYes | GDPR Cookie Consent: by CookieYes – 3.3.8
    WP Consent API: by WordPress Contributors – 2.0.0
    WP Cookie Consent: by WP Legal Pages – 4.0.7

    ### Settings ###

    Legacy API Enabled: ✔
    Force SSL: ✔
    Currency: EUR (€)
    Currency Position: right_space
    Thousand Separator: .
    Decimal Separator: ,
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)

    Connected to WooCommerce.com: ✔
    Enforce Approved Product Download Directories: –
    HPOS feature enabled: –
    Order datastore: WC_Order_Data_Store_CPT
    HPOS data sync enabled: ✔
    Enabled Features: analytics
    marketplace
    order_attribution
    site_visibility_badge
    remote_logging
    blueprint
    point_of_sale


    ### Logging ###

    Enabled: ✔
    Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
    Retention period: 30 days
    Level threshold: –
    Log directory size: 3 MB

    ### WC Pages ###

    Shop base: #45192 - /negozio/
    Cart: #6619 - /cart/ - Contains the [woocommerce_cart] shortcode
    Checkout: #6620 - /checkout/ - Contains the [woocommerce_checkout] shortcode
    My account: #6621 - /account/ - Contains the [woocommerce_my_account] shortcode
    Terms and conditions: #36031 - /terms-and-conditions/

    ### Theme ###

    Name: Maxi Theme
    Version: 2
    Author URL:
    Child Theme: ✔
    Parent Theme Name: Storefront
    Parent Theme Version: 4.6.2
    Parent Theme Author URL: https://woocommerce.com/
    Theme type: Classic theme
    WooCommerce Support: ✔

    ### Templates ###

    Overrides: maxi_theme/woocommerce/cart/cart-shipping.php
    maxi_theme/woocommerce/cart/cart-totals.php
    maxi_theme/woocommerce/cart/cart.php
    maxi_theme/woocommerce/cart/mini-cart.php
    maxi_theme/woocommerce/cart/proceed-to-checkout-button.php
    maxi_theme/woocommerce/cart/shipping-calculator.php
    maxi_theme/woocommerce/checkout/form-billing.php
    maxi_theme/woocommerce/checkout/payment.php
    maxi_theme/woocommerce/checkout/review-order.php
    maxi_theme/woocommerce/checkout/thankyou.php
    maxi_theme/woocommerce/content-product.php
    maxi_theme/woocommerce/content-single-product.php
    maxi_theme/woocommerce/emails/email-addresses.php
    maxi_theme/woocommerce/emails/email-order-items.php
    maxi_theme/woocommerce/emails/email-styles.php
    maxi_theme/woocommerce/loop/add-to-cart.php
    maxi_theme/woocommerce/myaccount/dashboard.php
    maxi_theme/woocommerce/myaccount/form-edit-address.php
    maxi_theme/woocommerce/myaccount/my-address.php
    maxi_theme/woocommerce/myaccount/navigation.php
    maxi_theme/woocommerce/myaccount/orders.php
    maxi_theme/woocommerce/myaccount/view-order.php
    maxi_theme/woocommerce/order/order-details-item.php
    maxi_theme/woocommerce/order/order-details.php
    maxi_theme/woocommerce/single-product/add-to-cart/simple.php
    maxi_theme/woocommerce/single-product/add-to-cart/variable.php
    maxi_theme/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php
    maxi_theme/woocommerce/single-product/add-to-cart/variation.php
    maxi_theme/woocommerce/single-product/price.php
    maxi_theme/woocommerce/single-product/related.php


    ### WooCommerce PayPal Payments ###

    Onboarded: ✔
    Branded only: –
    New UI active: –
    Shop country code: IT
    WooCommerce currency supported: ✔
    Advanced Card Processing available in country: ✔
    Pay Later messaging available in country: ✔
    Webhook status: ✔
    PayPal Vault enabled: –
    ACDC Vault enabled: –
    Logging enabled: –
    Reference Transactions: –
    Used PayPal Checkout plugin: ✔
    Subscriptions Mode: Disabled
    PayPal Shipping Callback: –
    Apple Pay: ✔
    Google Pay: ✔
    Fastlane: –

    ### Admin ###

    Enabled Features: activity-panels
    analytics
    product-block-editor
    experimental-iapi-mini-cart
    coupons
    core-profiler
    customize-store
    customer-effort-score-tracks
    import-products-task
    experimental-fashion-sample-products
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    mobile-app-banner
    onboarding
    onboarding-tasks
    pattern-toolkit-full-composability
    product-custom-fields
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    printful
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    woo-mobile-welcome
    wc-pay-promotion
    wc-pay-welcome-page
    launch-your-store

    Disabled Features: product-data-views
    experimental-blocks
    experimental-iapi-runtime
    coming-soon-newsletter-template
    minified-js
    product-pre-publish-modal
    products-catalog-api
    settings
    async-product-editor-category-field
    product-editor-template-system
    use-wp-horizon
    rest-api-v4

    Daily Cron: ✔ Next scheduled: 2025-12-12 14:15:17 +01:00
    Options: ✔
    Notes: 262
    Onboarding: completed

    ### Action Scheduler ###

    Complete: 967
    Oldest: 2025-12-02 09:32:03 +0100
    Newest: 2025-12-12 09:21:05 +0100

    Pending: 14
    Oldest: 2025-12-12 10:04:27 +0100
    Newest: 2025-12-13 04:54:52 +0100


    ### Status report information ###

    Generated at: 2025-12-12 09:58:56 +01:00

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @laaau89,

    Thank you for sharing these details about the PHP warning in your error log. I understand how frustrating it can be to deal with thousands of repeated warnings, especially when they persist after updates.

    The warning you’re seeing suggests that somewhere in your setup, the wc_price() function (or a related formatting function) is being called without the expected in_span parameter in the arguments array. This could be caused by:

    • Your custom theme templates might be calling WooCommerce functions with incomplete parameters
    • One of your active plugins might be calling WooCommerce formatting functions incorrectly
    • Any custom code in your functions.php or elsewhere that calls WooCommerce price formatting functions

    To troubleshoot this:

    1. I notice you have many custom templates in your maxi_theme folder. Look for any calls to wc_price() or similar functions in these files.
    2. I know you’re using the Storefront theme, but temporarily switch to a default WordPress theme, such as Twenty Twenty-Four, or your parent theme, to see if the warnings stop.
    3. Try deactivating plugins one by one to identify if any are causing the issue.
    4. If your site or child theme includes custom code using WooCommerce formatting functions, verify that $args arrays always include the ‘in_span’ key when passed.

    I hope that helps. Let us know how it goes!

    Thread Starter laaau89

    (@laaau89)

    Thank you Frank for your reply! I confirm that my functions.php calls 9 times wc_price().

    However, I see that wc_price() expects $price (required) and $args (optional). $args is made of 7 possible different values, $in_span included, but I’m never passing any $args at all – being optional. Why would just the optional $in_span, out of all of them, raise the warning?

    Anyway, I’ll troubleshoot (it will take me some time) and let you know, thanks.

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @laaau89,

    Great questions! You’ve identified the root cause. 

    When you call wc_price() without the optional $args parameter, WooCommerce should handle this correctly. However, the warning suggests that somewhere in your code flow, an array is being passed or expected that doesn’t contain the in_span key. This could happen if:

    1. Your functions.php code is modifying or passing arrays that get used later in the formatting process
    2. You’re using hooks or filters that modify the arguments before they reach the formatting functions
    3. There’s custom code that builds an $args array but doesn’t include all expected keys

    Let us know how your troubleshooting goes so we see.

    Thread Starter laaau89

    (@laaau89)

    Hi Frank,

    just to let you know that I’ve checked my functions.php and the issue is not related to my custom theme. All my wc_price() calls pass just the price parameters, and the problem persists even after removing them.

    It might be a plugin. This will take me longer to debug, as I will have to create a staging site first.
    Anyway, thank you for giving me the hints on what to check. Appreciate your assistance!

    Hi @laaau89, I appreciate you coming back with the update and taking the time to test this further. It is clear you have been methodical with your checks, and I can see how frustrating it is when the warning persists even after ruling out your custom theme and direct wc_price() calls.

    Given what you have confirmed so far, this does point much more strongly to a plugin or custom integration that is filtering or rebuilding the arguments passed into WooCommerce formatting functions and omitting the in_span key. This aligns with what we typically see when a plugin hooks into price formatting or display logic and passes a partial $args array instead of letting WooCommerce merge defaults internally.

    At this stage, setting up a staging site is a solid next step, as you mentioned. On staging, I recommend running a plugin conflict test by temporarily deactivating all non WooCommerce plugins and then re enabling them one at a time until the warning reappears. That should help narrow down which plugin is injecting or modifying the arguments incorrectly. This guide walks through that process in detail: https://woocommerce.com/document/how-to-test-for-conflicts/

    Once you identify the plugin involved, the best path is to report this directly to that plugin’s developer, as the fix needs to happen where the arguments are being altered. If you do find a specific plugin causing it, feel free to update the thread here and we can take another look together.

    Thanks again for sharing your findings so far, and let us know how it goes once you have a chance to test on staging.

    Plugin Support Feten L. a11n

    (@fetenlakhal)

    Hi there,

    Just checking in! Since it’s been a while, I’ll go ahead and close this out — but feel free to reach out whenever you’re ready.

    Apart from this, if you’re happy with our plugin and the support you’ve received, we’d really appreciate a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post

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

You must be logged in to reply to this topic.