On front end pages with no ecommerce functionality, this plugin adds over 220+ database queries. The more I messed with the code trying to make it behave, the more I understood just how horribly written this plugin is.
Now, as someone that has been doing development long enough to know, there are times that code just gets away from the development team and becomes a mess unto itself. It happens, especially in the OSS world where code reviews are few if ever. But, as I read the forums for this thing, the developers are just fooling themselves thinking the code is in good shape.
Here are a few basic suggestions:
1) Check to see if the page needs to execute the plugin. If it doesnt, dont do it. There is no reason to increase the number of queries by an order of magantuide when I am on a page that has no WP Ecommerce functionality.
2) Clean up the queries. For example:
SELECT `id` FROM `wp_product_list` WHERE `active` IN(’1′)
should be
SELECT `id` FROM `wp_product_list` WHERE `active` = 1
It is more effiecent.
3) Index the tables! The query above doesnt use an index. That is right folks, the field “active” in product_list is not indexed. This is easy and simple.
4) Use arrays or some other data structure for complex data. Dont use the same basic query over and over again. Example: