Plugin Header Requirements

Plugin Header Requirements

The main PHP file of a plugin is the one that contains certain header information which tells ClassicPress that it is a plugin, and provides information about the plugin. ClassicPress only supports plugin files in the base plugins directory (wp-content/plugins) and in one directory below the plugins directory (wp-content/plugins/my-plugin). The file it looks for has the plugin data and must be found in one of those two locations.

The plugin file and plugin folder should have the same name, although this is not a technical requirement.

There is only one field which is technically required to be included in the plugin header:
The Plugin Name
However there are several optional, but recommended fields. All plugin data must be on its own line. For plugin description, it must not have any newlines.

Header Fields

Plugin Name: (required) The name of your plugin, which will be displayed in the Plugins list in the WordPress Admin. It should be unique.
Plugin URI: The home page of the plugin, which should be a unique URL, preferably on your own website. This must be unique to your plugin. You cannot use a WordPress.org or ClassicPress.net URL here.
Description: A short description of the plugin, as displayed in the Plugins section in the WordPress Admin. Keep this description to fewer than 140 characters.
Version: The current version of the plugin (e.g. 1.0.3 or 2.1.1); for ClassicPress plugins the version should follow semantic versioning.
Requires at least: The lowest WordPress version that the plugin will work on.
    Note: this field only works if the plugin is stored on the WordPress Repository.
    Note 2: if set, the version should be no higher than 4.9.15
Requires PHP: The minimum required PHP version.
    Note: this field only works if the plugin is stored on the WordPress Repository.
Author: The name of the plugin author. Multiple authors may be listed using commas.
Author URI: The author’s website or profile on another website, such as WordPress.org or ClassicPress Forum Profile.
License: The short name (slug) of the plugin’s license (e.g. GPLv2). All plugins submitted to the ClassicPress Plugin Directory must be licensed under a GPL license or have a GPL compatible license.
License URI: A link to the full text of the license, such as http://www.gnu.org/licenses/gpl-2.0.html.
Text Domain: 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: The folder location of the translations; this is only useful if the translations are in a folder above the plugin’s base path. For example, if .mo files are located in the languages folder then Domain Path will be “/languages/” and must have the first slash.
Network: Whether the plugin can only be activated network-wide. Can only be set to true, and should be left out when not needed.

This is an example of a properly formatted Plugin Header:

/**
 * Plugin Name:       My Basics Plugin
 * Plugin URI:        https://example.com/plugins/the-basics/
 * Description:       Handle the basics with this plugin.
 * Version:           1.10.3
 * Requires at least: 4.9.15
 * Requires PHP:      7.2
 * Author:            John Smith
 * Author URI:        https://author.example.com/
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       my-basics-plugin
 * Domain Path:       /languages
 */