Back to Reports

Dynamic Update of wp_wc_product_attributes_lookup Fails for Products with Many Attributes

closed Apr 17, 2024 PluginWoocommerce

Summary:

The dynamic update mechanism for the wp_wc_product_attributes_lookup table is failing under specific conditions, leading to a corrupted lookup table. This issue occurs when a product with a very high number of attribute terms (e.g., over 200 variations) has its stock status updated. The failure subsequently causes product filters on category pages, which rely on this lookup table, to malfunction.

The root cause appears to be related to the complexity of updating the lookup table for products with an exceptionally large number of attributes. The site in question has 377 product attributes and 6,676 attribute terms, and the manual regeneration of the lookup table for 8,958 products takes approximately two hours, indicating a significant data processing load. Despite running on a high-specification server (96GB RAM, low CPU utilization), the dynamic update process fails, suggesting a robustness issue within the WooCommerce code itself when handling large datasets.

The impact is that shop owners cannot rely on the automatic synchronization of the lookup table, potentially leading to incorrect product filtering and display for customers. This forces a reliance on the lengthy manual regeneration tool to correct the table's state.

How to Replicate:

Replication steps were not explicitly detailed by the original poster. However, the described scenario involves:

  • Having a WooCommerce installation with a product that has a very high number of variations (e.g., 268).
  • Ensuring the wp_wc_product_attributes_lookup table is set to update dynamically.
  • Triggering a stock status change for that product (e.g., marking a variation out of stock).
  • Observing that the lookup table becomes corrupted, causing product filters to fail.