When you build a plugin or theme, I’d encourage you to really think about whether your settings page is really needed. Have you added the settings page just because it’s the normal thing to do? Maybe because users expect there to be a place to go and “configure” the plugin? Perhaps you just didn’t think about not including it? It’s true, settings pages are very, very standard in themes and plugins, but I challenge the idea that they are always needed.
I am going to show you an example plugin (one that I wrote) and walk you through why no settings page is needed.
Let me introduce you to Sugar Event Calendar: it is a free plugin (with paid upgrade) that I wrote for adding a simple event calendar and management system to your WordPress site. When writing it, I wanted the plugin to be very, very light weight, and also very simple. When a new user installs it, they should be able to have their event calendar setup with real events in less than five minutes. I believe I achieved that, and I also believe it is in part because there is no settings page, none at all.
If you do a search for “Event Calendar” on WordPress.org, you will find a lot of options, and nearly every one boasts a settings page, many of them listing it as a feature.
What exactly is the purpose of a settings page? Well, that’s simple: a place to configure the options of the plugin.
What kind of options does a simple events calendar plugin need? Several:
- An option to choose the day of the week that is the start day (usually Sunday or Monday)
- An option to set the date format shown on events
- An option to set the time format shown on events
- Perhaps an option to choose the style of the calendar (if options are provided)
These all seem like valid options, right? Absolutely! But did you know that each of these (excluding the style option) is available as a WordPress core option already available in the main Settings section of the WordPress Dashboard?
When you build a plugin or theme, make sure that you are leveraging the settings already made available to you by WordPress core.
Sugar Event Calendar manages to not have a settings page because it utilizes the options already provided by core. Instead of creating another place for a site owner to configure yet another date format, I chose to simply use whatever was already set. And I did the same thing with the time format, as well as the week start day.
To use these options in your plugin or theme, just call get_option() with the appropriate option ID:
- Date Format: date_format
- Time Format: time_format
- Week Start Day: start_of_week
What about styling? Obviously many, many plugins and most themes include optional styles that users can choose from. How does one make these available without a settings page? Quite simply, I don’t, at least not with Sugar Event Calendar. I opted for something much simpler: no optional styles at all.
Perhaps it is the minimalist in me, but I really, really prefer plugins that load very, very little CSS on the front end, not because of load times but because I would much rather have the plugin adopt the styles of my theme. That’s the point of a theme after all, isn’t it?
Sugar Event Calendar has 21 lines of CSS, which is just enough to ensure that elements are properly laid out and have some very basic styling. The rest is handled by the theme. By doing it this way, Sugar Event Calendar integrates with almost every theme perfectly. The only themes, in fact, that it doesn’t work well with are themes that haven’t accounted for all or most of the standard HTML elements, but it even works pretty well with those.
The next time you write a plugin or theme, really think about whether your settings page is necessary.