Home / Forums / WoodMart support forum / Layered Navigation causes WC_Query query_vars warning & slow site
Home › Forums › WoodMart support forum › Layered Navigation causes WC_Query query_vars warning & slow site
Layered Navigation causes WC_Query query_vars warning & slow site
- This topic has 2 replies, 2 voices, and was last updated 1 week, 2 days ago by
Artem Temos.
-
AuthorPosts
-
December 16, 2025 at 10:10 pm #701177
autopolishing7ParticipantHello,
I am experiencing a critical performance issue related to WoodMart Layered Navigation widgets on WooCommerce product archive pages.
Environment
WordPress: 6.9
WooCommerce: latest
Theme: WoodMart 8.3.7
PHP: 8.3
WP_DEBUG: enabled
Server: shared hosting (MySQL max_user_connections limit applies)Problem
The website becomes extremely slow and eventually hits MySQL max_user_connections, causing the site to partially or fully stop responding.
The debug.log file is continuously filled with the following warning:
“PHP Warning: Attempt to read property “query_vars” on null
File: wp-content/plugins/woocommerce/includes/class-wc-query.php
Lines: 895 / 907″This warning is logged many times per single page load.
Stack trace always includes
-Automatic\WooCommerce\Internal\ProductAttributesLookup\Filterer
-WOODMART_Widget_Layered_Nav
-layered_nav_list
-dynamic_sidebar
-archive-product.phpObservations
Happens on Shop / product archive pages
Triggered by WoodMart Layered Navigation widgets
Attribute counts calculation is involved
Warning repeats continuously
debug.log grows very fast
MySQL connections remain in Sleep state and accumulate
Eventually MySQL refuses new connectionsSteps to reproduce
Open the Shop page (e.g. /magazin/) with Layered Navigation widgets enabled
Reload the page several times or interact with filters
Check wp-content/debug.log
The warning appears repeatedly and performance degrades rapidlyTests already done
Disabling Layered Navigation widgets stops the warnings completely
Issue does not occur when widgets are removed
Tried custom PHP workaround snippets → caused fatal errors / did not resolve the issue
The issue appears consistently with WoodMart widgets enabledExpected behavior
Layered Navigation widgets should not trigger repeated WooCommerce query warnings or cause excessive MySQL connections.
Additional notes
This seems to be related to how WoodMart handles WooCommerce attribute queries and WC_Query when calculating filtered term counts.
Please let me know if you need temporary admin access to investigate further.
Thank you in advance.
December 17, 2025 at 3:17 am #701217
autopolishing7ParticipantAdditional technical details – exact location in WoodMart code
While debugging the issue, I identified a specific trigger point in the WoodMart code:
File:
woodmart/inc/widgets/class-widget-layered-nav.phpClass:
WOODMART_Widget_Layered_NavMethod:
get_filtered_term_product_counts( $term_ids, $taxonomy, $query_type )Inside this method, WoodMart directly calls WooCommerce’s ProductAttributesLookup Filterer:
wc_get_container()
->get( \Automattic\WooCommerce\Internal\ProductAttributesLookup\Filterer::class )
->get_filtered_term_product_counts( $term_ids, $taxonomy, $query_type );In my case, this call appears to trigger the WC_Query query_vars warnings and the heavy database queries, leading to CPU and DB spikes on shop and product archive pages.
Disabling/removing the WoodMart Layered Navigation widgets immediately stops the warnings and the resource usage, which strongly suggests this code path as the source of the issue.
This information may help you reproduce and debug the problem more quickly.
December 17, 2025 at 11:01 am #701267
Artem TemosKeymasterHi,
Thanks for the detailed report. Our Layered Navigation widgets are wrappers over WooCommerce’s native filtering; all filter queries and term counts are performed by WooCommerce. The warnings and DB load you see come from WooCommerce’s Product Attributes Lookup system.
Please try to compare with default WooCommerce filters. Add the default WooCommerce layered navigation/active filters widgets to the same sidebar and test. They should behave the same as our widgets.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register