Subscriptions: stop loading subscribe block and panels when module disabled
Subscriptions: stops loading editor functionality (i.e. the block and panels) when subscriptions module is disabled.
Resolves https://github.com/Automattic/jetpack/issues/39800
Proposed changes:
- Dont'load the JS code at all when module is disabled
- Remove "enable module" nudges from JS since those aren't loaded anymore
Other information:
- [ ] Have you written new tests for your changes, if applicable?
- [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?
- [ ] Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
- Block and panels work when subscriptions module is enabled
- You won't find any functionality in the editor when module is disabled
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
-
To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the
update/stop-loading-subscribe-block-when-module-disabledbranch. -
To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/stop-loading-subscribe-block-when-module-disabled
Interested in more tips and information?
- In your local development environment, use the
jetpack rsynccommand to sync your changes to a WoA dev blog. - Read more about our development workflow here: PCYsg-eg0-p2
- Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :red_circle: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Follow this PR Review Process:
- Ensure all required checks appearing at the bottom of this PR are passing.
- Choose a review path based on your changes:
- A. Team Review: add the "[Status] Needs Team Review" label
- For most changes, including minor cross-team impacts.
- Example: Updating a team-specific component or a small change to a shared library.
- B. Crew Review: add the "[Status] Needs Review" label
- For significant changes to core functionality.
- Example: Major updates to a shared library or complex features.
- C. Both: Start with Team, then request Crew
- For complex changes or when you need extra confidence.
- Example: Refactor affecting multiple systems.
- A. Team Review: add the "[Status] Needs Team Review" label
- Get at least one approval before merging.
Still unsure? Reach out in #jetpack-developers for guidance!
Jetpack plugin:
The Jetpack plugin has different release cadences depending on the platform:
- WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).
- WoA releases happen weekly.
- Releases to self-hosted sites happen monthly. The next release is scheduled for none scheduled (scheduled code freeze on undefined).
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.
Works for me. I tested this on a JN site. Thanks for working on this! 🙏
Jetpack connected
WordPress.com account connected, Newsletter disabled
WordPress.com account connected, Newsletter enabled
This is also nice, @simison 🚀
Could we instead hide the newsletter icon, but keep the placeholders to invite folks to turn the feature on?
It's an option, yes. I'm little less worried about undoing work (although it's a bummer) and more interested in finding best possible UX. :-)
Happy to have the product convo in a P2 regarding other blocks, before committing to this!
Happy to have the product convo in a P2 regarding other blocks, before committing to this!
It may be worth a discussion on +jpopdesignp2 I think. I don't have a strong opinion on the matter personally, but I think it would make sense to have a consistent approach. If we were to remove the placeholders for one block, we should probably do it for all. I think there are arguments for it, performance could be one of them.
Happy to have the product convo in a P2 regarding other blocks, before committing to this!
It may be worth a discussion on +jpopdesignp2 I think. I don't have a strong opinion on the matter personally, but I think it would make sense to have a consistent approach. If we were to remove the placeholders for one block, we should probably do it for all. I think there are arguments for it, performance could be one of them.
My thoughts: When a user opens Gutenberg, they're usually focused on writing content for their site, not exploring new features. Sure, they could come across new features, but that's not the main goal for this UI.
I think we can find better opportunities to introduce features within the WP Admin or Jetpack, rather than adding more icons to Gutenberg that users may not need right away (or maybe never).
I'm not entirely sure we have a one-size-fits-all approach, it probably depends on the feature. AI, for example, directly helps with writing, so that one makes sense to keep.
@jeherve I was reviewing a bit placehodler status for other features:
While Newsletters feature has a clear'ish "on/off" toggle (it could be better discoverable but that's separate issue), not all features do have it:
For example Related posts has a toggle which adds classic related posts to posts:
Having that toggle control the block is kinda meaningless since related posts would just appear in your posts, you don't need to deal with the block anymore. Once related posts is updated to use block hooks, hiding the block when module is disabled is more meaningful.
There are likely similar UX issues with other blocks, and placeholders are kinda "hack" to improve otherwise poor UX for enabling and discovering features, but have a tradeoff of contributing to the bloated feeling of Jetpack.
There are likely similar UX issues with other blocks, and placeholders are kinda "hack" to improve otherwise poor UX for enabling and discovering features, but have a tradeoff of contributing to the bloated feeling of Jetpack.
Yup, that's very true.
Interestingly, the concept of modules also contributed to fight the idea of bloat since when a module is inactive, code for that feature didn't run on the site. If we were to do away with that, and for example always load the related posts codebase so the block is available without having to activate a module, we would do away with that concept. I'm honestly not quite sure how to best address this.