[wp-hackers] Need help with: coding new Plugin options

Ozh ozh at planetozh.com
Thu Nov 6 20:54:20 GMT 2008

On Thu, Nov 6, 2008 at 9:49 PM, Daiv Mowbray <daiv at daivmowbray.com> wrote:
> Ozh, the functions which you refer are from the plugin builder:
> http://www.wp-fun.co.uk/wizzards/fun-with-plugins/
> It reads to see if the options are there, if not they write the default into
> the ops table.
> If you know another way to check for options ... all ears.

A lot of plugins do this on every instantiation:
1) read options from DB
2) do various checks, including default values
3) write options in DB

The write part is totally unneeded and is just a query waste, since
after step 2 everything is ok. Just to steps 1 and 2, and write to the
DB only when options are updated through the admin form.

My 2 cents :)

http://planetOzh.com ~ Blog and WordPress Stuff
http://FrenchFragFactory.net ~ Daily Quake News

More information about the wp-hackers mailing list