WordPress.org

Plugin Directory

Plugin Dependencies

Plugin dependency management

Error on activation: "Parse error: syntax error, unexpected..."

Make sure your host is running PHP 5. The only foolproof way to do this is to add this line to wp-config.php (after the opening <?php tag):

var_dump(PHP_VERSION);

What happens if a user doesn't have Plugin Dependencies installed?

Nothing. The Depends: header will simply be ignored.

Can I have grand-child plugins?

Yes, the dependency chain can go as deep as you want.

Defining virtual packages

Say you have some useful functions that you would like to package up as a library plugin:

/*
Plugin Name: Facebook Lib
Provides: lib-facebook
*/

Now, dependant plugins can specify 'lib-facebook' as a dependency:

/*
Plugin Name: Cool Facebook Plugin
Depends: lib-facebook
*/

Besides being more robust, the Provides: header allows multiple plugins to implement the same set of functionality and be used interchangeably.

Requires: 3.1 or higher
Compatible up to: 4.0.7
Last Updated: 2014-11-13
Active Installs: 500+

Ratings

5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
33,3,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1