Product edit page loading too slow, for huge number of attribute values
-
When there are attributes with many terms (in the order of tens of thousands), the loading of the product edit page, in the admin, gets really slow, requiring 2-3 minutes to complete. The size of the produced HTML also gets really huge, possibly exceeding 1MB.
This is caused by how WooCommerce renders its meta-box in the product edit page, and the Attributes tab in particular.
The exact reason is the retrieval of all the terms (even empty ones), of all attributes, for attributes of the “Select” type (instead of “Text” ones), which are then used to create a huge <select> element for each attribute, with every term as an <option> element.
The block containing these actions is at:
/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php:28 on WooCommerce v2.4.10.Changing the attribute’s type to “Text” would obviously improve things, but that isn’t always an option, depending on the use case.
The best solution would probably be to use AJAX to load the appropriate attribute values as the user types them, thus avoiding the unnecessary handling of huge term volumes, but currently WooCommerce doesn’t even provide the means (hooks) for a custom implementation of that functionality.
Is there any workaround, or a planned permanent fix for a future version?
- The topic ‘Product edit page loading too slow, for huge number of attribute values’ is closed to new replies.