You need to checkout the Redux Framework for your next WordPress theme or plugin project. It’s, hands down, the best and most robust solution for WordPress options because it’s written to WordPress options standards, it has a ton of features and it’s easy to use/extend.
Here are the top ten reasons why I think you should give Redux a shot:
The framework can be embedded in your theme or plugin, but it can also be used as a plugin itself. It’s in the WordPress plugin repository which means the WordPress team have given it their blessing. This also means that if you use it this way, you won’t have to update your theme or plugin whenever Redux has an update. As long as the user updates their Redux plugin within WordPress, everything will always be kept up-to-date. Less work maintaining project code is usually a good thing.
The framework is also written as an OOP plugin. This helps it play well with itself. You can use it with multiple plugins and themes on the same WordPress site.
Easy to Use
Adding fields and options tabs to your theme or plugin is easy. A few simple arrays and the options are added to the WordPress admin page. There are a ton of different field options built in and the framework includes validation options for most of the fields. It also comes with a great sample options file that you can use for reference. Documentation is currently a little light on the Redux website but they’re working on that. (still in beta as of this writting)
It’s also very easy to pull these options from the database for use within your theme or plugin. All of the options are stored in their own row within the wp_options table of the WordPress database. To pull the options you can call the global options variable (you name the variable when setting up framework) or you can write your own function for pulling these options. Either method is fast and simple to implement.
Need a field that’s not included with Redux? No problem! Although I’d be hard pressed to come up with a field that’s not included, that doesn’t mean that they have everything you might ever need. If you do have a field that you need to add, it’s very easy to create your own, including any required validation necessary.
Variety of Options Fields
Need Google fonts? done! How about WordPress media uploader? yup! Want to integrate with WordPress posts, pages, user capabilities, categories, tags….sure, no problem.
There are even fields for controlling theme background images, padding or margins, link attributes, galleries, value sliders, image option select, passwords, code (js and css/less/sass), colors and gradients, sortable checkboxes, sortable text boxes, toggles and more! Whew! There’s even a repeatable field that groups 1 or more separate fields together. Check out the demo to get a better idea.
Active Development / Support
One of the best things about WordPress is the community. Actively developed and supported themes and plugins make the WordPress eco-system thrive. The Redux Framework is no different. Currently under active development with great support has helped to make the Redux Framework a solid choice. The fact that the development team has a plan for monetizing the Framework through premium add-ons bodes well for the future too. I expect Redux is here to stay.
The options page itself contains tabs on the left side of the page that help to organize large numbers of options for the user. Each tab of options fits fairly well within the standard WordPress admin design and users should feel right at home with a Redux options panel.
But it’s ajax that really makes the panel shine. Whenever a user makes a change to an option on any of the tabs, a small alert appears to warn the user to save their changes or else they might be lost. Also, the select boxes use the select2 jQuery plugin which makes it super easy for users to find what they’re looking for in long lists of data. For example, if you want the user to choose some posts for the homepage of your theme, you can use the “posts multi-select field”. If the site has a ton of posts, they’ll all be loaded in the select field but rather than scrolling forever to find the one they’re looking for, they can simply start typing in the box and their posts will start to filter. Talk about good UX design!
Import / Export
Have a theme with 200+ different options? (or hell, even just 25) You need an easy way for your users to import and export their options. The Redux Framework doesn’t just give the user a box with a bunch of seemingly nonsensical json code when they want to export their settings. It actually allows them to download the file for safe-keeping. It’s also easy to provide a url from a theme or plugin demo site for your users to import demo settings. They just copy and paste a link you provide and they’re done. Easy!
Free! It doesn’t get much better than that! Redux, like WordPress, is a professional level product and it’s available to everyone for free! You can get involved directly with the project and recommend or provide code improvements or addons. The developers are extremely responsive and welcoming to contributions (especially bug fixes).
Presets and Defaults
Presets are a great way to setup a sort of “theme within a theme”. It’s easy to create a way for your users to click 1 button and instantly change 1 or all of your theme options. Presets can be a huge time saver for your users and I think it brings the UX of the options panel to another level.
Right when the theme is activated, the defaults are automatically saved to the database with your defaults values for all of the options. Even if you navigate to the database and delete the option row associated with your theme or plugin, the framework will automatically add back the defaults without the need to load the options page in the admin. This is a feature that wasn’t available in many of the other options frameworks.
Many themes allow for the user to customize colors, background images and other css related details. The problem with some of these themes is that they stuff the custom css produced by their options page into the header of the WordPress site. This isn’t the most efficient way to do things. Redux includes pre-processor support, meaning that you can have the framework generate a single minified css file for the entire site whenever a style option is changed in the panel. As the developer, you determine which of these fields will fire the pre-processor by including 1 small line with your field array.
The really cool part is that Redux allows you to use whichever pre-processor you want. LESS, SASS, or plain ol’ css can be used and it’s easy to tie-in which ever option you want. This is great for LESS and SASS because you can programatically control so many parts of the design without overloading your user with too many options. For example, you can allow the user to control the primary and secondary colors in the panel. Then, using LESS or SASS, you can create 1 or more additional complimentary colors based upon the original 2 user choices. Use mixins, calculate shades of the users’ primary color and more. The possibilities are practically endless.
With Great Power Comes Great Responsibility
It’s obvious that I like the Redux Framework. But just because you can use Redux doesn’t mean that you should. It’s feature rich but the trade-off for so many options and versatility is bloat. In it’s current state, Redux is around 3.5 MB in size. While this isn’t huge, it would definitely be overkill if all you needed was a small handful of options for your theme. I usually don’t use it for client projects because clients hire me to adjust their options for them. Redux is much better suited for complex plugins and premium or public themes that will be used by many less experienced website owners.
Redux is a powerful, easy to use and fully supported options framework for WordPress projects. It will work well on themes and plugins, but I suspect it’s most at home on projects where you need more than just a few options.
What do you think? Have you tried Redux? Do you prefer something else for theme or plugin options? I’d love to hear your response in the comments below.