[wp-hackers] Plugin dependency checking
Shane A. Froebel
shane at bugssite.org
Tue Jun 16 09:12:03 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
I got some good news. While I was reading all these messages I went
ahead (and watching ID4) I created a new "class":
This class with the proper registration of the plugin when it's read
will test to see if the theme or plugin will allow you to even activate
once it's tied into the WordPress main code.
I just finished the "class" and didn't tie it into any WordPress code
code. Just a test file.
The way I have it "coded" right now is that when the plugin is even
placed in WordPress it attaches itself to the 'register' part of the
class so it can say 'Hello. I am installed and these are my dependencies
based on version of WordPress and Plugins Needed and their versions for
me to work properly.'
I am working on one more feature that was suggested on the
#wordpress-dev channel. There be a field for 'recommended' for the
plugin dependencies. A little warning would show up only saying that you
should have at least this version, but not required. Let me know what
you think about this.
I'll post the sample code on my website (bugssite.org) in later in the day.
Mike Schinkel wrote:
> "scribu" <scribu at gmail.com> wrote:
>> Yes, not using interfaces would would limit what could be done
>> with their children, but on the other hand, interfaces would
>> limit what child plugins could do themselves.
> How so? I don't see it.
> Minimally (for the proposed use in WordPress) an "interface" is simply a name that parent and child agree to offer and to use. It could be more than just a name but it would not have to be.
>> It's the same tradeoff that would happen if normal plugins would
>> have to have an interface that the core would have to check.
> I think it would be the other way around, i.e. core would implement (an) interface(s) that plugins would use. BTW, that is what already happens implicitly anyway, so we are not loosing anything by formalizing into a name.
> Let me see if I can find time to work on some examples. I think you'll "see" it more readily with code.
> -Mike Schinkel
> Custom Wordpress Plugins
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
-----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