@@ -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 | ); |
@@ -347,11 +347,11 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) { |
350 | - define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
350 | + define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) { |
354 | - define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
354 | + define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
355 | 355 | } |
356 | 356 | } |
357 | 357 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | } |
372 | 372 | |
373 | 373 | // Traditional WordPress plugin locale filter. |
374 | - $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
374 | + $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
375 | 375 | $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); |
376 | 376 | |
377 | 377 | // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | public function monsterinsights_wp_notice() { |
411 | 411 | $url = admin_url( 'plugins.php' ); |
412 | 412 | // Check for MS dashboard |
413 | - if( is_network_admin() ) { |
|
413 | + if ( is_network_admin() ) { |
|
414 | 414 | $url = network_admin_url( 'plugins.php' ); |
415 | 415 | } |
416 | 416 | ?> |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | public function monsterinsights_pro_notice() { |
432 | 432 | $url = admin_url( 'plugins.php' ); |
433 | 433 | // Check for MS dashboard |
434 | - if( is_network_admin() ) { |
|
434 | + if ( is_network_admin() ) { |
|
435 | 435 | $url = network_admin_url( 'plugins.php' ); |
436 | 436 | } |
437 | 437 | ?> |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php'; |
458 | 458 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php'; |
459 | 459 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php'; |
460 | - $monsterinsights_settings = monsterinsights_get_options(); |
|
460 | + $monsterinsights_settings = monsterinsights_get_options(); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * |
472 | 472 | * @return void |
473 | 473 | */ |
474 | - public function load_licensing(){ |
|
474 | + public function load_licensing() { |
|
475 | 475 | if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
476 | 476 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/license-compat.php'; |
477 | 477 | self::$instance->license = new MonsterInsights_License_Compat(); |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $instance->api_auth->delete_auth(); |
641 | 641 | |
642 | 642 | // Delete data |
643 | - $instance->reporting->delete_aggregate_data('site'); |
|
643 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
644 | 644 | |
645 | 645 | restore_current_blog(); |
646 | 646 | } |
@@ -648,22 +648,22 @@ discard block |
||
648 | 648 | $instance->api_auth->uninstall_network_auth(); |
649 | 649 | |
650 | 650 | // Delete network data |
651 | - $instance->reporting->delete_aggregate_data('network'); |
|
651 | + $instance->reporting->delete_aggregate_data( 'network' ); |
|
652 | 652 | } else { |
653 | 653 | // Delete auth |
654 | 654 | $instance->api_auth->delete_auth(); |
655 | 655 | |
656 | 656 | // Delete data |
657 | - $instance->reporting->delete_aggregate_data('site'); |
|
657 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | // Clear notification cron schedules |
661 | 661 | $schedules = wp_get_schedules(); |
662 | 662 | |
663 | - if ( is_array( $schedules ) && ! empty( $schedules ) ) { |
|
663 | + if ( is_array( $schedules ) && ! empty( $schedules ) ) { |
|
664 | 664 | foreach ( $schedules as $key => $value ) { |
665 | - if ( 0 === strpos($key, "monsterinsights_notification_") ) { |
|
666 | - $cron_hook = implode("_", explode( "_", $key, -2 ) ) . '_cron'; |
|
665 | + if ( 0 === strpos( $key, "monsterinsights_notification_" ) ) { |
|
666 | + $cron_hook = implode( "_", explode( "_", $key, -2 ) ) . '_cron'; |
|
667 | 667 | wp_clear_scheduled_hook( $cron_hook ); |
668 | 668 | } |
669 | 669 | } |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | * |
755 | 755 | * @return void |
756 | 756 | */ |
757 | -function monsterinsights_lite_call_install_and_upgrade(){ |
|
757 | +function monsterinsights_lite_call_install_and_upgrade() { |
|
758 | 758 | add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' ); |
759 | 759 | } |
760 | 760 |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | $user = new WP_User( $user_id ); |
33 | 33 | } |
34 | 34 | |
35 | - $track_user = true; |
|
36 | - $roles = monsterinsights_get_option( 'ignore_users', array() ); |
|
35 | + $track_user = true; |
|
36 | + $roles = monsterinsights_get_option( 'ignore_users', array() ); |
|
37 | 37 | |
38 | 38 | if ( ! empty( $roles ) && is_array( $roles ) ) { |
39 | 39 | foreach ( $roles as $role ) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | |
184 | 184 | function monsterinsights_generate_ga_client_id() { |
185 | - return rand(100000000,999999999) . '.' . time(); |
|
185 | + return rand( 100000000, 999999999 ) . '.' . time(); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $stop = time(); |
203 | 203 | } |
204 | 204 | |
205 | - $diff = (int) abs( $stop - $start ); |
|
205 | + $diff = (int) abs( $stop - $start ); |
|
206 | 206 | $hours = round( $diff / HOUR_IN_SECONDS ); |
207 | 207 | return $hours; |
208 | 208 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $editable_roles = apply_filters( 'editable_roles', $all_roles ); |
261 | 261 | |
262 | 262 | foreach ( $editable_roles as $id => $name ) { |
263 | - $roles[ $id ] = translate_user_role( $name['name'] ); |
|
263 | + $roles[$id] = translate_user_role( $name['name'] ); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | return $roles; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | foreach ( $editable_roles as $id => $role ) { |
288 | 288 | if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) { |
289 | - $roles[ $id ] = translate_user_role( $role['name'] ); |
|
289 | + $roles[$id] = translate_user_role( $role['name'] ); |
|
290 | 290 | } |
291 | 291 | } |
292 | 292 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | } |
334 | 334 | if ( substr_count( $host, '.' ) > 1 ) { |
335 | - $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
335 | + $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
336 | 336 | foreach ( $subdomains_to_check as $subdomain ) { |
337 | 337 | $subdomain = str_replace( '.', '(.)', $subdomain ); |
338 | 338 | $subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain ); |
@@ -348,16 +348,16 @@ discard block |
||
348 | 348 | |
349 | 349 | // Set cookie to expire in 2 years |
350 | 350 | function monsterinsights_get_cookie_expiration_date( $time ) { |
351 | - return date('D, j F Y H:i:s', time() + $time ); |
|
351 | + return date( 'D, j F Y H:i:s', time() + $time ); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | function monsterinsights_string_ends_with( $string, $ending ) { |
355 | - $strlen = strlen($string); |
|
356 | - $endinglen = strlen($ending); |
|
355 | + $strlen = strlen( $string ); |
|
356 | + $endinglen = strlen( $ending ); |
|
357 | 357 | if ( $endinglen > $strlen ) { |
358 | 358 | return false; |
359 | 359 | } |
360 | - return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0; |
|
360 | + return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | function monsterinsights_string_starts_with( $string, $start ) { |
@@ -887,11 +887,11 @@ discard block |
||
887 | 887 | return $countries; |
888 | 888 | } |
889 | 889 | |
890 | -function monsterinsights_get_api_url(){ |
|
890 | +function monsterinsights_get_api_url() { |
|
891 | 891 | return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' ); |
892 | 892 | } |
893 | 893 | |
894 | -function monsterinsights_get_licensing_url(){ |
|
894 | +function monsterinsights_get_licensing_url() { |
|
895 | 895 | return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' ); |
896 | 896 | } |
897 | 897 | |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | } |
936 | 936 | } |
937 | 937 | |
938 | -if ( ! function_exists ( 'remove_class_filter' ) ) { |
|
938 | +if ( ! function_exists( 'remove_class_filter' ) ) { |
|
939 | 939 | /** |
940 | 940 | * Remove Class Filter Without Access to Class Object |
941 | 941 | * |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) { |
957 | 957 | global $wp_filter; |
958 | 958 | // Check that filter actually exists first |
959 | - if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE; |
|
959 | + if ( ! isset( $wp_filter[$tag] ) ) return FALSE; |
|
960 | 960 | /** |
961 | 961 | * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer |
962 | 962 | * a simple array, rather it is an object that implements the ArrayAccess interface. |
@@ -965,33 +965,33 @@ discard block |
||
965 | 965 | * |
966 | 966 | * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/ |
967 | 967 | */ |
968 | - if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) { |
|
969 | - $callbacks = &$wp_filter[ $tag ]->callbacks; |
|
968 | + if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) { |
|
969 | + $callbacks = &$wp_filter[$tag]->callbacks; |
|
970 | 970 | } else { |
971 | - $callbacks = &$wp_filter[ $tag ]; |
|
971 | + $callbacks = &$wp_filter[$tag]; |
|
972 | 972 | } |
973 | 973 | // Exit if there aren't any callbacks for specified priority |
974 | - if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE; |
|
974 | + if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE; |
|
975 | 975 | // Loop through each filter for the specified priority, looking for our class & method |
976 | - foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) { |
|
976 | + foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) { |
|
977 | 977 | // Filter should always be an array - array( $this, 'method' ), if not goto next |
978 | - if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue; |
|
978 | + if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue; |
|
979 | 979 | // If first value in array is not an object, it can't be a class |
980 | - if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue; |
|
980 | + if ( ! is_object( $filter['function'][0] ) ) continue; |
|
981 | 981 | // Method doesn't match the one we're looking for, goto next |
982 | - if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue; |
|
982 | + if ( $filter['function'][1] !== $method_name ) continue; |
|
983 | 983 | // Method matched, now let's check the Class |
984 | - if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) { |
|
984 | + if ( get_class( $filter['function'][0] ) === $class_name ) { |
|
985 | 985 | // Now let's remove it from the array |
986 | - unset( $callbacks[ $priority ][ $filter_id ] ); |
|
986 | + unset( $callbacks[$priority][$filter_id] ); |
|
987 | 987 | // and if it was the only filter in that priority, unset that priority |
988 | - if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] ); |
|
988 | + if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] ); |
|
989 | 989 | // and if the only filter for that tag, set the tag to an empty array |
990 | 990 | if ( empty( $callbacks ) ) $callbacks = array(); |
991 | 991 | // If using WordPress older than 4.7 |
992 | - if ( ! is_object( $wp_filter[ $tag ] ) ) { |
|
992 | + if ( ! is_object( $wp_filter[$tag] ) ) { |
|
993 | 993 | // Remove this filter from merged_filters, which specifies if filters have been sorted |
994 | - unset( $GLOBALS[ 'merged_filters' ][ $tag ] ); |
|
994 | + unset( $GLOBALS['merged_filters'][$tag] ); |
|
995 | 995 | } |
996 | 996 | return TRUE; |
997 | 997 | } |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | } |
1001 | 1001 | } // End function exists |
1002 | 1002 | |
1003 | -if ( ! function_exists ( 'remove_class_action' ) ) { |
|
1003 | +if ( ! function_exists( 'remove_class_action' ) ) { |
|
1004 | 1004 | /** |
1005 | 1005 | * Remove Class Action Without Access to Class Object |
1006 | 1006 | * |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | foreach ( $translations->entries as $msgid => $entry ) { |
1073 | - $locale[ $msgid ] = $entry->translations; |
|
1073 | + $locale[$msgid] = $entry->translations; |
|
1074 | 1074 | } |
1075 | 1075 | |
1076 | 1076 | return $locale; |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | |
1214 | 1214 | $pattern = '/UA-[0-9-]+/'; |
1215 | 1215 | if ( isset( $options['ga-UID'] ) && preg_match( $pattern, $options['ga-UID'] ) ) { |
1216 | - ++ $count; |
|
1216 | + ++$count; |
|
1217 | 1217 | } |
1218 | 1218 | } |
1219 | 1219 | |
@@ -1224,7 +1224,7 @@ discard block |
||
1224 | 1224 | |
1225 | 1225 | $pattern = '/UA-[0-9-]+/'; |
1226 | 1226 | if ( ! empty( $code ) && preg_match( $pattern, $code ) ) { |
1227 | - ++ $count; |
|
1227 | + ++$count; |
|
1228 | 1228 | } |
1229 | 1229 | } |
1230 | 1230 | |
@@ -1443,22 +1443,22 @@ discard block |
||
1443 | 1443 | * |
1444 | 1444 | * @return trimed sentence |
1445 | 1445 | */ |
1446 | -function monsterinsights_trim_text( $text, $count ){ |
|
1447 | - $text = str_replace(" ", " ", $text); |
|
1448 | - $string = explode(" ", $text); |
|
1446 | +function monsterinsights_trim_text( $text, $count ) { |
|
1447 | + $text = str_replace( " ", " ", $text ); |
|
1448 | + $string = explode( " ", $text ); |
|
1449 | 1449 | $trimed = ""; |
1450 | 1450 | |
1451 | 1451 | for ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ) { |
1452 | 1452 | $trimed .= isset( $string[$wordCounter] ) ? $string[$wordCounter] : ''; |
1453 | 1453 | |
1454 | - if ( $wordCounter < $count ){ |
|
1454 | + if ( $wordCounter < $count ) { |
|
1455 | 1455 | $trimed .= " "; |
1456 | 1456 | } else { |
1457 | 1457 | $trimed .= "..."; |
1458 | 1458 | } |
1459 | 1459 | } |
1460 | 1460 | |
1461 | - $trimed = trim($trimed); |
|
1461 | + $trimed = trim( $trimed ); |
|
1462 | 1462 | |
1463 | 1463 | return $trimed; |
1464 | 1464 | } |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | $monsterinsights_reference = isset( $_GET['monsterinsights_reference'] ) ? $_GET['monsterinsights_reference'] : ''; |
1535 | 1535 | |
1536 | 1536 | if ( 'post-new.php' === $pagenow && 'pretty-link' === $post_type && 'url_builder' === $monsterinsights_reference ) { |
1537 | - $onboard = get_option( 'prli_onboard' ); |
|
1537 | + $onboard = get_option( 'prli_onboard' ); |
|
1538 | 1538 | |
1539 | 1539 | if ( $onboard == 'welcome' || $onboard == 'update' ) { |
1540 | 1540 | update_option( 'monsterinsights_backup_prli_onboard_value', $onboard ); |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ''; |
1555 | 1555 | |
1556 | 1556 | if ( 'edit.php' === $pagenow && 'pretty-link' === $post_type ) { |
1557 | - $onboard = get_option( 'monsterinsights_backup_prli_onboard_value' ); |
|
1557 | + $onboard = get_option( 'monsterinsights_backup_prli_onboard_value' ); |
|
1558 | 1558 | |
1559 | 1559 | if ( class_exists( 'PrliBaseController' ) && ( $onboard == 'welcome' || $onboard == 'update' ) ) { |
1560 | 1560 | update_option( 'prli_onboard', $onboard ); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | |
99 | 99 | if ( $create && ! empty( $create ) && is_array( $create ) ) { |
100 | 100 | $create = json_encode( $create ); |
101 | - $create = str_replace( '"', "'", $create ); |
|
102 | - $options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create; |
|
101 | + $create = str_replace( '"', "'", $create ); |
|
102 | + $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create; |
|
103 | 103 | } else { |
104 | 104 | $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'"; |
105 | 105 | } |
@@ -191,37 +191,37 @@ discard block |
||
191 | 191 | * @return string Javascript to output. |
192 | 192 | */ |
193 | 193 | public function frontend_output( ) { |
194 | - $options = $this->frontend_tracking_options(); |
|
194 | + $options = $this->frontend_tracking_options(); |
|
195 | 195 | $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
196 | - $compat_mode = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
|
196 | + $compat_mode = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
|
197 | 197 | $compat = $compat_mode ? 'window.ga = __gaTracker;' : ''; |
198 | 198 | $track_user = monsterinsights_track_user(); |
199 | 199 | $ua = monsterinsights_get_ua(); |
200 | 200 | $output = ''; |
201 | 201 | $reason = ''; |
202 | - $attr_string = monsterinsights_get_frontend_analytics_script_atts(); |
|
202 | + $attr_string = monsterinsights_get_frontend_analytics_script_atts(); |
|
203 | 203 | ob_start(); |
204 | 204 | ?> |
205 | 205 | <!-- This site uses the Google Analytics by MonsterInsights plugin v<?php echo MONSTERINSIGHTS_VERSION; ?> - Using Analytics tracking - https://www.monsterinsights.com/ --> |
206 | 206 | <?php if ( ! $track_user ) { |
207 | 207 | if ( empty( $ua ) ) { |
208 | 208 | $reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ); |
209 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
209 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
210 | 210 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
211 | - $reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
212 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
211 | + $reason = __( 'Note: MonsterInsights does not track you as a logged-in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
212 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
213 | 213 | } else { |
214 | 214 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
215 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
215 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
216 | 216 | } |
217 | 217 | echo $output; |
218 | 218 | } ?> |
219 | 219 | <?php if ( $ua ) { ?> |
220 | -<script<?php echo $attr_string;?>> |
|
220 | +<script<?php echo $attr_string; ?>> |
|
221 | 221 | (window.gaDevIds=window.gaDevIds||[]).push("dZGIzZG"); |
222 | 222 | var mi_version = '<?php echo MONSTERINSIGHTS_VERSION; ?>'; |
223 | 223 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
224 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
224 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
225 | 225 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
226 | 226 | |
227 | 227 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | ?> |
276 | 276 | } else { |
277 | 277 | <?php if ( $this->should_do_optout() ) { ?> |
278 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
278 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
279 | 279 | (function() { |
280 | 280 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
281 | 281 | var noopfn = function() { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | var f = arguments[len-1]; |
300 | 300 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
301 | - console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason ); |
|
301 | + console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason ); |
|
302 | 302 | return; |
303 | 303 | } |
304 | 304 | try { |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | |
23 | 23 | $defaults = array( |
24 | 24 | 't' => 'event', // Required: Hit type |
25 | - 'ec' => '', // Optional: Event category |
|
26 | - 'ea' => '', // Optional: Event Action |
|
27 | - 'el' => '', // Optional: Event Label |
|
28 | - 'ev' => null, // Optional: Event Value |
|
25 | + 'ec' => '', // Optional: Event category |
|
26 | + 'ea' => '', // Optional: Event Action |
|
27 | + 'el' => '', // Optional: Event Label |
|
28 | + 'ev' => null, // Optional: Event Value |
|
29 | 29 | ); |
30 | 30 | |
31 | - $body = array_merge( $defaults , $args ); |
|
31 | + $body = array_merge( $defaults, $args ); |
|
32 | 32 | |
33 | 33 | // We want to get the user's IP address when possible |
34 | - $ip = ''; |
|
34 | + $ip = ''; |
|
35 | 35 | if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) { |
36 | 36 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
37 | 37 | } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'uip' => $ip, |
80 | 80 | |
81 | 81 | // Optional: User Agent |
82 | - 'ua' => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'], |
|
82 | + 'ua' => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'], |
|
83 | 83 | |
84 | 84 | // Optional: Time of the event |
85 | 85 | 'z' => time(), |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // Unset empty values to reduce request size |
101 | 101 | foreach ( $body as $key => $value ) { |
102 | 102 | if ( empty( $value ) ) { |
103 | - unset( $body[ $key ] ); |
|
103 | + unset( $body[$key] ); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // Optional: Event Value |
139 | 139 | 'ev' => null, |
140 | 140 | ); |
141 | - $args = wp_parse_args( $args, $default_args ); |
|
141 | + $args = wp_parse_args( $args, $default_args ); |
|
142 | 142 | //$args = apply_filters( 'monsterinsights_mp_track_event_call', $args ); |
143 | 143 | |
144 | 144 | return monsterinsights_mp_api_call( $args ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if ( method_exists( $this, 'get_themes_' . $type ) ) { |
65 | 65 | $this->themes = call_user_func( array( $this, 'get_themes_' . $type ) ); |
66 | 66 | if ( ! empty( $theme ) ) { |
67 | - $this->theme = isset( $this->themes[ $theme ] ) ? $this->themes[ $theme ] : array(); |
|
67 | + $this->theme = isset( $this->themes[$theme] ) ? $this->themes[$theme] : array(); |
|
68 | 68 | |
69 | 69 | return $this->theme; |
70 | 70 | } else { |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | |
115 | 115 | $settings = $this->get_theme_stored_styles(); |
116 | 116 | |
117 | - if ( ! empty( $settings[ $type ] ) ) { |
|
117 | + if ( ! empty( $settings[$type] ) ) { |
|
118 | 118 | foreach ( $themes as $theme_key => $theme_values ) { |
119 | - if ( ! empty( $settings[ $type ][ $theme_key ] ) ) { |
|
120 | - foreach ( $themes[ $theme_key ]['styles'] as $object => $props ) { |
|
121 | - if ( ! empty( $settings[ $type ][ $theme_key ][ $object ] ) ) { |
|
119 | + if ( ! empty( $settings[$type][$theme_key] ) ) { |
|
120 | + foreach ( $themes[$theme_key]['styles'] as $object => $props ) { |
|
121 | + if ( ! empty( $settings[$type][$theme_key][$object] ) ) { |
|
122 | 122 | foreach ( $props as $style_key => $style_value ) { |
123 | - if ( ! empty( $settings[ $type ][ $theme_key ][ $object ][ $style_key ] ) ) { |
|
124 | - $themes[ $theme_key ]['styles'][ $object ][ $style_key ] = $settings[ $type ][ $theme_key ][ $object ][ $style_key ]; |
|
123 | + if ( ! empty( $settings[$type][$theme_key][$object][$style_key] ) ) { |
|
124 | + $themes[$theme_key]['styles'][$object][$style_key] = $settings[$type][$theme_key][$object][$style_key]; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | } |
@@ -521,13 +521,13 @@ discard block |
||
521 | 521 | continue; |
522 | 522 | } |
523 | 523 | |
524 | - if ( ! empty( $atts[ $atts_key ] ) ) { |
|
525 | - if ( is_bool( $atts[ $atts_key ] ) || 'on' === $atts[ $atts_key ] ) { |
|
524 | + if ( ! empty( $atts[$atts_key] ) ) { |
|
525 | + if ( is_bool( $atts[$atts_key] ) || 'on' === $atts[$atts_key] ) { |
|
526 | 526 | continue; |
527 | 527 | } |
528 | 528 | if ( 'size' === $style_key ) { |
529 | - $style_key = 'font-size'; |
|
530 | - $atts[ $atts_key ] .= 'px'; |
|
529 | + $style_key = 'font-size'; |
|
530 | + $atts[$atts_key] .= 'px'; |
|
531 | 531 | } |
532 | 532 | if ( 'background' === $style_key || 'background' === $element && 'color' === $style_key ) { |
533 | 533 | $style_key = 'background-color'; |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | if ( 'border' === $element || 'border' === $style_key ) { |
536 | 536 | $style_key = 'border-color'; |
537 | 537 | } |
538 | - $style_css .= $style_key . ':' . $atts[ $atts_key ] . ';'; |
|
538 | + $style_css .= $style_key . ':' . $atts[$atts_key] . ';'; |
|
539 | 539 | } |
540 | 540 | } |
541 | 541 | } |
@@ -558,11 +558,11 @@ discard block |
||
558 | 558 | |
559 | 559 | $class = get_called_class(); |
560 | 560 | |
561 | - if ( ! isset( self::$instances[ $class ] ) ) { |
|
562 | - self::$instances[ $class ] = new $class; |
|
561 | + if ( ! isset( self::$instances[$class] ) ) { |
|
562 | + self::$instances[$class] = new $class; |
|
563 | 563 | } |
564 | 564 | |
565 | - return self::$instances[ $class ]; |
|
565 | + return self::$instances[$class]; |
|
566 | 566 | |
567 | 567 | } |
568 | 568 | |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | public function get_themes_styles_for_output() { |
724 | 724 | |
725 | 725 | $stored_styles = $this->get_theme_props()->get_theme_stored_styles(); |
726 | - $themes = ! empty( $stored_styles[ $this->type ] ) && is_array( $stored_styles[ $this->type ] ) ? $stored_styles[ $this->type ] : array(); |
|
726 | + $themes = ! empty( $stored_styles[$this->type] ) && is_array( $stored_styles[$this->type] ) ? $stored_styles[$this->type] : array(); |
|
727 | 727 | |
728 | 728 | return $themes; |
729 | 729 |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | $this->notification_recurrence_name = $this->notification_id . '_' . $this->notification_interval . '_days'; |
127 | 127 | $this->notification_id = $this->notification_id . '_' . time(); |
128 | 128 | $this->notification_active_for = date( "m/d/Y", strtotime( "+" . ( $this->notification_interval - 2 ) . " day" ) ); |
129 | - $this->report_start_from = "-". $this->notification_interval ." day"; |
|
129 | + $this->report_start_from = "-" . $this->notification_interval . " day"; |
|
130 | 130 | |
131 | - if( ! isset( $this->notification_first_run_time ) || empty( $this->notification_first_run_time ) ) { |
|
132 | - $this->notification_first_run_time = "+". $this->notification_interval ." day"; |
|
131 | + if ( ! isset( $this->notification_first_run_time ) || empty( $this->notification_first_run_time ) ) { |
|
132 | + $this->notification_first_run_time = "+" . $this->notification_interval . " day"; |
|
133 | 133 | } |
134 | 134 | |
135 | - if( ! isset( $this->notification_icon ) || empty( $this->notification_icon ) ) { |
|
136 | - $this->notification_icon = '<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|
135 | + if ( ! isset( $this->notification_icon ) || empty( $this->notification_icon ) ) { |
|
136 | + $this->notification_icon = '<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|
137 | 137 | <circle cx="16" cy="16" r="16" fill="#D3F8EA"/> |
138 | 138 | <path d="M21.8634 18.6429C21.8634 18.8571 21.7831 19.0268 21.6224 19.1518C21.5688 19.3482 21.542 19.6786 21.542 20.1429C21.542 20.6071 21.5688 20.9375 21.6224 21.1339C21.7831 21.2768 21.8634 21.4464 21.8634 21.6429V22.0714C21.8634 22.25 21.8009 22.4018 21.6759 22.5268C21.5509 22.6518 21.3992 22.7143 21.2206 22.7143H12.4349C11.7206 22.7143 11.1134 22.4643 10.6134 21.9643C10.1134 21.4643 9.86345 20.8571 9.86345 20.1429V11.5714C9.86345 10.8571 10.1134 10.25 10.6134 9.75C11.1134 9.25 11.7206 9 12.4349 9H21.2206C21.3992 9 21.5509 9.0625 21.6759 9.1875C21.8009 9.3125 21.8634 9.46429 21.8634 9.64286V18.6429ZM13.292 12.5893V13.125C13.292 13.2321 13.3456 13.2857 13.4527 13.2857H19.1313C19.2384 13.2857 19.292 13.2321 19.292 13.125V12.5893C19.292 12.4821 19.2384 12.4286 19.1313 12.4286H13.4527C13.3456 12.4286 13.292 12.4821 13.292 12.5893ZM13.292 14.3036V14.8393C13.292 14.9464 13.3456 15 13.4527 15H19.1313C19.2384 15 19.292 14.9464 19.292 14.8393V14.3036C19.292 14.1964 19.2384 14.1429 19.1313 14.1429H13.4527C13.3456 14.1429 13.292 14.1964 13.292 14.3036ZM20.0688 21C20.0152 20.4286 20.0152 19.8571 20.0688 19.2857H12.4349C12.2027 19.2857 11.9974 19.375 11.8188 19.5536C11.6581 19.7143 11.5777 19.9107 11.5777 20.1429C11.5777 20.375 11.6581 20.5804 11.8188 20.7589C11.9974 20.9196 12.2027 21 12.4349 21H20.0688Z" fill="#1EC185"/> |
139 | 139 | </svg>'; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | ( $schedule['hour'] * HOUR_IN_SECONDS ) + |
233 | 233 | ( $schedule['minute'] * MINUTE_IN_SECONDS ) + |
234 | 234 | $schedule['second']; |
235 | - $date = strtotime( $this->notification_first_run_time ) + $schedule['offset']; |
|
235 | + $date = strtotime( $this->notification_first_run_time ) + $schedule['offset']; |
|
236 | 236 | |
237 | 237 | return $date; |
238 | 238 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $notification['start'] = $this->notification_active_from; |
267 | 267 | $notification['end'] = $this->notification_active_for; |
268 | 268 | |
269 | - $notification_data = apply_filters( $this->notification_id, $notification ); |
|
269 | + $notification_data = apply_filters( $this->notification_id, $notification ); |
|
270 | 270 | |
271 | 271 | if ( is_array( $notification_data ) && ! empty( $notification_data ) ) { |
272 | 272 | MonsterInsights()->notifications->add( $notification_data ); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * |
285 | 285 | * @since 7.12.3 |
286 | 286 | */ |
287 | - public function get_report( $report_name="overview", $report_start_from="-30 day", $report_end_to="-1 day" ) { |
|
287 | + public function get_report( $report_name = "overview", $report_start_from = "-30 day", $report_end_to = "-1 day" ) { |
|
288 | 288 | // get overview report data |
289 | 289 | $data = array(); |
290 | 290 | $report = MonsterInsights()->reporting->get_report( $report_name ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | - $site_license = array( |
|
67 | + $site_license = array( |
|
68 | 68 | 'key' => MonsterInsights()->license->get_site_license_key(), |
69 | 69 | 'type' => MonsterInsights()->license->get_site_license_type(), |
70 | 70 | 'is_disabled' => MonsterInsights()->license->site_license_disabled(), |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | // Array fields are needed even if empty. |
125 | 125 | $array_fields = array( 'view_reports', 'save_settings', 'ignore_users' ); |
126 | 126 | foreach ( $array_fields as $array_field ) { |
127 | - if ( ! isset( $options[ $array_field ] ) ) { |
|
128 | - $options[ $array_field ] = array(); |
|
127 | + if ( ! isset( $options[$array_field] ) ) { |
|
128 | + $options[$array_field] = array(); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | if ( isset( $options['custom_code'] ) ) { |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | if ( $empty ) { |
259 | - unset( $value[ $key ] ); |
|
259 | + unset( $value[$key] ); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } else { |
307 | 307 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
308 | 308 | } |
309 | - $parsed_addons[ $addon->slug ] = $addon; |
|
309 | + $parsed_addons[$addon->slug] = $addon; |
|
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | 'slug' => 'pretty-link', |
385 | 385 | ); |
386 | 386 | // SeedProd. |
387 | - $parsed_addons['coming-soon'] = array( |
|
387 | + $parsed_addons['coming-soon'] = array( |
|
388 | 388 | 'active' => function_exists( 'seed_csp4_activation' ), |
389 | 389 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/seedprod.png', |
390 | 390 | 'title' => 'SeedProd', |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | 'basename' => 'coming-soon/coming-soon.php', |
394 | 394 | 'slug' => 'coming-soon', |
395 | 395 | ); |
396 | - $parsed_addons['rafflepress'] = array( |
|
396 | + $parsed_addons['rafflepress'] = array( |
|
397 | 397 | 'active' => function_exists( 'rafflepress_lite_activation' ), |
398 | 398 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/rafflepress.png', |
399 | 399 | 'title' => 'RafflePress', |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $installed = false; |
435 | 435 | $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
436 | 436 | |
437 | - if ( isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
437 | + if ( isset( $installed_plugins[$plugin_basename] ) ) { |
|
438 | 438 | $installed = true; |
439 | 439 | |
440 | 440 | if ( is_multisite() && is_network_admin() ) { |
@@ -577,8 +577,8 @@ discard block |
||
577 | 577 | ); |
578 | 578 | |
579 | 579 | foreach ( $exclude as $e ) { |
580 | - if ( ! empty( $new_settings[ $e ] ) ) { |
|
581 | - unset( $new_settings[ $e ] ); |
|
580 | + if ( ! empty( $new_settings[$e] ) ) { |
|
581 | + unset( $new_settings[$e] ); |
|
582 | 582 | } |
583 | 583 | } |
584 | 584 | |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | } |
590 | 590 | |
591 | 591 | foreach ( $exclude as $e ) { |
592 | - if ( ! empty( $settings[ $e ] ) ) { |
|
593 | - $new_settings = $settings[ $e ]; |
|
592 | + if ( ! empty( $settings[$e] ) ) { |
|
593 | + $new_settings = $settings[$e]; |
|
594 | 594 | } |
595 | 595 | } |
596 | 596 | |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | ), |
751 | 751 | admin_url( 'admin.php' ) |
752 | 752 | ); |
753 | - $url = esc_url( $url ); |
|
753 | + $url = esc_url( $url ); |
|
754 | 754 | |
755 | 755 | ob_start(); |
756 | 756 | if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) { |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | $homepage = get_option( 'page_on_front' ); |
857 | 857 | if ( ! $homepage ) { |
858 | 858 | $array[] = array( |
859 | - 'id' => - 1, |
|
859 | + 'id' => -1, |
|
860 | 860 | 'title' => __( 'Homepage', 'google-analytics-for-wordpress' ), |
861 | 861 | ); |
862 | 862 | } |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | if ( ! post_type_supports( $post_type->name, 'editor' ) || 'product' === $post_type->name ) { |
931 | 931 | continue; |
932 | 932 | } |
933 | - $post_types_parsed[ $post_type->name ] = $post_type->labels->singular_name; |
|
933 | + $post_types_parsed[$post_type->name] = $post_type->labels->singular_name; |
|
934 | 934 | } |
935 | 935 | |
936 | 936 | $post_types_parsed = apply_filters( 'monsterinsights_vue_post_types_editor', $post_types_parsed ); |
@@ -1052,18 +1052,18 @@ discard block |
||
1052 | 1052 | $value = sanitize_text_field( wp_unslash( $_POST['value'] ) ); // Value of custom style like 12px or #fff. |
1053 | 1053 | $settings = get_option( $settings_key, array() ); |
1054 | 1054 | |
1055 | - if ( ! isset( $settings[ $type ] ) ) { |
|
1056 | - $settings[ $type ] = array(); |
|
1055 | + if ( ! isset( $settings[$type] ) ) { |
|
1056 | + $settings[$type] = array(); |
|
1057 | 1057 | } |
1058 | - if ( ! isset( $settings[ $type ][ $theme ] ) ) { |
|
1059 | - $settings[ $type ][ $theme ] = array(); |
|
1058 | + if ( ! isset( $settings[$type][$theme] ) ) { |
|
1059 | + $settings[$type][$theme] = array(); |
|
1060 | 1060 | } |
1061 | 1061 | |
1062 | - if ( ! isset( $settings[ $type ][ $theme ][ $object ] ) ) { |
|
1063 | - $settings[ $type ][ $theme ][ $object ] = array(); |
|
1062 | + if ( ! isset( $settings[$type][$theme][$object] ) ) { |
|
1063 | + $settings[$type][$theme][$object] = array(); |
|
1064 | 1064 | } |
1065 | 1065 | |
1066 | - $settings[ $type ][ $theme ][ $object ][ $key ] = $value; |
|
1066 | + $settings[$type][$theme][$object][$key] = $value; |
|
1067 | 1067 | |
1068 | 1068 | update_option( $settings_key, $settings ); |
1069 | 1069 |