I’m looking at adding a few more explanatory documents to the plugin guidelines; this is the first of them covering the requirements for the plugin header. When this document is finalised, I can do the one for the plugin readme.txt and then follow up with documents for the future theme guidelines.
Plugin Header Requirements
The main PHP file of a plugin must contain certain header informaiton which tells ClassicPress that i is a plugin and provides information about the plugin.
There are several fields which are required to be included in the plugin header (there is an overlap with the content of the readme.txt):
- Plugin Name (String). Name of the plugin. Should be unique.
- Plugin URI (String). The plugins home page, which should be a unique page, ideally on your own site or in the GitHub repository.
- Description (String). A short description, no more than 140 characters) of the plugin which will be displayed in the ClassicPress Admin.
- Version (String). The current version of the plugin (e.g. 1.0.3 or 2.1.1); for ClassicPres plugins the version should follow semver.
- Author (String). Name of the plugin author; multiple authors ay be listed, separated with commas.
- Author URI (String). The author's website or ClassicPress Forum profile.
There are additional fields which can optionally be included:
- Text Domain (String). The gettext text domain of the plugin. This should be unique per plugin and should be same as the one used in load_plugin_textdomain().
- Domain Path (String). The folder location of the translations; this is only required if the translations are not stored in the root of the plugin directory. For example, if .mo files are located in the languages folder then Domain Path will be "/languages/" and must have the first slash.
- Network (Boolean). "true" if the plugin is activated across all sites in an installation; this prevents the plugin being activated on a siet when Multisite is enabled. If this will not be "true" then the line should be excluded. License (String). The shortname of the applied license, such as "GPLv2 or later". All plugins submitted to the ClassicPress Plugin Directory must be licensed under the GPL. License URI (String). A link to the full text of the license, such as http://www.gnu.org/licenses/gpl-2.0.html.
This is an example of how a plugin header might look:
/* Plugin Name: My Plugin Plugin URI: https://www.example.com/plugins/my-plugin/ Description: My plugin has this functionality. Version: 1.0.0 Author: John Smith Author URI: https://www.example.com/authors/john-smith/ License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: john-smith-my-plugin Domain Path: /languages/ */