Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 798 forks source link

VideoPress: module is still activated when downgrading plan #11233

Open mmtr opened 5 years ago

mmtr commented 5 years ago

Steps to reproduce the issue

  1. Start from a Jetpack site with an active Premium upgrade.
  2. Go to Jetpack > Settings, and enable the VideoPress feature.
  3. Remove the Premium upgrade from your account.
  4. Go to Media > Library.
  5. Upload a new video.

What I expected

Video should be uploaded correctly and not processed by VideoPress.

What happened instead

VideoPress intercepted the upload, but the video is not uploaded, probably because the API detects that we're missing an upgrade.

screen shot 2019-01-31 at 11 56 51

Additional info

We found this when testing https://github.com/Automattic/jetpack/pull/11193 (props to @dmsnell).

I noted that Jetpack loads the /modules/videopress.php file when we downgrade from Premium to Free. Furthermore, this stops happening as soon as you visit "Jetpack > Settings", so it seems that the VideoPress module is not deactivated during the downgrade, and we deactivate it when visiting the "Jetpack > Settings" page.

jeherve commented 5 years ago

Good catch. The plan data is stored on WordPress.com, so you most likely ran into a cache issue where the plan status (and thus the features available to you) did not match the reality. Maybe we should shortcircuit VideoPress features a bit earlier than here, to make sure that even if the plan and module status don't match, we don't generate any errors: https://github.com/Automattic/jetpack/blob/b4437f5237e28390586b3d682dd80d97b68ccfef/modules/videopress/class.jetpack-videopress.php#L45

stale[bot] commented 5 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.