As I create and publish more and more plugins (I now have 25 on WordPress.org), my increasing focus is to keep each plugin as simple as possible. My first few WordPress plugins suffered from bloat from the beginning and are still paying the consequences, including poor usability, untenability, and a likely path toward abandonment. With simplicity as the priority, a plugin is smaller, more efficient, and easier to use. Each plugin should do one thing and do it well. “Well” means that it works as-out-of-the-box as possible, is compatible with as many site configurations (themes, other plugins) as possible, and can be customized in a variety of ways to fit a given site’s needs.
This post features case studies of five small plugins that can make a big impact on a site. All of these plugins have been published for over one year, allowing time to evaluate the levels of support and maintenance required and any community feedback via reviews and active installation data. Somewhat coincidentally, each of these plugins includes only a single file of PHP code, a single readme text file (that is generally larger than the actual code), and no additional assets (images, CSS, JavaScript, etc.). At this scale, the tiny size of the plugin download bundle is irrelevant; I will instead report the number of lines of code, including inline comments, but excluding my typical 32-line plugin header and license statement. I will also summarize the usability (configuration and customization requirements), maintenance (number of updates required, for any reason), and support (via the WordPress.org forums) requests for each plugin.
If you want to learn more about a particular plugin, click through to the WordPress.org listings, which will also show the current reviews and active installation counts. These five plugins have a diverse set of functions, adding features, modifying the admin interface, and more. A common theme is extending existing core WordPress functionality, exposing it in new and useful ways.
Chronological Posts
Globally reverses the post order to be chronological, so that your site can display a journal or a book in chronological order.
- Lines of code: 6 (PHP)
- Configuration: Activate the plugin, and you’re done
- Customization: Fork the plugin and add any required conditionals to the code
- Updates Required to Date: 0 (public for 2 years)
- Support: 7 forum posts / 1,000+ active installs ( < 0.7%)
Front Page Custom Post Type
Select a custom post type to be displayed in place of latest posts on the front page. Allows custom post types to be featured on the front page out-of-the-box with most themes.
- Lines of code: 47 (PHP)
- Configuration: Select from additional front page options in the customizer
- Customization: Additional CSS or theme CSS edits may be required depending on the theme’s use of post-type-specific selectors
- Updates Required to Date: 0 (public for 1.5 years)
- Support: 0 forum posts / 100+ active installs (0%)
This plugin is my fastest-ever to be approved, going through the plugin review queue in a matter of hours (the same day that it was conceived, written, tested, documented, and submitted). It received a shout-out from plugin reviewer Mika Epstein, and could make a good candidate for core inclusion.
https://twitter.com/Ipstenu/status/784204207721066496
Login Site Icon
Display your site icon instead of the WordPress icon on the login screen. Particularly helpful for users with multiple WordPress sites.
- Lines of code: 19 (PHP)
- Configuration: Activate the plugin, and set up a site icon if you haven’t already
- Customization: Install additional plugins or custom code to further customize the login screen
- Updates Required to Date: 0 (public for 2 years)
- Support: 0 forum posts / 100+ active installs (0%)
Multisite Custom CSS
Allow multisite site admins to access custom CSS (via the core feature in the customizer) by trusting them with unfiltered CSS.
- Lines of code: 7 (PHP)
- Configuration: Activate the plugin, and you’re done
- Customization: Additional plugins or custom code if further user role/capability or security adjustments are required
- Updates Required to Date: 0 (public for 1.3 years)
- Support: 1 forum post / < 10 active installs ( > 10%; notably, there are three five-star reviews for > 30% engagement… the active install data appears to be incorrect; perhaps it doesn’t correctly account for multisite installs)
Multisite Site Index
Display an index of all sites on a multisite network with a widget or a shortcode.
- Lines of code: 162 (PHP)
- Configuration: Add the widget and/or shortcode, and customize its appearance
- Customization: Custom CSS strongly encouraged, with examples for common layouts available in the plugin FAQ
- Updates Required to Date: 1 (public for 1.3 years)
- Support: 3 forum posts / 60+ active installs (5%)
This last plugin is roughly three times larger than the next largest plugin featured in this post. However, its ability to remain relatively streamlined while providing a substantial amount of functionality on the site is significant. Plugins that display content on the frontend typically feature extensive administration interfaces and frontend styling. This plugin instead prioritizes smart defaults via semantic markup. Given the target audience of multisite network administrators, some level of advanced appearance customization should be expected regardless, and is best served via the core custom CSS feature.
Good plugins don’t have to be small. But small plugins are much more likely to serve a majority of users’ needs well, require fewer maintenance updates, have minimal support needs and conflicts with other plugins, and remain relevant for a long time. Simplistic plugins that work out of the box for a majority of users, make more decisions, and present fewer options observe the WordPress Philosophy. All plugins should adopt this philosophy to optimize their potential and longevity.