Brolga & Swan

SEO Services & More

WordPress Plugin and Theme Headers

Plugins

Whatever the type of plugin, WordPress looks for, and requires, a header comment in the php. A reasonably complete version is:

<?php /* Author: Author URI: Description: Domain Path: Network: Plugin Name: Plugin URI: Site Wide Only: (deprecated in favor of Network) Text Domain: Version: */ ?>

Note the caveat on the above of: reasonably complete. The above is, to quote WordPress:

"... the current concrete File Header default implementation (02 Jun 2010). Headers can be extended, so this is a subset, not the superset."
A more typical example is:

<?php /* Plugin Name: Name Of The Plugin Plugin URI: https://URI_Of_Page_Describing_Plugin_and_Updates Description: A brief description of the Plugin that appears on WordPress installations admin pages. Version: The Plugin's Version Number, e.g.: 1.0 Author: Name Of The Plugin Author Author URI: https://URI_Of_The_Plugin_Author License: A "Slug" license name e.g. GPL2 */ ?>

Whilst the bare minimum needed is the name of the plugin on its own comment line. This, in the context of the file's location, is what WordPress uses to identify the code as a plugin and then present it on the admin page. For example:

<?php /* Plugin Name: My Simple Plugin */ // plugin code ?>

Try It Yourself - put the above code into a file of any name with the extension .php and put that into the plugins directory of your WordPress installation. In the admin plugins page there will now be a plugin My Simple Plugin which you can activate, deactivate and delete - don't worry, it won't do anything.

When you've finished, feel free to throw the above file away.

Themes

a work in progress ... TBC