WordPress Feature Project: Plugin Dependencies

Overview

WordPress Feature Project: Plugin Dependencies

  • Contributors: afragen, costdev
  • Description: Parses 'Requires Plugins' header, add plugin install dependencies tab, and information about dependencies.
  • License: MIT
  • Network: true
  • Requires at least: 5.2
  • Requires PHP: 5.6
  • Stable tag: trunk

Descripton

Parses a 'Requires Plugins' header and adds a Dependencies tab in the plugin install page. If a requiring plugin does not have all it's dependencies installed and active, it will not activate.

My solution to #22316. Feature plugin version of PR #1724

  • Parses the Requires Plugins header that defines plugin dependencies using a comma separated list of wp.org slugs.

  • Displays a single admin notice with link to Plugins > Add New > Dependencies if not all plugin dependencies have been installed.

  • Adds a new view/tab to plugins install page ( Plugins > Add New ) titled Dependencies that contains plugin cards for all plugin dependencies.

  • This view also lists which plugins require which plugin dependencies in the plugin card, though that feature requires the filter below to function. 😅

  • In the plugins page, a dependent plugin is unable to be deleted or deactivated if the requiring plugin is active.

  • Plugin dependencies can be deactivated or deleted if the requiring plugin is not active.

  • Messaging in the plugin row description is inserted; as is data noting which plugins require the dependency.

  • If the dependency API data is not available a generic plugin card will be displayed in the Dependencies tab.

  • Ensures that plugins with unmet dependencies cannot be activated.

FAQ

Make post for Plugin Dependencies Feature Project

Phase 1 - Architecture & Design Discussion

Discussion of architecture and design elements and features. This will be done via issues.

Please review them, comment on them, and create new issues.

Phase 2 - Actual code review

If you are more comfortable looking at actual code, below are the 2 PRs currently available for #22316. Please comment on the trac ticket.

Implement WP admin UI for plugin dependencies PR #1547

Plugin Dependencies Tab PR #1724

Currently the above PRs have been closed.

Comments
  • PRO and non PRO plugins as dependencies

    PRO and non PRO plugins as dependencies

    Try to allow for dependencies that may come in a non-premium or a premium plugin.

    Possibly use a filter from the premium plugin to remove the non-premium slug as a dependency and insert itself.

    enhancement 
    opened by afragen 16
  • Filter dependency list for versioning

    Filter dependency list for versioning

    I simple thought occurred to me as reflecting on how we'd use this in GiveWP. We currently, and will continue to, do version checking when someone installs one of our add-ons — we need to make sure it's compatible with the version of core installed.

    I understand that versioning is out of the scope of this, which is fine. What would be useful would be to have the ability to filter the plugin names as they appear in the dependency lists. Even if it's not functionally doing anything, being able to have the dependency appear as "GiveWP 2.21.4" instead of just "GiveWP" — as a subtle communication to the user.

    opened by JasonTheAdams 6
  • Bulk select checkbox removed when dependencies inactive

    Bulk select checkbox removed when dependencies inactive

    When a plugin that has dependencies is active, currently the bulk select checkbox is always removed.

    I believe this should only be the case if other plugins that depend on it are active (as is the case with the "Deactivate" link):

    Screenshot 2022-06-07 at 1 50 00 PM
    opened by morehawes 6
  • Use sprintf for concatenating strings

    Use sprintf for concatenating strings

    https://github.com/WordPress/wp-plugin-dependencies/blob/cda4a6a96edb98e64cfc0615f0a96321c55d547f/wp-admin/includes/class-wp-plugin-dependencies.php#L319

    While translating on translate.wordpress.org I noted an issue with one string. It should be:

    $string = sprintf(
        /* translators: 1: Opening <strong>-tag, 2: Closing <strong>-tag, 3: List of dependent plugins. */
        esc_html__( '%$1sRequired by:%$2s %$3s' ),
        '<strong>,
        '</strong>',
        esc_html( $sources )
    );
    

    Cheers!

    opened by kebbet 5
  • Add a plugin header data

    Add a plugin header data

    Hello,

    This is a really great idea, thanks for it.

    I think adding a plugin header information like "Depedencies:" should be a great idea for plugins which are requiring dependency.

    If your plugin installed or one it will be in Core, WordPress or your plugin will parse the plugin header like it's done today and be able to add the required plugins to the mechanism.

    opened by sebastienserre 3
  • Change deactivated notice

    Change deactivated notice

    This admin notice better reflects what has occurred: some plugins had to be deactivated because their dependencies are now unmet.

    The reason being that their dependencies were deleted, which WordPress lists as separate admin notices below.

    opened by morehawes 3
  • Unmet Dependencies Simplification

    Unmet Dependencies Simplification

    Currently the admin_notices() method contains the message:

    "... plugin(s) could not be activated. There are uninstalled or inactive dependencies. Go to the Dependencies install page."

    However because the UI helpfully:

    1. Does not allow you to Activate a plugin if if it has unmet dependencies
    2. Does not allow you to Deactivate a plugin with active dependencies

    This message currently does not see the light of day.

    This makes me think that not only could this notice be removed, but also the deactivate_unmet_dependencies() method (and the need for the wp_plugin_dependencies_deactivate_plugins transient).

    I can see that in the future there may be circumstances where you may require this logic (activating/deactivating plugins through the WP-CLI for example), but removing unused complexity at this stage seems like a good idea.

    Or perhaps I am missing something?

    opened by morehawes 2
  • Notice in admin section does not make much sense for some users

    Notice in admin section does not make much sense for some users

    If there are plugins with unmet dependencies, a notice is displayed in the admin section that says: "There are additional plugins that must be installed. Go to the Dependencies install page."

    notice

    This notice is displayed even for users who do not have the capability to install plugins. For example, the notice is displayed even for users with the Subscriber role. The notice does not make much sense for such users because they can't actually do anything that the notice suggests. If they click on the "Dependencies" link, they just get a page with an error message (which is to be expected, because they do not have the required capability).

    I think it would be better to do either of the following:

    1. I think it would be best simply to not display the notice at all if the user does not have the capability to install plugins.
    2. If you still want to display a notice to such users, it would be best to reword it (for those users) to something like "There are additional plugins that must be installed. Please notify the site administrator." This is similar to the wording currently used in WordPress core when there is an update available.
    opened by siliconforks 1
  • Docs: get_requires_plugins_names()

    Docs: get_requires_plugins_names()

    /**
    * Get names of required plugins.
    *
    * @param array $data Array of plugin or theme data.
    *
    * @return string
    */
    private function get_requires_plugins_names( $data ) {
    

    The parameter is a string not an array. Should we name it $plugin_file?

    opened by Soean 1
  • Update Screenshots

    Update Screenshots

    • Update screenshots to reflect current release UI
    • Removes Hello Dolly from screenshots (see below)

    I noticed that unlike the screenshot-1 shows, in the case of Hello Dolly the modify_plugin_row action does not actually do anything; due to the fact that unlike the code expects, the plugin is is not contained within a directory (i.e. it lives in plugins/hello.php).

    I realise that this is a weird edge case, but as it is not a true reflection of the current release I thought it might be best removed from the screenshots.

    opened by morehawes 1
  • Use correct header in plugin description.

    Use correct header in plugin description.

    Minor text tweak. The plugin description states "Parses 'Requires Plugin' header", which is not the correct header. This changes the text to be "Parses 'Requires Plugins' header".

    opened by morehawes 1
  • Installing dependency from modal on plugin page should refresh plugins list

    Installing dependency from modal on plugin page should refresh plugins list

    Instructions

    1. Install a plugin with a dependency
    2. On Plugins > Installed Plugins, click the link of a dependent plugin in the "Requires: {Plugin}" list
    3. Click "Install Now" in the modal to install the plugin

    Actual Outcome

    The dependent plugin is installed but the plugin is not listed in the list of plugins until the page is refreshed

    Expected Outcome

    The dependent plugin is listed in the list of plugins and the plugin with dependencies has its options updated to reflect the installed dependency

    opened by mrwweb 2
  • Common Libraries

    Common Libraries

    There are effectively two types of plugin that I can think of that has dependencies

    1. addon plugins - for example a plugin that adds features to WooCommerce

    2. plugins that use other plugins as libraries, e,g, using CMB2

    I want to talk about type 2.

    I think that 'new 'plugins submitted as frameworks or libraries are no longer acceptable / frowned up

    What many plugins do is include third party open source libraries, indeed this is possible with CMB2, but there are many other libraries such as the Stripe PHP SDK in common use.

    What this then means each plugin loads their own copy of the libraries and unless they are specifically designed for WP this can result in conflicts ( e.g. different versions of the Stripe PHP SDK are not compatible - so require them to be re-namespaced to avoid conflict ).

    What I think would be a good idea is to have curated set of the most common third party libraries and a WordPress driven autoloading subsystem for these so only the library is loaded.

    I do realise this changes a dynamic of plugin in that they currently only have to use WP core libraries and introducing third party libraries starts to get complex in terms impact of change, however today we have the issue of 'plugin conflicts' Also a security fix to a common third party library can be done once rather than chasing say 1,000 developers.

    That is my thoughts so wanted to at least bring it up here.

    opened by alanef 7
  • Micro-Vertical solution Packages

    Micro-Vertical solution Packages

    I'm really passionate about the idea that some of the most shining genius in the WordPress community lies with 'builders' who don't necessarily write plugins and extensions, but they have a good handle on which ones do the one thing really well. I could imagine a way to build a plugin which would act as a solution manager to provide a solution package to micro-veritical problems.

    I don't know if that makes sense, but sometimes the right solution is the combination of other solutions. To me, that is the beauty of open source in a sense...like a pantry of ingredients. The chef isn't growing the vegetables and herbs, but he certainly knows how to cook a great meal.

    I know there is no discussion of including a theme here, but can themes require plugins? I'm just rubber ducking, but my solution for charter boat captains is theme + plugins + other plugins = a whole solution. Anyway, just wanted to start that conversation as we consider how we consider creating elegant solutions to real world challenges :)

    opened by megphillips91 2
  • Mechanism vs. Communication

    Mechanism vs. Communication

    Maybe we could tackle this in two parts and benefit in two ways.

    Two Parts:

    • how do we accomplish requiring plugins from plugin code? (the mechanism)
    • how do we communicate to the site administrator and provide freedom of choice? (the communication)

    Two Benefits:

    • we could encapsulate the solutions with better separation of concerns
    • we could establish and seek more partners across the community who are already working on the communication vehicle and therein make the solution more 'future proof'

    Just a suggestion :)

    opened by megphillips91 7
  • Architecture: Interaction with non-dot org plugins as dependencies

    Architecture: Interaction with non-dot org plugins as dependencies

    Adding this as it came up often in the discussion on the Make Post

    While this is probably out of scope, I can say that just using my PR it is possible to to include plugins not hosted in the WordPress.org repository simply using existing core filters and adding the slug in the Requires Plugins header.

    screenshot_154
    opened by afragen 4
  • Design: Dependency installation

    Design: Dependency installation

    How do we want to display and install these plugin dependencies? Each of the PRs has opinions about how this should happen.

    1. Each plugin dependency admin notice has a link to install the plugin.
    • non-standard method of plugin installation
    • No clear way to view additional information about the dependency
    1. A distinct view/tab in the Plugin Install page showing all the plugin dependencies as plugin cards. This gives the advantage of being able to display more Information about the dependency as well as install/activate the plugin from the familiar core method.
    • Having a tab in the Plugin Install page offers an easy method to show all the actual dependencies and their installation/activation status.
    opened by afragen 13
Releases(1.7.2)
This composer plugin is a temporary implementation of using symbolic links to local packages as dependencies to allow a parallel work process

Composer symlinker A Composer plugin to install packages as local symbolic links. This plugin is a temporary implementation of using symbolic links to

Pierre Cassat 18 Nov 9, 2021
Plugin for composer to apply patches onto dependencies.

composer-patches-plugin This plugin allows you to provide patches for any package from any package. If you don't want a patch package outside the root

Netresearch 75 Aug 7, 2022
Composer bin plugin — Isolate your bin dependencies

Composer bin plugin — Isolate your bin dependencies Table of Contents Why? How does this plugin work? Installation Usage Example The all bin namespace

Bilal Amarni 394 Jan 7, 2023
Api.video-wordpress-plugin - The official api.video plugin for WordPress

api.video WordPress Plugin api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managin

api.video 5 Oct 19, 2022
Contracts for Rule Doc Generator. Useful for production code with minimum dependencies.

Rule Doc Generator Contracts Contracts for Rule Doc Generator. Useful for production code with minimum dependencies. Install composer require symplify

null 19 Dec 22, 2022
Docker-magento2 - 🐳 Docker containers with all required Magento 2 dependencies installed available as FPM through Nginx and CLI

Magento 2 Docker A collection of Docker images for running Magento 2 through nginx and on the command line. Quick Start cp composer.env.sample compose

Meanbee 454 Dec 27, 2022
Roach-example-project - Example project to demonstrate how to use RoachPHP in a Laravel project.

Example repository to illustrate how to use roach-php/laravel in a Laravel app. Check app/Spiders/FussballdatenSpider.php for an example spider that c

Kai Sassnowski 11 Dec 15, 2022
A PHP implementation of the Unleash protocol aka Feature Flags in GitLab.

A PHP implementation of the Unleash protocol aka Feature Flags in GitLab. This implementation conforms to the official Unleash standards and implement

Dominik Chrástecký 2 Aug 18, 2021
Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.

Switchover Laravel Integration Switchover Switchover is a Software-As-A-Service for managing feature toggles (aka switches, flags or feature flips) in

Switchover 6 Nov 6, 2022
Build lightning-fast and feature-rich websites with ProcessWire.

WIREKIT Core Build lightning-fast and feature-rich websites with ProcessWire. Website: wirekit.dev (in plans) Demo: start.wirekit.dev/core/ Updates: W

Ivan Milincic 10 Nov 3, 2022
This package is considered feature-complete, and is now in security-only maintenance mode

laminas-soap This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Laminas Project 46 Dec 18, 2022
EmoteSimple is a Feature or API for PocketMine-MP 4.0+

EmoteSimple EmoteSimple is a Feature or API for PocketMine-MP 4.0+ Permission This feature next update.. Support You can use minecraft bedrock profile

Ibenrm 4 Nov 24, 2022
Issue trackers, feature requests, and translation for all of my NamelessMC products

NamelessMC Products In this repository you can find current issues for each of my NamelessMC products, progress on solving them, feature requests, and

Coldfire 1 Mar 25, 2022
⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

Brad Parbs 13 Oct 6, 2022
Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP ?? Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

Waren Gonzaga 8 Dec 19, 2022
A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.

GitScrum Plugin for Wordpress A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress. GitS

GitScrum 4 Nov 30, 2022
A plugin manager for PocketMine-MP downloads plugin from PocketMine-MP official plugin repository

oh-my-pmmp A plugin manager for PocketMine-MP Getting Started Prerequisites Your server MUST RUN the latest version of PocketMine. Installation From P

thebigcrafter 6 Jan 4, 2023
Integrates the ClassicPress Plugin Directory and any plugin stored in GitHub (tagged with classicpress-plugin) in the ClassicPress Admin

ClassicPress Plugin Directory Adds a new screen in a ClassicPress Install where you can browse, install, activate, deactivate, update, delete and pagi

TukuToi 3 Dec 27, 2022