Amp-wp: Jetpack Facebook Page plugin not working with beta

Created on 6 Jul 2018  路  7Comments  路  Source: ampproject/amp-wp

As a user, I should expect the AMP plugin, when in Native AMP mode, to convert HTML markup (including Jetpack's Facebook Page plugin widget) on render to compliant AMPHTML components.

  • [x] AC1: When both Jetpack and AMP are installed, activated and configured in Native AMP mode, the Facebook Page plugin (as activated in a widget area, screenshot below) should render in a non-error state. The AMP plugin should be able to distinguish between what embeds need an <amp-facebook> or an <amp-facebook-page> wrapper (and possibly <amp-facebook-like> and <amp-facebook-comments>) as described by @westonruter below.

I use the Jetpack Facebook Page Plugin in my sidebar.

When I activate AMP I get:
"This Facebook post is no longer available. It may have been removed or the privacy settings of the post may have changed."

Bug

All 7 comments

@markbiernat Are you referring to the Facebook Page Like Box Widget?

Yes the widget created by Jetpack - It can display your FB header image and a like and message button. See the attached.
fbjetpack

I can reproduce this problem.

The plugin is currently taking this markup:

<div id="fb-root"></div>
<div class="fb-page" data-href="https://www.facebook.com/xwp.co/" data-width="340"  data-height="432" data-hide-cover="false" data-show-facepile="true" data-show-posts="false">
    <div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/xwp.co/"><a href="https://www.facebook.com/xwp.co/">Like Us</a></blockquote>
    </div>
</div>

And converting it into:

<div id="fb-root"></div>
<amp-facebook data-href="https://www.facebook.com/xwp.co/" data-embed-as="post" layout="responsive" width="600" height="400"></amp-facebook>

This is wrong. Instead of an amp-facebook component it should be converted into an amp-facebook-page component.

Support needs to be added to the AMP_Facebook_Embed_Handler class:

https://github.com/Automattic/amp-wp/blob/024e450798c35a89c3390c410ab42522a924f712/includes/embeds/class-amp-facebook-embed.php#L97-L136

If possible not only should it properly properly convert amp-facebook and amp-facebook-page, but it should also handle amp-facebook-like and amp-facebook-comments, if it makes sense.

Hi @markbiernat! Thanks for reporting in your issue. I believe @hellofromtonya will be working on this shortly and we'll ping you here with an update when it's ready for testing.

I'm confirming I could see this locally on my side as well. @westonruter, thanks for helping work though this.

I'm removing this from 1.0 milestone. It's not something that is required for 1.0. It can come after. It's something that can be done at any time.

Better late than never, I've opened a PR to fix this issue: #1956.

@markbiernat This may not be an issue for you anymore, but if so, please test the amp.zip build attached to that PR.

On
Version 1.1-alpha-20190226T001832Z-bc77bcb5
It works and I do not have the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

westonruter picture westonruter  路  5Comments

miina picture miina  路  5Comments

GitaStreet picture GitaStreet  路  4Comments

maciejmackowiak picture maciejmackowiak  路  5Comments

westonruter picture westonruter  路  4Comments