• I am currently using the Age Gate plugin on my website, but I’m experiencing an issue. The Age Gate does not load as the first element on the site. Instead, the rest of the site content (including scripts and styles) loads first, which defeats the purpose of restricting access to underage users.

    Additionally, we use FlyingPress for optimization, including defer and delay for scripts. This may be affecting the loading sequence of the Age Gate. Could you please guide me on how to:

    1. Ensure that the Age Gate loads first, regardless of the FlyingPress optimization settings?
    2. Block or delay other scripts and styles from rendering until the Age Gate confirmation is completed?

    I’ve attempted the following so far:

    • Enqueuing the Age Gate scripts and styles as a priority using WordPress hooks.
    • Using filters to delay other scripts until the Age Gate confirmation.

    Despite these attempts, the rest of the content still renders momentarily before the Age Gate appears.

    Any guidance, including specific settings for FlyingPress or adjustments to the Age Gate configuration, would be greatly appreciated.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @milanmaster,

    I’ve just loaded your site with various throttle speeds and I see age gate pretty much as the first thing and certainly before any content, so did you get a solution?

    My suggestions were going to be:

    Set the “In header” mode – which it looks like you done.
    And to ensure that the age gate JS isn’t deferred in that instance, which is also looks like you done.

    Do let me know either way.

    Thanks
    Phil

    Thread Starter milanmaster

    (@milanmaster)

    Hello, thanks  “In header” mode fix issue – also when I exclude “defer script” and “delay script” in flyingpress plugin for optimization.

    Just can’t make google page speed score for mobile (for desktop good) ” agegate.js” render-blocking page. But I think it need to “block”. Can you give us your opinion?

    Plugin Author Phil

    (@philsbury)

    Hi @milanmaster – I’d imagine if FlyingPress allows you to defer the script it will probably allow you to set it to async which I think will prevent the page speed issue (did in a test for me).

    Developer can set these themselves now (since WP 6.3) so I’ll look at doing those things myself in future.

    Thanks
    Phil

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

The topic ‘[NSFW] Loading after content’ is closed to new replies.