Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.38k stars 1.97k forks source link

Marketplace: Global plugins install is slow and error state UX is incorrect for erroring plugins #92251

Open ebinnion opened 1 week ago

ebinnion commented 1 week ago

Quick summary

When attempting to install widont-part-deux on a site from https://wordpress.com/plugins/widont-part-deux, the installation takes quite a long time then errors out with a notice of:

An error occurred while installing Widon’t Part Deux on ebinnion69.wpcomstaging.com.

CleanShot 2024-07-01 at 12 41 11@2x

This notice is incorrect because the plugin was installed, but it couldn't be activated. This is because the plugin fatals on activation which we see when we activate the plugin from wp-admin.

CleanShot 2024-07-01 at 12 42 14@2x

Some bits of feedback to share here are:

Steps to reproduce

  1. Go to global plugins view at https://wordpress.com/plugins/widont-part-deux
  2. Install the plugin on a WoA site
  3. Observe the slow install and eventual error message
  4. Go to wp-admin and verify that the plugin did install but did not activate.

What you expected to happen

A quicker process with more correct error states.

What actually happened

As described above.

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

eoigal commented 5 days ago

I've created https://github.com/Automattic/wp-calypso/pull/92284 to update the error message to be more clear on what has happened and also update the modal state so that you can see that the plugin is installed (but not activated).

The slow response appears to be due to how the manage sites on plugins works, where it queues up auto updates each time the plugins endpoint is queried. This coupled by an issue ( p1720076625916529/1719866457.103339-slack-CDLH4C1UZ ) where the plugins that we are trying to update are on Github (not the WP.ORG repo) which means they constantly fail to update as the endpoint doesn't yet support that.

@lupus2k is working on a fix, or at least a bypass of Github plugins, to help avoid the noise from this issue.