Support » Plugin: Age Gate » After a while Age Gate stops workig

  • Resolved michel993

    (@michel993)


    I installed and set the plugin, it works fine but after few hours it stops working.

    The screen appears all black (as it should be) but the contents (that are all white) don’t appear and customers think the site is broken.

    I noticed that if I clean the cache with SG Optimizer the plugin works again, but as I said, after a while, it stops working.

    My settings are:
    Use uncachable version: ON
    AJAX endpoint: Admin AJAX

    I tried to put it on OFF but it didn’t work at all so I put uncachable version ON.
    Then I tried to switch between Admin AJAX e Rest API. Same results.

    I read other topics and I thought that adding this code would have fixed it but nothing happened. The black screen was still there

    body.age-restriction, html.age-gate-restricted {
      position: relative;
      overflow: auto;
    }

    Now the plugin is disactivated but if you need to investigate I can activate it.

    I wish to not be forced to choice another plugin because this one is great and really simple to use.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Rafael UJ

    (@rafaeluj)

    I am no expert but no means but that sounds like your age gate CSS was minified and broken on the way.
    The easiest way to rule my theory out – would be to look at the page source in the browser after the unsuccessful load.

    • If you can see all the DOMs in the source code but nothing on the screen – CSS problem.
    • If you can’t see the elements of the page in the code – something went wrong while generating the page. Potentially JS problem?
    • This reply was modified 4 months ago by Rafael UJ.
    Plugin Author Phil

    (@philsbury)

    Hi @michel993,

    Sounds to me like there’s potentially 2 issues here. The first is caching, so Use uncachable version: ON and AJAX endpoint: Admin AJAX (though this one matters less) sound like the right options.

    The next thing is going to be some kind of CSS/JS conflict potentially. If you want to turn the plugin on I’ll have a look.

    Thanks
    Phil

    Thread Starter michel993

    (@michel993)

    Hi @philsbury,
    I’m activating Age-Gate, if you want to take a look I would appreciate it!
    Thanks
    Michel

    Plugin Author Phil

    (@philsbury)

    Hi @michel993,

    Just having a look now, will let you know what I find

    Thanks
    Phil

    Plugin Author Phil

    (@philsbury)

    Hi @michel993,

    This is being caused by your cookie consent plugin. For whatever reason it is adjusting the javascript template despite it just being html in a JS wrapper.

    Digging into it, I can’t see a way of omitting that template without a couple of changes to age gate to allow <!--IUB-COOKIE-BLOCK-SKIP-START--> and <!--IUB-COOKIE-BLOCK-SKIP-END--> to be added to the HTML. I’ll look at doing that so it’s customisable (an action, probably).

    I did find that if I change the iubenda settings for script blocking to use the “Secondary” parsing engine it also fixed it, so might want to get that a go too.

    Thanks
    Phil

    Plugin Author Phil

    (@philsbury)

    Hi @michel993,

    Just pushed out 2.15.0 which has a couple of actions you can now use to fix this with the primary parser:

    
    add_action('age_gate/script_template/before', function () {
        echo '<!--IUB-COOKIE-BLOCK-SKIP-START-->';
    });
    add_action('age_gate/script_template/after', function () {
        echo '<!--IUB-COOKIE-BLOCK-SKIP-END-->';
    });
    
    

    Thanks,
    Phil

    Thread Starter michel993

    (@michel993)

    Hi @philsbury

    I really appreciated how fast you helped me!

    Should I add that code in function.php? Or in a particular place?

    Kindness, rapidity and competence are qualities not easily found nowadays…

    I will definitely give the plugin 5 starts!

    Thanks,
    Michel

    Plugin Author Phil

    (@philsbury)

    Hi @michel993,

    Yeah, functions.php should do the trick.

    Thanks
    Phil

    Thread Starter michel993

    (@michel993)

    Perfect!

    Thanks again!
    Michel

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.