[wp-hackers] Plugin dependency checking

Mike Schinkel mikeschinkel at newclarity.net
Thu Jun 18 19:02:19 GMT 2009


Stephen,

Believe me, I'm with you on that preference, in general. In this case  
the reason I proposed it was I could not see how it could work  
robustly without the option for a service.

Consider the following example which now seems preposterous.  Imagine  
that you wanted to retrieve information from a website via HTTP, i.e.  
use the Twitter Search API.  To do so you hardcode the IP address of  
the Twitter Search API into your plugin.  That would be crazy right?  
Better to use the DNS system to look it up.  But of course people DID  
hardcode IP addresses into a hosts file, before the DNS system existed.

I know the analogy isn't perfect but the reason it is needed here is  
to ensure that the correct interface definition is accessed.  Since my  
whole reason for proposing interfaces is to allow multiple people to  
implement the same interface who then is authoritative for the  
interface?  Each plugin developer could hardcode a slightly different  
implementation and if two plugins with conflicting interface  
definitions were used on the same site one of them would break.  A  
registry that is primary (with local coding as a fallback) would  
ensure that everyone ends up using the same interface definitions for  
well-known public interfaces when the service is available.

I don't see how it works robustly any other way.  Depending on web  
services is not a bad thing, depending on them when they are not  
*really* needed is. At least IMO.

-Mike Schinkel
WordPress Custom Plugins
http://mikeschinkel.com/custom-wordpress-plugins/




On Jun 18, 2009, at 10:10 AM, Stephen Rider wrote:

>
> On Jun 18, 2009, at 1:22 AM, Mike Schinkel wrote:
>
>> In earlier emails on this thread we discussed how interfaces could  
>> be managed on wordpress.org with a fallback to interfaces defined  
>> locally in a plugin which fully addresses this issue. If you read  
>> back through this entire thread you can to see the direction we  
>> were headed. Without speaking for them I believe scribu and Stephen  
>> were appreciating this direction.
>
> Just for the record, I am not a fan of plugins depending on some  
> service from a web site -- wordpress.org or otherwise.*  (If it's  
> specific to the plugin -- e.g. Akismet -- fine, but not in a sense  
> general to all plugins.)
>
> So long as plugins can register interfaces locally, I'm okay with  
> the site registration being a possibility....
>
> Stephen
>
>
> * This is already an issue for me with plugins and the auto-update:  
> My plugins are not hosted on Extend, and as a result they are not  
> checked for updates -- but the WP update check implicitly says  
> "there are no updates for this plugin" by way of complete silence.
>
> -- 
> 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