[wp-hackers] Plugin dependency checking
Mike Schinkel
mikeschinkel at newclarity.net
Fri Jun 12 00:19:34 GMT 2009
Not sure I like either #1 or #2. What about a #3?
Use the URL "slug" from WordPress.org extend for those hosted and allow those not hosted on WordPress.org to define their own slug via another header?
-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins
----- Original Message -----
From: "Stephen Rider" <wp-hackers at striderweb.com>
To: wp-hackers at lists.automattic.com
Sent: Thursday, June 11, 2009 5:57:56 PM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Plugin dependency checking
On Jun 11, 2009, at 3:00 PM, scribu wrote:
> A new field in the plugin header would be nice:
>
> /*
> Plugin Name: My Plugin
> Depends On: Spam Karma, scbFramework
> */
>
> WP would check if each plugin in the list is installed and active
> and takes
> care of the loading order.
Two possibilities:
1) You can make a sub plugin for a plugin that registers itself as
"sub-able". Then you could do a header like your example.
2) otherwise you do a header like this:
Depends On: spam-karma/spam_karma_plugin.php
Both 1 and 2 should work. WordPress strongly follows a pattern like
#1, but #2 would allow for more flexibility I think. I can certainly
imagine making a plugin that depends on another, even if the author of
that other plugin doesn't anticipate that....
**
ALSO: Scribu -- I will definitely have to keep in mind your example,
and the possibility that a plugin might be dependent on ***more than
one*** other plugin. In that situation the strict "sub plugin"
concept doesn't quite work. I think what I could do is set up the
"dependency' system, and on top of that would be a second layer
implementing the "sub plugin" idea. The dependency part is universal,
while the sub-plugin part really only affects how it appears under the
Manage Plugins page.
That is, a sub-plugin is a special kind of dependent plugin.
In terms of interface, sub-plugins would fall under the collapsable
area under their Master plugin. Simply dependent plugins would look
like regular plugins on the list.
**
What happens when I activate a dependent plugin and the master plugin
is not active? Automatically activate the master also? Or give a
"you can't do that" message?
**
ONE LAST THING: You would have to be able to specify a minimum
*version* of the master plugin. "Depends on Spam Karma v2.0". Don't
want to run a plugin that needs v2.0 of another one, when v1.3 of that
other is installed.
Stephen
--
Stephen Rider
http://striderweb.com/
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list