• Resolved Amrilio

    (@amrilio)


    Hi Litespeed Support,

    I got an issue with invalid AMP pages. I used AMP plugin by AMP Project Contributors.
    When I tried to validate the AMP pages, I got an error with Custom JS is not allowed. This JS code below that causing the error.
    Wondering if this JS code from Litespeed plugin? If yes, could you help me to fix the error?

    Thanks,
    Amrilio

    <script data-no-optimize="1" defer>!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).LazyLoad=e()}(this,function(){"use strict";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,a=arguments[e];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function i(t){return e({},it,t)}function o(t,e){var n,a="LazyLoad::Initialized",i=new t(e);try{n=new CustomEvent(a,{detail:...

    • This topic was modified 2 years, 8 months ago by Amrilio.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support qtwrk

    (@qtwrk)

    a quick workaround , add this at top of your wp-config.php , next line after <?php

    if (strpos($_SERVER['REQUEST_URI'], "amp") !== false){
    define( 'LITESPEED_DISABLE_ALL', true );
    }

    then purge all

    Thread Starter Amrilio

    (@amrilio)

    Thanks Qtwrk,

    Will implement the code.

    Best,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Invalid AMP due to Custom JS is not allowed’ is closed to new replies.