• Resolved anoirinoh

    (@anoirinoh)


    Hi there,
    Thanks for the great plugin, when I activated it, it breaks the amp validator giving this error The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. I am wondering if you could help excluding the Amp script from moving to the footer, I don’t know the script slug.
    Anyway here is the script link:
    <script type=”text/javascript” src=”https://cdn.ampproject.org/v0.js&#8221; async></script>
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Joshua David Nelson

    (@joshuadnelson)

    Hey @anoirinoh!

    Thanks for posting this issue.

    I’ll do some testing with the amp plugin. Are you using the “official” AMP plugin or the AMP for WP plugin?

    My initial thought is that Scripts to footer shouldn’t run on amp endpoints at all, since you’ll be handling scripts so differently in those conditions.

    Thanks,
    Joshua

    Thread Starter anoirinoh

    (@anoirinoh)

    Hi @joshuadnelson
    Thank you for the quick reply, I am using the official AMP plugin, yeah, I think we should exclude script to footer plugin from running on AMP pages, I have found a similar fix for litespeed cache, I think code like this:

    function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && ! defined( 'LITESPEED_NO_LAZY' ) && define( 'LITESPEED_NO_LAZY', true ) ;
    could fix the issue but I don’t know the variables I should replace.

    Thanks

    Plugin Author Joshua David Nelson

    (@joshuadnelson)

    Yea, great! I’ll work on a change and try to have an update out soon.

    In the meantime, the main stf_include filter should work:

    
    function stf_amp_filter( $include ) {
        
        if( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() )
            $include = false;
        
        return $include;
    }
    add_filter( 'stf_include', 'stf_amp_filter' );
    
    Thread Starter anoirinoh

    (@anoirinoh)

    Hi there,
    Thank you for your reply and sorry for the late response. I tried the code you cited above without any results and still getting the issue, any alternative solution?

    Plugin Author Joshua David Nelson

    (@joshuadnelson)

    Hey again!

    Sorry that didn’t work for you! I’m on vacation at the moment, but I’ll test this out a bit more and get a solution for you (either a plugin update or custom code) next week.

    Thanks,
    Joshua

    Plugin Author Joshua David Nelson

    (@joshuadnelson)

    Hey @anoirinoh – apologies on my delay here. Can you confirm if this is still an issue for you in the current versions of AMP (1.4.2) and Scripts To Footer (0.6.4)? I’ve tried to replicate this issue, but AMP is working as expected on my end.

    It could be related to a specific configuration, though. Are you using the “Standard, “Traditional,” or “Reader” website mode? (Setting in AMP > General)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude Amp script’ is closed to new replies.