WordPress.org

Ready to get started?Download WordPress

Forums

Plugin Dependencies
[resolved] Plugin Dependencies (8 posts)

  1. elyobo
    Member
    Posted 2 years ago #

    One potentially useful feature for plugin dependencies would be to support conflicting plugins, e.g. plugin X can be enabled or plugin Y can be enabled, but not both. In the dependency sense, plugin X requires not plugin Y and vice versa.

    A related concept could be applied to normal dependencies, where plugin X requires either plugin Y or plugin Z.

    http://wordpress.org/extend/plugins/plugin-dependencies/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, this is already possible with the development version, by using the "Provides:" header.

  3. elyobo
    Member
    Posted 2 years ago #

    Sounds great, are there docs for the headers somewhere? I take it that Provides: would implement the second feature, is there anything that implements the conflicting feature?

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    No docs yet, since it's a development version. I should try to release it though, as it's basically done.

  5. RichardWPG
    Member
    Posted 2 years ago #

    It will be great to be able to try it out

  6. scribu
    Member
    Plugin Author

    Posted 2 years ago #

  7. elyobo
    Member
    Posted 2 years ago #

    Only come across one issue so far, line 164 in plugin-dependencies.php doesn't check that the array index exists before using it, throwing out a pile of notices for those that aren't suppressing them. This then blocks the redirect header so we get a pile of notices on screen and nothing else.

    Simple fix, either suppress errors or check first, e.g.

    $deps = @self::$dependencies[ $dep ];

    or

    $deps = isset(self::$dependencies[ $dep ]) ? self::$dependencies[ $dep ] : array();

  8. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    That shouldn't happen. Please paste the error messages and the header of the plugin(s) that are causing them.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic