wp-plugin-dependencies
wp-plugin-dependencies copied to clipboard
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.
- 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
- 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.
Other thoughts?
Pervious design review by @paaljoachim https://github.com/WordPress/wordpress-develop/pull/1724#issuecomment-1086731926
Walking through the current process.
I am also including my thought process.
I have made a sample plugin that has two plugin dependencies: WooCommerce and Gutenberg. Local site running Desktop Server. Alpha version of WordPress 6.0. Plugins active: Git Updater, WordPress Beta Tester and Plugin Dependencies Tab.
Uploading Sample plugin and clicking Install Now.
See the standard information on installing a plugin.

Should there be a sentence below "Plugin installed successfully" text which mentions that this plugin has dependencies? As it would be a subtile touch before the user clicks to Activate Plugin.
I click to Activate Plugin.
I see this:

It gives a non intrusive overview. One line telling that that there are dependencies (requirements) I need to deal with to be able to use the Sample plugin. There is also a very clear message in the Sample plugin description telling me that this plugin requires WooCommerce and Gutenberg.
What happens if I click Activate under the Sample plugin? Nothing happens. If I want to use the Sample plugin clicking activate does nothing (as it should). I will need to deal with the dependencies.
Clicking Go to the Dependencies install page link. I initially did not know where it would lead me. As I initially did not know where the Dependencies install page is located. Going through it I thought about "Go to the Add New Dependencies install page." But as I turned it around in my mind I end up back at the original text: Go to the Dependencies install page
After clicking it the first time and going to Add New Dependencies tab. I thought aha this seems like a good way to handle required plugins. As these are plugins that are needed to be installed for the Sample plugin to work. Having the Dependencies tab in the Add New plugins screen feels right. It creates a good association with what the Add Plugins screen is about.
EDIT 11 April (Updated the screenshot. It now shows Required by: Sample):

My conclusion from looking at the user interface flow is that it integrates tightly with the current WordPress user interface. It is non intrusive, gives the exact information needed and guides the user in how to install the required (dependencies) plugins.
The dependencies page imo needs a way to indicate the installed dependants requiring the displayed plugins
@justlevine not sure I understand. The Dependencies tab contains all the dependencies and the plugin card of each dependency tells what plugin requires it. Some of the above images were taken when the filter was not in place.

I found this single notice confusing for a few reasons:
- There’s no visual connection or information regarding which plugin has requirements. I can assume from context that it’s the plugin I just installed, but that may not always be the case.
- There’s no indication of what a dependency is or where the link will take me.
- This adds additional work for me, the user, who is simply trying to use a new plugin. I expected WordPress to reduce the number of steps needed to allow me to use my newly installed plugin.
My first thought was to clarify the notice and place it near the plugin with the requirements.
This feels more informative and helpful, but as its not at the top of the page it might be harder to see. It also could lead to a scenario with multiple notices when there are multiple plugins with missing requirements — I don’t think this scenario will be very common, so I only mention it as an edge-case.
--
Another option that came to mind was to simply list required plugins at the top of the Installed Plugins screen.

--
Its also possible that we could avoid the need for notices or extra installation steps by introducing some friction to the beginning flow. For example, perhaps we display a dialog before the flow begins.
This dialog would inform the user about the need for additional plugins and enforce installing all requirements, redirecting users to the Installed Plugins screen when complete.
The idea for a single admin notice was for simplification and not having an admin notice for each dependency, as this would quickly result in admin notice hell. 👿
The notice informs the user that there are plugin dependencies and the link takes the user to the page displaying all the plugin dependencies, what they are dependencies for, and the ability to install and activate them.
The plugins page lists both the dependencies and the requiring plugins in each appropriate plugin row.
Mixing the functions of each page, plugins.php and install-plugin.php, will be challenging. I'm not certain of the benefit, but I'm very open to discussion.
In order to something like this to happen, the plugins_api() would need to be expanded to return the contents of the Requires Plugins header for each plugin.
Thanks for the great work on this! I am new to contributing, so apologies if this is not in the proper place or format.
In my testing of this plugin and reading through some of the history, it occurred to me that the UI could be treated akin to how WordPress handles the 'Requires PHP' header (i.e. when the PHP version requirement is not met):

- No Bulk Select Option
- "Activate" link disabled ("Cannot activate" in grey text, unclickable link)
- Useful message and link for user to learn more
In the current implementation, the user can create an error either by Bulk selecting, or clicking the Activate link. This error directs them to the new Dependencies tab on plugin-install.php.
My suggestion would be to eliminate the need for the error message by removing these actions when the dependency is not met:

The Dependencies tab is a nice summary, but I think the user could be kept on plugins.php by offering them information about the plugin using a "More Details" modal borrowed from plugin-install.php. This also has the Install Now button:

Advantages
- Removes actions that could incur error (Bulk checkbox and Activate link).
- Simple inline message reduces clutter.
- Keeps user on plugins.php, no need for new Dependencies tab.
- Inline with similar WP approaches (i.e. 'Requires PHP' header).
- Simple :)
@morehawes I really like some of the above. What do you think of this?
I think that is a very good idea @afragen ! As it strengthens the message that this specific plugin has dependencies and one can quickly also see which plugins it also requires.
Good additions and subtractions, I like it.
Now in v1.1.0 https://wordpress.org/plugins/wp-plugin-dependencies/