PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-ui.php +68 -246 13.6.2 → 16.3 View file →
@@ -8,11 +8,13 @@
8 8 namespace Automattic\Jetpack\Publicize;
9 9
10 10 use Automattic\Jetpack\Assets;
11 11 use Automattic\Jetpack\Current_Plan;
12 +use Automattic\Jetpack\Publicize\Publicize_Utils as Utils;
13 +use Automattic\Jetpack\Status\Host;
12 14
13 15 /**
14 - * Only user facing pieces of Publicize are found here.
16 + * Classic editor integration: the Publicize metabox on the post screen, and its assets.
15 17 */
16 18 class Publicize_UI {
17 19 /**
18 20 * Contains an instance of class 'Publicize' which loads Keyring, sets up services, etc.
@@ -21,9 +23,9 @@
21 23 */
22 24 public $publicize;
23 25
24 26 /**
25 - * URL to Sharing settings page in wordpress.com
27 + * URL of the admin page where Publicize connections are managed.
26 28 *
27 29 * @var string
28 30 */
29 31 protected $publicize_settings_url = '';
@@ -37,9 +39,9 @@
37 39 $publicize = new Publicize();
38 40 }
39 41 $this->publicize = $publicize;
40 42
41 - add_action( 'init', array( $this, 'init' ) );
43 + add_action( 'admin_init', array( $this, 'init' ) );
42 44 }
43 45
44 46 /**
45 47 * Initialize UI-related functionality.
@@ -44,115 +46,23 @@
44 46 /**
45 47 * Initialize UI-related functionality.
46 48 */
47 49 public function init() {
48 - $this->publicize_settings_url = $this->publicize->publicize_connections_url();
49 -
50 50 // Show only to users with the capability required to manage their Publicize connections.
51 - if ( ! $this->publicize->current_user_can_access_publicize_data() ) {
51 + if ( ! Utils::is_publicize_active() || ! $this->publicize->current_user_can_access_publicize_data() ) {
52 52 return;
53 53 }
54 54
55 + $this->publicize_settings_url = $this->publicize->publicize_connections_url();
56 +
55 57 // Assets (css, js).
56 58 add_action( 'admin_head-post.php', array( $this, 'post_page_metabox_assets' ) );
57 59 add_action( 'admin_head-post-new.php', array( $this, 'post_page_metabox_assets' ) );
58 60
59 - // Management of publicize (sharing screen, ajax/lightbox popup, and metabox on post screen).
60 61 add_action( 'post_submitbox_misc_actions', array( $this, 'post_page_metabox' ) );
61 62 }
62 63
63 64 /**
64 - * If the ShareDaddy plugin is not active we need to add the sharing settings page to the menu still
65 - *
66 - * @deprecated 0.42.3
67 - */
68 - public function sharing_menu() {
69 - add_submenu_page(
70 - 'options-general.php',
71 - esc_html__( 'Sharing Settings', 'jetpack-publicize-pkg' ),
72 - esc_html__( 'Sharing', 'jetpack-publicize-pkg' ),
73 - 'publish_posts',
74 - 'sharing',
75 - array( $this, 'wrapper_admin_page' )
76 - );
77 - }
78 -
79 - /**
80 - * Add admin page with wrapper.
81 - *
82 - * @deprecated 0.42.3
83 - */
84 - public function wrapper_admin_page() {
85 - if ( class_exists( 'Jetpack_Admin_Page' ) ) {
86 - \Jetpack_Admin_Page::wrap_ui( array( $this, 'management_page' ) );
87 - }
88 - }
89 -
90 - /**
91 - * Management page to load if Sharedaddy is not active so the 'pre_admin_screen_sharing' action exists.
92 - *
93 - * @deprecated 0.42.3
94 - */
95 - public function management_page() {
96 - ?>
97 - <div class="wrap">
98 - <div class="icon32" id="icon-options-general"><br /></div>
99 - <h1><?php esc_html_e( 'Sharing Settings', 'jetpack-publicize-pkg' ); ?></h1>
100 -
101 - <?php
102 - /** This action is documented in modules/sharedaddy/sharing.php */
103 - do_action( 'pre_admin_screen_sharing' );
104 - ?>
105 - </div>
106 - <?php
107 - }
108 -
109 - /**
110 - * Styling for the sharing screen and popups
111 - * JS for the options and switching
112 - *
113 - * @deprecated 0.42.3
114 - */
115 - public function load_assets() {
116 - if ( class_exists( 'Jetpack_Admin_Page' ) ) {
117 - \Jetpack_Admin_Page::load_wrapper_styles();
118 - }
119 - }
120 -
121 - /**
122 - * Lists the current user's publicized accounts for the blog
123 - * looks exactly like Publicize v1 for now, UI and functionality updates will come after the move to keyring
124 - *
125 - * @deprecated 0.42.3
126 - */
127 - public function admin_page() {
128 - ?>
129 - <h2 id="publicize"><?php esc_html_e( 'Jetpack Social', 'jetpack-publicize-pkg' ); ?></h2>
130 - <p><?php esc_html_e( 'Connect social media services to automatically share new posts.', 'jetpack-publicize-pkg' ); ?></p>
131 - <h4>
132 - <?php
133 - printf(
134 - wp_kses(
135 - /* translators: %s is the link to the Publicize page in Calypso */
136 - __( "We've made some updates to Jetpack Social. Please visit the <a href='%s' class='jptracks' data-jptracks-name='legacy_publicize_settings'>WordPress.com sharing page</a> to manage your Jetpack Social connections or use the button below.", 'jetpack-publicize-pkg' ),
137 - array(
138 - 'a' => array(
139 - 'href' => array(),
140 - 'class' => array(),
141 - 'data-jptracks-name' => array(),
142 - ),
143 - )
144 - ),
145 - esc_url( $this->publicize->publicize_connections_url() )
146 - );
147 - ?>
148 - </h4>
149 -
150 - <a href="<?php echo esc_url( $this->publicize->publicize_connections_url() ); ?>" class="button button-primary jptracks" data-jptracks-name='legacy_publicize_settings'><?php esc_html_e( 'Jetpack Social Settings', 'jetpack-publicize-pkg' ); ?></a>
151 - <?php
152 - }
153 -
154 - /**
155 65 * CSS for styling the publicize message box and counter that displays on the post page.
156 66 * There is also some JavaScript for length counting and some basic display effects.
157 67 */
158 68 public function post_page_metabox_assets() {
@@ -161,11 +71,15 @@
161 71 if ( $current_screen && $current_screen->is_block_editor ) {
162 72 return;
163 73 }
164 74
75 + $is_atomic_site = ( new Host() )->is_woa_site();
76 + $is_simple_site = ( new Host() )->is_wpcom_simple();
77 + $site_type = $is_atomic_site ? 'atomic' : ( $is_simple_site ? 'simple' : 'jetpack' );
78 +
165 79 Assets::register_script(
166 80 'jetpack-social-classic-editor-options',
167 - '../build/classic-editor-connections.js',
81 + '../build/classic-editor.js',
168 82 __FILE__,
169 83 array(
170 84 'in_footer' => true,
171 85 'enqueue' => true,
@@ -171,33 +85,36 @@
171 85 'enqueue' => true,
172 86 'textdomain' => 'jetpack-publicize-pkg',
173 87 )
174 88 );
89 +
175 90 wp_add_inline_script(
176 91 'jetpack-social-classic-editor-options',
177 92 'var jetpackSocialClassicEditorOptions = ' . wp_json_encode(
178 93 array(
179 - 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
180 94 'connectionsUrl' => esc_url( $this->publicize_settings_url ),
181 95 'isEnhancedPublishingEnabled' => $this->publicize->has_enhanced_publishing_feature(),
182 - 'resharePath' => '/jetpack/v4/publicize/{postId}',
96 + 'resharePath' => '/wpcom/v2/publicize/share-post/{postId}',
97 + 'refreshConnections' => '/wpcom/v2/publicize/connections?test_connections=1',
183 98 'isReshareSupported' => Current_Plan::supports( 'republicize' ),
184 - )
99 + 'siteType' => $site_type,
100 + ),
101 + JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP
185 102 ),
186 103 'before'
187 104 );
188 105
189 106 $default_prefix = $this->publicize->default_prefix;
190 - $default_prefix = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_prefix ) );
107 + $default_prefix = preg_replace( '/%([0-9])\$s/', '" + %\\1$s + "', wp_json_encode( (string) $default_prefix, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ) );
191 108
192 109 $default_message = $this->publicize->default_message;
193 - $default_message = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_message ) );
110 + $default_message = preg_replace( '/%([0-9])\$s/', '" + %\\1$s + "', wp_json_encode( (string) $default_message, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ) );
194 111
195 112 $default_suffix = $this->publicize->default_suffix;
196 - $default_suffix = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_suffix ) );
113 + $default_suffix = preg_replace( '/%([0-9])\$s/', '" + %\\1$s + "', wp_json_encode( (string) $default_suffix, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ) );
197 114
198 - $max_length = defined( 'JETPACK_PUBLICIZE_TWITTER_LENGTH' ) ? JETPACK_PUBLICIZE_TWITTER_LENGTH : 280;
199 - $max_length = $max_length - 24; // t.co link, space.
115 + $max_length = defined( 'JETPACK_PUBLICIZE_TWITTER_LENGTH' ) ? JETPACK_PUBLICIZE_TWITTER_LENGTH : 280;
116 + $max_length -= 24; // t.co link, space.
200 117
201 118 ?>
202 119
203 120 <script type="text/javascript">
@@ -228,9 +145,9 @@
228 145 // Keep the postTitle and the placeholder in sync
229 146 postTitle.on( 'keyup', function( e ) {
230 147 var url = $( '#sample-permalink' ).text();
231 148 <?php // phpcs:ignore ?>
232 - var defaultMessage = $.trim( '<?php printf( $default_prefix, 'url' ); printf( $default_message, 'e.currentTarget.value', 'url' ); printf( $default_suffix, 'url' ); ?>' )
149 + var defaultMessage = $.trim( <?php printf( $default_prefix, 'url' ); ?> + <?php printf( $default_message, 'e.currentTarget.value', 'url' ); ?> + <?php printf( $default_suffix, 'url' ); ?> )
233 150 .replace( /<[^>]+>/g,'');
234 151
235 152 wpasTitle.attr( 'placeholder', defaultMessage );
236 153 wpasTitle.trigger( 'keyup' );
@@ -365,9 +282,9 @@
365 282 }
366 283 .publicize-external-link__text {
367 284 text-decoration: underline;
368 285 }
369 -#publicize-title:before {
286 +#publicize-title::before {
370 287 content: "\f237";
371 288 font: normal 20px/1 dashicons;
372 289 speak: none;
373 290 margin-left: -1px;
@@ -391,8 +308,11 @@
391 308 .publicize__notice-warning .dashicons {
392 309 font-size: 16px;
393 310 text-decoration: none;
394 311 }
312 +.publicize-placeholders-help {
313 + margin: 0.5rem 0 1rem;
314 +}
395 315 </style>
396 316 <?php
397 317 }
398 318
@@ -412,26 +332,8 @@
412 332 );
413 333 }
414 334
415 335 /**
416 - * Extracts the connections that require reauthentication, for example, LinkedIn, when it switched v1 to v2 of its API.
417 - *
418 - * @return array Connections that must be reauthenticated
419 - */
420 - public function get_must_reauth_connections() {
421 - $must_reauth = array();
422 - $connections = $this->publicize->get_connections( 'linkedin' );
423 - if ( is_array( $connections ) ) {
424 - foreach ( $connections as $index => $connection ) {
425 - if ( $this->publicize->is_invalid_linkedin_connection( $connection ) ) {
426 - $must_reauth[ $index ] = 'LinkedIn';
427 - }
428 - }
429 - }
430 - return $must_reauth;
431 - }
432 -
433 - /**
434 336 * Controls the metabox that is displayed on the post page
435 337 * Allows the user to customize the message that will be sent out to the social network, as well as pick which
436 338 * networks to publish to. Also displays the character counter and some other information.
437 339 */
@@ -443,14 +345,8 @@
443 345 }
444 346
445 347 $connections_data = $this->publicize->get_filtered_connection_data();
446 348
447 - $available_services = $this->publicize->get_services( 'all' );
448 -
449 - if ( ! is_array( $available_services ) ) {
450 - $available_services = array();
451 - }
452 -
453 349 if ( ! is_array( $connections_data ) ) {
454 350 $connections_data = array();
455 351 }
456 352 ?>
@@ -461,40 +357,12 @@
461 357
462 358 if ( ! empty( $connections_data ) ) :
463 359 $publicize_form = $this->get_metabox_form_connected( $connections_data );
464 360
465 - $must_reauth = $this->get_must_reauth_connections();
466 - if ( ! empty( $must_reauth ) ) {
467 - foreach ( $must_reauth as $connection_name ) {
468 - ?>
469 - <span class="notice-warning publicize__notice-warning">
470 - <?php
471 - printf(
472 - /* translators: %s is the name of a Jetpack Social service like "LinkedIn" */
473 - esc_html__(
474 - 'Your %s connection needs to be reauthenticated to continue working – head to Sharing to take care of it.',
475 - 'jetpack-publicize-pkg'
476 - ),
477 - $connection_name // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
478 - );
479 - ?>
480 - <a
481 - class="publicize-external-link"
482 - href="<?php echo esc_url( $this->publicize->publicize_connections_url() ); ?>"
483 - target="_blank"
484 - >
485 - <span class="publicize-external-link__text"><?php esc_html_e( 'Go to Sharing settings', 'jetpack-publicize-pkg' ); ?></span>
486 - <span class="dashicons dashicons-external"></span>
487 - </a>
488 - </span>
489 - <?php
490 - }
491 - }
492 -
493 361 $labels = array();
494 362
495 363 foreach ( $connections_data as $connection_data ) {
496 - if ( ! $connection_data['enabled'] || ( isset( $connection_data['is_healthy'] ) && false === $connection_data['is_healthy'] ) ) {
364 + if ( ! $connection_data['enabled'] ) {
497 365 continue;
498 366 }
499 367
500 368 $labels[] = sprintf(
@@ -505,15 +373,15 @@
505 373
506 374 ?>
507 375 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- labels are already escaped above ?>
508 376 <span id="publicize-defaults"><?php echo implode( ', ', $labels ); ?></span>
509 - <a href="#" id="publicize-form-edit"><?php esc_html_e( 'Edit', 'jetpack-publicize-pkg' ); ?></a>&nbsp;<a href="<?php echo esc_url( $this->publicize->publicize_connections_url( 'jetpack-social-connections-classic-editor' ) ); ?>" rel="noopener noreferrer" target="_blank"><?php esc_html_e( 'Settings', 'jetpack-publicize-pkg' ); ?></a><br />
377 + <a href="#" id="publicize-form-edit"><?php esc_html_e( 'Edit', 'jetpack-publicize-pkg' ); ?></a>&nbsp;<a href="<?php echo esc_url( $this->publicize->publicize_connections_url() ); ?>" rel="noopener noreferrer" target="_blank"><?php esc_html_e( 'Settings', 'jetpack-publicize-pkg' ); ?></a><br />
510 378 <?php
511 379 else :
512 - $publicize_form = $this->get_metabox_form_disconnected( $available_services );
380 + $publicize_form = '';
513 381 ?>
514 382 <strong><?php esc_html_e( 'Not Connected', 'jetpack-publicize-pkg' ); ?></strong>
515 - <a href="<?php echo esc_url( $this->publicize->publicize_connections_url( 'jetpack-social-connections-classic-editor' ) ); ?>" rel="noopener noreferrer" target="_blank"><?php esc_html_e( 'Settings', 'jetpack-publicize-pkg' ); ?></a><br />
383 + <a href="<?php echo esc_url( $this->publicize->publicize_connections_url() ); ?>" rel="noopener noreferrer" target="_blank"><?php esc_html_e( 'Settings', 'jetpack-publicize-pkg' ); ?></a><br />
516 384 <?php
517 385
518 386 endif;
519 387 ?>
@@ -571,12 +439,8 @@
571 439 */
572 440 private function get_metabox_form_connected( $connections_data ) {
573 441 global $post;
574 442
575 - $all_done = $this->publicize->post_is_done_sharing();
576 - $all_connections_done = true;
577 - $broken_connections = array();
578 -
579 443 ob_start();
580 444
581 445 ?>
582 446 <div id="publicize-form" class="hide-if-js">
@@ -583,40 +447,25 @@
583 447 <ul>
584 448 <?php
585 449
586 450 foreach ( $connections_data as $connection_data ) {
587 - $all_connections_done = $all_connections_done && $connection_data['done'];
588 - $connection_healthy = ! isset( $connection_data['is_healthy'] ) || $connection_data['is_healthy'];
589 - if ( ! $connection_healthy ) {
590 - $broken_connections[] = $connection_data;
591 -
592 - }
593 451 ?>
594 452
595 453 <li>
596 454 <label
597 - for="wpas-submit-<?php echo esc_attr( $connection_data['id'] ); ?>"
455 + for="wpas-submit-<?php echo esc_attr( $connection_data['connection_id'] ); ?>"
598 456 >
599 457 <input
600 458 type="checkbox"
601 - name="wpas[submit][<?php echo esc_attr( $connection_data['id'] ); ?>]"
602 - id="wpas-submit-<?php echo esc_attr( $connection_data['id'] ); ?>"
459 + name="wpas[submit][<?php echo esc_attr( $connection_data['connection_id'] ); ?>]"
460 + id="wpas-submit-<?php echo esc_attr( $connection_data['connection_id'] ); ?>"
603 461 class="wpas-submit-<?php echo esc_attr( $connection_data['service_name'] ); ?>"
604 462 value="1"
605 - data-id="<?php echo esc_attr( $connection_data['id'] ); ?>"
463 + data-id="<?php echo esc_attr( $connection_data['connection_id'] ); ?>"
606 464 <?php
607 - checked( true, $connection_data['enabled'] && $connection_healthy );
608 - disabled( false, $connection_healthy );
465 + checked( true, $connection_data['enabled'] );
609 466 ?>
610 467 />
611 - <?php if ( $connection_data['enabled'] && $connection_healthy && ! $connection_data['toggleable'] ) : // Need to submit a value to force a global connection to POST. ?>
612 - <input
613 - type="hidden"
614 - name="wpas[submit][<?php echo esc_attr( $connection_data['id'] ); ?>]"
615 - value="1"
616 - />
617 - <?php endif; ?>
618 -
619 468 <?php echo esc_html( $this->connection_label( $connection_data['service_label'], $connection_data['display_name'] ) ); ?>
620 469
621 470 </label>
622 471 </li>
@@ -631,10 +480,12 @@
631 480 $is_social_note = 'jetpack-social-note' === get_post_type( $post->ID );
632 481
633 482 $is_post_published = 'publish' === get_post_status( $post->ID );
634 483
635 - $all_done = $all_done || $all_connections_done;
484 + $templates_enabled = $this->publicize->has_paid_features();
636 485
486 + $placeholders = $this->get_message_placeholders();
487 +
637 488 ?>
638 489
639 490 </ul>
640 491
@@ -639,10 +490,28 @@
639 490 </ul>
640 491
641 492 <?php if ( ! $is_social_note ) : ?>
642 493 <label for="wpas-title"><?php esc_html_e( 'Custom Message:', 'jetpack-publicize-pkg' ); ?></label>
643 - <span id="wpas-title-counter" class="alignright hide-if-no-js">0</span>
494 + <?php if ( ! $templates_enabled ) : ?>
495 + <span id="wpas-title-counter" class="alignright hide-if-no-js">0</span>
496 + <?php endif; ?>
644 497 <textarea name="wpas_title" id="wpas-title"><?php echo esc_textarea( $title ); ?></textarea>
498 + <?php if ( $templates_enabled && ! empty( $placeholders ) ) : ?>
499 + <details class="publicize-placeholders-help">
500 + <summary><?php esc_html_e( 'Available placeholders', 'jetpack-publicize-pkg' ); ?></summary>
501 + <p>
502 + <?php esc_html_e( 'Use placeholders to automatically insert post details.', 'jetpack-publicize-pkg' ); ?>
503 + </p>
504 + <ul>
505 + <?php foreach ( $placeholders as $placeholder ) : ?>
506 + <li>
507 + <code><?php echo esc_html( $placeholder['id'] ); ?></code>
508 + &mdash; <?php echo esc_html( $placeholder['label'] ); ?>
509 + </li>
510 + <?php endforeach; ?>
511 + </ul>
512 + </details>
513 + <?php endif; ?>
645 514 <a href="#" class="hide-if-no-js button" id="publicize-form-hide"><?php esc_html_e( 'OK', 'jetpack-publicize-pkg' ); ?></a>
646 515 <input type="hidden" name="wpas[0]" value="1" />
647 516 <?php endif; ?>
648 517 <?php if ( $is_post_published && Current_Plan::supports( 'republicize' ) ) : ?>
@@ -653,38 +522,9 @@
653 522 <?php endif; ?>
654 523 </div>
655 524
656 525 <div id="pub-connection-needs-media"></div>
657 -
658 - <?php if ( ! $all_done ) : ?>
659 - <?php if ( $broken_connections ) : ?>
660 - <div id="pub-connection-tests" class="error below-h2 publicize-token-refresh-message">
661 - <?php
662 - printf(
663 - wp_kses(
664 - /* translators: %s is the link to the connections page in Calypso */
665 - _n(
666 - 'One of your social connections is broken. Reconnect it on the <a href="%s" rel="noopener noreferrer" target="_blank">connection management</a> page.',
667 - 'Some of your social connections are broken. Reconnect them on the <a href="%s" rel="noopener noreferrer" target="_blank">connection management</a> page.',
668 - count( $broken_connections ),
669 - 'jetpack-publicize-pkg'
670 - ),
671 - array(
672 - 'a' => array(
673 - 'href' => array(),
674 - 'target' => array(),
675 - 'rel' => array(),
676 - ),
677 - )
678 - ),
679 - esc_url( $this->publicize->publicize_connections_url() )
680 - );
681 - ?>
682 - </div>
683 - <?php else : ?>
684 - <div id="pub-connection-tests"></div>
685 - <?php endif; ?>
686 - <?php endif; ?>
526 + <div id="pub-connection-tests"></div>
687 527 <?php
688 528
689 529 return ob_get_clean();
690 530 }
@@ -689,33 +529,15 @@
689 529 return ob_get_clean();
690 530 }
691 531
692 532 /**
693 - * Metabox that is shown when no services are connected.
533 + * Get the catalogue of placeholders supported in custom Publicize messages.
694 534 *
695 - * @param array $available_services Array of available services for connecting.
535 + * Sourced from WPCOM via `Message_Templates_Placeholders` so the metabox
536 + * hint can never drift from the resolver in `Template_Parser`.
537 + *
538 + * @return array<int, array{id: string, label: string}> Ordered list of placeholders.
696 539 */
697 - private function get_metabox_form_disconnected( $available_services ) {
698 - ob_start();
699 - ?>
700 - <div id="publicize-form" class="hide-if-js">
701 - <div id="add-publicize-check" style="display: none;"></div>
702 -
703 - <?php esc_html_e( 'Connect to', 'jetpack-publicize-pkg' ); ?>:
704 -
705 - <ul class="not-connected">
706 - <?php foreach ( $available_services as $service_name => $service ) : ?>
707 - <li>
708 - <?php /* translators: %s is the name of a Publicize service such as "LinkedIn" */ ?>
709 - <a class="pub-service" data-service="<?php echo esc_attr( $service_name ); ?>" title="<?php echo esc_attr( sprintf( __( 'Connect and share your posts on %s', 'jetpack-publicize-pkg' ), $this->publicize->get_service_label( $service_name ) ) ); ?>" rel="noopener noreferrer" target="_blank" href="<?php echo esc_url( $this->publicize->connect_url( $service_name ) ); ?>">
710 - <?php echo esc_html( $this->publicize->get_service_label( $service_name ) ); ?>
711 - </a>
712 - </li>
713 - <?php endforeach; ?>
714 - </ul>
715 - <a href="#" class="hide-if-no-js button" id="publicize-disconnected-form-hide"><?php esc_html_e( 'OK', 'jetpack-publicize-pkg' ); ?></a>
716 - </div>
717 - <?php
718 -
719 - return ob_get_clean();
540 + private function get_message_placeholders() {
541 + return Message_Templates_Placeholders::get_all();
720 542 }
721 543 }