@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | self::$instance->notices = new MonsterInsights_Notice_Admin(); |
234 | 234 | self::$instance->license_actions = new MonsterInsights_License_Actions(); |
235 | 235 | self::$instance->reporting = new MonsterInsights_Reporting(); |
236 | - self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
236 | + self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
237 | 237 | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
238 | 238 | self::$instance->require_updater(); |
239 | 239 | } else { |
240 | 240 | add_action( 'admin_init', array( self::$instance, 'require_updater' ) ); |
241 | 241 | } |
242 | 242 | |
243 | - self::$instance->routes = new MonsterInsights_Rest_Routes(); |
|
243 | + self::$instance->routes = new MonsterInsights_Rest_Routes(); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | if ( monsterinsights_is_pro_version() ) { |
@@ -351,11 +351,11 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) { |
354 | - define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
354 | + define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) { |
358 | - define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
358 | + define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | // Traditional WordPress plugin locale filter. |
378 | - $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
378 | + $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
379 | 379 | $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); |
380 | 380 | |
381 | 381 | // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | public function monsterinsights_wp_notice() { |
415 | 415 | $url = admin_url( 'plugins.php' ); |
416 | 416 | // Check for MS dashboard |
417 | - if( is_network_admin() ) { |
|
417 | + if ( is_network_admin() ) { |
|
418 | 418 | $url = network_admin_url( 'plugins.php' ); |
419 | 419 | } |
420 | 420 | ?> |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | public function monsterinsights_pro_notice() { |
436 | 436 | $url = admin_url( 'plugins.php' ); |
437 | 437 | // Check for MS dashboard |
438 | - if( is_network_admin() ) { |
|
438 | + if ( is_network_admin() ) { |
|
439 | 439 | $url = network_admin_url( 'plugins.php' ); |
440 | 440 | } |
441 | 441 | ?> |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php'; |
462 | 462 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php'; |
463 | 463 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php'; |
464 | - $monsterinsights_settings = monsterinsights_get_options(); |
|
464 | + $monsterinsights_settings = monsterinsights_get_options(); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | * |
476 | 476 | * @return void |
477 | 477 | */ |
478 | - public function load_licensing(){ |
|
478 | + public function load_licensing() { |
|
479 | 479 | if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
480 | 480 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/license.php'; |
481 | 481 | self::$instance->license = new MonsterInsights_License(); |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | $instance->api_auth->delete_auth(); |
643 | 643 | |
644 | 644 | // Delete data |
645 | - $instance->reporting->delete_aggregate_data('site'); |
|
645 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
646 | 646 | |
647 | 647 | // Delete license |
648 | 648 | $instance->license->delete_site_license(); |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $instance->api_auth->uninstall_network_auth(); |
654 | 654 | |
655 | 655 | // Delete network data |
656 | - $instance->reporting->delete_aggregate_data('network'); |
|
656 | + $instance->reporting->delete_aggregate_data( 'network' ); |
|
657 | 657 | |
658 | 658 | // Delete network license |
659 | 659 | $instance->license->delete_network_license(); |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | $instance->api_auth->delete_auth(); |
663 | 663 | |
664 | 664 | // Delete data |
665 | - $instance->reporting->delete_aggregate_data('site'); |
|
665 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
666 | 666 | |
667 | 667 | // Delete license |
668 | 668 | $instance->license->delete_site_license(); |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | * |
757 | 757 | * @return void |
758 | 758 | */ |
759 | -function monsterinsights_lite_call_install_and_upgrade(){ |
|
759 | +function monsterinsights_lite_call_install_and_upgrade() { |
|
760 | 760 | add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' ); |
761 | 761 | } |
762 | 762 |
@@ -37,7 +37,8 @@ |
||
37 | 37 | // Load the Welcome class. |
38 | 38 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/admin/welcome.php'; |
39 | 39 | |
40 | - if ( isset( $_GET['page'] ) && 'monsterinsights-onboarding' === $_GET['page'] ) { // WPCS: CSRF ok, input var ok. |
|
40 | + if ( isset( $_GET['page'] ) && 'monsterinsights-onboarding' === $_GET['page'] ) { |
|
41 | +// WPCS: CSRF ok, input var ok. |
|
41 | 42 | // Only load the Onboarding wizard if the required parameter is present. |
42 | 43 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/admin/onboarding-wizard.php'; |
43 | 44 | } |
@@ -270,7 +270,7 @@ |
||
270 | 270 | ), |
271 | 271 | admin_url( 'admin.php' ) |
272 | 272 | ); |
273 | - $url = esc_url( $url ); |
|
273 | + $url = esc_url( $url ); |
|
274 | 274 | |
275 | 275 | ob_start(); |
276 | 276 | if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) { |
@@ -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 |
@@ -28,7 +28,8 @@ |
||
28 | 28 | delete_transient( '_monsterinsights_activation_redirect' ); |
29 | 29 | |
30 | 30 | // Bail if activating from network, or bulk. |
31 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { // WPCS: CSRF ok, input var ok. |
|
31 | + if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
32 | +// WPCS: CSRF ok, input var ok. |
|
32 | 33 | return; |
33 | 34 | } |
34 | 35 |
@@ -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 ) { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | |
101 | 101 | $ga_cookie = $_COOKIE['_ga']; |
102 | - $cookie_parts = explode('.', $ga_cookie ); |
|
102 | + $cookie_parts = explode( '.', $ga_cookie ); |
|
103 | 103 | if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) { |
104 | 104 | $uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3]; |
105 | 105 | if ( is_string( $uuid ) ) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | $ga_cookie = $_COOKIE['_ga']; |
161 | - $cookie_parts = explode('.', $ga_cookie ); |
|
161 | + $cookie_parts = explode( '.', $ga_cookie ); |
|
162 | 162 | if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) { |
163 | 163 | $uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3]; |
164 | 164 | if ( is_string( $uuid ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | |
175 | 175 | function monsterinsights_generate_ga_client_id() { |
176 | - return rand(100000000,999999999) . '.' . time(); |
|
176 | + return rand( 100000000, 999999999 ) . '.' . time(); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $stop = time(); |
194 | 194 | } |
195 | 195 | |
196 | - $diff = (int) abs( $stop - $start ); |
|
196 | + $diff = (int) abs( $stop - $start ); |
|
197 | 197 | $hours = round( $diff / HOUR_IN_SECONDS ); |
198 | 198 | return $hours; |
199 | 199 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $editable_roles = apply_filters( 'editable_roles', $all_roles ); |
252 | 252 | |
253 | 253 | foreach ( $editable_roles as $id => $name ) { |
254 | - $roles[ $id ] = translate_user_role( $name['name'] ); |
|
254 | + $roles[$id] = translate_user_role( $name['name'] ); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | return $roles; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | foreach ( $editable_roles as $id => $role ) { |
279 | 279 | if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) { |
280 | - $roles[ $id ] = translate_user_role( $role['name'] ); |
|
280 | + $roles[$id] = translate_user_role( $role['name'] ); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | } |
325 | 325 | if ( substr_count( $host, '.' ) > 1 ) { |
326 | - $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
326 | + $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
327 | 327 | foreach ( $subdomains_to_check as $subdomain ) { |
328 | 328 | $subdomain = str_replace( '.', '(.)', $subdomain ); |
329 | 329 | $subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain ); |
@@ -339,16 +339,16 @@ discard block |
||
339 | 339 | |
340 | 340 | // Set cookie to expire in 2 years |
341 | 341 | function monsterinsights_get_cookie_expiration_date( $time ) { |
342 | - return date('D, j F Y H:i:s', time() + $time ); |
|
342 | + return date( 'D, j F Y H:i:s', time() + $time ); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | function monsterinsights_string_ends_with( $string, $ending ) { |
346 | - $strlen = strlen($string); |
|
347 | - $endinglen = strlen($ending); |
|
346 | + $strlen = strlen( $string ); |
|
347 | + $endinglen = strlen( $ending ); |
|
348 | 348 | if ( $endinglen > $strlen ) { |
349 | 349 | return false; |
350 | 350 | } |
351 | - return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0; |
|
351 | + return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | function monsterinsights_string_starts_with( $string, $start ) { |
@@ -872,11 +872,11 @@ discard block |
||
872 | 872 | return $countries; |
873 | 873 | } |
874 | 874 | |
875 | -function monsterinsights_get_api_url(){ |
|
875 | +function monsterinsights_get_api_url() { |
|
876 | 876 | return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' ); |
877 | 877 | } |
878 | 878 | |
879 | -function monsterinsights_get_licensing_url(){ |
|
879 | +function monsterinsights_get_licensing_url() { |
|
880 | 880 | return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' ); |
881 | 881 | } |
882 | 882 | |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | } |
921 | 921 | } |
922 | 922 | |
923 | -if ( ! function_exists ( 'remove_class_filter' ) ) { |
|
923 | +if ( ! function_exists( 'remove_class_filter' ) ) { |
|
924 | 924 | /** |
925 | 925 | * Remove Class Filter Without Access to Class Object |
926 | 926 | * |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) { |
942 | 942 | global $wp_filter; |
943 | 943 | // Check that filter actually exists first |
944 | - if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE; |
|
944 | + if ( ! isset( $wp_filter[$tag] ) ) return FALSE; |
|
945 | 945 | /** |
946 | 946 | * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer |
947 | 947 | * a simple array, rather it is an object that implements the ArrayAccess interface. |
@@ -950,33 +950,33 @@ discard block |
||
950 | 950 | * |
951 | 951 | * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/ |
952 | 952 | */ |
953 | - if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) { |
|
954 | - $callbacks = &$wp_filter[ $tag ]->callbacks; |
|
953 | + if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) { |
|
954 | + $callbacks = &$wp_filter[$tag]->callbacks; |
|
955 | 955 | } else { |
956 | - $callbacks = &$wp_filter[ $tag ]; |
|
956 | + $callbacks = &$wp_filter[$tag]; |
|
957 | 957 | } |
958 | 958 | // Exit if there aren't any callbacks for specified priority |
959 | - if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE; |
|
959 | + if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE; |
|
960 | 960 | // Loop through each filter for the specified priority, looking for our class & method |
961 | - foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) { |
|
961 | + foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) { |
|
962 | 962 | // Filter should always be an array - array( $this, 'method' ), if not goto next |
963 | - if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue; |
|
963 | + if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue; |
|
964 | 964 | // If first value in array is not an object, it can't be a class |
965 | - if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue; |
|
965 | + if ( ! is_object( $filter['function'][0] ) ) continue; |
|
966 | 966 | // Method doesn't match the one we're looking for, goto next |
967 | - if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue; |
|
967 | + if ( $filter['function'][1] !== $method_name ) continue; |
|
968 | 968 | // Method matched, now let's check the Class |
969 | - if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) { |
|
969 | + if ( get_class( $filter['function'][0] ) === $class_name ) { |
|
970 | 970 | // Now let's remove it from the array |
971 | - unset( $callbacks[ $priority ][ $filter_id ] ); |
|
971 | + unset( $callbacks[$priority][$filter_id] ); |
|
972 | 972 | // and if it was the only filter in that priority, unset that priority |
973 | - if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] ); |
|
973 | + if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] ); |
|
974 | 974 | // and if the only filter for that tag, set the tag to an empty array |
975 | 975 | if ( empty( $callbacks ) ) $callbacks = array(); |
976 | 976 | // If using WordPress older than 4.7 |
977 | - if ( ! is_object( $wp_filter[ $tag ] ) ) { |
|
977 | + if ( ! is_object( $wp_filter[$tag] ) ) { |
|
978 | 978 | // Remove this filter from merged_filters, which specifies if filters have been sorted |
979 | - unset( $GLOBALS[ 'merged_filters' ][ $tag ] ); |
|
979 | + unset( $GLOBALS['merged_filters'][$tag] ); |
|
980 | 980 | } |
981 | 981 | return TRUE; |
982 | 982 | } |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | } |
986 | 986 | } // End function exists |
987 | 987 | |
988 | -if ( ! function_exists ( 'remove_class_action' ) ) { |
|
988 | +if ( ! function_exists( 'remove_class_action' ) ) { |
|
989 | 989 | /** |
990 | 990 | * Remove Class Action Without Access to Class Object |
991 | 991 | * |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | foreach ( $translations->entries as $msgid => $entry ) { |
1058 | - $locale[ $msgid ] = $entry->translations; |
|
1058 | + $locale[$msgid] = $entry->translations; |
|
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | return $locale; |
@@ -155,25 +155,25 @@ discard block |
||
155 | 155 | $this->network = is_network_admin() || ! empty( $args['network'] ); |
156 | 156 | |
157 | 157 | $default_token = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token(); |
158 | - $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
158 | + $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
159 | 159 | |
160 | - $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
161 | - $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
162 | - $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
163 | - $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
164 | - $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
165 | - $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
160 | + $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
161 | + $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
162 | + $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
163 | + $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
164 | + $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
165 | + $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
166 | 166 | |
167 | 167 | // We need to do this hack so that the network panel + the site_url of the main site are distinct |
168 | 168 | $this->site_url = is_network_admin() ? network_admin_url() : site_url(); |
169 | 169 | |
170 | 170 | if ( monsterinsights_is_pro_version() ) { |
171 | - $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
171 | + $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
172 | 172 | } |
173 | 173 | $this->plugin = MonsterInsights()->plugin_slug; |
174 | 174 | $this->miversion = MONSTERINSIGHTS_VERSION; |
175 | - $this->sitei = ! empty( $args['sitei'] ) ? $args['sitei'] : ''; |
|
176 | - $this->testurl = ! empty( $args['testurl'] ) ? $args['testurl'] : ''; |
|
175 | + $this->sitei = ! empty( $args['sitei'] ) ? $args['sitei'] : ''; |
|
176 | + $this->testurl = ! empty( $args['testurl'] ) ? $args['testurl'] : ''; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | public function request() { |
187 | 187 | // Make sure we're not blocked |
188 | 188 | $blocked = $this->is_blocked( $this->url ); |
189 | - if ( $blocked || is_wp_error( $blocked ) ) { |
|
189 | + if ( $blocked || is_wp_error( $blocked ) ) { |
|
190 | 190 | if ( is_wp_error( $blocked ) ) { |
191 | 191 | return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) ); |
192 | 192 | } else { |
@@ -243,14 +243,14 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | if ( 'GET' == $this->method ) { |
246 | - $body['time'] = time(); // just to avoid caching |
|
246 | + $body['time'] = time(); // just to avoid caching |
|
247 | 247 | } |
248 | 248 | |
249 | - $body['timezone'] = date('e'); |
|
249 | + $body['timezone'] = date( 'e' ); |
|
250 | 250 | |
251 | 251 | $body['network'] = $this->network ? 'network' : 'site'; |
252 | 252 | |
253 | - $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
253 | + $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
254 | 254 | |
255 | 255 | // This filter will be removed in the future. |
256 | 256 | $body = apply_filters( 'monsterinsights_api_request_body', $body ); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | ); |
282 | 282 | |
283 | 283 | // Perform the query and retrieve the response. |
284 | - $response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data ); |
|
284 | + $response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data ); |
|
285 | 285 | |
286 | 286 | //return new WP_Error( 'debug', '<pre>' . var_export( $response, true ) . '</pre>' ); |
287 | 287 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | // If not a 200 status header, send back error. |
302 | 302 | if ( 200 != $response_code ) { |
303 | - $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
303 | + $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
304 | 304 | |
305 | 305 | if ( empty( $response_code ) ) { |
306 | 306 | return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) ); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | // and for image linking purposes in Google Images. We use it to test outbound connections since it is run on google.com |
388 | 388 | // and is only a few bytes large. Plus on Google's main CDN so it loads in most places in 0.07 seconds or less. Perfect for our |
389 | 389 | // use case of quickly testing outbound connections. |
390 | - $testurl = ! empty( $this->testurl ) ? $this->testurl :'http://www.google.com/blank.html'; |
|
390 | + $testurl = ! empty( $this->testurl ) ? $this->testurl : 'http://www.google.com/blank.html'; |
|
391 | 391 | if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) { |
392 | 392 | if ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) { |
393 | 393 | $wp_http = new WP_Http(); |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | 'body' => '' |
403 | 403 | ); |
404 | 404 | $response = wp_remote_get( $testurl, $params ); |
405 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
405 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
406 | 406 | return false; |
407 | 407 | } else { |
408 | 408 | if ( is_wp_error( $response ) ) { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | ); |
425 | 425 | $response = wp_remote_get( $testurl, $params ); |
426 | 426 | |
427 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
427 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
428 | 428 | return false; |
429 | 429 | } else { |
430 | 430 | if ( is_wp_error( $response ) ) { |
@@ -34,21 +34,21 @@ discard block |
||
34 | 34 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
35 | 35 | |
36 | 36 | if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
37 | - // If dashboards disabled, first settings page |
|
38 | - add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
39 | - $hook = 'monsterinsights_settings'; |
|
37 | + // If dashboards disabled, first settings page |
|
38 | + add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
39 | + $hook = 'monsterinsights_settings'; |
|
40 | 40 | |
41 | - add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
41 | + add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
42 | 42 | } else { |
43 | - // if dashboards enabled, first dashboard |
|
44 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
43 | + // if dashboards enabled, first dashboard |
|
44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
45 | 45 | |
46 | - $hook = 'monsterinsights_reports'; |
|
46 | + $hook = 'monsterinsights_reports'; |
|
47 | 47 | |
48 | - add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
48 | + add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
49 | 49 | |
50 | - // then settings page |
|
51 | - add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
50 | + // then settings page |
|
51 | + add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // then tools |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // then addons |
58 | 58 | $network_key = MonsterInsights()->license->get_network_license_key(); |
59 | 59 | if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) { |
60 | - add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' ); |
|
60 | + add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:#7cc048"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', 'monsterinsights_addons', 'monsterinsights_addons_page' ); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | add_action( 'admin_menu', 'monsterinsights_admin_menu' ); |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | // First, let's see if this is an MS network enabled plugin. If it is, we should load the license |
72 | 72 | // menu page and the updater on the network panel |
73 | 73 | if ( ! function_exists( 'is_plugin_active_for_network' ) ) { |
74 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
74 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE ); |
78 | 78 | if ( ! is_plugin_active_for_network( $plugin ) ) { |
79 | - return; |
|
79 | + return; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | function monsterinsights_add_admin_body_class( $classes ) { |
102 | 102 | $screen = get_current_screen(); |
103 | 103 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
104 | - return $classes; |
|
104 | + return $classes; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return "$classes monsterinsights_page "; |
@@ -121,17 +121,17 @@ discard block |
||
121 | 121 | |
122 | 122 | // If lite, show a link where they can get pro from |
123 | 123 | if ( ! monsterinsights_is_pro_version() ) { |
124 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
125 | - array_unshift( $links, $get_pro ); |
|
124 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
125 | + array_unshift( $links, $get_pro ); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | // If Lite, support goes to forum. If pro, it goes to our website |
129 | 129 | if ( monsterinsights_is_pro_version() ) { |
130 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
131 | - array_unshift( $links, $support ); |
|
130 | + $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
131 | + array_unshift( $links, $support ); |
|
132 | 132 | } else { |
133 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
134 | - array_unshift( $links, $support ); |
|
133 | + $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
134 | + array_unshift( $links, $support ); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>'; |
@@ -156,26 +156,26 @@ discard block |
||
156 | 156 | function monsterinsights_load_admin_partial( $template, $data = array() ) { |
157 | 157 | |
158 | 158 | if ( monsterinsights_is_pro_version() ) { |
159 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
159 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
160 | 160 | |
161 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
162 | - require_once( $dir . $template . '.php' ); |
|
163 | - return true; |
|
164 | - } |
|
161 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
162 | + require_once( $dir . $template . '.php' ); |
|
163 | + return true; |
|
164 | + } |
|
165 | 165 | } else { |
166 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
166 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
167 | 167 | |
168 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
169 | - require_once( $dir . $template . '.php' ); |
|
170 | - return true; |
|
171 | - } |
|
168 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
169 | + require_once( $dir . $template . '.php' ); |
|
170 | + return true; |
|
171 | + } |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
175 | 175 | |
176 | 176 | if ( file_exists( $dir . $template . '.php' ) ) { |
177 | - require_once( $dir . $template . '.php' ); |
|
178 | - return true; |
|
177 | + require_once( $dir . $template . '.php' ); |
|
178 | + return true; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return false; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | // Get the current screen, and check whether we're viewing a MonsterInsights screen; |
192 | 192 | $screen = get_current_screen(); |
193 | 193 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
194 | - return; |
|
194 | + return; |
|
195 | 195 | } |
196 | 196 | if ( in_array( $screen->id, array( |
197 | 197 | 'insights_page_monsterinsights_settings', |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | |
206 | 206 | // If here, we're on an MonsterInsights screen, so output the header. |
207 | 207 | monsterinsights_load_admin_partial( 'header', array( |
208 | - 'mascot' => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ), |
|
209 | - 'logo' => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ), |
|
210 | - '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
211 | - '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
208 | + 'mascot' => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ), |
|
209 | + 'logo' => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ), |
|
210 | + '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
211 | + '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
212 | 212 | ) ); |
213 | 213 | } |
214 | 214 | add_action( 'in_admin_header','monsterinsights_admin_header', 100 ); |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | function monsterinsights_admin_footer( $text ) { |
225 | 225 | global $current_screen; |
226 | 226 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
227 | - $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
228 | - $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
227 | + $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
228 | + $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
229 | 229 | } |
230 | 230 | return $text; |
231 | 231 | } |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | // Don't show on MonsterInsights pages |
237 | 237 | $screen = get_current_screen(); |
238 | 238 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) { |
239 | - return; |
|
239 | + return; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | // Make sure they have the permissions to do something |
243 | 243 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
244 | - return; |
|
244 | + return; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | // Priority: |
@@ -258,45 +258,45 @@ discard block |
||
258 | 258 | |
259 | 259 | // 1. Google Analytics not authenticated |
260 | 260 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
261 | - $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
262 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
263 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
264 | - return; |
|
261 | + $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
262 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
263 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
264 | + return; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | // 2. License key not entered for pro |
268 | 268 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
269 | 269 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
270 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
271 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
272 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
273 | - return; |
|
270 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
271 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
272 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
273 | + return; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | // 3. License key not valid/okay for pro |
277 | 277 | if ( monsterinsights_is_pro_version() ) { |
278 | - $message = ''; |
|
279 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
280 | - if ( MonsterInsights()->license->site_license_expired() ) { |
|
281 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
282 | - } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
283 | - $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
284 | - } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
285 | - $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
286 | - } |
|
287 | - } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
288 | - if ( MonsterInsights()->license->network_license_expired() ) { |
|
289 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
290 | - } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
291 | - $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
292 | - } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
293 | - $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
294 | - } |
|
295 | - } |
|
296 | - if ( ! empty( $message ) ) { |
|
297 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
298 | - return; |
|
299 | - } |
|
278 | + $message = ''; |
|
279 | + if ( MonsterInsights()->license->get_site_license_key() ){ |
|
280 | + if ( MonsterInsights()->license->site_license_expired() ) { |
|
281 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
282 | + } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
283 | + $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
284 | + } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
285 | + $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
286 | + } |
|
287 | + } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
288 | + if ( MonsterInsights()->license->network_license_expired() ) { |
|
289 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
290 | + } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
291 | + $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
292 | + } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
293 | + $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
294 | + } |
|
295 | + } |
|
296 | + if ( ! empty( $message ) ) { |
|
297 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
298 | + return; |
|
299 | + } |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | // 4. Notices for PHP/WP version deprecations |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | $notices = get_option( 'monsterinsights_notices' ); |
362 | 362 | if ( ! is_array( $notices ) ) { |
363 | - $notices = array(); |
|
363 | + $notices = array(); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | // 6. Authenticate, not manual |
@@ -368,12 +368,12 @@ discard block |
||
368 | 368 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
369 | 369 | |
370 | 370 | if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
371 | - echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
372 | - echo '<p>'; |
|
373 | - echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
374 | - echo '</p>'; |
|
375 | - echo '</div>'; |
|
376 | - return; |
|
371 | + echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
372 | + echo '<p>'; |
|
373 | + echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
374 | + echo '</p>'; |
|
375 | + echo '</div>'; |
|
376 | + return; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | // 7. Automatic updates not configured |
@@ -393,64 +393,64 @@ discard block |
||
393 | 393 | |
394 | 394 | // 8. WooUpsell |
395 | 395 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
396 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
397 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
398 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
399 | - echo '<p><strong>'; |
|
400 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
401 | - echo '</strong></p>'; |
|
402 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
403 | - echo '<p>'; |
|
404 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
405 | - echo '</p>'; |
|
406 | - echo '<p>'; |
|
407 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
408 | - echo '</p>'; |
|
409 | - echo '<p>'; |
|
410 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
411 | - echo '</p>'; |
|
412 | - echo '<p>'; |
|
413 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
414 | - echo '</p>'; |
|
415 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
416 | - echo '</p>'; |
|
417 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
418 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
419 | - echo '</div>'; |
|
420 | - echo '</div>'; |
|
421 | - return; |
|
422 | - } |
|
396 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
397 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
398 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
399 | + echo '<p><strong>'; |
|
400 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
401 | + echo '</strong></p>'; |
|
402 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
403 | + echo '<p>'; |
|
404 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
405 | + echo '</p>'; |
|
406 | + echo '<p>'; |
|
407 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
408 | + echo '</p>'; |
|
409 | + echo '<p>'; |
|
410 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
411 | + echo '</p>'; |
|
412 | + echo '<p>'; |
|
413 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
414 | + echo '</p>'; |
|
415 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
416 | + echo '</p>'; |
|
417 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
418 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
419 | + echo '</div>'; |
|
420 | + echo '</div>'; |
|
421 | + return; |
|
422 | + } |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | // 9. EDDUpsell |
426 | 426 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
427 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
428 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
429 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
430 | - echo '<p><strong>'; |
|
431 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
432 | - echo '</strong></p>'; |
|
433 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
434 | - echo '<p>'; |
|
435 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
436 | - echo '</p>'; |
|
437 | - echo '<p>'; |
|
438 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
439 | - echo '</p>'; |
|
440 | - echo '<p>'; |
|
441 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
442 | - echo '</p>'; |
|
443 | - echo '<p>'; |
|
444 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
445 | - echo '</p>'; |
|
446 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
447 | - echo '</p>'; |
|
448 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
449 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
450 | - echo '</div>'; |
|
451 | - echo '</div>'; |
|
452 | - return; |
|
453 | - } |
|
427 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
428 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
429 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
430 | + echo '<p><strong>'; |
|
431 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
432 | + echo '</strong></p>'; |
|
433 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
434 | + echo '<p>'; |
|
435 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
436 | + echo '</p>'; |
|
437 | + echo '<p>'; |
|
438 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
439 | + echo '</p>'; |
|
440 | + echo '<p>'; |
|
441 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
442 | + echo '</p>'; |
|
443 | + echo '<p>'; |
|
444 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
445 | + echo '</p>'; |
|
446 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
447 | + echo '</p>'; |
|
448 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
449 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
450 | + echo '</div>'; |
|
451 | + echo '</div>'; |
|
452 | + return; |
|
453 | + } |
|
454 | 454 | } |
455 | 455 | } |
456 | 456 | add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' ); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | // AM Notices |
461 | 461 | function monsterinsights_am_notice_optout( $super_admin ) { |
462 | 462 | if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) { |
463 | - return false; |
|
463 | + return false; |
|
464 | 464 | } |
465 | 465 | return $super_admin; |
466 | 466 | } |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | |
36 | 36 | if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
37 | 37 | // If dashboards disabled, first settings page |
38 | - add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
38 | + add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
39 | 39 | $hook = 'monsterinsights_settings'; |
40 | 40 | |
41 | 41 | add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
42 | 42 | } else { |
43 | 43 | // if dashboards enabled, first dashboard |
44 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
45 | 45 | |
46 | 46 | $hook = 'monsterinsights_reports'; |
47 | 47 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
83 | 83 | $hook = 'monsterinsights_network'; |
84 | - add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
84 | + add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
85 | 85 | |
86 | 86 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
87 | 87 | |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | * @return array $links |
117 | 117 | */ |
118 | 118 | function monsterinsights_add_action_links( $links ) { |
119 | - $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
119 | + $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
120 | 120 | array_unshift( $links, $docs ); |
121 | 121 | |
122 | 122 | // If lite, show a link where they can get pro from |
123 | 123 | if ( ! monsterinsights_is_pro_version() ) { |
124 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
124 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
125 | 125 | array_unshift( $links, $get_pro ); |
126 | 126 | } |
127 | 127 | |
128 | 128 | // If Lite, support goes to forum. If pro, it goes to our website |
129 | 129 | if ( monsterinsights_is_pro_version() ) { |
130 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
130 | + $support = '<a title="MonsterInsights Pro Support" href="' . monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
131 | 131 | array_unshift( $links, $support ); |
132 | 132 | } else { |
133 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
133 | + $support = '<a title="MonsterInsights Lite Support" href="' . monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
134 | 134 | array_unshift( $links, $support ); |
135 | 135 | } |
136 | 136 | |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
160 | 160 | |
161 | 161 | if ( file_exists( $dir . $template . '.php' ) ) { |
162 | - require_once( $dir . $template . '.php' ); |
|
162 | + require_once( $dir . $template . '.php' ); |
|
163 | 163 | return true; |
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
167 | 167 | |
168 | 168 | if ( file_exists( $dir . $template . '.php' ) ) { |
169 | - require_once( $dir . $template . '.php' ); |
|
169 | + require_once( $dir . $template . '.php' ); |
|
170 | 170 | return true; |
171 | 171 | } |
172 | 172 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
175 | 175 | |
176 | 176 | if ( file_exists( $dir . $template . '.php' ) ) { |
177 | - require_once( $dir . $template . '.php' ); |
|
177 | + require_once( $dir . $template . '.php' ); |
|
178 | 178 | return true; |
179 | 179 | } |
180 | 180 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
212 | 212 | ) ); |
213 | 213 | } |
214 | -add_action( 'in_admin_header','monsterinsights_admin_header', 100 ); |
|
214 | +add_action( 'in_admin_header', 'monsterinsights_admin_header', 100 ); |
|
215 | 215 | |
216 | 216 | /** |
217 | 217 | * When user is on a MonsterInsights related admin page, display footer text |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | global $current_screen; |
226 | 226 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
227 | 227 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
228 | - $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
228 | + $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
229 | 229 | } |
230 | 230 | return $text; |
231 | 231 | } |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | // 1. Google Analytics not authenticated |
260 | 260 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
261 | 261 | $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
262 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
263 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
262 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' ); |
|
263 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
264 | 264 | return; |
265 | 265 | } |
266 | 266 | |
@@ -268,17 +268,17 @@ discard block |
||
268 | 268 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
269 | 269 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
270 | 270 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
271 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
272 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
271 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
272 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
276 | 276 | // 3. License key not valid/okay for pro |
277 | 277 | if ( monsterinsights_is_pro_version() ) { |
278 | 278 | $message = ''; |
279 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
279 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
280 | 280 | if ( MonsterInsights()->license->site_license_expired() ) { |
281 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
281 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
282 | 282 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
283 | 283 | $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
284 | 284 | } else if ( MonsterInsights()->license->site_license_invalid() ) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } else if ( MonsterInsights()->license->get_network_license_key() ) { |
288 | 288 | if ( MonsterInsights()->license->network_license_expired() ) { |
289 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
289 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
290 | 290 | } else if ( MonsterInsights()->license->network_license_disabled() ) { |
291 | 291 | $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
292 | 292 | } else if ( MonsterInsights()->license->network_license_invalid() ) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | if ( ! empty( $message ) ) { |
297 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
297 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
298 | 298 | return; |
299 | 299 | } |
300 | 300 | } |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | if ( version_compare( phpversion(), '5.4', '<' ) ) { |
308 | 308 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
309 | 309 | $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
310 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
310 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
311 | 311 | return; |
312 | 312 | } |
313 | 313 | // WordPress 3.0 - 4.5 |
314 | 314 | else if ( version_compare( $wp_version, '4.6', '<' ) ) { |
315 | 315 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
316 | 316 | $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.6 in April, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
317 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
317 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
318 | 318 | return; |
319 | 319 | } |
320 | 320 | // PHP 5.4/5.5 |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | // } |
359 | 359 | // } |
360 | 360 | |
361 | - $notices = get_option( 'monsterinsights_notices' ); |
|
361 | + $notices = get_option( 'monsterinsights_notices' ); |
|
362 | 362 | if ( ! is_array( $notices ) ) { |
363 | 363 | $notices = array(); |
364 | 364 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed(); |
368 | 368 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
369 | 369 | |
370 | - if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
|
370 | + if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { |
|
371 | 371 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
372 | 372 | echo '<p>'; |
373 | - echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
373 | + echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
374 | 374 | echo '</p>'; |
375 | 375 | echo '</div>'; |
376 | 376 | return; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | // 8. WooUpsell |
395 | 395 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
396 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
396 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
397 | 397 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
398 | 398 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
399 | 399 | echo '<p><strong>'; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | echo '<p>'; |
413 | 413 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
414 | 414 | echo '</p>'; |
415 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
415 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) . '">', ' »</a>' ); |
|
416 | 416 | echo '</p>'; |
417 | 417 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
418 | 418 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | // 9. EDDUpsell |
426 | 426 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
427 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
427 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
428 | 428 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
429 | 429 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
430 | 430 | echo '<p><strong>'; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | echo '<p>'; |
444 | 444 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
445 | 445 | echo '</p>'; |
446 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
446 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) . '">', ' »</a>' ); |
|
447 | 447 | echo '</p>'; |
448 | 448 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
449 | 449 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -276,7 +276,7 @@ |
||
276 | 276 | // 3. License key not valid/okay for pro |
277 | 277 | if ( monsterinsights_is_pro_version() ) { |
278 | 278 | $message = ''; |
279 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
279 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
280 | 280 | if ( MonsterInsights()->license->site_license_expired() ) { |
281 | 281 | $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
282 | 282 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
@@ -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 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | - $site_license = array( |
|
39 | + $site_license = array( |
|
40 | 40 | 'key' => MonsterInsights()->license->get_site_license_key(), |
41 | 41 | 'type' => MonsterInsights()->license->get_site_license_type(), |
42 | 42 | 'is_disabled' => MonsterInsights()->license->site_license_disabled(), |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | // Array fields are needed even if empty. |
97 | 97 | $array_fields = array( 'view_reports', 'save_settings', 'ignore_users' ); |
98 | 98 | foreach ( $array_fields as $array_field ) { |
99 | - if ( ! isset( $options[ $array_field ] ) ) { |
|
100 | - $options[ $array_field ] = array(); |
|
99 | + if ( ! isset( $options[$array_field] ) ) { |
|
100 | + $options[$array_field] = array(); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | if ( isset( $options['custom_code'] ) ) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | if ( $empty ) { |
174 | - unset( $value[ $key ] ); |
|
174 | + unset( $value[$key] ); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | foreach ( $addons_data as $addons_type => $addons ) { |
205 | 205 | foreach ( $addons as $addon ) { |
206 | - $slug = 'monsterinsights-' . $addon->slug; |
|
206 | + $slug = 'monsterinsights-' . $addon->slug; |
|
207 | 207 | if ( 'monsterinsights-ecommerce' === $slug ) { |
208 | 208 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
209 | 209 | if ( empty( $addon->installed ) ) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } else { |
214 | 214 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
215 | 215 | } |
216 | - $parsed_addons[ $addon->slug ] = $addon; |
|
216 | + $parsed_addons[$addon->slug] = $addon; |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $installed = false; |
268 | 268 | $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
269 | 269 | |
270 | - if ( isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
270 | + if ( isset( $installed_plugins[$plugin_basename] ) ) { |
|
271 | 271 | $installed = true; |
272 | 272 | $ms_active = is_plugin_active_for_network( $plugin_basename ); |
273 | 273 | $ss_active = is_plugin_active( $plugin_basename ); |