Closed BrookeDot closed 5 days ago
This seems like a bug, we shouldn't be displaying such a banner to all unconnected users. I wonder if it may be linked to the changes in #38961. @arthur791004 Could you take a look when you get the chance?
Is there any way to disable those blocks when no connection is present, to prevent users to insert them altogether?
Yes, that may be one way around the issue. We could add a connection check before we register the block here, e.g.: https://github.com/Automattic/jetpack/blob/a6c16b2318275f612c91151c759b5d3bfd9767e5/projects/plugins/jetpack/extensions/blocks/donations/donations.php#L22
We do that for other blocks, like here for example: https://github.com/Automattic/jetpack/blob/7066fdb12e42d56fb88097e3d69beb1cd4e02eef/projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php#L48-L51
Created https://github.com/Automattic/jetpack/pull/39315 (WiP until tests pass)
@BrookeDot it would be great if you could test the PR on your site...
This seems like a bug
I was on the fence if this was an enhancement or a bug, while nothing was "broken" I did find that the user experience could be improved so I agree with the reclassification as a bug.
@BrookeDot it would be great if you could test the PR on your site...
Sounds good, either I or someone on WPVIP will be able to test this out and comment if the PR works as expected here in the next few days.
Impacted plugin
Jetpack
What
Prevent WordPress.com Notice in Editor when no Jetpack connection is present
How
When an editor with
edit_posts
permissions is logged in but has not connected Jetpack visiting Post > Add New results in a message to connect Jetpack:This appears to stem from the
membership
endpoint:https://example.com/wp-json/wpcom/v2/memberships/status?source=gutenberg&type=all&is_editable=true&_locale=user
My browser returns a 500 error and the following response body:
Source: https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php#L243-L248
Most Jetpack blocks only ask you to connect Jetpack when they are inserted:
Alerting the editor to connect Jetpack on every page load seems a bit over zealous and if a reason is not provided as to why, the alert seems unhelpful.
Replicate:
1) Create a Jetpack site with a primary Jetpack connection 2) Log in as an editor who is not connected to Jetpack 3) Visit Post > Add New 4) See the Connect Jetpack Message
Current Workaround
Disable Jetpack Blocks