A requirement for all WordPress plugins is a valid plugin header. The plugin header must be defined at the very top of your main PHP file as a PHP comment. It does not need to exist in every file for your plugin, only the main PHP file. This header tells WordPress that your PHP file is in fact a legitimate WordPress plugin and should be processed as such. Following is an example of a standard plugin header:
Plugin Name: My Awesome Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin Description: This is a brief description of my plugin Version: 1.0 Author: Brad Williams
Author URI: http://example.com
The only required line in the plugin header is the Plugin Name. The rest of the information is optional but highly recommended. The information listed in your plugin header is used on the Manage Plugins section of WordPress. For example, you can see what the header looks like in WordPress in Figure 7-1.
You can see how important the plugin header information is, including all optional data. The information should be accurate and provide good links to your web site and the plugin URI for additional information and support regarding your plugin.
Ky jIh**!:» Plugin Thii <1 • dr wiDtton ef UV ßlugb
FIGURE 7-1: Example plugin listing
Was this article helpful?