• Resolved jz9520

    (@jz9520)


    I have a stock theme from of the biggest WP framework/theme developers that I basically haven’t altered any of the code. Yet, Google Search Console gave me an error (first detected today) saying that 9 of my AMP URLs are ERRORS because “Custom JavaScript is not allowed.” I’m hoping that more errors don’t show up tomorrow for some of my other urls.

    I don’t know what this means nor how to fix it.

    Please advise and thank you for making this plugin!

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    It appears the JS code is being injected by Gravity Forms.

    In the AMP Settings screen there is a Plugin Suppression feature. If you suppress Gravity Forms does that cause the error to go away?

    Thread Starter jz9520

    (@jz9520)

    Thanks. I suppressed the 3 Gravity Forms plugins that I use. Unfortunately, Google Search Console (GSC) says the issue still happens.

    Plugin Author Weston Ruter

    (@westonruter)

    What plugins specifically are those?

    It appears that Gravity Forms is starting an output buffer for the entire page very early before the AMP plugin starts its output buffer. When the AMP plugin’s output buffer finishes, it sanitizes the output to make sure there are no such invalid scripts. However, there was a previous output buffer started then invalid scripts could still be injected after the fact. This appears to be what is going on here.

    I am using gravity forms but I suppressed the plugin in the AMP settings

    below are a few pages where the error is occurring:

    https://www.edwardjohnsonlaw.com/carolen-white-2/
    
    https://www.edwardjohnsonlaw.com/law-practice-areas/homicide-murder-charges/
    
    https://www.edwardjohnsonlaw.com/law-practice-areas/drug-charges/
    Plugin Author Weston Ruter

    (@westonruter)

    @kdtanderson Did you recently update Gravity Forms? I’m wondering if this is a new problem caused on their side. What version are you using? Are you using any Gravity Forms extensions as well?

    Gravity Forms seems to be injecting this script in a non-WordPressy way, by using output buffer injection rather than using a standard wp_head action. We’ll try to get a copy of Gravity Forms to see what is going on.

    It may be a couple days before we are able to provide a resolution.

    Thread Starter jz9520

    (@jz9520)

    I’m using Gravity Forms 2.5.4. And I use gravity Forms SendGrid Add-On. Thanks.

    I am having the same issue. Suppressing Gravity Forms doesn’t work. I have Gravity forms 2.5.4 and Multiple Columns for Gravity Forms installed.

    Plugin Support Milind More

    (@milindmore22)

    Hello @cblack47 and @jz9520

    can you please update Gravity forms to the latest version ie. 2.5.4.4 as per changelog they have fixed the issue.

    reference: https://docs.gravityforms.com/gravityforms-change-log/

    Thanks very much. That version fixed the issue for me.

    Christina

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘AMP Error (Custom JavaScript is not allowed )’ is closed to new replies.