comments.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <?php
  2. require dirname( __FILE__ ) . '/base.php';
  3. /**
  4. * Main Comments class
  5. *
  6. * @package JetpackComments
  7. * @version 1.4
  8. * @since 1.4
  9. */
  10. class Jetpack_Comments extends Highlander_Comments_Base {
  11. /** Variables *************************************************************/
  12. /**
  13. * Possible comment form sources
  14. * @var array
  15. */
  16. public $id_sources = array();
  17. /**
  18. * URL
  19. * @var string
  20. */
  21. public $signed_url = '';
  22. /**
  23. * The default comment form color scheme
  24. * @var string
  25. * @see ::set_default_color_theme_based_on_theme_settings()
  26. */
  27. public $default_color_scheme = 'light';
  28. /** Methods ***************************************************************/
  29. public static function init() {
  30. static $instance = false;
  31. if ( ! $instance ) {
  32. $instance = new Jetpack_Comments;
  33. }
  34. return $instance;
  35. }
  36. /**
  37. * Main constructor for Comments
  38. *
  39. * @since JetpackComments (1.4)
  40. */
  41. public function __construct() {
  42. parent::__construct();
  43. // Comments is loaded
  44. /**
  45. * Fires after the Jetpack_Comments object has been instantiated
  46. *
  47. * @module comments
  48. *
  49. * @since 1.4.0
  50. *
  51. * @param array $jetpack_comments_loaded First element in array of type Jetpack_Comments
  52. **/
  53. do_action_ref_array( 'jetpack_comments_loaded', array( $this ) );
  54. add_action( 'after_setup_theme', array( $this, 'set_default_color_theme_based_on_theme_settings' ), 100 );
  55. }
  56. public function set_default_color_theme_based_on_theme_settings() {
  57. if ( function_exists( 'twentyeleven_get_theme_options' ) ) {
  58. $theme_options = twentyeleven_get_theme_options();
  59. $theme_color_scheme = isset( $theme_options['color_scheme'] ) ? $theme_options['color_scheme'] : 'transparent';
  60. } else {
  61. $theme_color_scheme = get_theme_mod( 'color_scheme', 'transparent' );
  62. }
  63. // Default for $theme_color_scheme is 'transparent' just so it doesn't match 'light' or 'dark'
  64. // The default for Jetpack's color scheme is still defined above as 'light'
  65. if ( false !== stripos( $theme_color_scheme, 'light' ) ) {
  66. $this->default_color_scheme = 'light';
  67. } elseif ( false !== stripos( $theme_color_scheme, 'dark' ) ) {
  68. $this->default_color_scheme = 'dark';
  69. }
  70. }
  71. /** Private Methods *******************************************************/
  72. /**
  73. * Set any global variables or class variables
  74. * @since JetpackComments (1.4)
  75. */
  76. protected function setup_globals() {
  77. parent::setup_globals();
  78. // Sources
  79. $this->id_sources = array(
  80. 'guest',
  81. 'jetpack',
  82. 'wordpress',
  83. 'twitter',
  84. 'facebook'
  85. );
  86. }
  87. /**
  88. * Setup actions for methods in this class
  89. * @since JetpackComments (1.4)
  90. */
  91. protected function setup_actions() {
  92. parent::setup_actions();
  93. // Selfishly remove everything from the existing comment form
  94. remove_all_actions( 'comment_form_before' );
  95. // Selfishly add only our actions back to the comment form
  96. add_action( 'comment_form_before', array( $this, 'comment_form_before' ) );
  97. add_action( 'comment_form_after', array( $this, 'comment_form_after' ), 1 ); // Set very early since we remove everything outputed before our action.
  98. // Before a comment is posted
  99. add_action( 'pre_comment_on_post', array( $this, 'pre_comment_on_post' ), 1 );
  100. // After a comment is posted
  101. add_action( 'comment_post', array( $this, 'add_comment_meta' ) );
  102. }
  103. /**
  104. * Setup filters for methods in this class
  105. * @since 1.6.2
  106. */
  107. protected function setup_filters() {
  108. parent::setup_filters();
  109. add_filter( 'comment_post_redirect', array( $this, 'capture_comment_post_redirect_to_reload_parent_frame' ), 100 );
  110. add_filter( 'get_avatar', array( $this, 'get_avatar' ), 10, 4 );
  111. }
  112. /**
  113. * Get the comment avatar from Gravatar, Twitter, or Facebook
  114. *
  115. * @since JetpackComments (1.4)
  116. *
  117. * @param string $avatar Current avatar URL
  118. * @param string $comment Comment for the avatar
  119. * @param int $size Size of the avatar
  120. * @param string $default Not used
  121. *
  122. * @return string New avatar
  123. */
  124. public function get_avatar( $avatar, $comment, $size, $default ) {
  125. if ( ! isset( $comment->comment_post_ID ) || ! isset( $comment->comment_ID ) ) {
  126. // it's not a comment - bail
  127. return $avatar;
  128. }
  129. // Detect whether it's a Facebook or Twitter avatar
  130. $foreign_avatar = get_comment_meta( $comment->comment_ID, 'hc_avatar', true );
  131. $foreign_avatar_hostname = parse_url( $foreign_avatar, PHP_URL_HOST );
  132. if ( ! $foreign_avatar_hostname ||
  133. ! preg_match( '/\.?(graph\.facebook\.com|twimg\.com)$/', $foreign_avatar_hostname ) ) {
  134. return $avatar;
  135. }
  136. // Return the FB or Twitter avatar
  137. return preg_replace( '#src=([\'"])[^\'"]+\\1#', 'src=\\1' . esc_url( set_url_scheme( $this->photon_avatar( $foreign_avatar, $size ), 'https' ) ) . '\\1', $avatar );
  138. }
  139. /** Output Methods ********************************************************/
  140. /**
  141. * Start capturing the core comment_form() output
  142. * @since JetpackComments (1.4)
  143. */
  144. public function comment_form_before() {
  145. /**
  146. * Filters the setting that determines if Jetpagk comments should be enabled for
  147. * the current post type.
  148. *
  149. * @module comments
  150. *
  151. * @since 3.8.1
  152. *
  153. * @param boolean $return Should comments be enabled?
  154. */
  155. if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type(), true ) ) {
  156. return;
  157. }
  158. // Add some JS to the footer
  159. add_action( 'wp_footer', array( $this, 'watch_comment_parent' ), 100 );
  160. ob_start();
  161. }
  162. /**
  163. * Noop the default comment form output, get some options, and output our
  164. * tricked out totally radical comment form.
  165. *
  166. * @since JetpackComments (1.4)
  167. */
  168. public function comment_form_after() {
  169. /** This filter is documented in modules/comments/comments.php */
  170. if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type(), true ) ) {
  171. return;
  172. }
  173. // Throw it all out and drop in our replacement
  174. ob_end_clean();
  175. // If users are required to be logged in, and they're not, then we don't need to do anything else
  176. if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
  177. /**
  178. * Changes the log in to comment prompt.
  179. *
  180. * @module comments
  181. *
  182. * @since 1.4.0
  183. *
  184. * @param string $var Default is "You must log in to post a comment."
  185. */
  186. echo '<p class="must-log-in">' . sprintf( apply_filters( 'jetpack_must_log_in_to_comment', __( 'You must <a href="%s">log in</a> to post a comment.', 'jetpack' ) ), wp_login_url( get_permalink() . '#respond' ) ) . '</p>';
  187. return;
  188. }
  189. if ( in_array( 'subscriptions', Jetpack::get_active_modules() ) ) {
  190. $stb_enabled = get_option( 'stb_enabled', 1 );
  191. $stb_enabled = empty( $stb_enabled ) ? 0 : 1;
  192. $stc_enabled = get_option( 'stc_enabled', 1 );
  193. $stc_enabled = empty( $stc_enabled ) ? 0 : 1;
  194. } else {
  195. $stb_enabled = 0;
  196. $stc_enabled = 0;
  197. }
  198. $params = array(
  199. 'blogid' => Jetpack_Options::get_option( 'id' ),
  200. 'postid' => get_the_ID(),
  201. 'comment_registration' => ( get_option( 'comment_registration' ) ? '1' : '0' ), // Need to explicitly send a '1' or a '0' for these
  202. 'require_name_email' => ( get_option( 'require_name_email' ) ? '1' : '0' ),
  203. 'stc_enabled' => $stc_enabled,
  204. 'stb_enabled' => $stb_enabled,
  205. 'show_avatars' => ( get_option( 'show_avatars' ) ? '1' : '0' ),
  206. 'avatar_default' => get_option( 'avatar_default' ),
  207. 'greeting' => get_option( 'highlander_comment_form_prompt', __( 'Leave a Reply', 'jetpack' ) ),
  208. /**
  209. * Changes the comment form prompt.
  210. *
  211. * @module comments
  212. *
  213. * @since 2.3.0
  214. *
  215. * @param string $var Default is "Leave a Reply to %s."
  216. */
  217. 'greeting_reply' => apply_filters( 'jetpack_comment_form_prompt_reply', __( 'Leave a Reply to %s', 'jetpack' ) ),
  218. 'color_scheme' => get_option( 'jetpack_comment_form_color_scheme', $this->default_color_scheme ),
  219. 'lang' => get_locale(),
  220. 'jetpack_version' => JETPACK__VERSION,
  221. );
  222. // Extra parameters for logged in user
  223. if ( is_user_logged_in() ) {
  224. $current_user = wp_get_current_user();
  225. $params['hc_post_as'] = 'jetpack';
  226. $params['hc_userid'] = $current_user->ID;
  227. $params['hc_username'] = $current_user->display_name;
  228. $params['hc_userurl'] = $current_user->user_url;
  229. $params['hc_useremail'] = md5( strtolower( trim( $current_user->user_email ) ) );
  230. if ( current_user_can( 'unfiltered_html' ) ) {
  231. $params['_wp_unfiltered_html_comment'] = wp_create_nonce( 'unfiltered-html-comment_' . get_the_ID() );
  232. }
  233. } else {
  234. $commenter = wp_get_current_commenter();
  235. $params['show_cookie_consent'] = (int) has_action( 'set_comment_cookies', 'wp_set_comment_cookies' );
  236. $params['has_cookie_consent'] = (int) ! empty( $commenter['comment_author_email'] );
  237. }
  238. $signature = Jetpack_Comments::sign_remote_comment_parameters( $params, Jetpack_Options::get_option( 'blog_token' ) );
  239. if ( is_wp_error( $signature ) ) {
  240. $signature = 'error';
  241. }
  242. $params['sig'] = $signature;
  243. $url_origin = set_url_scheme( 'http://jetpack.wordpress.com' );
  244. $url = "{$url_origin}/jetpack-comment/?" . http_build_query( $params );
  245. $url = "{$url}#parent=" . urlencode( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
  246. $this->signed_url = $url;
  247. $height = $params['comment_registration'] || is_user_logged_in() ? '315' : '430'; // Iframe can be shorter if we're not allowing guest commenting
  248. $transparent = ( $params['color_scheme'] == 'transparent' ) ? 'true' : 'false';
  249. if ( isset( $_GET['replytocom'] ) ) {
  250. $url .= '&replytocom=' . (int) $_GET['replytocom'];
  251. }
  252. /**
  253. * Filter whether the comment title can be displayed.
  254. *
  255. * @module comments
  256. *
  257. * @since 4.7.0
  258. *
  259. * @param bool $show Can the comment be displayed? Default to true.
  260. */
  261. $show_greeting = apply_filters( 'jetpack_comment_form_display_greeting', true );
  262. // The actual iframe (loads comment form from Jetpack server)
  263. ?>
  264. <div id="respond" class="comment-respond">
  265. <?php if ( true === $show_greeting ) : ?>
  266. <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( esc_html( $params['greeting'] ), esc_html( $params['greeting_reply'] ) ); ?>
  267. <small><?php cancel_comment_reply_link( esc_html__( 'Cancel reply', 'jetpack' ) ); ?></small>
  268. </h3>
  269. <?php endif; ?>
  270. <form id="commentform" class="comment-form">
  271. <iframe title="<?php esc_attr_e( 'Comment Form' , 'jetpack' ); ?>" src="<?php echo esc_url( $url ); ?>" style="width:100%; height: <?php echo $height; ?>px; border:0;" name="jetpack_remote_comment" class="jetpack_remote_comment" id="jetpack_remote_comment" sandbox="allow-same-origin allow-top-navigation allow-scripts allow-forms allow-popups"></iframe>
  272. <?php if ( ! Jetpack_AMP_Support::is_amp_request() ) : ?>
  273. <!--[if !IE]><!-->
  274. <script>
  275. document.addEventListener('DOMContentLoaded', function () {
  276. var commentForms = document.getElementsByClassName('jetpack_remote_comment');
  277. for (var i = 0; i < commentForms.length; i++) {
  278. commentForms[i].allowTransparency = <?php echo $transparent; ?>;
  279. commentForms[i].scrolling = 'no';
  280. }
  281. });
  282. </script>
  283. <!--<![endif]-->
  284. <?php endif; ?>
  285. </form>
  286. </div>
  287. <?php // Below is required for comment reply JS to work ?>
  288. <input type="hidden" name="comment_parent" id="comment_parent" value="" />
  289. <?php
  290. }
  291. /**
  292. * Add some JS to wp_footer to watch for hierarchical reply parent change
  293. *
  294. * @since JetpackComments (1.4)
  295. */
  296. public function watch_comment_parent() {
  297. $url_origin = set_url_scheme( 'http://jetpack.wordpress.com' );
  298. ?>
  299. <!--[if IE]>
  300. <script type="text/javascript">
  301. if ( 0 === window.location.hash.indexOf( '#comment-' ) ) {
  302. // window.location.reload() doesn't respect the Hash in IE
  303. window.location.hash = window.location.hash;
  304. }
  305. </script>
  306. <![endif]-->
  307. <script type="text/javascript">
  308. (function () {
  309. var comm_par_el = document.getElementById( 'comment_parent' ),
  310. comm_par = ( comm_par_el && comm_par_el.value ) ? comm_par_el.value : '',
  311. frame = document.getElementById( 'jetpack_remote_comment' ),
  312. tellFrameNewParent;
  313. tellFrameNewParent = function () {
  314. if ( comm_par ) {
  315. frame.src = "<?php echo esc_url_raw( $this->signed_url ); ?>" + '&replytocom=' + parseInt( comm_par, 10 ).toString();
  316. } else {
  317. frame.src = "<?php echo esc_url_raw( $this->signed_url ); ?>";
  318. }
  319. };
  320. <?php if ( get_option( 'thread_comments' ) && get_option( 'thread_comments_depth' ) ) : ?>
  321. if ( 'undefined' !== typeof addComment ) {
  322. addComment._Jetpack_moveForm = addComment.moveForm;
  323. addComment.moveForm = function ( commId, parentId, respondId, postId ) {
  324. var returnValue = addComment._Jetpack_moveForm( commId, parentId, respondId, postId ),
  325. cancelClick, cancel;
  326. if ( false === returnValue ) {
  327. cancel = document.getElementById( 'cancel-comment-reply-link' );
  328. cancelClick = cancel.onclick;
  329. cancel.onclick = function () {
  330. var cancelReturn = cancelClick.call( this );
  331. if ( false !== cancelReturn ) {
  332. return cancelReturn;
  333. }
  334. if ( ! comm_par ) {
  335. return cancelReturn;
  336. }
  337. comm_par = 0;
  338. tellFrameNewParent();
  339. return cancelReturn;
  340. };
  341. }
  342. if ( comm_par == parentId ) {
  343. return returnValue;
  344. }
  345. comm_par = parentId;
  346. tellFrameNewParent();
  347. return returnValue;
  348. };
  349. }
  350. <?php endif; ?>
  351. // Do the post message bit after the dom has loaded.
  352. document.addEventListener( 'DOMContentLoaded', function () {
  353. var iframe_url = <?php echo json_encode( esc_url_raw( $url_origin ) ); ?>;
  354. if ( window.postMessage ) {
  355. if ( document.addEventListener ) {
  356. window.addEventListener( 'message', function ( event ) {
  357. var origin = event.origin.replace( /^http:\/\//i, 'https://' );
  358. if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
  359. return;
  360. }
  361. jQuery( frame ).height( event.data );
  362. });
  363. } else if ( document.attachEvent ) {
  364. window.attachEvent( 'message', function ( event ) {
  365. var origin = event.origin.replace( /^http:\/\//i, 'https://' );
  366. if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
  367. return;
  368. }
  369. jQuery( frame ).height( event.data );
  370. });
  371. }
  372. }
  373. })
  374. })();
  375. </script>
  376. <?php
  377. }
  378. /**
  379. * Verify the hash included in remote comments.
  380. *
  381. * @since JetpackComments (1.4)
  382. *
  383. * @param type $comment Not used
  384. */
  385. public function pre_comment_on_post( $comment ) {
  386. $post_array = stripslashes_deep( $_POST );
  387. // Bail if missing the Jetpack token
  388. if ( ! isset( $post_array['sig'] ) ) {
  389. unset( $_POST['hc_post_as'] );
  390. return;
  391. }
  392. if ( false !== strpos( $post_array['hc_avatar'], '.gravatar.com' ) ) {
  393. $post_array['hc_avatar'] = htmlentities( $post_array['hc_avatar'] );
  394. }
  395. $check = Jetpack_Comments::sign_remote_comment_parameters( $post_array, Jetpack_Options::get_option( 'blog_token' ) );
  396. if ( is_wp_error( $check ) ) {
  397. wp_die( $check );
  398. }
  399. // Bail if token is expired or not valid
  400. if ( $check !== $post_array['sig'] ) {
  401. wp_die( __( 'Invalid security token.', 'jetpack' ) );
  402. }
  403. /** This filter is documented in modules/comments/comments.php */
  404. if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type( $post_array['comment_post_ID'] ), true ) ) {
  405. // In case the comment POST is legit, but the comments are
  406. // now disabled, we don't allow the comment
  407. wp_die( __( 'Comments are not allowed.', 'jetpack' ) );
  408. }
  409. }
  410. /** Capabilities **********************************************************/
  411. /**
  412. * Add some additional comment meta after comment is saved about what
  413. * service the comment is from, the avatar, user_id, etc...
  414. *
  415. * @since JetpackComments (1.4)
  416. *
  417. * @param type $comment_id
  418. */
  419. public function add_comment_meta( $comment_id ) {
  420. $comment_meta = array();
  421. switch ( $this->is_highlander_comment_post() ) {
  422. case 'facebook' :
  423. $comment_meta['hc_post_as'] = 'facebook';
  424. $comment_meta['hc_avatar'] = stripslashes( $_POST['hc_avatar'] );
  425. $comment_meta['hc_foreign_user_id'] = stripslashes( $_POST['hc_userid'] );
  426. break;
  427. case 'twitter' :
  428. $comment_meta['hc_post_as'] = 'twitter';
  429. $comment_meta['hc_avatar'] = stripslashes( $_POST['hc_avatar'] );
  430. $comment_meta['hc_foreign_user_id'] = stripslashes( $_POST['hc_userid'] );
  431. break;
  432. case 'wordpress' :
  433. $comment_meta['hc_post_as'] = 'wordpress';
  434. $comment_meta['hc_avatar'] = stripslashes( $_POST['hc_avatar'] );
  435. $comment_meta['hc_foreign_user_id'] = stripslashes( $_POST['hc_userid'] );
  436. $comment_meta['hc_wpcom_id_sig'] = stripslashes( $_POST['hc_wpcom_id_sig'] ); //since 1.9
  437. break;
  438. case 'jetpack' :
  439. $comment_meta['hc_post_as'] = 'jetpack';
  440. $comment_meta['hc_avatar'] = stripslashes( $_POST['hc_avatar'] );
  441. $comment_meta['hc_foreign_user_id'] = stripslashes( $_POST['hc_userid'] );
  442. break;
  443. }
  444. // Bail if no extra comment meta
  445. if ( empty( $comment_meta ) ) {
  446. return;
  447. }
  448. // Loop through extra meta and add values
  449. foreach ( $comment_meta as $key => $value ) {
  450. add_comment_meta( $comment_id, $key, $value, true );
  451. }
  452. }
  453. function capture_comment_post_redirect_to_reload_parent_frame( $url ) {
  454. if ( ! isset( $_GET['for'] ) || 'jetpack' != $_GET['for'] ) {
  455. return $url;
  456. }
  457. ?>
  458. <!DOCTYPE html>
  459. <html <?php language_attributes(); ?>>
  460. <!--<![endif]-->
  461. <head>
  462. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  463. <title><?php printf( __( 'Submitting Comment%s', 'jetpack' ), '&hellip;' ); ?></title>
  464. <style type="text/css">
  465. body {
  466. display: table;
  467. width: 100%;
  468. height: 60%;
  469. position: absolute;
  470. top: 0;
  471. left: 0;
  472. overflow: hidden;
  473. color: #333;
  474. }
  475. h1 {
  476. text-align: center;
  477. margin: 0;
  478. padding: 0;
  479. display: table-cell;
  480. vertical-align: middle;
  481. font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
  482. font-weight: normal;
  483. }
  484. .hidden {
  485. opacity: 0;
  486. }
  487. h1 span {
  488. -moz-transition-property: opacity;
  489. -moz-transition-duration: 1s;
  490. -moz-transition-timing-function: ease-in-out;
  491. -webkit-transition-property: opacity;
  492. -webkit-transition-duration: 1s;
  493. -webbit-transition-timing-function: ease-in-out;
  494. -o-transition-property: opacity;
  495. -o-transition-duration: 1s;
  496. -o-transition-timing-function: ease-in-out;
  497. -ms-transition-property: opacity;
  498. -ms-transition-duration: 1s;
  499. -ms-transition-timing-function: ease-in-out;
  500. transition-property: opacity;
  501. transition-duration: 1s;
  502. transition-timing-function: ease-in-out;
  503. }
  504. </style>
  505. </head>
  506. <body>
  507. <h1><?php printf( __( 'Submitting Comment%s', 'jetpack' ), '<span id="ellipsis" class="hidden">&hellip;</span>' ); ?></h1>
  508. <script type="text/javascript">
  509. try {
  510. window.parent.location = <?php echo json_encode( $url ); ?>;
  511. window.parent.location.reload(true);
  512. } catch (e) {
  513. window.location = <?php echo json_encode( $url ); ?>;
  514. window.location.reload(true);
  515. }
  516. ellipsis = document.getElementById('ellipsis');
  517. function toggleEllipsis() {
  518. ellipsis.className = ellipsis.className ? '' : 'hidden';
  519. }
  520. setInterval(toggleEllipsis, 1200);
  521. </script>
  522. </body>
  523. </html>
  524. <?php
  525. exit;
  526. }
  527. }
  528. Jetpack_Comments::init();