Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ability to update Woo.com extensions not available in WP.org plugin directory #44279

Merged
merged 82 commits into from Mar 20, 2024

Conversation

thilinah
Copy link
Contributor

@thilinah thilinah commented Feb 1, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

  • This PR removes the ability to update Woo.com hosted plugins, through WP plugin.php.
  • No auto-updates will be available for Woo.com hosted plugins.
  • The update button, on WooCommerce -> Extensions -> My Subscription, shows a modal asking the user to install Woo Update Manager if it's not installed.
  • Add an endpoint under wccom-site API for checking if the Woo Update Manager plugin is available.
  • Change the name of the Woo Connect plugin to Woo Update Manager on all the places (my-subscriptions tab / modals / plugin update notices / admin notices)
  • Add an admin notice on WC admin pages to notify the user about Woo Update Manager plugin.
  • Change the install URL structure to include the product id of the Woo Update Manager plugin.

Closes # .

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Assets for testing

Testing the removal of plugin update functionality

  1. Start the development environment pnpm -- wp-env start
  2. Visit WCCore My Subscriptions page, credentials can be found under wp-env documentation
  3. Make sure you have a Woo.com account and subscription for a product listed in WP.org and a product not listed in WP.org. I've used Square and AutomateWoo
  4. Connect your Woo.com account.
  5. Install Square extension via My Subscriptions.
  6. Notice the current version is updated.
Screenshot 2024-02-01 at 19 54 00
  1. Use pnpm -- wp-env run cli bash to change the version of the Square extension to an older version, by editing woocommerce-square.php.

  2. Notice that now an Update button is shown in for this plugin My Subscriptions

Screenshot 2024-02-01 at 19 55 39
  1. Under the WP plugins page also the update notice should be displayed.
Screenshot 2024-02-01 at 20 15 13

10 You should be able to update Square, since it's hosted in WP.org.

  1. Install AutomateWoo manually. (Woo.com auto install process won't work since the site is hosted locally).
  2. You should be able to see the current version of AutomateWoo under My Subscriptions.
Screenshot 2024-02-01 at 20 22 03 Screenshot 2024-02-01 at 20 21 07
  1. Use pnpm -- wp-env run cli bash to change the version of AutomateWoo to an older version.

  2. The WP plugin page won't display the update button, but a message to install woo marketplace plugin will be displayed to the user.

  3. But the My Subscriptions should show the update button.

Screenshot 2024-02-01 at 20 27 45

Testing Notifications

Changes to the notifications are based on what discussed in this P2: https://woomarketplace.wordpress.com/2024/02/13/woo-connect-plugin-flows-i2/

  1. Start the development environment pnpm -- wp-env start and build assets using pnpm --filter='@woocommerce/plugin-woocommerce' build
  2. Make sure your site is connected to WOO.COM.
  3. Make sure the market place plugin isn't installed and at least one of your Woo subscriptions are out dated. You can achieve this by using pnpm -- wp-env run cli bash to change the version of AutomateWoo (or another Woo.com plugin) to an older version.
  4. Visit discover extensions tab and notice the message shown to the user. (The action button links on the message aren't finalized yet).
Screenshot 2024-02-27 at 19 33 29
  1. Visit my-subscriptions tab and the same message should be displayed.
Screenshot 2024-02-27 at 19 34 17
  1. On the plugin management page a notification should be displayed asking to install Woo Connect.
Screenshot 2024-02-27 at 19 41 52
  1. When the user tried to update a connected subscription they should see the following message if Woo Connect isn't installed.
Screenshot 2024-02-27 at 19 42 52
  1. Install the Woo Update Manager plugin but keep it deactivated. Refresh my-subscriptions tab to notice that the notification has changed. Latest version of the plugin can be downloaded under Assets for Testing section at the top of the test instructions.

  2. The message should be same on discover extensions tab

  3. On the plugin management page a notification should be displayed asking to activate Woo Connect.

  4. Disconnect the store and notice the new connect message.

Screenshot 2024-02-21 at 09 41 02
  1. When the Woo Update Manager plugin isn't installed there should be WC admin notices shown on WC Admin pages such as orders, settings, reports and status.
Screenshot 2024-02-28 at 15 39 27

Testing wccom-site API status endpoint

  1. Start the development environment pnpm -- wp-env start
  2. Make sure your site is connected to WOO.COM
  3. Run these commands to find the access token for the connected site using woocommerce_helper_data option
pnpm -- wp-env run cli bash
wp shell
get_option('woocommerce_helper_data');
  1. Use the access token in the above option to replace <access_token> in the url below:
curl -X GET http://localhost:8888/index.php?rest_route=/wccom-site/v3/status&token=<access_token>&signature=1
  1. Temporarily update \WC_WCCOM_Site::verify_wccom_request function always return true;
  2. The updated CURL command in step 4 should give a successful response.
{"success":true,"data":{"wc_version":"8.7.0","woo_marketplace_plugin_active":false}}

Testing installtion URL on customer site with woocommerce.test

  1. Use this WC build under Assets for Testing section at the top of the test instructions.

  2. Add the following filter on customer mu-plugins to change installation URL to woocommerce.test

add_filter( 'woo_com_base_url', function( $base ) {
	return 'https://woocommerce.test/';
} );
  1. Notice that the installation URL generated on install notice, contains the product ID, access token and the signature.
    .

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

…ed from Woo.com

This prevents the WP core from updating Woo.com plugins.
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 1, 2024
…d from Woo.com

This prevents the WP core from updating Woo.com themes.
Copy link
Contributor

github-actions bot commented Feb 1, 2024

Test Results Summary

Commit SHA: 75cbfd2

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests309004803577m 49s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@thilinah thilinah changed the title Remove the hook for updating update_plugins transient with data fetch… Remove the ability to update Woo.com extension not available in WP.org plugin directory Feb 1, 2024
@thilinah thilinah self-assigned this Feb 5, 2024
…ing the package from Woo.com extensions.

When a Woo hosted plugin has an update, this will allow showing the update message but block the ability to update.
When a Woo.com hosted plugin has an update available it will show a message to install Woo Marketplace plugin, if it's not installed.
@thilinah thilinah changed the title Remove the ability to update Woo.com extension not available in WP.org plugin directory Remove the ability to update Woo.com extension not available in WP.org plugin directory - WIP Feb 8, 2024
@thilinah
Copy link
Contributor Author

@anaspk thanks for the review:

There is some HTML markup added to the page title.

This is fixed with 19bb02c and 41c3b3b

The red dot is missing from the "My subscriptions" tab.

I've intentionally skip this as there is no component for adding the bubble. As this is not an important indicator given the bubble on extensions menu is shown, this will be covered in another PR.

The red dot doesn't appear on WooCommerce -> Extensions menu item in the sidebar too if there are no existing updates available.

Fixed with 7681e62

@thilinah
Copy link
Contributor Author

thilinah commented Mar 14, 2024

There is just one small issue I'm describing below.
Under WC 8.6.1, when subscription for product is not connected/activated, Update now action is shown.
With this PR, it simply says "Automatic update is unavailable for this plugin" without any hint on how to resolve the issue.

Thanks for reporting this @denho. This is something that can be resolved in Woo Update Manger. I'll do some testing and add a fix to Woo Update Manager repo.

thilinah and others added 4 commits March 19, 2024 09:09
* Add wum-installed parameter to the connect URL

* Send status of Woo Update Manager installation on connection init.

* Revert "Add wum-installed parameter to the connect URL"

This reverts commit 4c55038.

---------

Co-authored-by: Denis Dvali <denis.dvali@automattic.com>
@denho denho added this to the 8.8.0 milestone Mar 20, 2024
@github-actions github-actions bot removed this from the 8.8.0 milestone Mar 20, 2024
@denho denho requested review from a team and vedanshujain and removed request for a team March 20, 2024 07:26
@lsinger lsinger merged commit d065b78 into trunk Mar 20, 2024
36 of 37 checks passed
@lsinger lsinger deleted the remove/updates-for-woo.com-extensions branch March 20, 2024 14:02
@github-actions github-actions bot added this to the 8.8.0 milestone Mar 20, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Mar 20, 2024
@juliaamosova juliaamosova added the release: highlight Issues that have a high user impact and need to be discussed/paid attention to. label Mar 20, 2024
@alopezari alopezari added needs: internal testing Indicates if the PR requires further testing conducted by Solaris status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. release: highlight Issues that have a high user impact and need to be discussed/paid attention to. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants