@@ -79,7 +79,7 @@ |
||
79 | 79 | $translations = wp_get_available_translations(); |
80 | 80 | |
81 | 81 | if ( is_array( $translations ) && ! empty( $translations ) ) { |
82 | - $site_iso = isset( $translations[ $site_language ]['iso'] ) ? $translations[ $site_language ]['iso'] : array(); // keep empty array, because site language has no iso setup for en_US language |
|
82 | + $site_iso = isset( $translations[$site_language]['iso'] ) ? $translations[$site_language]['iso'] : array(); // keep empty array, because site language has no iso setup for en_US language |
|
83 | 83 | |
84 | 84 | if ( is_array( $site_iso ) && ! in_array( $country['iso'], $site_iso ) ) { |
85 | 85 | $data['country'] = $country['name']; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | ( ! empty( $notification['end'] ) && time() > strtotime( $notification['end'] ) ) || |
233 | 233 | ( ! empty( $notification['type'] ) && ! in_array( $license_type, $notification['type'] ) ) |
234 | 234 | ) { |
235 | - unset( $notifications[ $key ] ); |
|
235 | + unset( $notifications[$key] ); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | |
290 | 290 | foreach ( $notifications as $key => $notification ) { |
291 | 291 | if ( ! empty( $notification['content'] ) ) { |
292 | - $notifications[ $key ]['content'] = wpautop( $notification['content'] ); |
|
293 | - $notifications[ $key ]['content'] = apply_filters( 'monsterinsights_notification_content_display', $notifications[ $key ]['content'] ); |
|
292 | + $notifications[$key]['content'] = wpautop( $notification['content'] ); |
|
293 | + $notifications[$key]['content'] = apply_filters( 'monsterinsights_notification_content_display', $notifications[$key]['content'] ); |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | // Translators: Readable time to display |
318 | 318 | $modified_start_time = sprintf( __( '%1$s ago', 'google-analytics-for-wordpress' ), human_time_diff( strtotime( $notification['start'] ), current_time( 'timestamp' ) ) ); |
319 | - $notifications[ $key ]['start'] = $modified_start_time; |
|
319 | + $notifications[$key]['start'] = $modified_start_time; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | return $notifications; |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | if ( is_array( $option['feed'] ) && ! empty( $option['feed'] ) ) { |
447 | 447 | foreach ( $option['feed'] as $key => $notification ) { |
448 | 448 | array_unshift( $option['dismissed'], $notification ); |
449 | - unset( $option['feed'][ $key ] ); |
|
449 | + unset( $option['feed'][$key] ); |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | if ( is_array( $option['events'] ) && ! empty( $option['events'] ) ) { |
453 | 453 | foreach ( $option['events'] as $key => $notification ) { |
454 | 454 | array_unshift( $option['dismissed'], $notification ); |
455 | - unset( $option['events'][ $key ] ); |
|
455 | + unset( $option['events'][$key] ); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | } |
@@ -460,13 +460,13 @@ discard block |
||
460 | 460 | $type = is_numeric( $id ) ? 'feed' : 'events'; |
461 | 461 | |
462 | 462 | // Remove notification and add in dismissed array. |
463 | - if ( is_array( $option[ $type ] ) && ! empty( $option[ $type ] ) ) { |
|
464 | - foreach ( $option[ $type ] as $key => $notification ) { |
|
463 | + if ( is_array( $option[$type] ) && ! empty( $option[$type] ) ) { |
|
464 | + foreach ( $option[$type] as $key => $notification ) { |
|
465 | 465 | if ( $notification['id'] == $id ) { // phpcs:ignore WordPress.PHP.StrictComparisons |
466 | 466 | // Add notification to dismissed array. |
467 | 467 | array_unshift( $option['dismissed'], $notification ); |
468 | 468 | // Remove notification from feed or events. |
469 | - unset( $option[ $type ][ $key ] ); |
|
469 | + unset( $option[$type][$key] ); |
|
470 | 470 | break; |
471 | 471 | } |
472 | 472 | } |
@@ -141,7 +141,8 @@ discard block |
||
141 | 141 | * @since {VERSION} |
142 | 142 | * |
143 | 143 | */ |
144 | - public function verify( $notifications ) { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh |
|
144 | + public function verify( $notifications ) { |
|
145 | +// phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh |
|
145 | 146 | |
146 | 147 | $data = array(); |
147 | 148 | |
@@ -462,7 +463,8 @@ discard block |
||
462 | 463 | // Remove notification and add in dismissed array. |
463 | 464 | if ( is_array( $option[ $type ] ) && ! empty( $option[ $type ] ) ) { |
464 | 465 | foreach ( $option[ $type ] as $key => $notification ) { |
465 | - if ( $notification['id'] == $id ) { // phpcs:ignore WordPress.PHP.StrictComparisons |
|
466 | + if ( $notification['id'] == $id ) { |
|
467 | +// phpcs:ignore WordPress.PHP.StrictComparisons |
|
466 | 468 | // Add notification to dismissed array. |
467 | 469 | array_unshift( $option['dismissed'], $notification ); |
468 | 470 | // Remove notification from feed or events. |