wp-plugin-dependencies icon indicating copy to clipboard operation
wp-plugin-dependencies copied to clipboard

Design: Dependency installation

Open afragen opened this issue 3 years ago • 13 comments

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.

afragen avatar Mar 08 '22 00:03 afragen

Other thoughts?

afragen avatar Mar 08 '22 01:03 afragen

Pervious design review by @paaljoachim https://github.com/WordPress/wordpress-develop/pull/1724#issuecomment-1086731926

afragen avatar Apr 04 '22 01:04 afragen

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. Screenshot 2022-04-04 at 09 20 49

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: Screenshot 2022-04-04 at 09 23 51

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): Screenshot 2022-04-11 at 16 53 32

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.

paaljoachim avatar Apr 04 '22 08:04 paaljoachim

The dependencies page imo needs a way to indicate the installed dependants requiring the displayed plugins

justlevine avatar Apr 09 '22 22:04 justlevine

@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.

screenshot-2

afragen avatar Apr 09 '22 22:04 afragen

image

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.

image

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.

image

--

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.

image

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.

shaunandrews avatar May 27 '22 17:05 shaunandrews

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.

afragen avatar May 27 '22 18:05 afragen

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.

afragen avatar May 27 '22 19:05 afragen

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):

wp-php-requirement

  • 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:

wp-plugin-requirement

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:

wp-plugin-info

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 avatar Jun 01 '22 04:06 morehawes

@morehawes I really like some of the above. What do you think of this?

screenshot_177

afragen avatar Jun 02 '22 05:06 afragen

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.

paaljoachim avatar Jun 02 '22 13:06 paaljoachim

Good additions and subtractions, I like it.

morehawes avatar Jun 02 '22 18:06 morehawes

Now in v1.1.0 https://wordpress.org/plugins/wp-plugin-dependencies/

afragen avatar Jun 02 '22 20:06 afragen