[wp-hackers] Plugin dependency checking
Shane A. Froebel
shane at bugssite.org
Thu Jun 18 05:33:01 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
I see a few problems with a few of examples given here and I will revise
on how my Class API works. (I have a hard-coded array right now... but I
will explain that in this email.)
1) function_exists or extension_loaded is fine and all, but I see if the
function exists in two different versions and it does TWO different
things, it would be important for the author of the plugin/theme to
define the plugin version that it was tested on. That way the result
would be the exactly the way it was.
2) Using wordpress.org would only be usefull for the current version on
the site that could be downloaded.
My code doesn't have this in yet. This is just a first draft of it
posted. I plan on posting the newest version on Saturday.
Plugin A v1.0 - Requires Plugin C v2.0+
Theme A v0.4 - Recommended Optionial Plugin B v2.5.2+, Optional B v2.3.4+
Theme B v0.5.2 - No requirements.
Plugin B v2.3.4 - No requirements. (Upgrade v2.5.2 exists)
Plugin C v1.0 - No requirements. (Upgrade v2.0 exists)
For plugin A to work, the class in theroy would not allow plugin A to be
activated. Instead it would say "under the plugin" Plugin C needs to be
upgraded to the current version. *This could be where the check on
WP.org comes in handy. Plugin A also requires Plugin C to be activated
for it to work. Current moment Plugin C is activated because it has no
Plugin A - Not Active
Plugin C - Active (Upgrade v2.0 Exists)
Theme A can be activated due to the fact it says it doesn't need Plugin
B. If it's needed for full use it asks that it be at least 2.3.4 but
recommended that it use 2.5.2+.
Theme A can be turned on.
Now Theme A has an update and it now has in it's settings (put into a
serialized array inside the options/meta table that it requires Plugin B
AND Plugin C at their most current versions.
That's just a sample example of what we can do. Theme's could have a
check inside their code checks to see if a version exists. But I don't
think that would be needed. The class could even activate plugins
forcefully if they are required to run, though a setting could override
Off to bed....
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers