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

Premium Content: Already logged-in users cannot see protected content #45663

Closed
mmtr opened this issue Sep 15, 2020 · 27 comments · Fixed by #45777
Closed

Premium Content: Already logged-in users cannot see protected content #45663

mmtr opened this issue Sep 15, 2020 · 27 comments · Fixed by #45777
Assignees
Labels
[Closed] Not Reproducible Issue cannot be reproduced. Earn Premium Content Controlling specific content for paying site visitors. [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug

Comments

@mmtr
Copy link
Member

mmtr commented Sep 15, 2020

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

@mmtr mmtr added [Type] Bug Earn Premium Content Controlling specific content for paying site visitors. labels Sep 15, 2020
@spncr
Copy link

spncr commented Sep 16, 2020

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.

@kwight kwight added the [Pri] High Address as soon as possible after BLOCKER issues label Sep 16, 2020
@kwight kwight assigned kwight and krymson24 and unassigned kwight Sep 16, 2020
@HenryMargusity
Copy link

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.

@HenryMargusity
Copy link

HenryMargusity commented Sep 17, 2020

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.

@HenryMargusity
Copy link

HenryMargusity commented Sep 17, 2020

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!

@HenryMargusity
Copy link

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)

@HenryMargusity
Copy link

HenryMargusity commented Sep 17, 2020

I cant login again.

I restarted and cleared my cache

Thanks

@HenryMargusity
Copy link

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.

@HenryMargusity
Copy link

HenryMargusity commented Sep 17, 2020

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!

@HenryMargusity
Copy link

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

@HenryMargusity
Copy link

HenryMargusity commented Sep 18, 2020

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.

@kwight
Copy link
Contributor

kwight commented Sep 18, 2020

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

@HenryMargusity
Copy link

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?

@krymson24
Copy link
Contributor

krymson24 commented Sep 19, 2020

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.

@mmtr
Copy link
Member Author

mmtr commented Sep 21, 2020

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

@HenryMargusity
Copy link

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?

@mmtr
Copy link
Member Author

mmtr commented Sep 21, 2020

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.

@HenryMargusity
Copy link

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.

@AtrumGeost
Copy link
Contributor

AtrumGeost commented Sep 21, 2020

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

@AtrumGeost
Copy link
Contributor

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

@kwight
Copy link
Contributor

kwight commented Sep 21, 2020

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

@kwight
Copy link
Contributor

kwight commented Sep 21, 2020

@AtrumGeost deployed on simple.

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

@HenryMargusity
Copy link

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

@gwensmithx
Copy link

Hi all I'm reopening this because I ran into this exact issue today - #3640046-zd.

Customer's paid subscribers are logged into WordPress but when they view the Premium Content page they cannot see the Premium Content and the login button is missing. It just says "subscribe".

I verified this by SSPing as one of the paid subscribers and visiting the page.

@gwensmithx gwensmithx reopened this Jan 13, 2021
@dhackneya8c
Copy link

I have another report of this issue - #27542495-hc

User is trying to login from the premium content block and being looped around with no content displaying once they go through the log in screen.

@pauljacobson
Copy link

pauljacobson commented Feb 17, 2021

I have another report like this. Subscribers are unable to access paid content contained in Premium Content Blocks, despite being subscribed to the content.

I have added details, and screenshots here: 3743413-zen (the screenshots and demo video contain personal information so I can't share it here).

@apeatling apeatling assigned apeatling and unassigned mmtr and krymson24 Mar 2, 2021
@iamgabrielma
Copy link
Contributor

Another case on 3799618-zen

The Premium Content block not working on subscriber content page https://weekend-ish.com/subscribercontent/ . It's showing the sign up / log in buttons but just endlessly loops through it when paying visitors attempt to check the Premium content. I could replicate it by SSP via a paid visitor.

Also noting this warning:

`WARNING: /wordpress/plugins/jetpack/9.5.1/extensions/blocks/premium-content/_inc/subscription-service/class-token-subscription-service.php:177 - Cannot modify header information - headers already sent by (output started at /wordpress/core/5.6.2/wp-includes/formatting.php:5739)

`

@apeatling
Copy link
Member

I'm unable to reproduce this on the most recent example. The older examples are before we moved and upgraded the block. The low number of reports makes me think these are different issues. Please reopen if there's another example.

@cathymcbride cathymcbride added the [Closed] Not Reproducible Issue cannot be reproduced. label Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Not Reproducible Issue cannot be reproduced. Earn Premium Content Controlling specific content for paying site visitors. [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug
Projects
None yet