• Resolved Wsan1

    (@wsan1)


    AMP Plugin Error


    For the site indicated, I get the error message below. I noticed in the Forum, other user(s) have had this issue, BUT, it appeared that the culprit was excessive CSS (usage) exceeding CSS Budget. That does not appear to be the case in this instance

    I checked with my hosting company. They said it was this AMP Plugin causing
    the problem, in their assessment.

    My hosting company wanted me to find out “(Server) requirements” & report back to them.
    As far as PHP, 5.6 I recall, is enough to work for this AMP Plugin, so we should bevfine there.

    Failed to prepare AMP page
    A PHP error occurred while trying to prepare the AMP response. This may not be caused by the AMP plugin but by some other active plugin or the current theme. You will need to review the error details to determine the source of the error.
    If you get stuck, you may want to share any details in a new topic on the plugin’s?support forum.

    Some (potentially) helpful info.

    – I have not created external CSS stylesheets

    – I have put Custom CSS into the “Additional CSS” in the “Appearance” > “Customize” > “Additional CSS” section of WordPress

    – I have tested the AMP Plugin & every time I turn OFF the AMP plugin, the “Failed to Prepare AMP page” message / error goes
    away & all is fine. When I active the AMP plugin, the message / Error Returns, immediately.

    – I checked the “inspect”, and clicked the “Network” tab and checked CSS usage. It was very minimal it appeared, only about 35 Kbytes.

    ?
    – BTW, I read in AMP plugin documentation that adding !important is not allowed. Evidently AMP pages won’t render or won’t render properly if !important is used – – – ? I have used !important in my custom CSS code to edit & have removed it.

    ? I thought that could have something to do with the Failed to prepare AMP page message? but when I removed !important from custom CSS, I still got the Failed to prepare AMP page error message when I activated the AMP plugin.

    Also, I have not changed any plugins, or added / changed CSS in the last 30 / 60 days but since then, this error pops
    up, I thought, after the most recent AMP plugin update.

    Error Log Below

    https://gist.github.com/wsan12/1a5171839c18dbfdf6c28e3a427a1c58


    >>> I have done this, below, per instructions to other user with same error message. I did not see any errors in the error index related to this issue.

    To debug this issue first make sure you are able to access the developer tool for AMP, ie you can see AMP has a submenu Validation tool and error index if no then goto Users->Profile->enable AMP developer Tools (screenshot)

    >>> My admin toolbar does not show the AMP plugin. I did not see access to CSS Usages

    Next visit subscribe page to check which plugin or theme is excedding your site CSS budget goto Admin Toolbar->AMP->CSS Usages (screenshot)
    Clicking on it will take you to a page where you can find which plugin or theme is overbudgeting CSS

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

Viewing 15 replies - 1 through 15 (of 20 total)
  • I have faced the same problem…

    this is the ss for https://prnt.sc/1gvbdbs

    How could I solve this?

    @wsan1 Thanks for teaching out and providing additional insights, hopefully we can assist. Firstly can you share your Site Health information via this form while also switching to transitional mode, so we can inspect your canonical (non AMP) URLs? I’m curious to know did this occur after a particular update also – ie. Was everything working as expected previoulsy?

    In relation to the requirements you’re correct, 5.6.1 should be enough. Once we have your Site Health information we can inspect your setup.

    @alamin1321 If you’d like to open your own support topic we’d be happy to work with you from that topic individually. Please include all relevant information, including the information requested above.

    Thread Starter Wsan1

    (@wsan1)

    James, Thank you, I expect to add the Site Health snapshots to the form you offered, shortly. The Site Health says errors visible to viewers. I activated the AMP plugin so that the AMP page would not render, in order to copy the error so you can check it live.

    Right now the AMP plugin is active, so I expect pages / posts will continue to not render. BTW, I viewed the errors on a macbook pro, not a mobile phone. Also, I viewed the errors in chrome, Firefox, Safari, and Chrome Incognito. The errors came up under all browsers I tested. As soon as I De-activate the AMP plugin, all errors go away.

    My Site Health sometimes says webpage not visible to viewers under SEO. I believe that is the Ryte ? test. I checked into that, & that was not correct, I believe there was a bug in that test. The site should be viewable and with Robots.txt, etc.

    I switched to Transitional Mode.

    Yes, Everything was working as expected previously.

    I believe, but didn’t track it close enough to know, that this happened since a recent update. I don’t know if it was the most recent particular update, or prior.

    As mentioned, I don’t believe this is due to CSS budget overage.

    What can we do to correct this problem so that it does not arise any longer ?

    Footnote – I think a separate (later) discussion could be useful about whether or not AMP will render if the user uses CSS – !important, or Keyframes (other than opacity and transform, etc.) per the AMP.dev guidelines
    in their CSS in the head section (additional CSS ? ) in wordpress

    I only mention this because the issue is the AMP page not rendering, & I noticed in AMP dev info that if the user uses CSS in those ways, AMP will not render ? I am guessing many people are not aware of that.

    Thank you
    Will

    Thanks for the update. While I can’t be sure of the cause at present can you try and use the plugins suppression tool to deactivate W3 total cache from AMP URLs before checking once more?

    If that fails please inform me if the same issue persists when checking your AMP URLs using the Health Check & Troubleshooting plugin. We have some steps on the plugin website in relation to this, which can help rule out any third party plugin conflicts. If you need assistance following the steps on the website let me know and I can help out.

    What can we do to correct this problem so that it does not arise any longer ?

    We’ll know more if we can determine or pinpoint the cause using the Health Check & troubleshooting plugin.

    Footnote – I think a separate (later) discussion could be useful about whether or not AMP will render if the user uses CSS – !important, or Keyframes (other than opacity and transform, etc.) per the AMP.dev guidelines
    in their CSS in the head section (additional CSS ? ) in wordpress

    There shouldn’t be an issue with !important or keyframe rules. The AMP plugin once sanitizing your content will reformat such rules to ensure they are AMP valid, using more targeted classed without the need for !important rules.

    Thread Starter Wsan1

    (@wsan1)

    James, Thank you. I submitted Site Health info via the Form you provided. If there is a shortfall in the info I provided, please let me know & I can send such info.

    I am going to try to look for / find the suppression tool within the AMP plugin. I don’t think I have noticed such a tool before. I will look and try to deactivate W3 cache using that tool.

    Per your instructions, I need to get, and install the Health Check & AMP troubleshooting plugin if the issue persists ensuing the suppression tool attempt.

    Thanks for the update. After checking the details you kindly provided in your form nothing obvious stands out. With that please do let us know how you get on after checking using the plugins suppression tool with W3 Cache. You’ll find this option within the AMP plugins main settings dashboard (AMP > Settings)

    Thread Starter Wsan1

    (@wsan1)

    James, Thank You.

    https://gist.github.com/wsan12/77b140b02b96423b9d44388186fdf76d

    Updated Info:

    Switching the AMP to Transitional Mode from Standard mode eliminated this problem. After switching to transitional mode with the AMP Plugin Activated, pages rendered as normal. Then I switched back to Standard mode with the AMP Plugin activated & the gist above, with error appeared again, today 0729

    Then, (after the error appeared again) as mentioned, while in standard mode, I suppressed w3 cache via the AMP Plugin suppression tool. This did not work / help. Error still showed.

    I then installed the Health and Trouble Shooting plugin as described. I followed the steps indicated by
    clicking on the troubleshooting link (Troubleshooting mode active)

    The issue no longer appeared. —— However, this was / is due at that moment, possibly because the
    plugins are not enabled. ??So I enabled the all the plugins one by one, except the AMP plugin, and the pages were fine
    no problem. I cleared all caches and refreshed a couple of times each time.

    Then, as soon as I enabled the AMP Plugin, boom, the Error appears immediately.

    Can we please do some further investigation here ?

    The AMP is rendering the Error in standard mode, even while suppressing the w3 cache.

    I kept the same Theme, 2020 on this site, but that seems to not be related, as the issue continues
    to only happen when the AMP Plugin is Enabled. No other plugin here causes this.

    I am thinking the idea is to use the AMP plugin in Standard mode instead of Transitional Mode – – – – ?

    If we cannot figure this out, or, until we figure this out, is an easy solution to simply switch the
    AMP mode from Standard to Transitional – – – – ? (If so, I would need to test that some more to make
    sure this (temporary?) cure is stable.

    If so, can you please describe in more detail here, the disadvantages or consequences to a site that is using
    transitional mode VS. Standard mode beyond the short sentence(s) in the settings – – – ?

    What is the next step – – – ? If I can be of assistance, please let me know.`

    Thanks for performing the above checks. While you used the Health Check & Troubleshooting plugin to check with all plugins one by one can you do the opposite of how you performed this check? By this I mean activate only the AMP plugin while using the Health Check & Troubleshooting plugin, before then checking for the same issue. If the issue doesn’t reoccur then activate your other plugins, one by one.

    You can perform the above while in standard mode. Let me know how you get on after checking this.

    Thread Starter Wsan1

    (@wsan1)

    James, thank you

    Per your request, I deactivated all Plugins except the AMP Plugin in Standard mode and the Health and Trouble shooting plugin was active & immediately got the error message below

    https://gist.github.com/wsan12/ef39dc4eaa54f3578a521364ab466461

    Then, I deactivated the health and Trouble shooting plugin also in order to,as you said, have only the AMP plugin activated. I still got same error message.

    I then, one by one, activated all the plugins while the AMP Plugin in Standard Mode was activated and checked each time and got the same error. I refreshed the page before checking each time. Still got the same error every time.

    I then did the reverse again (de-activating each plugin one by once since I was already there) I checked each time & got the same error each time. I was left with the AMP plugin active only & in standard mode & the same error showed.

    I then switched the AMP plugin back to Transitional mode & the error went away again, instantly.

    By the Way, I also got the Error Message below once. I can’t remember when. But it also happened the other day when I was testing the problem again.

    https://gist.github.com/wsan12/efbc2cd718ce05b0dfea5edde969ba25

    I also got some kind of error while signed into the host (I believe it was the host) saying there was an error because the home page could not re-direct to the amp page. I am thinking this was because I was in standard mode while the error was active. I lost that exact message. If it may have relevance I can try to reproduce it.

    I am wondering if a significant number of other people are having this same issue. It seems to me that there would be because I am not using the plugin in a strange fashion – just in standard mode.

    I have other sites I am planning on testing this on. Just haven’t gotten to it yet.

    Also, it seems we have to get to the bottom of it and fix it for the same reason. I don’t think I am using the Plugin in any rare or unusual way. I am using it in a very standard way.

    What can I do now ?

    Thanks!

    Thanks once again for performing the additional checks. Based on the above I don’t necessarily suspect a plugin conflict. Do you recall if you selected a different theme while in troubleshooting mode?

    Rather than using the Health Check & troubleshooting plugin it would be great if you could temporarily switch to a difference core theme before checking more. From reviewing the PHP logs you provided in your Site Health information I can see some AMP_Theme_Support related errors.

    Thread Starter Wsan1

    (@wsan1)

    James, Thanks. I tested further by switching temporarily to 5 other themes and Tested the AMP Plugin in Standard mode (And a bit in Transitional Mode)

    https://gist.github.com/wsan12/ea67aa4e5990e258ae791dd857f5f620

    Above: While AMP plugin was in Standard mode & all other Plugins De-activated, I Switched Themes from Twenty-Twenty, the to Astra theme, then switched to OceanWP, then to Twenty-Nineteen theme, then Neve Theme, then Twenty – Seventeen. For all Themes, I got what appeared to be the same error, above.

    I then switched the AMP plugin to Transitional & worked backwards in the theme order I gave above, & the Themes / Pages / Site instantly appeared
    again & just about all appeared to be fine.

    An exception is the gist below: Astra also gave me the following Error Below in AMP Transitional Mode, plus the “Failed to prepare AMP Pages” message above, in standard mode for AMP plugin (The main error)

    https://gist.github.com/wsan12/eeebbb53a98aea5495acad2f077710c5

    There may well be multiple reasons why the AMP Plugin is not the source of these error(s). I don’t work with, or know enough to consider all the possibilities.

    Having said that, I don’t now have an understanding of what could cause this other than the AMP plugin.

    I have used the same Theme for several years. If this is a specific theme issue, it seems some of the other Themes would have worked. None of them did in standard mode for the AMP Plugin.

    The AMP Health test plugin, I recall, seemed to eliminated the other plugins I was using.

    Could it be other issues on the Server side, such as capacity limits, other WordPress settings that I should check on – – – ?

    My first thought at the beginning is have there been recent updates in the AMP plugin that could be candidates for causing this – – – ?

    From my perspective, there appears to be a significant issue that really still needs to be solved. It does not seem to me that we can just stop here.

    What should be done now to help fix this ? Would access to the site help ?

    I don’t see how a significant # of other people are not having similar issues. Maybe I am wrong.

    Thanks,

    Many thanks for sharing the additional insights. Great that you checked with other plugins despite the issue unfortunately reoccurring.

    Could it be other issues on the Server side, such as capacity limits, other WordPress settings that I should check on – – – ?

    It could well be. Have you performed the following checks?
    – Upgrading to at last PHP 7.3.x
    – Increasing your sites PHP memory limit
    – Do you encounter any errors when switching to reader mode and checking any AMP URLs?

    Thread Starter Wsan1

    (@wsan1)

    James, thanks.

    PHP is, and has been 7.4.10
    PHP memory limit is 64M.
    The php.imi says 256 M within the file itself. However, the
    Host provider issues a notice at the bottom of that page saying
    that regardless of what the file says, 64M is afforded on shared
    hosting, which this site is on.

    —–

    I put the AMP Plugin in reader mode with all other plugins DIS-abled and all pages rendered fine. I began to enable all plugins and checked all the pages which all rendered fine.

    I then did a Lighthouse test and on the first attempt, lighthouse said a chrome extension was causing an issue and the robots.txt file could not be downloaded. However, I changed nothing & on the 2nd, 3rd, and 4th re-test, the pages rendered fine. I guess it was a hiccup on the 1st test.

    ——-

    I switched the AMP Plugin back to Transitional Mode & ran a Google Lighthouse check and scores were not given. Instead the following message came up:

    The page may not be loading as expected because your test URL (https://www.bank-statement-loan.com/) was redirected to https://www.bank-statement-loan.com/?amp=1. Try testing the second URL directly.
    Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 500)

    ——

    Then I switched the AMP plugin to Standard Mode, tried to view the page and it rendered the now too familiar “Failed to prepare AMP Page”.

    Then, after that, while still in Standard Mode, I ran a Lighthouse check & the result was:

    There were issues affecting this run of Lighthouse:

    Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 500)

    I don’t know that I made any progress towards solving this.

    Can you please guide further on trying to solve this — ?

    Thank you!

    Thread Starter Wsan1

    (@wsan1)

    I should have thought ahead that my copy and paste in the answer above might or would render the URL hyperlink(s). The moderator, or you can delete those.

    That answer, which is a direct quote from Lighthouse after the Lighthouse test,
    was pretty short, so I did not do a gist at github. Looks like next time, I’ll just need to do a gist even if it is short. Can’t think of any other way other than breaking up the url in the text so that it won’t render a URL. Thanks

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Failed to Prep AMP Page’ is closed to new replies.