PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
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 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/widgets/gravatar-profile.php +20 -10 13.7.216.3-a.1 View file →
@@ -1,6 +1,10 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 2
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + exit( 0 );
5 +}
6 +
3 7 // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
4 8
5 9 add_action( 'widgets_init', 'jetpack_gravatar_profile_widget_init' );
6 10 /**
@@ -150,9 +154,9 @@
150 154 $this->display_personal_links( (array) $profile['urls'] );
151 155 }
152 156
153 157 if ( $instance['show_account_links'] ) {
154 - $this->display_accounts( (array) $profile['accounts'] );
158 + $this->display_accounts( (array) $profile['accounts'], $profile['displayName'] );
155 159 }
156 160
157 161 ?>
158 162
@@ -235,11 +239,12 @@
235 239
236 240 /**
237 241 * Displays the "Verified Services" accounts.
238 242 *
239 - * @param array $accounts Array of social accounts.
243 + * @param array $accounts Array of social accounts.
244 + * @param string $display_name Gravatar display name of the user.
240 245 */
241 - public function display_accounts( $accounts = array() ) {
246 + public function display_accounts( $accounts = array(), $display_name = '' ) {
242 247 if ( empty( $accounts ) ) {
243 248 return;
244 249 }
245 250 ?>
@@ -266,17 +271,18 @@
266 271 <ul class="grofile-urls grofile-accounts">
267 272
268 273 <?php
269 274 foreach ( $accounts as $account ) :
270 - if ( 'true' !== $account['verified'] ) {
275 + $is_hidden = $account['is_hidden'] ?? false;
276 + if ( true !== $account['verified'] || $is_hidden ) {
271 277 continue;
272 278 }
273 279
274 280 $sanitized_service_name = $this->get_sanitized_service_name( $account['shortname'] );
275 281 $link_title = sprintf(
276 - /* translators: %1$s: service username. %2$s: service name ( Facebook, Twitter, etc.) */
282 + /* translators: %1$s: account display name. %2$s: service name ( Facebook, Twitter, etc.) */
277 283 _x( '%1$s on %2$s', '1: User Name, 2: Service Name (Facebook, Twitter, ...)', 'jetpack' ),
278 - esc_html( $account['display'] ),
284 + esc_html( $display_name ),
279 285 esc_html( $sanitized_service_name )
280 286 );
281 287 ?>
282 288
@@ -281,9 +287,12 @@
281 287 ?>
282 288
283 289 <li>
284 290 <a href="<?php echo esc_url( $account['url'] ); ?>" title="<?php echo esc_html( $link_title ); ?>">
285 - <span class="grofile-accounts-logo grofile-accounts-<?php echo esc_attr( $account['shortname'] ); ?> accounts_<?php echo esc_attr( $account['shortname'] ); ?>"></span>
291 + <span
292 + class="grofile-accounts-logo grofile-accounts-<?php echo esc_attr( $account['shortname'] ); ?> accounts_<?php echo esc_attr( $account['shortname'] ); ?>"
293 + style="background-image: url('<?php echo esc_attr( $account['iconUrl'] ); ?>')"
294 + ></span>
286 295 </a>
287 296 </li>
288 297
289 298 <?php endforeach; ?>
@@ -316,13 +325,14 @@
316 325 /**
317 326 * Outputs the widget settings form.
318 327 *
319 328 * @param array $instance Current settings.
329 + * @return string|void
320 330 */
321 331 public function form( $instance ) {
322 - $title = isset( $instance['title'] ) ? $instance['title'] : '';
323 - $email = isset( $instance['email'] ) ? $instance['email'] : '';
324 - $email_user = isset( $instance['email_user'] ) ? $instance['email_user'] : get_current_user_id();
332 + $title = $instance['title'] ?? '';
333 + $email = $instance['email'] ?? '';
334 + $email_user = $instance['email_user'] ?? get_current_user_id();
325 335 $show_personal_links = isset( $instance['show_personal_links'] ) ? (bool) $instance['show_personal_links'] : '';
326 336 $show_account_links = isset( $instance['show_account_links'] ) ? (bool) $instance['show_account_links'] : '';
327 337 $profile_url = 'https://gravatar.com/profile/edit';
328 338