• Resolved spontiflex

    (@spontiflex)


    Hello dear Support,

    i’m building some criminal-movie distribution website at the moment. The website should have a paywall, and so i decided to integrate your plugin. Yesterday I activated premium features, so these features work, but the premium plugin is still in trial period.

    Our website shows the following behaviour at moment: When a user has finished their purchase via paypal and is redirected to our site, the purchased product is shown including a link to the protected page. Following the link you would expect that the restricted content messages is not shown any more, but it is still given by webserver as a response.

    At woocommerce settings, the option to allow guest users is deativated, and according to the settings a new user is created at purchase process automatically (a wordpress_logged_in_… cookie for this new user is created during purchase and, monitoring the process at another browser, a new user pops up at admin dashboard). Furthermore woocommerce shows a new completed order for the fresh user after the purchase.

    A few hours ago, when I analyzed the problem a bit, i tried to refresh the protected page after the purchase again and again, using f5, shift f5, etc. because i thought of the browser cache… At first I did this again and again without an effect. And at the 8th, 9th or 10th time, it suddenly switched from the restricted content message to the full content (which is to be shown behind the paywall). This was reproducable many times. (Of course, I deleted the newly created user, the related order and cookies each time before trying anew.) Using webdeveloper tools at firefox browser i found out that http requests were not processed by the browser cache at all, but fetched from the server all the time, and that the switch to the full behind-paywall-content was just a matter of time. Really strange…

    This was some hours ago. At the moment the restricted content message is even more sticky. And the strange behaviour which was reproducable, is not reproducable any more. I. e. even if I refresh quite some times, the switching to the full content (which should be shown after purchase) does not happen any more. Even one or two minutes after the purchase it does not. (Clean preconditions before testing and the automatic creation of user and order during the purchase are still the same.)

    What can I do to have the restricted content message disappeared after purchase, immediately and in a reliable way?

    Best regards,
    Stefan

    • This topic was modified 5 years, 7 months ago by spontiflex.
    • This topic was modified 5 years, 7 months ago by spontiflex.
    • This topic was modified 5 years, 7 months ago by spontiflex.
    • This topic was modified 5 years, 7 months ago by spontiflex.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Matt Pramschufer

    (@mattpramschufer)

    Hey @spontiflex this sounds like a caching issue. Are you running any caching plugins or does your host? I.E. is you are using WPEngine they cache everything at a network level. Same thing if you are using CloudFront or something similar.

    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    Since I have not heard back from you I am going to close this thread. If you still need help please reach out.

    Thread Starter spontiflex

    (@spontiflex)

    Well, the problem is not yet resolved. Not sure if my webhoster, a quite big German one called Ionos, uses such a (hidden) cache. A quick google search didn’t indicate anything like that.

    Will continue analyzing the problem today… I. e. will look through the admin dashboards, use my hoster’s support, try further tests, etc.

    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    @spontiflex looking at https://www.ionos.com/hosting/wordpress-hosting they use both Ngnix full page caching and then https://www.ionos.com/hosting/wordpress-pro uses Varnish caching. So they have some sort of full page caching in place for you

    Thread Starter spontiflex

    (@spontiflex)

    Well, I contacted the ionos support yesterday, and today i got the answer to my problem: It isn’t possible for me to control or deactivate their webserver-cache, because we subscribed to a shared-hosting product. Support recommends an upgrade to a dedicated-hosting-product, which costs almost 10 times as much. Now I’m waiting for my principal to decide, how we will go further on.

    Thread Starter spontiflex

    (@spontiflex)

    oh, for the sake of completeness: there was no active wordpress caching-plugin all the time.

    Thread Starter spontiflex

    (@spontiflex)

    In order to implement an effective workaround, I added Javascript to my http-responses (by using the well-known plugin “Simple Custom CSS and JS”).

    Each time when a webbrowser receives an http-response from my wordpress, then the script checks whether the url corresponds to one of the paywalled wp-pages. If yes then
    ‘?timestamp=’ + (new Date()).getTime() is added to the url and the browser reloads the page anew.

    (Then the content of the testing browser disappears for a very short moment. Furthermore web-address field of the browser-tab shows the new url then, i. e. the old one enhanced by a dummy-param, which is obviously unique at each page-load.)

    And indeed: When a paywalled wp-page is loaded, then the webserver treats the url of the (respectively) 2nd http-request as a new one, whereas wordpress doesn’t pay attention to the unknown query parameter. (Seems that mod_rewrite, or equivalent of mod_rewrite at nginx, doesn’t filter it out.)

    The http-response is not served by some network level cache anymore then, and concerned wordpress-php-scripts are executed anew then, actually. This is evident, because after some user has finshed their payment process, a _different_ restricted-content-message is given as a response – it’s a different one then, because i changed it at another browser in the middle of the user’s payment process.

    I’m sure, you won’t be surprised that this is my issue now: Why doesn’t the post-for-pay plugin switch to the behind-paywall-content, although php-scripts are obviously/evidently executed anew after successful payment process?

    Preconditions and postconditions of my tests are still the same: I remove website-data (cookies, etc.) from testing browser before each test. Furthermore I start each test having a clean list of wordpress-users and a clean list of woocommerce-orders at the monitoring browser, where I’m logged in as an admin user. Payment process creates a wordpress-user, corresponding session-cookie at testing-browser and a complete order as ever.

    Would be great if you could help us to solve this issue and find the cause of this unexpected behaviour.

    • This reply was modified 5 years, 7 months ago by spontiflex.
    Plugin Author Matt Pramschufer

    (@mattpramschufer)

    @spontiflex I have tried numerous tests on my end to try to reproduce what you are experiencing and nothing I try gives the same results as you are describing. Do you happen to have any browser extensions running which are caching your pages locally in your browser for you?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Sticky restricted content message’ is closed to new replies.