Creating the Plugin Header

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

Bigger Blogging Profits

Bigger Blogging Profits

Are You Ready to Start Writing? Times are very hard, and there is no reason to assume or imagine that things are going to improve any time soon. The world as a whole has undergone some very traumatic changes over the last few years, and the financial situation in most countries seems grim.

Get My Free Ebook


Post a comment