Skip to content
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

Closed
2 tasks done
vindl opened this issue Oct 10, 2018 · 13 comments
Closed
2 tasks done

Gutenberg: handle blocks that require a paid plan #27772

vindl opened this issue Oct 10, 2018 · 13 comments
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task

Comments

@vindl
Copy link
Member

vindl commented Oct 10, 2018

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:

  • Audio
  • Video

Fix proposed in D19590-code.

cc @shaunandrews @gwwar

@vindl vindl added [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR [Type] Task [Goal] Gutenberg Working towards full integration with Gutenberg labels Oct 10, 2018
@vindl vindl added this to the Core Blocks Integration milestone Oct 10, 2018
@vindl vindl self-assigned this Oct 10, 2018
@shaunandrews
Copy link
Contributor

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:

image

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:

image

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:

image

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.

@vindl
Copy link
Member Author

vindl commented Oct 17, 2018

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)

@shaunandrews I think this part is resolved now with #27891, since the appropriate tab will be opened and the others will be disabled.

@vindl
Copy link
Member Author

vindl commented Oct 18, 2018

Fix proposed in D19590-code.

The messages have now been changed to the following:

screenshot 2018-10-18 at 16 14 03

screenshot 2018-10-18 at 16 38 53

@shaunandrews
Copy link
Contributor

since the appropriate tab will be opened

Very cool. At some point we'll look at adding the upsell nudge directly in the card, but this is a great starting point.

messages have now been changed

Also very cool. Any chance we can add a link to learn more — maybe sending them to /plans/

@vindl
Copy link
Member Author

vindl commented Oct 18, 2018

Also very cool. Any chance we can add a link to learn more — maybe sending them to /plans/

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).

@sirreal
Copy link
Member

sirreal commented Oct 22, 2018

We're working on simple payments which will require a plan check: #27998

@vindl
Copy link
Member Author

vindl commented Oct 22, 2018

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.

@vindl vindl closed this as completed Oct 22, 2018
@matticbot matticbot removed the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label Oct 22, 2018
@vindl
Copy link
Member Author

vindl commented Oct 22, 2018

@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).

@gwwar
Copy link
Contributor

gwwar commented Oct 23, 2018

we'll need server side checks to prevent rendering existing simple payment buttons when appropriate plan is not present

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
Copy link

Hey @vindl! It seems that this should be fixed per your comment here, but I got a user today complaining about this and when testing I see the error "Sorry, this file type is not permitted for security reasons." Should we reopen this issue?

@vindl
Copy link
Member Author

vindl commented Jan 21, 2020

@carinapilar I was able to reproduce this so I'll reopen it and add it to our backlog. Thanks for reporting it!

@vindl vindl reopened this Jan 21, 2020
@lancewillett
Copy link
Contributor

Related: #33013

Similar case where we don't prompt for a plan upgrade when users try to upload video/audio files.

@vindl
Copy link
Member Author

vindl commented May 14, 2020

Closing as duplicate of #33013.

@vindl vindl closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task
Projects
None yet
Development

No branches or pull requests

7 participants