Disabling wc-admin: Repurpose filter to remove optional features #7232
Conversation
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.
This tested well and changes look good, just wondering about one thing:
When we set the add_filter( 'woocommerce_admin_disabled', '__return_true' );
filter, should we also filter out the navigation & analytics feature options within WooCommerce > Settings > Advanced > Features?
It feels weird to still be able to toggle them, although it won't change anything because of the woocommerce_admin_disabled
being enabled.
I thought about this and agree with this. Even if the merchant toggles, it won't have an effect. What if we disable the toggle and display some sort of message to that effect? That could prevent some confusion, I will work on this today. |
cbc3c73
to
8f58e01
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.
readme.txt
Outdated
- Fix: Currency display on Orders activity card on homescreen #7181 | ||
- Fix: Report export filtering bug. #7165 | ||
- Fix: Use tab char for the CSV injection prevention. #7154 | ||
- Tweak: Revert Card component removal #7167 | ||
- Tweak: Repurpose disable wc-admin filter to remove optional features #7232 | ||
- Tweak: Revert Card component removal #7167 |
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.
This changelog is already present and can be removed, same goes for the change on line 100.
Good suggestion, I wasn't sure that was possible but you can. In d709f8c I directly edit the if ( $features_disabled ) {
$GLOBALS['hide_save_button'] = true;
} |
It would be great if there was a filter here, but I don't believe there is and AFAIK core does this the same way so I think it's the best available solution 👍 |
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.
LGTM 😄 I appreciate the extra changes @psealock, it looks and tests great 🚀
$GLOBALS['hide_save_button'] = true;
indeed feels a bit strange, but it sounds like we got Josh's approval 👍 (I double checked if the save button was still present on other pages, just incase 🤣 )
Hi Guys, Question, in the first screenshot there's an option 'Adds the new WooCommerce Navigation experience to the dashboard'. Is this the homepage, homepage menu item, inbox and the breadcrumb bar? If so why was this option dropped? and will it be brought back? We have no use for these on our stores and until today the Disable WooCommerce Bloat Plugin hid it all away and let us get straight into the orders screen. I've now got a bunch of angry people still clicking WooCommerce to refresh the orders screen and landing on the homepage. May not seem like much but it's all time that adds up. Cheers, |
Hi @bighippo999 - the experimental navigation is not the same as the homepage or breadcrumb bar. I'm not sure there ever was an option to disable those features individually; only the Because much of the code in this repo is being used by WooCommerce core (e.g., onboarding experience) blindly turning off all the code from this package could result in problems. If you have individual features you'd like to see behind feature toggles, please do open a new issue with the features you'd like to be able to toggle and we can look into putting them behind feature flags where possible. |
Thanks for the reply @joshuatf. Not the answer I was hoping for but it's an answer :) Today I've been trying to find info on what exactly the woocommerce_admin_disabled does affect. This would help to be able to list features I'd like to see behind feature toggles. Sadly it's a battle of getting through lots of info on just applying the filter to disable the new admin with very little detail of all that it affects. So I'm at a loss of building a list beyond homepage and breadcrumb bar that's the most prominent/visible for us today but I think generally I'd like to see all features have an option so that those like us who don't need/use them can turn them off without relying on 3rd party plugins to disable bits of core that may have a larger affect. I will continue to try to find more info and build a list for features toggles I'd like to see. |
…commerce/woocommerce-admin#7232) * Repurpose disable filter to remove optional features * changelog * disable feature toggles on wc-admin disabled * dedupe changelog * hide save button using
The previous attempt to remove the
woocommerce_admin_disabled
revealed some great feedback about why it was being used in #6568.This pull requests attempts to honour those use cases by turning off optional features of wc-admin which, as of now, are Navigation and Analytics. By turning off Analytics, this removes Reports, associated API's, data stores, and order processing. This allows WooCommerce to continue being a lean CMS delivering only content without including extensive reporting.
Detailed test instructions:
add_filter( 'woocommerce_admin_disabled', '__return_true' );
to an external plugin./wp-json/wc-admin/features
and confirm those features are excluded.