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