Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey, i found a solution for me :

    Go to => /wp-content/plugins/amp-wp/includes/class-amp-wp-content-sanitizer.php

    Search : Line 346 : Function transform_to_end_point_amp

    Replace $url by :

    $url = sprintf( ‘%s:%s/%s’, $parsed[‘scheme’], $parsed[‘host’], ltrim( $path, ‘/’ ) );
    $url = trailingslashit( $url ) . Amp_WP_Public::SLUG . ‘/’;

    Enjoy

    Thread Starter peteto2006

    (@peteto2006)

    Thank you!!!

    That did the trick!

    Thanks again. My amp is now validated.

    I guess I’ll have to do it with every plugin update.

    Plugin Author Mohsin Rafique

    (@mohsinrafique)

    Hi @peteto2006,

    You really don’t need to fix that error in our upcoming release. We will fix this error in our next release.

    For Yoast SEO, you really don’t need to do anything additional.

    @groslebrave thank you for helping us to find the bug in the code.

    Thanks,

    Plugin Author Mohsin Rafique

    (@mohsinrafique)

    Hi @peteto2006,

    Despite @groslebrave having a good suggestion, a better way to fix Malformed URL error, please do the following for a more accurate solution:

    Step 1: Go to path /wp-content/plugins/amp-wp/includes/

    Step 2: Open file class-amp-wp-content-sanitizer.php

    Step 3: Search function protected static function transform_to_end_point_amp at line 346.

    Step 4: Replace line no 368 return amp_wp_url_trim_end_slash( $url ); with return $url;

    Let us know if that helps.

    Thanks,

    Thread Starter peteto2006

    (@peteto2006)

    I don’t know what’s causing it, but Google Webmaster is giving me errors.
    Because it indexes the url the following way:
    For ex.:
    https://mysuper.site/mysuper.site/amp
    I.e. it’s addind the url twice before adding /amp
    If I enter the url the correct way and add /amp all is working, but somehow Google indexes the url the way described above.

    Here’s another example:
    https://mysuper.site/site/facebook-like-box/mysuper.site/site/facebook-like-box/amp/

    That way Google doesn’t index the amp ??

    Plugin Author Mohsin Rafique

    (@mohsinrafique)

    Hi @peteto2006,

    Provided URLs are indexed on google already. When Google re-indexes them, these issues will be resolved automatically. We didn’t find anymore critical issues on your site.

    Also, your AMP site layout seems to be broken, have you done any code customization on it?

    Thanks,

    Plugin Author Mohsin Rafique

    (@mohsinrafique)

    Hi @peteto2006,

    We have released a new version. Please update and let us know if you still face any issues.

    Note: Please clear your browser’s cache to see the changes. If you are using any caching plugin/software then please clear your server cache. This would resolve the layout issues, if there are any.

    Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Failed validation because of malformed url’ is closed to new replies.