• Resolved filz51

    (@filz51)


    Hi
    For some reason AMP-pages of our website aren’t valid because the miss the URL for attribute “src” in tag “amp-img”. I would appreciate if you can check it.
    Best regards, filz51

Viewing 14 replies - 1 through 14 (of 14 total)
  • If you are talking about invalid structured data, this probably because you have not defined a default image in the admin panel for pages that do not have a featured image.

    https://wordpress.org/support/topic/invalid-image-url/

    • This reply was modified 6 years, 8 months ago by frenchomatic.
    Thread Starter filz51

    (@filz51)

    I checked that, but this can’t be the reason because I defined a default post image in the admin panel of your plugin. From this error are also pages affected which have a unique post image defined.
    Check here the test results of one example: https://search.google.com/test/amp?id=ObpAfkKuFd3A-q5MZ-_TBA
    Any other ideas?
    Best, filz51

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @filz51,

    Can you tell me what you are trying to add above the title?

    Regards
    Marqas

    Thread Starter filz51

    (@filz51)

    Hi Marqas
    There’s nothing before the title. Or am I missunderstanding your question?
    Regards, filz51

    You have this in your AMP page

    <ul class="amp-wp-meta amp-meta-wrapper">
    		<div class="amp-wp-meta amp-wp-byline">
    					<amp-img src="" width="24" height="24" layout="fixed"></amp-img>
    		</div>

    This is being caused by the fact that you have something running into your post-title-meta. It isn’t obvious at a first glance but I think it is your avatar. That needs to be turned off. In the plugin this is bit of code is firing –

    <?php if ( function_exists( 'get_avatar_url' ) && $author_avatar_url ) : ?>
    			<amp-img src="<?php echo esc_url( $author_avatar_url ); ?>" width="24" height="24" layout="fixed"></amp-img>
    		<?php endif ; 

    Try this first of all – in admin settings for “single” for the plugin make sure

    Author Bio in Single is off. Test again. Then if it is still doing it try turning meta to pages to off.

    If none of this works we are into filtering it out via functions.php.

    Comment //

    WP total cache is showing debug info in the source on non-amp pages. You should stop that from showing. If the W3TC toggle to turn it off in the admin panel does doesn’t work then this will do it . In functions.php add this

    add_filter( ‘w3tc_can_print_comment’, ‘__return_false’, 10, 1 );

    • This reply was modified 6 years, 8 months ago by frenchomatic.
    • This reply was modified 6 years, 8 months ago by frenchomatic.
    Thread Starter filz51

    (@filz51)

    Hi frenchomatic
    Your answer was helpful, thank you. I made the modification in the functions.php. The problem persists when W3 total cache is unactivated, so I digged deeper. When WP User Avatar is unactivated the AMP-pages are valid. Reactivating W3 total cache then doesn’t result in new errors. So for the moment it’s fine. I hope that I can make use of the User Avatar plugin in the future again after some updates…
    Thanks for the support and kind regards
    filz51

    Glad you found it. It was not immediately obvious that an avatar was the cause.

    Still you should turn off the debug in W3 total cache as it slows the page load down. It also alerts people that you are using that plugin which has had some problems in the past as a target for the baddies. Often even if you turn off the comments from rendering in the source from the W3TC admin it continues to show them. One way to stop it is to use that filter I have given.

    You should mark this as resolved if you are happy it is solved.

    Thread Starter filz51

    (@filz51)

    One last question: how could I filter out the firing code from the avatar plugin in functions.php?

    Thread Starter filz51

    (@filz51)

    BTW debug mode is switched off. doesn’t it look like for you?

    Hi @filz51,

    We already have this ticket in Github and we are planning to add this compatibility in our next update.
    ref: https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/975

    Looks like comments being rendered by W3TC are no longer showing but you have not deactivated the avatar thing. If you don’t wish to wait for the update you could probably use a remove action from the amp template head. It is probably best to just wait for the update.

    Hi @filz51,

    We have resolved that issue of avatar and added it in our next update which we are hoping to release within a day or two.

    With this update, you can show the wp user avatars in AMP as well.

    Once the plugin is updated, please check and let us know if your problem is resolved or not.

    Regards
    Marqas

    Thread Starter filz51

    (@filz51)

    Hi Marquas
    The issue looks solved for me. Thank you very much for your great support.
    Best regards, filz51

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Missing URL for attribute ‘src’ in tag ‘amp-img’.’ is closed to new replies.