-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Gutenberg: handle blocks that require a paid plan #27772
Comments
The Audio and Video blocks allow you to use a URL, rather than uploading. The File block—for some strange reason—doesn't allow you to use a URL and requires that you upload/pick a file from your library. (Made an issue in Gutenberg about that URL field: WordPress/gutenberg#10521) Once we have the Calypso media modal fully integrated, the audio and video tabs will show a nudge to upgrade to access media uploads: However, its a little messy if you don't find those tabs. If you attempt to upload an media file on a free plan (without digging into any tabs) you'll get this cryptic error: There's no mention of required plan upgrade, or anyway to find more information. That sucks. Perhaps we could change this message to mention a paid plan, and add a link to read more? Right now, if you're using Gutenberg on WPcom wp-admin, and you try to upload an audio file, you'll get this different, cryptic message: I'm not sure how this error is related, or if Gutenberg is misinterpreting an error from WPcom, but this is another area where we might need to add a better error message with a link to learn more about upgrading. |
@shaunandrews I think this part is resolved now with #27891, since the appropriate tab will be opened and the others will be disabled. |
Very cool. At some point we'll look at adding the upsell nudge directly in the card, but this is a great starting point.
Also very cool. Any chance we can add a link to learn more — maybe sending them to |
I've looked into that already, but unfortunately I don't think it's possible with this approach, since error messages contain only plain text (even if passed, HTML will be escaped up the chain for security reasons, otherwise malicious translations could inject anything). I think we'd need to somehow override the default error message/block rendering for that, and there are no obvious extension points now. It will probably require writing our own custom versions of these blocks for WP.com (for nudges too). |
We're working on simple payments which will require a plan check: #27998 |
I'm closing this for now since we landed an intermediate fix in D19590-code. We'll probably circle back to this when we have more time in order to create custom versions of core blocks in which we'll be able to add upgrade nudges, but that's not an immediate priority right now. |
@sirreal let us know if there is some way that we can help. I suspect that your plan checking will be more straightforward since you can control the block's functionality completely. Just mentioning this in case it's not already on your radar - I just realized that in addition to checks in editor, we'll need server side checks to prevent rendering existing simple payment buttons when appropriate plan is not present (e.g. business plan expiry/downgrade). We'll need to consider this for core blocks too, but probably not before we start making our custom versions of them (not an immediate priority I'd say). |
Unless things have changed for Simple Payments, I believe the first block iteration will serialize the existing shortcodes, so no additional work for rendering buttons on the published view should be needed. |
@carinapilar I was able to reproduce this so I'll reopen it and add it to our backlog. Thanks for reporting it! |
Related: #33013 Similar case where we don't prompt for a plan upgrade when users try to upload video/audio files. |
Closing as duplicate of #33013. |
Some of the features that Core blocks provide are not available on WordPress.com Free plan. We need to find a way to handle those cases appropriately. The easiest way for the first iteration would be to hide the affected blocks, but we might also want to show upsell nudge instead of the usual placeholders (that won't be rendered on the front end, just visible in the editor).
Currently affected blocks:
Fix proposed in D19590-code.
cc @shaunandrews @gwwar
The text was updated successfully, but these errors were encountered: