Wp-calypso: Premium Content: Already logged-in users cannot see protected content

Created on 15 Sep 2020  Â·  22Comments  Â·  Source: Automattic/wp-calypso

Steps to reproduce

  1. Go to wordpress.com/block-editor and insert a Premium Content block.
  2. Publish the post.
  3. Visit the post with a different account.
  4. Subscribe to the Premium Content plan.
  5. Note how the protected content is now visible.
  6. Log out and log in again through https://wordpress.com/log-in (make sure you don't log in through the login button of the Premium Content post).
  7. Visit the post with the subscriber account.

What I expected

The protected content to be visible.

What happened instead

The protected content is not visible. Instead the non-subscriber view is shown with no login button.

Context

Reported in 3300926-zd-woothemes

Earn Premium Content [Pri] High [Type] Bug

Most helpful comment

@AtrumGeost deployed on simple.

@HenryMargusity you should be good to go, apologies for the troubles.

All 22 comments

I chatted with a WordPress.com user today who has subscribers faced with this issue.
24182609-hc

Here it is in action:
Screen Capture on 2020-09-16 at 10-52-14

Going through the login link in the menu does not give them access to the content, it just sends them back through the same loop.

There is no way for a subscriber to see the content, if they close the window with the tokenized url, which they only get once from the "login" button path.

keith

I even logged out and logged back in before I used that link and this is what I get: an option to resubscribe before I get access.

Windows 10 and I've used both edge (chromium version) and chrome. That combination has worked and that is the combination I have used since I became a subscriber. I also was able to use it on Android though that took some effort as well.

Henry, I'm back to having subscription issues. It worked yesterday with the same account, now it wants me to subscribe again. Instead of showing that subscribe option all the time should be a place to login. It's pretty bad when the site doesn't even have a login. Also, I shouldn't have to through this nonsense every other time I want to get to my subscription site which is almost what it has come down to. sorry for the terse email but the frustration level continues to increase with the site. WordPress hosting needs to cleanup their act!

Comment: I subscribed earlier this morning, 15 September, 2020, and when I went to my laptop, which is what I signed up on, I could not log in, and was asked to subscribe again. Thinking that my first attempt had failed, I reentered my credit card information and submitted again. I now have emails, 2 for each attempt, saying that I am subscribed, but If I go to Wordpress, it shows no subscriptions still, and I have paid twice as indicated above. I have been emailing with them, and they informed me to contact you about this.
I only need 1 subscription, so if a refund for one of those can be made, and login access made available for the remaining subscription be granted that would solve this problem.

Charles S. Newman Jr. (Sandy)

I cant login again.

I restarted and cleared my cache

Thanks

So it seems if you hit the wordpress login button at the top of the page the subscriber button will come back on the subscriber pages.

I was able to access the subscription site one day this week. After the rearranging of the site, I again lost that capability. Following your temporary workaround instructions only gave me access to your public video, but NOT to your subscription site. I’m totally frustrated. I have never had such an experience before.

From: Weather Madness™ Sent: Thursday, September 17, 2020 8:43 AM To: [redacted] Subject: [New post] Flooding Rains from Sally Today…Another Storm Develops in the Gulf!

Henry thanks for caring. I do not like or trust this site, already having many emails to opt in to products, etc. Please cancel all my subscriptions and I will just stay on the free site! i have not been able to access the site since the inception a few days ago......I have always enjoyed your love for creation involving weather

Subject: Log in?

Comment: Your log in sucks. Where it says Login you get World Press. I cant get any videos or other info.
Fix this.

Hi @HenryMargusity ! We're working on this 👍 By all means, keep adding feedback you're getting, but please avoid exposing people's personal emails to these comments (it makes them vulnerable to scraping and can get them added to email lists).

Message: Signed up about an hour ago via wordpress ....received confirmation that my Amex was charged....yet when i try to access subscription content...it tells me I need to subscribe.

Is there a delay in accessing subscription content after signing up?

In my investigation, I've found a couple of issues. This issue pertains to Simple sites.

  • Despite being a premium user, and already adding the Premium Content block, and also posting the Premium Content block, the "Upgrade your plan to use this premium block" banner still shows up

Screen_Shot_2020-09-18_at_8 37 01_PM

  • The Premium Content block doesn't have a default contribution, and your post is still valid, even if you didn't set a contribution. This is confusing because you expect that your Premium Content is set up, but nothing shows up in your post.

2020-09-18 20 42 22

  • Multiple posts with Premium Content Blocks — as a user, I expect that my subscriber should only have access to the premium content for the post that they've subscribed to. Both of these posts have Premium Content blocks which the user has subscribed to. One shows that they haven't subscribed, the other shows shows that they have.

2020-09-18 23 33 19

So I've put myself in the perfect scenario to find out why one view shows the Premium Content, but the other does not. It looks like what the discrepancy lies is the selectedPlanId

I traced this logic to these function calls (first being the last function that is used to determine if a visitor can access premium content)

  1. premium_content_current_visitor_can_access
  2. premium_content_block_subscriber_view_render, premium_content_block_logged_out_view_render
  3. register_block_type
  4. 'premium-content/container'
  5. 'premium-content-editor'

Something is passing the premium-content/planId on the frontend and that is getting set to $atttributes. I used this documentation to better understand register_block_type https://developer.wordpress.org/reference/functions/register_block_type/. Unfortunately, all of the source JS is minified in wp-content/plugins/full-site-editing-plugin/259352868/premium-content/dist/premium-content.js (adding a log in that file yields a log in the console, but adding a log in any other file yields nothing). So, there's some JS that is setting the premium-content/planId. I got set up locally to sync the plugin files, but haven't gotten logs to show up in the browser in the subscriber's perspective.

@krymson24 those sound like separate issues to me, the issue reported in the summary here affects posts containing only 1 block. I'd suggest to create new issues for the things you found, so we can keep this issue for solving the visibility of the subscriber view to already logged in users.

I took a quick look and this is what I found:

  • A user has 2 ways of logging in to WordPress.com: (1) via the login link that appears in the top menu of wordpress.com and (2) via the login button that is included in a Premium Content block.
    Screen Shot 2020-09-21 at 10 14 15
    Screen Shot 2020-09-21 at 10 15 20

So, when a user logs in using the 1st way:

  • The subscriber view is not rendered, because the Premium Content cookie doesn't exist.
  • The Premium Content login button is not rendered as well, because the user is already logged in.

One easy way of solving is changing the visibility of the Premium Content login button so it gets rendered if the Premium Content cookie is not set.

So to solve the problem on my site I should

  1. remove the WP login button at the top
  2. Make the visibility of the premium content login better? How do I do that?

Sorry @HenryMargusity, my comment above was intended for the engineering team working on solving this issue.

You don't need to do anything for solving the issue, our team is working on a fix that will automatically solves the issue in your site.

Thank you. I made password protected pages which I give to subscribers having issues. That seems to have stopped my bleeding of upset users until the issue is fixed. Keep m in the loop because it seems you are narrowing things down to the ultimate issue.

Got another case here:

21440656-hc

Here's a recording of the issue:

https://d.pr/i/pzJxIC/5gFsGXiK1v

Slack convo: p1600703764065000-slack-CDA5HLRD2

I offered the user to follow-up when the fix is deployed here:

3336128-zd-woothemes

Hey @kwight! Thank you for checking this, do you know when the changes will be visible on WordPress.com sites?

@AtrumGeost within the next few hours, maybe tomorrow for AT.

@AtrumGeost deployed on simple.

@HenryMargusity you should be good to go, apologies for the troubles.

Thanks so much. I informed my users to try and see if it works better now.

Was this page helpful?
0 / 5 - 0 ratings