Quick List: Things WordPress Plugins Developers Can Do to Help Their Plugins Scale

1) For┬áheavy backend operations like generating reports, don’t generate the screen on the init hook. Schedule a cron job and generate it periodically … if the administrator needs it right away, give them a refresh button.

2) Don’t autoload options unless they are really needed on every page load. And if you do autoload the option then make sure it isn’t too big 10KB should be plenty. Keep in mind if you create your option for the first time using the update_option(); [codex] function it will be autoloaded by default. So you should instead intiate the option using add_option('myoption','myvalue', false);

3) Don’t use wp_postmeta fields for numeric calculations. WordPress strongly encourages developers to work within their custom post type API, which is good, but that doesn’t mean the Metadata API is equally good for all data types. For instance a post_type, “order”, in which the record will have fields like ‘subtotal’,'tax’,'discount’,'grand_total’, which will likely be summed and counted and multiplied etc, go ahead and use a custom table with a foreign key on post_id.

About Mike Van Winkle

Ugh. I hate writing profiles. Just read the blog dude.

Comments

  1. Ahaa, its fastidious dialogue regarding this post at
    this place at this website, I have read all that, so at this
    time me also commenting at this place.

  2. Hey there! I’ve been following your site for a while now and
    finally got the courage to go ahead and give you a shout out from Humble Texas!
    Just wanted to tell you keep up the excellent work!

  3. Everyone loves what you guys are up too. This type of clever work
    and reporting! Keep up the terrific works guys I’ve added you
    guys to my personal blogroll.

Speak Your Mind

*