links Archive

0

How to fix WP ECommerce

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:

Share
0

2000 Castello D’Albola Chianti Classico Reserva

2000 Castello D’Albola Chianti Classico Reserva
Sangiovese
$29
Score: 93

We first had Castello D’Albola Chianti Classico Reserva when eating at Sambuca’s in Addison.  It paired wonderfully with the steak I had and was decent with the herb chicken Jessica ate.

That was several years ago, and several cases of this wine later, it is official….we have finally polished off the final bottle.  Feel free to cry, we almost did.

This is an excellent CCR, but a little difficult to find in your local retailer, around here at least.  It, of course, pairs the best with red meat and other strong flavors, like herb encrusted chicken, or pork dishes.  Strong currant flavors with a woody aftertaste.  This is an excellently made wine that needs to be consumed now.  It is ready and probably a little past peak already, but still highly recommended and ready to drink.

If you want more information, check out the CellarTracker page on this great wine!

Share
Tags: ,