• We updated the AMP plugin last Thursday, and starting on Saturday we got AMP issues with google.

    We are getting 4 different errors:
    1: The tag ‘img’ should be replaced with an equivalent ‘amp-img’ tag.
    2: A mandatory AMP HTML tag is missing from this document.
    3: Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.
    4: External stylesheets not supported, except for whitelisted font providers. Use the document inline ‘style amp-custom’ tag instead.

    It’s currently only on 4 of our amp pages, however I noticed it’s an issue on all of them, google just hasn’t crawled them yet.

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

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    OK, thanks. Narrowing things down…

    Something else to try. In that same file, at the top of the prepare_response method, please add this condition:

    if ( isset( $_GET['verify_prepare_response_called'] ) ) {
    	return 'Prepare response was called! ##BEGIN##' . $response . '##END##';
    }

    So it would look like this:

    ...
    	public static function prepare_response( $response, $args = [] ) {
    		if ( isset( $_GET['verify_prepare_response_called'] ) ) {
    			return 'Prepare response was called! ##BEGIN##' . $response . '##END##';
    		}
    ...

    We’ll be able to confirm that it is being called by requesting the page with ?verify_prepare_response_called=1.

    • This reply was modified 4 years, 7 months ago by Weston Ruter.
    Thread Starter scoscosco

    (@scoscosco)

    added the code

    Plugin Author Weston Ruter

    (@westonruter)

    OK, so that is not getting called even though ob_start() was indeed called with it as the output buffer callback.

    Only thing I can think of is somehow you have a plugin that is cancelling the output buffer. But I would have expected “Prepare response was called!” to appear in the page because ob_start() did return true. Nevertheless, something else to try would be to add an argument to ob_start() to prevent it from being stopped.

    So in the start_output_buffering method, replace this line:

    if ( ! ob_start( [ __CLASS__, 'finish_output_buffering' ] ) ) {

    with

    if ( ! ob_start( [ __CLASS__, 'finish_output_buffering' ], null, 0 ) ) {

    The 0 will make the output buffer non-cleanable, non-flushable, and non-removable.

    Thread Starter scoscosco

    (@scoscosco)

    • This reply was modified 4 years, 7 months ago by scoscosco.
    • This reply was modified 4 years, 7 months ago by scoscosco.
    Plugin Author Weston Ruter

    (@westonruter)

    Very interesting. Now the question is which plugin on your site is causing that to happen. Are you able to deactivate plugins one-by-one to see which one causes that issue to stop happening when that ob_start() change is not applied?

    Thread Starter scoscosco

    (@scoscosco)

    Turned out to be a custom plugin that was made for us, and shouldn’t have been running on that page. It has been fixed. Thank you very much for the help!

    Is it possible to have the url and the info post deleted by chance?

    Thanks again!

    Plugin Author Weston Ruter

    (@westonruter)

    Can you share what the custom plugin was doing? If yours was doing it then others may be doing it as well, and if we can account for it we can improve compatibility.

    As for deleting site health info, I’m not sure. You may be able to edit your topics to remove content. Otherwise, it would have to be a request to the support forum moderators as it’s not something I have the ability to do.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘1.5.3 Update Issues’ is closed to new replies.