Automattic / wp-calypso

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

UX Improvement: Prevent users from purchasing redundant plugins Sensei Pro and Sensei Pro (WC Paid Courses) #76033

Open masperber opened 1 year ago

masperber commented 1 year ago

Quick summary

Sensei Pro may be purchased from the WordPress.com plugin marketplace. Sensei Pro (WC Paid Courses) may be purchased from the WooCommerce marketplace.

These two are the same plugin, but they are named differently and the purchases are priced differently.

It is possible for a customer to purchase both products separately, and if they do, it will create a critical error on the website because the two identical plugins will conflict with each other.

We should find a way to prevent a customer from purchasing one of these products if the other is already owned.

Steps to reproduce

  1. Create a new plugin-enabled website.
  2. Purchase and install Sensei Pro
  3. Purchase and install Sensei Pro (WC Paid Courses)

What you expected to happen

  1. The customer should not be able to make a duplicate purchase.
  2. One plugin should not be installed if the other is present.

What actually happened

The customer was able to make a duplicate purchase, and both plugins installed, creating a critical error.

Impact

All

Available workarounds?

No and the platform is unusable

Platform (Simple and/or Atomic)

Atomic, Self-hosted

Logs or notes

No response

cuemarie commented 1 year ago

I believe this is the same underlying issue as https://github.com/Automattic/wp-calypso/issues/74493 ; from the latest comment there:

I've checked this a bit and it looks like the expected behavior here is if there is more than one of the plugins among Sensei Pro (WC Paid Courses), Sensei Pro, and Sensei Interactive Blocks are installed, only one of them should be enabled at a time.

There is code in place to enforce the aforementioned behavior, that only one is allowed to be activated. But for some reason it's not enforcing it. I've added this issue to our Janitorial board and we'll look into why that's happening.

masperber commented 1 year ago

Yes, but there is a bit more to this as well because the customer can actually make the same purchase twice. I think we need to take steps to prevent that.

cuemarie commented 1 year ago

@masperber Gotcha, that makes sense!

@aaronfc or @Imran92 pinging y'all since this is related to https://github.com/Automattic/wp-calypso/issues/74493

šŸ“Œ ACTIONS

šŸ“Œ Message to Devs

cpapazoglou commented 1 year ago

Plugins Sensei Pro and WC Paid Courses have different slug. Meaning that we would need to hardcode the mapping between those to create such an exception.

Even if we create that kind of mapping in WP.com and block the purchase through WordPress.com when user has already installed the other version, we won't be able to block the purchase through WooCommerce.com since the purchases there are not initiated from a specific site.

What we need to do:

  1. Resolve the fatal error https://github.com/Automattic/wp-calypso/issues/74493
  2. Investigate why the user ended up buying the plugin a second time and try fix the UX there.
cuemarie commented 1 year ago

Given the next steps advised by @cpapazoglou , looks like the main focus should be on https://github.com/Automattic/wp-calypso/issues/74493 , and we can leave this open for investigating the UX (part 2 of the suggestions above) as time allows.

šŸ“Œ ACTIONS