• Resolved Kamil Chmielewski

    (@kamster94)


    On my website I use LiteSpeed and AMP plugins. The later can’t be used in standard mode where AMP version is served by default, and I’d like it that way. Problem is that LiteSpeed plugins breaks AMP validation. If I turn debug mode on, I receive errors:
    ‘is_amp_endpoint() was called before the parse_query hook was called’ and
    ‘is_amp_endpoint() was called before the wp action which means it will not have access to the queried object to determine if it is an AMP response, thus neither the amp_skip_post filter nor the AMP enabled publish metabox toggle will be considered.’
    That is the case only if LiteSpeed is turned on. I’ve checked it by disabling plugins one by one – it’s LiteSpeed that causes that, without it it’s fine, AMP works.
    Theme is unmodified Twenty Twenty, which works with standard AMP mode.
    I’ve searched LiteSpeed files for is_amp_endpoint usage, and found a function which should make sure to disable lazyload on amp. That shouldn’t cause any trouble, but just for test I’ve deleted that line with is_amp_endpoint. And it changed nothig, errors are still there, after cleaning cache on my site and cloudflare. Is there anything I can do to make LiteSpeed work with AMP?

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Kamil Chmielewski

    (@kamster94)

    I was able to replicate issue on local environment. I’ve installed AMP and lightspeed cache on fresh wp, activated twenty twenty, both plugins and amp is broken. Deactivating lightspeed makes it work.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    There are several AMP plugins , could you please state which one you are using ? I will try to reproduce the issue locally as well.

    Best regards,

    Thread Starter Kamil Chmielewski

    (@kamster94)

    https://wordpress.org/plugins/amp/

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I have enabled wp debug also the log

    may I know the steps for how to trigger/reproduce the error as you have seen ?

    Best regards,

    Thread Starter Kamil Chmielewski

    (@kamster94)

    I’ve activated Twenty Twenty theme, activated LiteSpeed plugin and AMP plugin (https://wordpress.org/plugins/amp/), set AMP mode to ‘Standard’ in settings. It shows error that it couldn’t retrieve amp status due to failed json fetch. Then I just open any page or post, and the ‘is_amp_endpoint() was called before …’ errors pops up

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I did see the json fetch validation issue when save to Standard

    But how do I trigger that is_amp_endpoint() was called before ?

    Best regards,

    I was able to resolve issue by desactivating lazy images loading in Media Setting Menu…

    Thread Starter Kamil Chmielewski

    (@kamster94)

    Funny thing, it’s not present now – dunno what’s changed, as I have auto-updates turned on. Maybe one of mentioned plugins changed, maybe it was another plugin that was interfering with LiteSpeed.
    So, is_amp_endpoint() is no longer an issue, but json fetch is still failing with LiteSpeed turned on, and works fine with disabled. Tried to turn off option by option in LiteSpeed configuration, including lazy load, purging cache after every change, but it’s still the issue.

    Thread Starter Kamil Chmielewski

    (@kamster94)

    It’s problem with comment appended to site’s html – Weston Ruter found it out, apparently he already posted you an issue on github.
    https://wordpress.org/support/topic/amp-not-working-with-litespeed/#post-12716486
    https://github.com/litespeedtech/lscache_wp/issues/212

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Thanks for the info , we will look into it.

    Best regards,

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

The topic ‘LiteSpeed Cache breaks AMP’ is closed to new replies.