• Resolved avonrivercs

    (@avonrivercs)


    The owner of this website has been complaining of slow operations in the backend. I have done a few things to speed up the site including installing Memcached and adding an object cache amongst other things. I installed Query Monitor plugin and apart from deprecated warnings, there doesn’t seem to be any problems until I go to view the Woocommerce > Orders. This error warning then shows in red in Query Monitor:

    WarningUndefined array key “post_type”+

    1. wp-content/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-orders.php:711

    1Plugin: woocommerce

    CoPilot suggests the following fixes:

    $post_type = isset($_REQUEST[‘post_type’]) ? $_REQUEST[‘post_type’] : ”;

    Or, using null coalescing (php7+)

    $post_type = $_REQUEST[‘post_type’] ?? ”;

    I understand that any fix would only be effective until the next update, so this would not be a permanent fix. Has anyone else found this issue and has a long term workaround?

    P.S. We are using php 8.2

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

Viewing 1 replies (of 1 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thanks for the detailed information and for sharing your findings.

    The warning you’re seeing Undefined array key "post_type"typically appears when a plugin or a custom code snippet triggers the WooCommerce Orders page without passing the expected post_type value.

    Since this is a PHP 8.2-related notice, it usually doesn’t affect functionality but can appear due to stricter error handling in PHP 8+.

    To confirm, could you please:

    1. Temporarily switch to a default theme like Storefront and deactivate all plugins except WooCommerce, then check if the warning still appears.
    2. If the warning disappears, reactivate your other plugins one by one to identify which one triggers it.

    If the issue only occurs with WooCommerce active and no other plugins/themes. I’m suggesting this because I’m not able to replicate the issue on my end.

    I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further.

Viewing 1 replies (of 1 total)

The topic ‘Undefined array key “post_type” on Orders Page’ is closed to new replies.