Plugin Author
Phil
(@philsbury)
WP Engine’s cache can ignore pages with certain cookies attached, but due to the nature of age gating content, it would essentially mean no pages are cached at all as it need to do various checks along the way and serve a different template if the age gate is not passed. So what’s happened is the cache has picked up the form the first time round and cached it. I’d imagine if you clicked yes, then cleared the cache, then refreshed you’d see your content. No much good in a real scenario.
Essentially, in it’s current format it doesn’t work with cached sites (see the FAQ). I’ve been looking at various was to get around this issue, but with so many caching options it’s had to do so in a way that addresses everything. However, I do have a method that is currently in development that will hopefully get over this issue.
As an aside, the plugin doesn’t actually use cookies, but sessions as there were issues in an early release with cookies in IE.
Hey, Phil.
Thanks for the quick response! I look forward to the next version. This seems like the most straightforward age restriction plugin so I’d love to implement it going forward.
Thanks and best of luck.
Plugin Author
Phil
(@philsbury)
Hi,
Just to let you know, version 1.4.0 has been released, this has the option of an age gate that wonβt be affected by caching β but still allows the site to be cached.
There’s an option section called “Caching” and using “Cache Bypass” should solve your caching issues.
Thanks
Phil
Awesome. Works flawlessly. Changed the option to: “Cache bypass” and it works as intended.
Thanks so much!
Hi there,
had a similar issue and the Cache Bypass now works. However, I’m using qTranslate-X and when Cache Bypass is checked, the Age Gate shows both Language versions, see below:
[:EN]WELCOME[:DE]WILLKOMMEN
[:en]You must be of legal drinking age to enter this site.[:de]Du musst 18 Jahre alt sein, um diese Seite zu betreten.
When Cache Bypass is not checked, it shows normally, as here:
WELCOME
You must be of legal drinking age to enter this site.
Best wishes,
Tom
Plugin Author
Phil
(@philsbury)
Hi Tom,
Where is qTranslate-x getting it’s translations from for those sections? If you can screen shot all the settings tabs for it and put them here I’ll set up a local version to match and see what’s what
Thanks
Phil
Plugin Author
Phil
(@philsbury)
Right, I can replicate that. My initial thought is that in “standard” all the usual filters get applied, whereas in “bypass” they potentially don’t.
I’ll have a dig around for a solution.
Cheers
Phil
Plugin Author
Phil
(@philsbury)
Hi Tom,
Can you give this a try, the solution was remarkable simple in the end. Went round the houses a bit to get there though!
If you find no issues, please let me know and I’ll merge it into the official build and release it.
https://www.dropbox.com/s/gz6az8oqvyw7f3h/age-gate-1.4.13-beta.zip?dl=0
Cheers
Phil
Hi Phil,
Thanks for the fast reply π
Just tested it, unfortunately, when using the Cache Bypass, now I don’t get the prompt at all (purged my caches). If I use Standard mode, then it loads, but then again – I’m stuck in the loop.
Best wishes
Tom
Plugin Author
Phil
(@philsbury)
You’re right, I moved the scripts to be enqueued properly, but the conditional I added after initially sending you the message was always false.
Anyway, I’ve updated the link above (below too for ease), and should be good now.
https://www.dropbox.com/s/gz6az8oqvyw7f3h/age-gate-1.4.13-beta.zip?dl=0
Cheers
Phil
Works! π
When do you plan to push it live?
Also, Does the “Remember me” checkbox works with the “Cache Bypass” parameter?
Cheers
Tom
Plugin Author
Phil
(@philsbury)
Hi Tom,
That’s now in the latest release.
For remember me, yes it should work with cache bypass, it sets a cookie called ageCookieRemember – but only if they pass the test. There are some changes to that coming in v2.0.0 as it’ll support multiple ages – but for now it’s just a true or false.
Thanks
Phil