Introduction
This guide will provide you with all the knowledge necessary to develop high-quality plugins for the WordPress system. It will also explain why you might want to write a plugin and give some examples of the types of things that a WordPress plugin can do for you.Why Write a Plugin?
It is obvious that many people believe in the WordPress plugin system solely by the number of plugins that exist. However, what isn't obvious is why plugins are so plentiful? What are the benefits to writing a plugin for WordPress? There are three main reasons that you should consider utilizing WordPress's plugin system.- Take advantage of an advanced blogging system's existing infrastructure
- Reach the widest marketable audience possible
- Plugins let you upgrade WordPress without worrying about losing core modifications
Sure, those bullet points are nice, but what about specific examples and anecdotes?
The WordPress Advantage
When you start writing a plugin for WordPress, you get to use the built-in functions and functionality that the system provides. As an example, consider the uploading of files for a specific purpose. Instead of spending hours writing a upload and thumbnailing system yourself, you can utilize WordPress's built-in thumbnailing and upload utility functions, knowing that they are well tested, both in theory and in practice.In addition to specific code functionality, as mentioned above, you also gain a pre-built administrative interface that users are familiar with and integration into a system that they already trust.
A Marketable Audience
Sure, it may be nice to write a plugin, but who is going to use it? According to the latest numbers, there are 201,000 blogs using the latest version of WordPress. This is only about 9% of the existing WordPress installations, so you can multiply that number by 10 and get an idea of the kind of audience your plugin will have.Also, WordPress users are accustomed to utilizing plugins, so they'll go searching for something they want WordPress to do if the base install doesn't do it for them. You can serve a niche audience with your plugin and still attract an enormous amount of people. This can lead to fame, a greater sense of self-worth, and a feeling that you helped out a community of users.
No Core Modifications
WordPress is always changing. New versions are released in a rapid cycle, with each new release adding new features, improving old ones, and fixing bugs. By using a plugin, you can easily and quickly upgrade to each new release without worrying about losing functionality that you added. If you made modifications to core WordPress files, you would have to make detailed notes and then add those changes to the new release. It's a lot of extra work for no gain.What Can a Plugin Do?
An important question to ask before starting development of a WordPress plugin is to determine what exactly can be done via the plugin architecture. The short answer to this question is: "Just about anything." If you can think of something you want to do in WordPress, you can probably do it via a plugin with the right amount of effort. To substantiate this, here are some examples of things you can do and some plugins that do it:- Add an interface element to the write screen - Amazon Reloaded for WordPress
- Add an entirely new concept to WordPress administration - WP-Project
- Interact with external APIs through WordPress - WordPress Flickr Manager
- Modify post output dynamically - WP-Affiliate
As you can see, these examples illustrate the wide range of things that the WordPress plugin architecture allows. Now that you're familiar with the possibilities, it's time to start development.
Developing a Plugin
Starting the development of a WordPress plugin is easy. It requires a bare minimum of PHP knowledge, the ability to read software documentation, and sometimes might require knowledge of HTML/CSS for presentation. You don't need to know much about WordPress to develop a plugin for it, but sometimes it helps if you have the source code available. I won't describe how to set up a complete development environment here, but please make sure you have one suitable for PHP development ready to go before starting your plugin development.When I start developing a plugin, I follow a series of basic steps similar to the list that follows. I'll expand on each step further after the list.
- Nail down your plugin requirements
- Decide on the data storage mechanism
- Setup a blank WordPress plugin file
- Register activation and deactivation hooks
- Determine the action and filter hooks you'll need to interact with
- Write the plugin code







Comments
Write New Comment ▼
Write New Comment
Sorry! This knol's owner(s) have blocked you from editing, making suggestions, or commenting here.