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
Omit WooCommerce plugin from the list of Woo extensions in Helper #40549
Conversation
Test Results SummaryCommit SHA: 9bcef3a
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. |
|
Hi @Dan-Q, @jonathansadowski, @xristos3490, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
ceafa7d
to
552e22a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Re-adding the woocommerce_show_addons_page hook can assist WX and other third-party developers who were previously using this filter!
Added a minor comment! Pre-approving!
| if ( apply_filters( 'woocommerce_show_addons_page', true ) ) { | ||
| if ( FeaturesUtil::feature_is_enabled( 'marketplace' ) ) { | ||
| $container = wc_get_container(); | ||
| $container->get( Marketplace::class ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://github.com/woocommerce/woocommerce/blob/32e01a21f2b7c5a0b9cfa87b9d75488594dd8b91/plugins/woocommerce/includes/README.md#interacting-with-the-src-folder, it's the new way of getting an instance of a class from the src folder.
f08ff21
to
780a3f1
Compare
…ist of Woo extensions. The Woo release team uses this product to distribute the Woo AF release (pcShBQ-14K). Restored `woocommerce_show_addons_page` filter, which is used to add or not add the Extensions menu item. Changed the method we use to hide the extra Extensions submenu item we add to WooCommerce as a temporary measure, to ensure the My Subscriptions page still works. Using the superior `hide_submenu_page` method borrowed from Jetpack.
780a3f1
to
db8dede
Compare
Submission Review Guidelines:
Changes proposed in this Pull Request:
p1696252501678409-slack-C03Q87XT1QF
woocommerce_show_addons_pageto hide the current addons page. The filter was removed in an earlier PR. This PR restores it: if the filter returns false, we won't add the addons page.Woo:header in the bootstrap file. This means that Helper identifies it as a Woo extension. It's then listed as a plugin which doesn't have a corresponding WooCommerce.com subscription. To hide it in the Helper list, I've added a condition which omits the plugin if (1) it has aWoo:header (2) its name isWooCommerce.How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Reproducing the problem
wp-envenvironment, create a JN or other test WordPress site and install a WooCommerce weekly release like this one:woocommerce-8.2.0.2.zip (You can also download this from https://woocommerce.com/my-account/downloads/: it's listed as
WooCommerce (weekly release).)wp-admin/admin.php?page=wc-addons&path§ion=helperand connect your test site to your WooCommerce.com account, by clicking on the "Connect" button in the screen shown below. When connected, the page will refresh to show a list of your Woo extensions. Notice that WooCommerce is listed as a "Woo extension" without a subscription, like in the other screenshot below.Testing the fix for the WooCommerce plugin
plugins/woocommerce/bin/build-zip.shto skip that step:plugins/woocommerce/woocommerce.phpand add theWooheader* Woo: 18734002369816:624a1b9ba2fe66bb06d84bcdd401c6a6to the plugin header. The header should look like this. (Don't worry about the version number, it's isn't important here.)cd plugins/woocommerce && ./bin/build-zip.sh.plugins/woocommerceto your test site and enable the plugin.Testing the hidden submenu item
Inspect the HTML after the Extensions submenu item in the WooCommerce menu. There should be a hidden item with the
hide-if-jsclass.If you don't see this item, with the new marketplace UI, enable the
Marketplacefeature inWooCommerce > Settings > Advanced > Features.Changelog entry
Significance
Type
Message
Adds condition to ensure WooCommerce is not listed as a Woo extension in the Helper list. Restores the
woocommerce_show_addons_pagefilter as a means of controlling whether the addons page is added as a WooCommerce submenu item. Hides a temporary extra addons submenu item using a better method borrowed from Jetpack.Comment
Screenshots