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

John James Jacoby in at j-3.me
Mon Jul 26 07:45:02 UTC 2010


Agree with Westi 100%

BuddyPress is a great example of this already, as is WordPress. 

Make yourself a default constants file and make sure it can be filtered.

Will save on serializing and/or caching the 4k back and forth when 1 small
change occurs.

If you want to keep it configurable, save only the settings that differ from
default, and wp_parse_args them at runtime?

-JJJ

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Peter Westwood
Sent: Monday, July 26, 2010 3:38 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Best practices for plugin with complicated
settings?

On Mon, July 26, 2010 8:11 am, Carl Roett wrote:
> 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.
>

My first response to this is - Do you /really/ need that many user
configurable options.

Consider making some decisions about how the plugin should work and more
some of them to only be configurable using filters so that in the rare
case where someone does need to change one of those settings they still
can.

Cheers

westi


_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list