Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30550 closed enhancement (duplicate)

Add plugin dependency support

Reported by: section214's profile section214 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: administration Cc:

Description

With more and more large-scale projects being released, we're seeing a rise in plugin dependencies across the board. Historically, it has been the unspoken rule that plugins should fail gracefully if a dependent plugin isn't active. This has resulted in numerous ways devs are attempting to detect the existence of other plugins and handle their absence, many of which cause as many problems as the resolve. This is far from ideal.

At this point, I think that WordPress itself needs to facilitate dependency management between plugins, if not between themes and plugins. I've been prototyping an implementation which relies on the addition of a Dependencies: line to the standard theme/plugin headers in order to keep in line with WordPress standards.

As of now, it's just a hodgepodge of functions I've thrown into a simple plugin which works... but it's far from perfect. If the community as a whole agrees that this is in the best interests of furthering WordPress development, I'd like to put more serious work into developing a dependency platform that, at a later date, could be integrated into core.

Attachments (1)

Screen Shot 2014-11-29 at 7.44.34 PM.PNG (96.7 KB) - added by section214 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 follow-up: @mordauk
10 years ago

I know there are several other tickets on the topic of plugin dependencies, so it might be worthwhile merging this with those. Regardless, I'd love to see something like this:

register_plugin_requirement( $plugin_slug, $plugin_version );

I could see this being done for both required plugins and themes.

#2 in reply to: ↑ 1 @section214
10 years ago

Replying to mordauk:

I know there are several other tickets on the topic of plugin dependencies, so it might be worthwhile merging this with those. Regardless, I'd love to see something like this:

register_plugin_requirement( $plugin_slug, $plugin_version );

I could see this being done for both required plugins and themes.

Oooh.... that'd be a major change of direction from what I have so far (right now it's based on a comma-separated Dependencies: array in the header), but that'd be a cool way to do it to!

#3 @section214
10 years ago

I have an almost completely functional plugin demo written. There's a few things that are hackish due to core not having a few necessary filters (like adding the appropriate CSS classes to plugin rows) which will be a non-issue if this is accepted into core in the future, but it predominantly works...

#4 @ocean90
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #22316.

Note: See TracTickets for help on using tickets.