It looks like it might be server related as it is not occurring on the staging site. It appears that once input is submitted admin-ajax.php loads in the network tab but nothing else does. It stops there. If I refresh the page everything else loads fine.
Actually nvm, that does not seem to be the problem. I can confirm that the css classes do not get removed when a user verifies their age which causes the issues I mentioned above.
So after hours of fiddling around with cache settings the issue was actually a bug in the code.
If you have “Transitions” selected to anything other than none the code to remove all the css classes will not run.
The following code block in public/js/age-gate-public.js needs to fixed
key: "hide",
value: function () {
var e = this;
age_gate_params.settings.transition
? (jQuery(".age-gate-wrapper").on("transitionend", function (t) {
jQuery(window).scrollTop(0),
jQuery("body").removeClass("age-restriction"),
jQuery("html").removeClass("age-gate-restricted age-gate-js"),
jQuery("body").removeClass("age-gate--error"),
jQuery(".age-gate-wrapper").remove(),
e.removeViewport();
}),
jQuery(".age-gate-wrapper").addClass("transition " + age_gate_params.settings.transition))
: (jQuery(window).scrollTop(0),
jQuery("body").removeClass("age-restriction"),
jQuery("body").removeClass("age-gate--error"),
jQuery("html").removeClass("age-gate-restricted age-gate-js"),
jQuery(".age-gate-wrapper").remove(),
this.removeViewport());
},
When I output age_gate_params.settings.transition to the console it showed the transition correctly but it skipped all those lines of jQuery code.
If anyone else is having this issue you may just need to disable Transitions in the Appearance settings.
-
This reply was modified 5 years, 4 months ago by
robhyrk.
-
This reply was modified 5 years, 4 months ago by
robhyrk.
Plugin Author
Phil
(@philsbury)
Hi @robhyrk,
Thanks for this, but even more so your investigation 🙂
During my v3 rewrite I had something similar. I’ll have dig and see if I can find the issue here and get a patch into v2.
Thanks
Phil
I was on a time crunch and couldn’t wait haha. Hopefully it helps out for a future release!
Great plugin btw! Even the paid ones aren’t as good. Cheers!