Hi,
We’re using Atelier as a site and WooCommerce theme. Our site has about hundred products and variations.
We’ve been having problems with slow site issues. I found it odd until I installed the WordPress debug bar, which can log and show the database queries.
https://wordpress.org/support/plugin/debug-bar
We have a ‘Featured Products’ Swift thing on the homepage, which shows four products. This page is hitting the database about 880 times! Removing this takes it back to the more normal (for WordPress) 80 queries.
The Products listing, which shows the standard 12 products, is hitting the database over 1600 times!!!
I did some hunting around, and traced it down to themes/atelier/woocommerce/content-product.php
, which both the widget, and the WooCommerce shop use.
As a quick fix to halve the queries on each of these pages, I removed (around line 172) this:
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
}
The rest of the remaining ~80 queries per-product are spread around this template.
This is, obviously, crazy amounts, and may explain some of the speed complaint issues on this forum.
If someone on the Swift team could spare a bit of time to reviewing this template, that would be great.
Thanks!