WordPress plugins enable you to extend WordPress in many ways. The key is understanding what has already been done, so you aren't reinventing the wheel.
- [Instructor] Why do we build WordPress plugins? To answer that, consider the number one rule when working with WordPress. Don't modify the WordPress Core. Changing anything in the WordPress core files is a bad idea for two important reasons. First, when WordPress is updated, any core modifications will be overwritten and lost. And second, changing stuff in the WordPress core can break things and put your site at risk. Fortunately, WordPress provides a powerful and robust API that enables us to extend default WordPress functionality without touching any core files.
So before diving into plugin development, let's take a moment to explore some of the diverse plugins currently available in the WordPress plugin directory. Understanding what's already been done can help us make decisions regarding our own plugins and help us brainstorm new ideas. We may find a plugin that does exactly what we need, or we may find a plugin that we can adopt and continue development on our own or with a team. As you can see here, the WordPress plugin directory hosts over 50,000 free plugins.
These plugins vary greatly in terms of their scope and complexity. Some plugins are simple and focus on a specific task. For example, this plugin changes the default location of the WordPress login page. Another one, here is a plugin that disables the WordPress emoji icon feature. And here is a plugin that disables all WordPress feeds, which can be useful when WordPress is used as a strict CMS instead of a blogging platform. These are examples of simple plugins that basically do one thing and do it well.
Of course, plugins also may be very advanced, providing a wide range of functionality and features. For example, All in One SEO provides a variety of features all designed to improve your site's SEO. Also, W3 Total Cache provides a great deal of functionality to help improve site performance. And Dashboard Widgets Suite is one of my own plugins. It provides a variety of useful widgets for the WordPress dashboard. Keep in mind that WordPress plugins come and go all the time, so if any of these plugins are missing for some reason, don't sweat it.
They're just examples. The point is to familiarize yourself with what's out there. With so many plugins in the plugin directory, it's almost always possible to find a suitable plugin to do just about anything that's required. This is an important thing to understand when getting into plugin development. Knowing what's already been done can save you time and help focus your efforts on lucrative projects. A few more examples. Here is some plugins that show the vast range of plugin functionality. WP Statistics is one of many plugins that provides statistics about your site.
There also are plugins for doing just about anything with social media, display icons, social logins, sharing, and everything in between. Here is one of my plugins, User Submitted Posts, that enables users to submit content from the front end of the site. There also are many shopping cart and membership plugins available to transform your site into a fully functional eCommerce system. Need to schedule clients? There are some great Booking/Calendar plugins available here at WordPress.org. Lots of great niche plugins, too, like this one for integrating a complete real estate system.
There also are many premium, or pro plugins, available outside of the plugin directory. You can find pro plugins around the web at places like CodeCanyon, wpmudev.org, and many smaller plugin shops such as my own at Plugin Planet. So as you get further into plugin development, always keep in mind the enormous library of existing WordPress plugins. Before developing a new plugin, do some research and see what's already available. All plugins hosted at the WordPress plugin directory are open source so you are free to explore and reuse the code according to the GPL license.
Also, it's important to note that plugins provided from locations outside of the WordPress plugin directory may or may not be entirely GPL licensed. So make sure to confirm the license terms before reusing any code. We'll cover more about plugin licensing in the next video. For now, I hope this brief overview shed some light on the rapidly growing collection of free WordPress plugins and the diverse functionality that they enable.
- WordPress APIs
- Action and filter hooks
- Activating and deactivating plugins
- Plugin security
- Creating the directory and files
- Adding menus and the settings page
- Inserting custom functionality
- Testing and debugging WordPress plugins
- Creating widgets
- Managing users and roles
- Adding custom post types and taxonomies
- Working with custom fields and database queries
- Using APIs: Transients, HTTP, and REST