Based on a quick read of the plugin code it looks like the plugin isn’t compatible with the WP Engine cache. I may be able to help out from the WP Engine end, I’ve reached out the plugin author to verify some details of its operation.
Hi – I’m having the same issue with the verification popping up on every page, and we’re with WP Engine. Have you had any luck working out a way to only make the verification come up on the initial landing page?
Thread Starter
bmp
(@bphippen)
I ended up just creating some custom javascript using jQuery and jQuery cookie and it works fine.
Essentially I call a modal on every page load unless it can find a valid cookie which gets set when a visitor clicks on an “I am over 18” button.
Here it is in action if you would like to see it: http://vsgdemo1.wpengine.com/
<script type="text/javascript">
jQuery(document).ready(function($){
var modal = UIkit.modal("#age-verify", {keyboard:false, bgclose:false, center:true});
if ( $.cookie('age-verification') == 'yes' ) {
modal.hide();
}
else {
modal.show();
$(".uk-modal-close").click(function() {
$.cookie('age-verification', 'yes', { expires: 30, path: '/' });
});
}
});
</script>
Hi – thanks that looks great. Unfortunately my coding ability is pretty limited so I think it will be safer to stick with a plugin.
I’ve found another one I might try out – https://wordpress.org/plugins/itro-popup/