@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | $data['usagetracking'] = get_option( 'monsterinsights_usage_tracking_config', false ); |
| 94 | 94 | $data['usercount'] = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set'; |
| 95 | 95 | $data['usesauth'] = $usesauth; |
| 96 | - $data['timezoneoffset']= date('P'); |
|
| 96 | + $data['timezoneoffset'] = date( 'P' ); |
|
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | // Retrieve current plugin information |
| 101 | - if( ! function_exists( 'get_plugins' ) ) { |
|
| 101 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
| 102 | 102 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | foreach ( $plugins as $key => $plugin ) { |
| 109 | 109 | if ( in_array( $plugin, $active_plugins ) ) { |
| 110 | 110 | // Remove active plugins from list so we can show active and inactive separately |
| 111 | - unset( $plugins[ $key ] ); |
|
| 111 | + unset( $plugins[$key] ); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if( ! $this->tracking_allowed() && ! $override ) { |
|
| 129 | + if ( ! $this->tracking_allowed() && ! $override ) { |
|
| 130 | 130 | return false; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -158,15 +158,15 @@ discard block |
||
| 158 | 158 | public function schedule_send() { |
| 159 | 159 | if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) { |
| 160 | 160 | $tracking = array(); |
| 161 | - $tracking['day'] = rand( 0, 6 ); |
|
| 161 | + $tracking['day'] = rand( 0, 6 ); |
|
| 162 | 162 | $tracking['hour'] = rand( 0, 23 ); |
| 163 | 163 | $tracking['minute'] = rand( 0, 59 ); |
| 164 | 164 | $tracking['second'] = rand( 0, 59 ); |
| 165 | - $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
| 166 | - ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
| 165 | + $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
| 166 | + ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
| 167 | 167 | ( $tracking['minute'] * MINUTE_IN_SECONDS ) + |
| 168 | 168 | $tracking['second']; |
| 169 | - $tracking['initsend'] = strtotime("next sunday") + $tracking['offset']; |
|
| 169 | + $tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset']; |
|
| 170 | 170 | |
| 171 | 171 | wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' ); |
| 172 | 172 | update_option( 'monsterinsights_usage_tracking_config', $tracking ); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -52,7 +52,8 @@ |
||
| 52 | 52 | // Check for wizard-specific parameter |
| 53 | 53 | // Allow plugins to disable the onboarding wizard |
| 54 | 54 | // Check if current user is allowed to save settings. |
| 55 | - if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { // WPCS: CSRF ok, input var ok. |
|
| 55 | + if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { |
|
| 56 | +// WPCS: CSRF ok, input var ok. |
|
| 56 | 57 | return; |
| 57 | 58 | } |
| 58 | 59 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | 'kad_admin_js', // Pinnacle theme |
| 354 | 354 | 'dt-chart', // DesignThemes core features plugin |
| 355 | 355 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
| 356 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
| 356 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
| 357 | 357 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
| 358 | 358 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
| 359 | 359 | 'imagify-promise-polyfill', // Imagify |
@@ -372,16 +372,16 @@ discard block |
||
| 372 | 372 | 'rml-modal', // WP Real Media Library |
| 373 | 373 | 'rml-order', // WP Real Media Library |
| 374 | 374 | 'rml-meta', // WP Real Media Library |
| 375 | - 'rml-uploader', // WP Real Media Library |
|
| 376 | - 'rml-options', // WP Real Media Library |
|
| 377 | - 'rml-usersettings', // WP Real Media Library |
|
| 375 | + 'rml-uploader', // WP Real Media Library |
|
| 376 | + 'rml-options', // WP Real Media Library |
|
| 377 | + 'rml-usersettings', // WP Real Media Library |
|
| 378 | 378 | 'rml-main', // WP Real Media Library |
| 379 | 379 | 'control-panel-sweet-alert', // Ken Theme |
| 380 | 380 | 'sweet-alert-js', // Vitrine Theme |
| 381 | 381 | 'theme-admin-script', // Vitrine Theme |
| 382 | 382 | 'sweetalert', // Church Suite Theme by Webnus |
| 383 | 383 | 'be_alerts_charts', // WooCommerce bolder product alerts |
| 384 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
| 384 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
| 385 | 385 | 'control-panel-sweet-alert', // Ken Theme |
| 386 | 386 | 'cpm_chart', // WP Project Manager |
| 387 | 387 | 'adminscripts', // Artisan Nayma Theme |
@@ -472,20 +472,20 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | global $wp_styles; |
| 474 | 474 | foreach ( $wp_styles->queue as $handle ) { |
| 475 | - if ( strpos( $wp_styles->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
| 475 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
| 476 | 476 | return; |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
| 479 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
| 480 | 480 | return; |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | foreach ( $third_party as $partial ) { |
| 484 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, $partial ) !== false ) { |
|
| 484 | + if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
|
| 485 | 485 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
| 486 | 486 | wp_deregister_style( $handle ); |
| 487 | 487 | break; |
| 488 | - } else if ( strpos( $wp_styles->registered[ $handle ]->src, $partial ) !== false ) { |
|
| 488 | + } else if ( strpos( $wp_styles->registered[$handle]->src, $partial ) !== false ) { |
|
| 489 | 489 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
| 490 | 490 | wp_deregister_style( $handle ); |
| 491 | 491 | break; |
@@ -495,20 +495,20 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | global $wp_scripts; |
| 497 | 497 | foreach ( $wp_scripts->queue as $handle ) { |
| 498 | - if ( strpos( $wp_scripts->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
| 498 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
| 499 | 499 | return; |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
| 502 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | foreach ( $third_party as $partial ) { |
| 507 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, $partial ) !== false ) { |
|
| 507 | + if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
|
| 508 | 508 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
| 509 | 509 | wp_deregister_script( $handle ); |
| 510 | 510 | break; |
| 511 | - } else if ( strpos( $wp_scripts->registered[ $handle ]->src, $partial ) !== false ) { |
|
| 511 | + } else if ( strpos( $wp_scripts->registered[$handle]->src, $partial ) !== false ) { |
|
| 512 | 512 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
| 513 | 513 | wp_deregister_script( $handle ); |
| 514 | 514 | break; |
@@ -582,14 +582,14 @@ discard block |
||
| 582 | 582 | foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
| 583 | 583 | foreach ( $hooks as $name => $arr ) { |
| 584 | 584 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 585 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 585 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
| 586 | 586 | continue; |
| 587 | 587 | } |
| 588 | 588 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 589 | 589 | continue; |
| 590 | 590 | } |
| 591 | 591 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 592 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 592 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | } |
@@ -599,14 +599,14 @@ discard block |
||
| 599 | 599 | foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
| 600 | 600 | foreach ( $hooks as $name => $arr ) { |
| 601 | 601 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 602 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 602 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
| 603 | 603 | continue; |
| 604 | 604 | } |
| 605 | 605 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 606 | 606 | continue; |
| 607 | 607 | } |
| 608 | 608 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 609 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 609 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | } |
@@ -616,14 +616,14 @@ discard block |
||
| 616 | 616 | foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
| 617 | 617 | foreach ( $hooks as $name => $arr ) { |
| 618 | 618 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 619 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 619 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
| 620 | 620 | continue; |
| 621 | 621 | } |
| 622 | 622 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 623 | 623 | continue; |
| 624 | 624 | } |
| 625 | 625 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 626 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 626 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | 629 | } |
@@ -684,10 +684,10 @@ discard block |
||
| 684 | 684 | // Put together redirect URL |
| 685 | 685 | $url = add_query_arg( |
| 686 | 686 | array( |
| 687 | - 'utm_source' => $source, // Pro/Lite Plugin |
|
| 688 | - 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
| 687 | + 'utm_source' => $source, // Pro/Lite Plugin |
|
| 688 | + 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
| 689 | 689 | 'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report) |
| 690 | - 'utm_content' => $content, // Version number of MI |
|
| 690 | + 'utm_content' => $content, // Version number of MI |
|
| 691 | 691 | ), |
| 692 | 692 | trailingslashit( $url ) |
| 693 | 693 | ); |
@@ -87,7 +87,8 @@ |
||
| 87 | 87 | wp_cache_flush(); |
| 88 | 88 | $cachec = true; |
| 89 | 89 | } |
| 90 | - } else { // if existing install |
|
| 90 | + } else { |
|
| 91 | +// if existing install |
|
| 91 | 92 | if ( version_compare( $version, '6.0.11', '<' ) ) { |
| 92 | 93 | if ( ! $cachec ) { |
| 93 | 94 | wp_cache_flush(); |
@@ -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' ); |
@@ -363,25 +363,25 @@ discard block |
||
| 363 | 363 | public function v700_upgrades() { |
| 364 | 364 | // 1. Default all event tracking and tracking to GA + JS respectively |
| 365 | 365 | // 3a Set tracking_mode to use analytics.js |
| 366 | - $this->new_settings['tracking_mode' ] = 'analytics'; |
|
| 366 | + $this->new_settings['tracking_mode'] = 'analytics'; |
|
| 367 | 367 | |
| 368 | 368 | |
| 369 | 369 | // 3b Set events mode to use JS if the events mode is not set explicitly to none |
| 370 | - if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) { |
|
| 371 | - $this->new_settings['events_mode' ] = 'js'; |
|
| 370 | + if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) { |
|
| 371 | + $this->new_settings['events_mode'] = 'js'; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | // 2. Migrate manual UA codes |
| 375 | 375 | // 2a Manual UA has the lowest priority |
| 376 | - if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) { |
|
| 376 | + if ( ! empty( $this->new_settings['manual_ua_code'] ) ) { |
|
| 377 | 377 | // Set as manual UA code |
| 378 | - 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' ] ) ); |
|
| 378 | + 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'] ) ); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | // 2b Then try the oAuth UA code |
| 382 | - if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) { |
|
| 382 | + if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) { |
|
| 383 | 383 | // Set as manual UA code |
| 384 | - 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' ] ) ); |
|
| 384 | + 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'] ) ); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | // 3. Migrate License keys |
@@ -423,8 +423,8 @@ discard block |
||
| 423 | 423 | 'track_internal_as_label', |
| 424 | 424 | ); |
| 425 | 425 | foreach ( $settings as $setting ) { |
| 426 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 427 | - unset( $this->new_settings[ $setting ] ); |
|
| 426 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 427 | + unset( $this->new_settings[$setting] ); |
|
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | } |
@@ -468,8 +468,8 @@ discard block |
||
| 468 | 468 | ); |
| 469 | 469 | |
| 470 | 470 | foreach ( $settings as $setting ) { |
| 471 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 472 | - unset( $this->new_settings[ $setting ] ); |
|
| 471 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 472 | + unset( $this->new_settings[$setting] ); |
|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
@@ -508,8 +508,8 @@ discard block |
||
| 508 | 508 | ); |
| 509 | 509 | |
| 510 | 510 | foreach ( $settings as $setting ) { |
| 511 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 512 | - unset( $this->new_settings[ $setting ] ); |
|
| 511 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 512 | + unset( $this->new_settings[$setting] ); |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | } |
| 601 | 601 | preg_match( $regex, $cross_domain['domain'], $matches ); |
| 602 | 602 | if ( count( $matches ) > 0 ) { |
| 603 | - unset( $this->new_settings['cross_domains'][ $key ] ); |
|
| 603 | + unset( $this->new_settings['cross_domains'][$key] ); |
|
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | 606 | } |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | 'js', |
| 681 | 681 | 'tgz' |
| 682 | 682 | ); |
| 683 | - $extensions_to_add = array( |
|
| 683 | + $extensions_to_add = array( |
|
| 684 | 684 | 'docx', |
| 685 | 685 | 'pptx', |
| 686 | 686 | 'xlsx', |
@@ -782,8 +782,8 @@ discard block |
||
| 782 | 782 | ); |
| 783 | 783 | |
| 784 | 784 | foreach ( $popular_posts_defaults as $key => $value ) { |
| 785 | - if ( empty( $this->new_settings[ $key ] ) ) { |
|
| 786 | - $this->new_settings[ $key ] = $value; |
|
| 785 | + if ( empty( $this->new_settings[$key] ) ) { |
|
| 786 | + $this->new_settings[$key] = $value; |
|
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | $content = isset( $dismiss_notification['content'] ) ? $dismiss_notification['content'] : ''; |
| 799 | 799 | |
| 800 | 800 | if ( empty( $title ) || empty( $content ) ) { |
| 801 | - unset( $dismissed_notifications[ $key ] ); |
|
| 801 | + unset( $dismissed_notifications[$key] ); |
|
| 802 | 802 | } |
| 803 | 803 | } |
| 804 | 804 | |