@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function __construct() { |
63 | 63 | // Allow dashboard widget to be hidden on multisite installs |
64 | - $show_widget = is_multisite() ? apply_filters( 'monsterinsights_show_dashboard_widget', true ) : true; |
|
64 | + $show_widget = is_multisite() ? apply_filters( 'monsterinsights_show_dashboard_widget', true ) : true; |
|
65 | 65 | if ( ! $show_widget ) { |
66 | 66 | return false; |
67 | 67 | } |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | |
94 | 94 | // Attept to place the widget at the top. |
95 | 95 | $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; |
96 | - $widget_instance = array( self::WIDGET_KEY => $normal_dashboard[ self::WIDGET_KEY ] ); |
|
97 | - unset( $normal_dashboard[ self::WIDGET_KEY ] ); |
|
96 | + $widget_instance = array( self::WIDGET_KEY => $normal_dashboard[self::WIDGET_KEY] ); |
|
97 | + unset( $normal_dashboard[self::WIDGET_KEY] ); |
|
98 | 98 | $sorted_dashboard = array_merge( $widget_instance, $normal_dashboard ); |
99 | 99 | $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; |
100 | 100 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | if ( isset( $_POST['reports'] ) ) { |
228 | 228 | $reports = json_decode( sanitize_text_field( wp_unslash( $_POST['reports'] ) ), true ); |
229 | 229 | foreach ( $reports as $report => $reports_sections ) { |
230 | - $reports[ $report ] = array_map( 'boolval', $reports_sections ); |
|
230 | + $reports[$report] = array_map( 'boolval', $reports_sections ); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | $b = (array) $b; |
272 | 272 | $result = $b; |
273 | 273 | foreach ( $a as $k => &$v ) { |
274 | - if ( is_array( $v ) && isset( $result[ $k ] ) ) { |
|
275 | - $result[ $k ] = self::wp_parse_args_recursive( $v, $result[ $k ] ); |
|
274 | + if ( is_array( $v ) && isset( $result[$k] ) ) { |
|
275 | + $result[$k] = self::wp_parse_args_recursive( $v, $result[$k] ); |
|
276 | 276 | } else { |
277 | - $result[ $k ] = $v; |
|
277 | + $result[$k] = $v; |
|
278 | 278 | } |
279 | 279 | } |
280 | 280 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // if new install or Yoast Era instal |
64 | 64 | if ( ! $version ) { |
65 | 65 | // See if from Yoast |
66 | - $yoast = get_option( 'yst_ga', false ); |
|
66 | + $yoast = get_option( 'yst_ga', false ); |
|
67 | 67 | |
68 | 68 | // In case from Yoast, start from scratch |
69 | 69 | delete_option( 'yoast-ga-access_token' ); |
@@ -297,25 +297,25 @@ discard block |
||
297 | 297 | public function v700_upgrades() { |
298 | 298 | // 1. Default all event tracking and tracking to GA + JS respectively |
299 | 299 | // 3a Set tracking_mode to use analytics.js |
300 | - $this->new_settings['tracking_mode' ] = 'analytics'; |
|
300 | + $this->new_settings['tracking_mode'] = 'analytics'; |
|
301 | 301 | |
302 | 302 | |
303 | 303 | // 3b Set events mode to use JS if the events mode is not set explicitly to none |
304 | - if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) { |
|
305 | - $this->new_settings['events_mode' ] = 'js'; |
|
304 | + if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) { |
|
305 | + $this->new_settings['events_mode'] = 'js'; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | // 2. Migrate manual UA codes |
309 | 309 | // 2a Manual UA has the lowest priority |
310 | - if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) { |
|
310 | + if ( ! empty( $this->new_settings['manual_ua_code'] ) ) { |
|
311 | 311 | // Set as manual UA code |
312 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ); |
|
312 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | // 2b Then try the oAuth UA code |
316 | - if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) { |
|
316 | + if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) { |
|
317 | 317 | // Set as manual UA code |
318 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ); |
|
318 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // 3. Migrate License keys |
@@ -357,8 +357,8 @@ discard block |
||
357 | 357 | 'track_internal_as_label', |
358 | 358 | ); |
359 | 359 | foreach ( $settings as $setting ) { |
360 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
361 | - unset( $this->new_settings[ $setting ] ); |
|
360 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
361 | + unset( $this->new_settings[$setting] ); |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | } |
@@ -402,8 +402,8 @@ discard block |
||
402 | 402 | ); |
403 | 403 | |
404 | 404 | foreach ( $settings as $setting ) { |
405 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
406 | - unset( $this->new_settings[ $setting ] ); |
|
405 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
406 | + unset( $this->new_settings[$setting] ); |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | ); |
443 | 443 | |
444 | 444 | foreach ( $settings as $setting ) { |
445 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
446 | - unset( $this->new_settings[ $setting ] ); |
|
445 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
446 | + unset( $this->new_settings[$setting] ); |
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | } |
535 | 535 | preg_match( $regex, $cross_domain['domain'], $matches ); |
536 | 536 | if ( count( $matches ) > 0 ) { |
537 | - unset( $this->new_settings['cross_domains'][ $key ] ); |
|
537 | + unset( $this->new_settings['cross_domains'][$key] ); |
|
538 | 538 | } |
539 | 539 | } |
540 | 540 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * not be used by other developers. This hook's behavior may be modified |
39 | 39 | * or the hook may be removed at any time, without warning. |
40 | 40 | */ |
41 | - $reports = apply_filters( 'monsterinsights_get_reports', array() ); |
|
41 | + $reports = apply_filters( 'monsterinsights_get_reports', array() ); |
|
42 | 42 | return $reports; |
43 | 43 | } |
44 | 44 | |
@@ -60,5 +60,5 @@ discard block |
||
60 | 60 | */ |
61 | 61 | do_action( 'monsterinsights_head' ); |
62 | 62 | echo monsterinsights_ublock_notice(); |
63 | - monsterinsights_settings_error_page( 'monsterinsights-reports'); |
|
63 | + monsterinsights_settings_error_page( 'monsterinsights-reports' ); |
|
64 | 64 | } |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | if ( $to_check == false ) { |
100 | 100 | // Non load balanced. Start checking in in 7 days + 2-4 days. |
101 | 101 | $checktime = array(); |
102 | - $checktime['day'] = rand( 0, 6 ); |
|
102 | + $checktime['day'] = rand( 0, 6 ); |
|
103 | 103 | $checktime['hour'] = rand( 0, 23 ); |
104 | 104 | $checktime['minute'] = rand( 0, 59 ); |
105 | 105 | $checktime['second'] = rand( 0, 59 ); |
106 | - $checktime['offset'] = ( $checktime['day'] * DAY_IN_SECONDS ) + |
|
107 | - ( $checktime['hour'] * HOUR_IN_SECONDS ) + |
|
106 | + $checktime['offset'] = ( $checktime['day'] * DAY_IN_SECONDS ) + |
|
107 | + ( $checktime['hour'] * HOUR_IN_SECONDS ) + |
|
108 | 108 | ( $checktime['minute'] * MINUTE_IN_SECONDS ) + |
109 | 109 | $checktime['second']; |
110 | - $to_check = strtotime("next sunday") + $checktime['offset']; |
|
110 | + $to_check = strtotime( "next sunday" ) + $checktime['offset']; |
|
111 | 111 | update_option( '_amn_' . $this->plugin . '_to_check', $to_check ); |
112 | 112 | } |
113 | 113 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return; |
207 | 207 | } |
208 | 208 | |
209 | - $plugin_notifications = $this->get_plugin_notifications( - 1, array( |
|
209 | + $plugin_notifications = $this->get_plugin_notifications( -1, array( |
|
210 | 210 | 'post_status' => 'all', |
211 | 211 | 'meta_key' => 'viewed', |
212 | 212 | 'meta_value' => '0', |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | if ( ! $continue ) { |
268 | - unset( $plugin_notifications[ $key ] ); |
|
268 | + unset( $plugin_notifications[$key] ); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | if ( ! $continue ) { |
283 | - unset( $plugin_notifications[ $key ] ); |
|
283 | + unset( $plugin_notifications[$key] ); |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $continue = (string) wp_get_theme() === $theme; |
290 | 290 | |
291 | 291 | if ( ! empty( $theme ) && ! $continue ) { |
292 | - unset( $plugin_notifications[ $key ] ); |
|
292 | + unset( $plugin_notifications[$key] ); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | // Version validation. |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | if ( ! $continue ) { |
304 | - unset( $plugin_notifications[ $key ] ); |
|
304 | + unset( $plugin_notifications[$key] ); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | if ( ! $continue ) { |
317 | - unset( $plugin_notifications[ $key ] ); |
|
317 | + unset( $plugin_notifications[$key] ); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | if ( ! $continue ) { |
331 | - unset( $plugin_notifications[ $key ] ); |
|
331 | + unset( $plugin_notifications[$key] ); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | public function revoke_notifications( $ids ) { |
461 | 461 | // Loop through each of the IDs and find the post that has it as meta. |
462 | 462 | foreach ( (array) $ids as $id ) { |
463 | - $notifications = $this->get_plugin_notifications( - 1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) ); |
|
463 | + $notifications = $this->get_plugin_notifications( -1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) ); |
|
464 | 464 | if ( $notifications ) { |
465 | 465 | foreach ( $notifications as $notification ) { |
466 | 466 | update_post_meta( $notification->ID, 'viewed', 1 ); |