[wp-hackers] Plugin dependency checking

Shane A. Froebel shane at bugssite.org
Tue Jun 16 09:12:03 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I got some good news. While I was reading all these messages I went
ahead (and watching ID4) I created a new "class":

WP_Dependency

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.

Your Friend,
Shane

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
> http://mikeschinkel.com/custom-wordpress-plugins
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKN2HiAAoJEChMcQvNqPqmDb8P/3mAOTqkP+ooaoQE28qbryXe
PhYXz7c5MMm4qN8XHT6rZ+vk1WkBTvs+N4snNMRcS4Qo2jIodnd7+7+drAfPi1vb
LYvvc0d+w4Bet6wL0xuXauBPJkvK3KvqFL0EWDOEdzBVnCpC//zwXm/XMxxzB7pC
gjzHiVI0h3Hcf6k7pLcOiM4RBCzjmx0aaD23gWHd6gWU7VTZ6KOKb5TfwkgZ6b4C
YCgf83oRqj5t16hCVu35rjjYdcr6NRJDq9udZAWNAJkKrRFMO8L+RVO0M/ofFJTa
o04bE0YrXlsg72cw6kgfWcirCOXNxTo+9pRQ4m3vXO7LkTbrTfkQvft7pWU1qh3D
oLY4Y7+nBDOBLRybRU6mCtPf9A9gzb0Csv+AFOQq1dLeWFEjMXKyhbTj13v0xmf5
pMFomLb59I/o3w4MP+dfV+RI4XW66ufjqwhIbJ4zKOnHbR3msIiAGxdsK7O0scXK
oE83QfcoDneET+iC6vf8XhETYnjwggDIxy/gswKLy9iPlTP6OUtb19ShHlVPUtes
r+Tu6aI4mYGajzk2GMG0X874f2O3d/WyFNc4Nsvab4hLq6wm7IPoDgnmmV3sWWqi
gfusmzHIQPH/pBtCEH0B1U+dMHktiy+vOEhQQLyw/tgfbkTQVP9IEr5JDgNT72Wo
VsIW8Nx28BTQDqmTuqZm
=82Yt
-----END PGP SIGNATURE-----


More information about the wp-hackers mailing list