[wp-trac] [WordPress Trac] #11308: Handling plugin dependencies

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 2 22:04:45 UTC 2009


#11308: Handling plugin dependencies
-------------------------+--------------------------------------------------
 Reporter:  apeatling    |       Owner:  westi  
     Type:  enhancement  |      Status:  new    
 Priority:  normal       |   Milestone:  3.0    
Component:  Plugins      |     Version:         
 Severity:  normal       |    Keywords:  plugins
-------------------------+--------------------------------------------------

Comment(by filosofo):

 I think the advantages of something like this---in contrast to the
 "dependent" plugin's doing its own checking for needed functionality,
 defined classes, etc.,---are outweighed by the problems it introduces.

  * The proposed system is (by necessity) too binary: a plugin is either a
 requirement or it isn't. In contrast, plugins checking for their own
 needed functionality can disable / enable features as needed, granularly.
  * There's the difficult problem of name collisions.  The "Requires:" line
 really needs to use GUIDs.
  * The dilemma of versions with the parent plugin: if the dependency-check
 isn't aware of versions, it's not that helpful.  If it is, it becomes much
 more complicated.
  * It adds extra code and responsibility to WP to solve problems
 introduced by a minority of plugins, when those problems should and can be
 solved by the plugins themselves.

 > As it stands, users who install plugins designed for BuddyPress have to
 manually deactivate each plugin before upgrading or deactivating
 BuddyPress. They also need to make sure BuddyPress is active before
 installing a dependant plugin (many people don't and see errors).

 This is just sloppy plugin design.  At the very least, the plugin authors
 could wrap everything in a class_exists conditional for one of the core BP
 classes.


 '''My Counter-Proposal'''

 Instead of trying to sort out dependencies on the WP side of things, let's
 provide better tools for dependent plugins to use.  Some ideas:
  * Make it even simpler to add warning messages, complete with styling, to
 the admin, so plugins can say with one function call things like "you must
 have plugin X activated to use the full features of this...".
  * Allow plugins to set more easily the CSS classes on their plugin's
 plugin-page row, and have a class that has to do with partial
 functionality.  That will allow plugin authors another way to give a
 visual cue to users that their plugin needs something done before it will
 work.
  * Encourage "parent"-like plugins, such as BuddyPress, to provide action
 hooks and the like, to which dependent plugins can attach feature-
 activating callbacks (e.g. maybe {{{do_action('buddypress_init');}}} ?).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11308#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list