Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first-party support for Crowdsignal poll/survey oEmbeds #1929

Merged
merged 3 commits into from
May 25, 2019

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Mar 5, 2019

Related: #1925.

@kraftbj
Copy link
Contributor

kraftbj commented Mar 5, 2019

Confirming that since Crowdsignal/Polldaddy is a core oembed, those embeds will work in some decent way without Jetpack in AMP after this PR?

@westonruter
Copy link
Member Author

@kraftbj oh, I wasn't aware that it is a core embed now. Well, without support the support of the AMP plugin or Jetpack then the sample content from Automattic/jetpack#11484 gets rendered as:

image

In other words, the poll oEmbed successfully gets a fallback since it has noscript for the AMP plugin to unwrap. The script does cause a validation error which the AMP plugin catches:

image

The Survey oEmbed, however, renders nothing since the oEmbed response is only a script:

<script type="text/javascript">(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/survey.js':'http://i0.poll.fm/survey.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-embed'));</script>

image

This lack of noscript seems like a shortcoming of the Crowdsignal survey oEmbed response.

Nevertheless, now that Crowdsignal is actually directly supported by core, it seems actually that it shouldn't be removed. More specifically, the oEmbed handling shouldn't be removed. The shortcode handling, however, is something that should be handled rather by the Jetpack or Crowdsignal plugins since the shortcodes are not defined in core. Agree?

@westonruter westonruter force-pushed the remove/bundled-polldaddy branch from 3e4bd5b to 923dd57 Compare March 15, 2019 00:18
@westonruter westonruter changed the title Remove Polldaddy code which should move to Jetpack/Crowdsignal Add first-party support for Crowdsignal poll/survey oEmbeds Mar 15, 2019
@westonruter westonruter marked this pull request as ready for review March 15, 2019 00:24
kraftbj pushed a commit to Automattic/jetpack that referenced this pull request Mar 15, 2019
#11484)

* Add AMP support for Crowdsignal shortcodes and oEmbeds

* Remove embed_oembed_html filter which remains in AMP plugin via ampproject/amp-wp#1929
@westonruter westonruter added this to the v1.2 milestone Mar 15, 2019
@westonruter westonruter requested a review from amedina May 24, 2019 18:32
@westonruter westonruter force-pushed the remove/bundled-polldaddy branch from 508c4f0 to 50fc4a0 Compare May 24, 2019 18:43
Copy link
Member

@amedina amedina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMT

@westonruter westonruter merged commit e3c647d into develop May 25, 2019
@swissspidy swissspidy deleted the remove/bundled-polldaddy branch June 18, 2019 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants