[wp-hackers] Best practices for plugin with complicated settings?

Carl Roett carlroett at gmail.com
Mon Jul 26 07:11:17 UTC 2010

Andrew, I have specific situation I'd like your input on:

My team is currently working on the BuddyPress Media plugin
http://code.google.com/p/buddypress-media/  (previously known as BP Album+)

At present, we have 207 configuration settings consisting of mixed data
types (bool, int, string, object) that we're storing to a single WP option.
This number is probably going to increase to around 400 settings by the time
we're finished. Total stored size in the DB about 4K. The settings rarely
change after the admin has completed initial setup.

Approximately 15% of the options need to be known for each page load, but
the combinations change for every screen, and multiple screens have config
options in common. So, if we wanted to load only the settings necessary for
a given screen, we'd have to split them into roughly 150 different config

Currently, we just use the WP Settings API to load our configuration object
on each plugin page load, and then we access the individual settings from
the object in memory.

Is this the most efficient way to do it? If not, how would you recommend we
implement it?



More information about the wp-hackers mailing list