@@ -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. |
@@ -325,7 +325,7 @@ |
||
| 325 | 325 | <?php } ?> |
| 326 | 326 | } else { |
| 327 | 327 | <?php if ( $this->should_do_optout() ) { ?> |
| 328 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
| 328 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
| 329 | 329 | ( function () { |
| 330 | 330 | function __gtagTracker() { |
| 331 | 331 | return null; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ( ! is_array( $inbound_paths ) ) { |
| 62 | 62 | $inbound_paths = array(); |
| 63 | 63 | } else { |
| 64 | - foreach( $inbound_paths as $index => $pair ) { |
|
| 64 | + foreach ( $inbound_paths as $index => $pair ) { |
|
| 65 | 65 | // if empty pair, unset and continue |
| 66 | 66 | if ( empty( $pair['path'] ) ) { |
| 67 | 67 | unset( $inbound_paths[$index] ); |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | $download_extensions = array( $download_extensions ); |
| 88 | 88 | } |
| 89 | 89 | $i = 0; |
| 90 | - foreach( $download_extensions as $extension ){ |
|
| 91 | - $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
|
| 90 | + foreach ( $download_extensions as $extension ) { |
|
| 91 | + $download_extensions[$i] = esc_js( trim( $extension ) ); |
|
| 92 | 92 | $i++; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $download_extensions = array( $download_extensions ); |
| 88 | 88 | } |
| 89 | 89 | $i = 0; |
| 90 | - foreach( $download_extensions as $extension ){ |
|
| 90 | + foreach( $download_extensions as $extension ) { |
|
| 91 | 91 | $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
| 92 | 92 | $i++; |
| 93 | 93 | } |