{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/32875000","id":32875000,"diff_hunk":"@@ -13,12 +14,92 @@ class PolldaddyShortcode {\n \t * Add all the actions & resgister the shortcode\n \t */\n \tfunction __construct() {\n-\t\tif ( defined( 'GLOBAL_TAGS' ) == false )\n+\t\tif ( defined( 'GLOBAL_TAGS' ) == false ) {\n \t\t\tadd_shortcode( 'polldaddy', array( $this, 'polldaddy_shortcode' ) );\n+\t\t\tadd_filter( 'pre_kses', array( $this, 'polldaddy_embed_to_shortcode' ) );\n+\t\t}\n \t\tadd_action( 'wp_enqueue_scripts', array( $this, 'check_infinite' ) );\n \t\tadd_action( 'infinite_scroll_render', array( $this, 'polldaddy_shortcode_infinite' ), 11 );\n \t}\n \n+\tprivate function get_async_code( array $settings, $survey_link ) {\n+\t\t$embed_src     = 'http://i0.poll.fm/survey.js';\n+\t\t$embed_src_ssl = 'https://polldaddy.com/survey.js';\n+\n+\t\t$include = <<<CONTAINER\n+( function( d, c, j ) {\n+  if ( !d.getElementById( j ) ) {\n+    var pd = d.createElement( c ), s;\n+    pd.id = j;\n+    pd.src = ( 'https:' == d.location.protocol ) ? '{$embed_src_ssl}' : '{$embed_src}';\n+    s = d.getElementsByTagName( c )[0];\n+    s.parentNode.insertBefore( pd, s );\n+  }\n+}( document, 'script', 'pd-embed' ) );\n+CONTAINER;\n+\n+\t\t// Compress it a bit\n+\t\t$include = $this->compress_it( $include );\n+\n+\t\t$placeholder = '<div class=\"pd-embed\" data-settings=\"'.esc_attr( json_encode( $settings ) ).'\"></div>';\n+\t\tif ( $type === 'button' )","path":"modules/shortcodes/polldaddy.php","position":41,"original_position":41,"commit_id":"738c4998c11ea13c9b96aaf9563df3d6c444e2b4","original_commit_id":"738c4998c11ea13c9b96aaf9563df3d6c444e2b4","user":{"login":"dereksmart","id":7129409,"avatar_url":"https://avatars.githubusercontent.com/u/7129409?v=3","gravatar_id":"","url":"https://api.github.com/users/dereksmart","html_url":"https://github.com/dereksmart","followers_url":"https://api.github.com/users/dereksmart/followers","following_url":"https://api.github.com/users/dereksmart/following{/other_user}","gists_url":"https://api.github.com/users/dereksmart/gists{/gist_id}","starred_url":"https://api.github.com/users/dereksmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dereksmart/subscriptions","organizations_url":"https://api.github.com/users/dereksmart/orgs","repos_url":"https://api.github.com/users/dereksmart/repos","events_url":"https://api.github.com/users/dereksmart/events{/privacy}","received_events_url":"https://api.github.com/users/dereksmart/received_events","type":"User","site_admin":false},"body":"Yoda conditionals plz\r\n","created_at":"2015-06-19T22:31:19Z","updated_at":"2015-06-19T22:31:19Z","html_url":"https://github.com/Automattic/jetpack/pull/2242#discussion_r32875000","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2242","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/32875000"},"html":{"href":"https://github.com/Automattic/jetpack/pull/2242#discussion_r32875000"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2242"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/2242","id":37445912,"html_url":"https://github.com/Automattic/jetpack/pull/2242","diff_url":"https://github.com/Automattic/jetpack/pull/2242.diff","patch_url":"https://github.com/Automattic/jetpack/pull/2242.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/2242","number":2242,"state":"open","locked":false,"title":"Shortcodes: Merges the polldaddy shortcode changes from WP.com","user":{"login":"zinigor","id":374293,"avatar_url":"https://avatars.githubusercontent.com/u/374293?v=3","gravatar_id":"","url":"https://api.github.com/users/zinigor","html_url":"https://github.com/zinigor","followers_url":"https://api.github.com/users/zinigor/followers","following_url":"https://api.github.com/users/zinigor/following{/other_user}","gists_url":"https://api.github.com/users/zinigor/gists{/gist_id}","starred_url":"https://api.github.com/users/zinigor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinigor/subscriptions","organizations_url":"https://api.github.com/users/zinigor/orgs","repos_url":"https://api.github.com/users/zinigor/repos","events_url":"https://api.github.com/users/zinigor/events{/privacy}","received_events_url":"https://api.github.com/users/zinigor/received_events","type":"User","site_admin":false},"body":"This is a fairly large merge that brings the wpcom shortcode version in sync with the Jetpack version. Should fix #2079.","created_at":"2015-06-11T09:47:22Z","updated_at":"2015-06-19T22:31:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56b26bde61bc1b349bb2fa6523b75e3ada4b668a","assignee":null,"milestone":{"url":"https://api.github.com/repos/Automattic/jetpack/milestones/16","html_url":"https://github.com/Automattic/jetpack/milestones/3.6","labels_url":"https://api.github.com/repos/Automattic/jetpack/milestones/16/labels","id":955017,"number":16,"title":"3.6","description":"","creator":{"login":"jeherve","id":426388,"avatar_url":"https://avatars.githubusercontent.com/u/426388?v=3","gravatar_id":"","url":"https://api.github.com/users/jeherve","html_url":"https://github.com/jeherve","followers_url":"https://api.github.com/users/jeherve/followers","following_url":"https://api.github.com/users/jeherve/following{/other_user}","gists_url":"https://api.github.com/users/jeherve/gists{/gist_id}","starred_url":"https://api.github.com/users/jeherve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeherve/subscriptions","organizations_url":"https://api.github.com/users/jeherve/orgs","repos_url":"https://api.github.com/users/jeherve/repos","events_url":"https://api.github.com/users/jeherve/events{/privacy}","received_events_url":"https://api.github.com/users/jeherve/received_events","type":"User","site_admin":false},"open_issues":142,"closed_issues":168,"state":"open","created_at":"2015-01-28T15:04:56Z","updated_at":"2015-06-19T21:52:14Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2242/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2242/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/2242/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/738c4998c11ea13c9b96aaf9563df3d6c444e2b4","head":{"label":"Automattic:merge/shortcode-polldaddy","ref":"merge/shortcode-polldaddy","sha":"738c4998c11ea13c9b96aaf9563df3d6c444e2b4","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Your WordPress, Streamlined.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","created_at":"2013-12-16T16:43:01Z","updated_at":"2015-06-18T07:53:31Z","pushed_at":"2015-06-19T22:29:04Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"http://jetpack.me","size":294032,"stargazers_count":355,"watchers_count":355,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":246,"mirror_url":null,"open_issues_count":566,"forks":246,"open_issues":566,"watchers":355,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"0b95c24c9e86ffdf6a4138718ef275947e423ab2","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Your WordPress, Streamlined.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","created_at":"2013-12-16T16:43:01Z","updated_at":"2015-06-18T07:53:31Z","pushed_at":"2015-06-19T22:29:04Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"http://jetpack.me","size":294032,"stargazers_count":355,"watchers_count":355,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":246,"mirror_url":null,"open_issues_count":566,"forks":246,"open_issues":566,"watchers":355,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2242"},"html":{"href":"https://github.com/Automattic/jetpack/pull/2242"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/2242"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/2242/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2242/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2242/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/738c4998c11ea13c9b96aaf9563df3d6c444e2b4"}}}}