WordPress recently introduced Plugin Dependencies "to make the process of installing/activating add-ons (dependents) and the plugins they rely on (dependencies) consistent and easy to use."
This is also mentioned in the article that:
"The feature does not intend to replace the need for defensive coding within dependent plugins, or ensure version compatibility with their dependencies; nor does it seek to mitigate the vast array of potential plugin interactions.".
"A plugin’s dependencies can be declared by the use of a new Requires Plugins header in the dependent plugin’s main file. This must contain a comma-separated list of WordPress.org slugs for its dependencies, such as jetpack (jetpack/jetpack.php is not supported)."
"Defining plugins not hosted on WordPress.org as dependencies will enforce and display the dependencies to the user. However, there will be no ability to install the missing plugins through the UI changes, and these will need to be installed manually."
Declaring a plugin dependency for the Bridge plugin, dependent on Foo and Bar, places the following requirements:
Bridge can only be installed once Foo and Bar have been installed.
Bridge can only be activated once Foo and Bar have been activated.
Foo and Bar can only be deactivated once Bridge has been deactivated.
Foo and Bar can only be deleted once Bridge has been deleted.
This is how it'll appear in the plugin repository:
WordPress recently introduced Plugin Dependencies "to make the process of installing/activating add-ons (dependents) and the plugins they rely on (dependencies) consistent and easy to use."
This is also mentioned in the article that: "The feature does not intend to replace the need for defensive coding within dependent plugins, or ensure version compatibility with their dependencies; nor does it seek to mitigate the vast array of potential plugin interactions.".
"A plugin’s dependencies can be declared by the use of a new
Requires Plugins
header in the dependent plugin’s main file. This must contain a comma-separated list of WordPress.org slugs for its dependencies, such as jetpack (jetpack/jetpack.php is not supported).""Defining plugins not hosted on WordPress.org as dependencies will enforce and display the dependencies to the user. However, there will be no ability to install the missing plugins through the UI changes, and these will need to be installed manually."
Declaring a plugin dependency for the Bridge plugin, dependent on Foo and Bar, places the following requirements:
This is how it'll appear in the plugin repository:
This is how it'll appear in "Installed plugins":