@@ -19,32 +19,32 @@ discard block |
||
19 | 19 | global $admin_page_hooks; |
20 | 20 | |
21 | 21 | if ( ! is_object( $current_screen ) || empty( $current_screen->id ) || empty( $admin_page_hooks ) ) { |
22 | - return false; |
|
22 | + return false; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $settings_page = false; |
26 | 26 | if ( ! empty( $admin_page_hooks['monsterinsights_settings'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_settings'] ) { |
27 | - $settings_page = true; |
|
27 | + $settings_page = true; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | if ( ! empty( $admin_page_hooks['monsterinsights_reports'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_reports'] ) { |
31 | - $settings_page = true; |
|
31 | + $settings_page = true; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if ( $current_screen->id === 'toplevel_page_monsterinsights_settings' ) { |
35 | - $settings_page = true; |
|
35 | + $settings_page = true; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if ( $current_screen->id === 'insights_page_monsterinsights_settings' ) { |
39 | - $settings_page = true; |
|
39 | + $settings_page = true; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if ( $current_screen->id === 'insights_page_monsterinsights_tracking' ) { |
43 | - $settings_page = true; |
|
43 | + $settings_page = true; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if ( ! empty( $current_screen->base ) && strpos( $current_screen->base, 'monsterinsights_network' ) !== false ) { |
47 | - $settings_page = true; |
|
47 | + $settings_page = true; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return $settings_page; |
@@ -106,31 +106,31 @@ discard block |
||
106 | 106 | function monsterinsights_save_general_settings_page() { |
107 | 107 | |
108 | 108 | if ( ! monsterinsights_is_settings_page() ) { |
109 | - return; |
|
109 | + return; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Check if user pressed the 'Update' button and nonce is valid |
113 | 113 | if ( ! isset( $_POST['monsterinsights-settings-submit'] ) ) { |
114 | - return; |
|
114 | + return; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | if ( ! wp_verify_nonce( $_POST['monsterinsights-settings-nonce'], 'monsterinsights-settings-nonce' ) ) { |
118 | - return; |
|
118 | + return; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
122 | - return; |
|
122 | + return; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if ( ! empty( $_POST['monsterinsights_settings_tab'] ) && $_POST['monsterinsights_settings_tab'] === 'general' ) { |
126 | - /** |
|
127 | - * Developer Alert: |
|
128 | - * |
|
129 | - * Per the README, this is considered an internal hook and should |
|
130 | - * not be used by other developers. This hook's behavior may be modified |
|
131 | - * or the hook may be removed at any time, without warning. |
|
132 | - */ |
|
133 | - do_action( 'monsterinsights_settings_save_general' ); |
|
126 | + /** |
|
127 | + * Developer Alert: |
|
128 | + * |
|
129 | + * Per the README, this is considered an internal hook and should |
|
130 | + * not be used by other developers. This hook's behavior may be modified |
|
131 | + * or the hook may be removed at any time, without warning. |
|
132 | + */ |
|
133 | + do_action( 'monsterinsights_settings_save_general' ); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | add_action( 'current_screen', 'monsterinsights_save_general_settings_page' ); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <?php echo esc_html__( 'General', 'google-analytics-for-wordpress' ); ?> |
80 | 80 | </a> |
81 | 81 | |
82 | - <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url('admin.php?page=monsterinsights_tracking#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-engagement');?>" title="<?php echo esc_attr( __( 'Tracking', 'google-analytics-for-wordpress' ) ); ?>"> |
|
82 | + <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url( 'admin.php?page=monsterinsights_tracking#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-engagement' ); ?>" title="<?php echo esc_attr( __( 'Tracking', 'google-analytics-for-wordpress' ) ); ?>"> |
|
83 | 83 | <?php echo esc_html__( 'Tracking', 'google-analytics-for-wordpress' ); ?> |
84 | 84 | </a> |
85 | 85 | </h1> |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | ob_start(); |
179 | 179 | ?> |
180 | 180 | <tr id="monsterinsights-input-<?php echo esc_attr( $option_class ); ?>"> |
181 | - <?php if ( !empty ( $title ) ) { ?> |
|
181 | + <?php if ( ! empty ( $title ) ) { ?> |
|
182 | 182 | <th scope="row"> |
183 | 183 | <label for="monsterinsights-<?php echo esc_attr( $option_class ); ?>"><?php echo $title; ?></label> |
184 | 184 | </th> |
@@ -38,7 +38,7 @@ |
||
38 | 38 | <h1 id="monsterinsights-settings-page-main-nav" class="monsterinsights-main-nav-container monsterinsights-nav-container" data-container="#monsterinsights-settings-pages"> |
39 | 39 | <a class="monsterinsights-main-nav-item monsterinsights-nav-item monsterinsights-spacing-item" href="#"> </a> |
40 | 40 | |
41 | - <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url('admin.php?page=monsterinsights_settings');?>" title="<?php echo esc_attr( __( 'General', 'google-analytics-for-wordpress' ) ); ?>"> |
|
41 | + <a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="<?php echo admin_url( 'admin.php?page=monsterinsights_settings' ); ?>" title="<?php echo esc_attr( __( 'General', 'google-analytics-for-wordpress' ) ); ?>"> |
|
42 | 42 | <?php echo esc_html__( 'General', 'google-analytics-for-wordpress' ); ?> |
43 | 43 | </a> |
44 | 44 |
@@ -35,54 +35,54 @@ |
||
35 | 35 | function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) { |
36 | 36 | |
37 | 37 | switch( $cap ) { |
38 | - case 'monsterinsights_view_dashboard' : |
|
39 | - $roles = monsterinsights_get_option( 'view_reports', array() ); |
|
38 | + case 'monsterinsights_view_dashboard' : |
|
39 | + $roles = monsterinsights_get_option( 'view_reports', array() ); |
|
40 | 40 | |
41 | - $user_can_via_settings = false; |
|
42 | - if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
43 | - foreach ( $roles as $role ) { |
|
44 | - if ( is_string( $role ) ) { |
|
45 | - if ( user_can( $user_id, $role ) ) { |
|
46 | - $user_can_via_settings = true; |
|
47 | - break; |
|
48 | - } |
|
49 | - } |
|
50 | - } |
|
51 | - } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
52 | - if ( user_can( $user_id, $roles ) ) { |
|
53 | - $user_can_via_settings = true; |
|
54 | - } |
|
55 | - } |
|
41 | + $user_can_via_settings = false; |
|
42 | + if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
43 | + foreach ( $roles as $role ) { |
|
44 | + if ( is_string( $role ) ) { |
|
45 | + if ( user_can( $user_id, $role ) ) { |
|
46 | + $user_can_via_settings = true; |
|
47 | + break; |
|
48 | + } |
|
49 | + } |
|
50 | + } |
|
51 | + } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
52 | + if ( user_can( $user_id, $roles ) ) { |
|
53 | + $user_can_via_settings = true; |
|
54 | + } |
|
55 | + } |
|
56 | 56 | |
57 | - if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
58 | - $caps = array(); |
|
59 | - } |
|
57 | + if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
58 | + $caps = array(); |
|
59 | + } |
|
60 | 60 | |
61 | - break; |
|
62 | - case 'monsterinsights_save_settings' : |
|
63 | - $roles = monsterinsights_get_option( 'save_settings', array() ); |
|
61 | + break; |
|
62 | + case 'monsterinsights_save_settings' : |
|
63 | + $roles = monsterinsights_get_option( 'save_settings', array() ); |
|
64 | 64 | |
65 | - $user_can_via_settings = false; |
|
66 | - if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
67 | - foreach ( $roles as $role ) { |
|
68 | - if ( is_string( $role ) ) { |
|
69 | - if ( user_can( $user_id, $role ) ) { |
|
70 | - $user_can_via_settings = true; |
|
71 | - break; |
|
72 | - } |
|
73 | - } |
|
74 | - } |
|
75 | - } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
76 | - if ( user_can( $user_id, $roles ) ) { |
|
77 | - $user_can_via_settings = true; |
|
78 | - } |
|
79 | - } |
|
65 | + $user_can_via_settings = false; |
|
66 | + if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
67 | + foreach ( $roles as $role ) { |
|
68 | + if ( is_string( $role ) ) { |
|
69 | + if ( user_can( $user_id, $role ) ) { |
|
70 | + $user_can_via_settings = true; |
|
71 | + break; |
|
72 | + } |
|
73 | + } |
|
74 | + } |
|
75 | + } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
76 | + if ( user_can( $user_id, $roles ) ) { |
|
77 | + $user_can_via_settings = true; |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
82 | - $caps = array(); |
|
83 | - } |
|
81 | + if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
82 | + $caps = array(); |
|
83 | + } |
|
84 | 84 | |
85 | - break; |
|
85 | + break; |
|
86 | 86 | } |
87 | 87 | return $caps; |
88 | 88 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) { |
36 | 36 | |
37 | - switch( $cap ) { |
|
37 | + switch ( $cap ) { |
|
38 | 38 | case 'monsterinsights_view_dashboard' : |
39 | 39 | $roles = monsterinsights_get_option( 'view_reports', array() ); |
40 | 40 | |
@@ -86,4 +86,4 @@ discard block |
||
86 | 86 | } |
87 | 87 | return $caps; |
88 | 88 | } |
89 | -add_filter( 'map_meta_cap','monsterinsights_add_capabilities', 10, 4 ); |
|
90 | 89 | \ No newline at end of file |
90 | +add_filter( 'map_meta_cap', 'monsterinsights_add_capabilities', 10, 4 ); |
|
91 | 91 | \ No newline at end of file |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | add_action( 'admin_init', array( $this, 'reauthenticate_listener' ) ); |
38 | 38 | } |
39 | 39 | |
40 | - public function get_tt(){ |
|
40 | + public function get_tt() { |
|
41 | 41 | $tt = is_network_admin() ? get_site_option( 'monsterinsights_network_tt', '' ) : get_option( 'monsterinsights_site_tt', '' ); |
42 | 42 | if ( empty( $tt ) ) { |
43 | 43 | // if TT is empty, generate a new one, save it and then return it |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | return $tt; |
48 | 48 | } |
49 | 49 | |
50 | - public function rotate_tt(){ |
|
50 | + public function rotate_tt() { |
|
51 | 51 | $tt = $this->generate_tt(); |
52 | 52 | is_network_admin() ? update_site_option( 'monsterinsights_network_tt', $tt ) : update_option( 'monsterinsights_site_tt', $tt ); |
53 | 53 | } |
54 | 54 | |
55 | - public function generate_tt(){ |
|
55 | + public function generate_tt() { |
|
56 | 56 | return hash( 'sha512', wp_generate_password( 128, true, true ) . AUTH_SALT . uniqid( "", true ) ); |
57 | 57 | } |
58 | 58 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | return hash_equals( $tt, $passed_tt ); |
62 | 62 | } |
63 | 63 | |
64 | - public function maybe_authenticate(){ |
|
64 | + public function maybe_authenticate() { |
|
65 | 65 | |
66 | 66 | // Check nonce |
67 | 67 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | - public function authenticate_listener(){ |
|
109 | + public function authenticate_listener() { |
|
110 | 110 | // Make sure it's for us |
111 | 111 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'auth' ) { |
112 | 112 | return; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | exit; |
176 | 176 | } |
177 | 177 | |
178 | - public function maybe_reauthenticate(){ |
|
178 | + public function maybe_reauthenticate() { |
|
179 | 179 | |
180 | 180 | // Check nonce |
181 | 181 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | wp_send_json_success( array( 'redirect' => $siteurl ) ); |
223 | 223 | } |
224 | 224 | |
225 | - public function reauthenticate_listener(){ |
|
225 | + public function reauthenticate_listener() { |
|
226 | 226 | // Make sure it's for us |
227 | 227 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'reauth' ) { |
228 | 228 | return; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | exit; |
291 | 291 | } |
292 | 292 | |
293 | - public function maybe_verify(){ |
|
293 | + public function maybe_verify() { |
|
294 | 294 | |
295 | 295 | // Check nonce |
296 | 296 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | } |
326 | 326 | |
327 | - public function verify_auth( $credentials = array() ){ |
|
327 | + public function verify_auth( $credentials = array() ) { |
|
328 | 328 | $creds = ! empty( $credentials ) ? $credentials : ( $this->is_network_admin() ? MonsterInsights()->auth->get_network_analytics_profile( true ) : MonsterInsights()->auth->get_analytics_profile( true ) ); |
329 | 329 | |
330 | 330 | if ( empty( $creds['key'] ) ) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
344 | - public function maybe_delete(){ |
|
344 | + public function maybe_delete() { |
|
345 | 345 | |
346 | 346 | // Check nonce |
347 | 347 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
384 | - public function delete_auth( $force = false ){ |
|
384 | + public function delete_auth( $force = false ) { |
|
385 | 385 | if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
386 | 386 | return false; |
387 | 387 | } else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | public function __construct() { |
29 | 29 | |
30 | 30 | // Authentication Actions |
31 | - add_action( 'wp_ajax_monsterinsights_maybe_authenticate', array( $this, 'maybe_authenticate' ) ); |
|
32 | - add_action( 'wp_ajax_monsterinsights_maybe_reauthenticate', array( $this, 'maybe_reauthenticate' ) ); |
|
33 | - add_action( 'wp_ajax_monsterinsights_maybe_verify', array( $this, 'maybe_verify' ) ); |
|
34 | - add_action( 'wp_ajax_monsterinsights_maybe_delete', array( $this, 'maybe_delete' ) ); |
|
31 | + add_action( 'wp_ajax_monsterinsights_maybe_authenticate', array( $this, 'maybe_authenticate' ) ); |
|
32 | + add_action( 'wp_ajax_monsterinsights_maybe_reauthenticate', array( $this, 'maybe_reauthenticate' ) ); |
|
33 | + add_action( 'wp_ajax_monsterinsights_maybe_verify', array( $this, 'maybe_verify' ) ); |
|
34 | + add_action( 'wp_ajax_monsterinsights_maybe_delete', array( $this, 'maybe_delete' ) ); |
|
35 | 35 | |
36 | - add_action( 'admin_init', array( $this, 'authenticate_listener' ) ); |
|
37 | - add_action( 'admin_init', array( $this, 'reauthenticate_listener' ) ); |
|
36 | + add_action( 'admin_init', array( $this, 'authenticate_listener' ) ); |
|
37 | + add_action( 'admin_init', array( $this, 'reauthenticate_listener' ) ); |
|
38 | 38 | } |
39 | 39 | |
40 | - public function get_tt(){ |
|
40 | + public function get_tt() { |
|
41 | 41 | $tt = is_network_admin() ? get_site_option( 'monsterinsights_network_tt', '' ) : get_option( 'monsterinsights_site_tt', '' ); |
42 | 42 | if ( empty( $tt ) ) { |
43 | 43 | // if TT is empty, generate a new one, save it and then return it |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | return $tt; |
48 | 48 | } |
49 | 49 | |
50 | - public function rotate_tt(){ |
|
50 | + public function rotate_tt() { |
|
51 | 51 | $tt = $this->generate_tt(); |
52 | 52 | is_network_admin() ? update_site_option( 'monsterinsights_network_tt', $tt ) : update_option( 'monsterinsights_site_tt', $tt ); |
53 | 53 | } |
54 | 54 | |
55 | - public function generate_tt(){ |
|
55 | + public function generate_tt() { |
|
56 | 56 | return hash( 'sha512', wp_generate_password( 128, true, true ) . AUTH_SALT . uniqid( "", true ) ); |
57 | 57 | } |
58 | 58 | |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | return hash_equals( $tt, $passed_tt ); |
62 | 62 | } |
63 | 63 | |
64 | - public function maybe_authenticate(){ |
|
64 | + public function maybe_authenticate() { |
|
65 | 65 | |
66 | 66 | // Check nonce |
67 | 67 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
68 | 68 | |
69 | 69 | // current user can authenticate |
70 | 70 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
71 | - wp_send_json_error( array( 'message' => __( "You don't have permission to authenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
71 | + wp_send_json_error( array( 'message' => __( "You don't have permission to authenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | if ( ! empty( $_REQUEST['isnetwork'] ) && $_REQUEST['isnetwork'] ) { |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | // Only for Pro users, require a license key to be entered first so we can link to things. |
79 | 79 | $valid = is_network_admin() ? MonsterInsights()->license->is_network_licensed() : MonsterInsights()->license->is_site_licensed(); |
80 | 80 | if ( monsterinsights_is_pro_version() && ! $valid ) { |
81 | - wp_send_json_error( array( 'message' => __( "Cannot authenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
81 | + wp_send_json_error( array( 'message' => __( "Cannot authenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // we do not have a current auth |
85 | 85 | if ( ! $this->is_network_admin() && MonsterInsights()->auth->is_authed() ) { |
86 | - wp_send_json_error( array( 'message' => __( "Cannot authenticate. Please re-authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
86 | + wp_send_json_error( array( 'message' => __( "Cannot authenticate. Please re-authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
87 | 87 | } else if ( $this->is_network_admin() && MonsterInsights()->auth->is_network_authed() ) { |
88 | - wp_send_json_error( array( 'message' => __( "Cannot network authenticate. Please re-authenticate on the network settings panel.", 'google-analytics-for-wordpress' ) ) ); |
|
88 | + wp_send_json_error( array( 'message' => __( "Cannot network authenticate. Please re-authenticate on the network settings panel.", 'google-analytics-for-wordpress' ) ) ); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $siteurl = add_query_arg( array( |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | - public function authenticate_listener(){ |
|
109 | + public function authenticate_listener() { |
|
110 | 110 | // Make sure it's for us |
111 | 111 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'auth' ) { |
112 | 112 | return; |
@@ -124,12 +124,12 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | // Make sure has required params |
127 | - if ( empty( $_REQUEST['key'] ) || |
|
128 | - empty( $_REQUEST['token'] ) || |
|
129 | - empty( $_REQUEST['ua'] ) || |
|
127 | + if ( empty( $_REQUEST['key'] ) || |
|
128 | + empty( $_REQUEST['token'] ) || |
|
129 | + empty( $_REQUEST['ua'] ) || |
|
130 | 130 | empty( $_REQUEST['viewname'] ) || |
131 | - empty( $_REQUEST['a'] ) || |
|
132 | - empty( $_REQUEST['w'] ) || |
|
131 | + empty( $_REQUEST['a'] ) || |
|
132 | + empty( $_REQUEST['w'] ) || |
|
133 | 133 | empty( $_REQUEST['p'] ) |
134 | 134 | ) { |
135 | 135 | return; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $where = $this->is_network_admin() ? 'network' : 'site'; |
167 | 167 | MonsterInsights()->reporting->delete_aggregate_data( $where ); |
168 | 168 | |
169 | - $url = $this->is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ) ; |
|
169 | + $url = $this->is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
170 | 170 | $url = add_query_arg( array( |
171 | 171 | 'mi_action' => 'auth', |
172 | 172 | 'success' => 'true', |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | exit; |
176 | 176 | } |
177 | 177 | |
178 | - public function maybe_reauthenticate(){ |
|
178 | + public function maybe_reauthenticate() { |
|
179 | 179 | |
180 | 180 | // Check nonce |
181 | 181 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
182 | 182 | |
183 | 183 | // current user can authenticate |
184 | 184 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
185 | - wp_send_json_error( array( 'message' => __( "You don't have permission to re-authenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
185 | + wp_send_json_error( array( 'message' => __( "You don't have permission to re-authenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if ( ! empty( $_REQUEST['isnetwork'] ) && $_REQUEST['isnetwork'] ) { |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | // Only for Pro users, require a license key to be entered first so we can link to things. |
193 | 193 | $valid = is_network_admin() ? MonsterInsights()->license->is_network_licensed() : MonsterInsights()->license->is_site_licensed(); |
194 | 194 | if ( monsterinsights_is_pro_version() && ! $valid ) { |
195 | - wp_send_json_error( array( 'message' => __( "Cannot re-authenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
195 | + wp_send_json_error( array( 'message' => __( "Cannot re-authenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | // we do have a current auth |
199 | 199 | if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
200 | - wp_send_json_error( array( 'message' => __( "Cannot re-authenticate. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
200 | + wp_send_json_error( array( 'message' => __( "Cannot re-authenticate. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
201 | 201 | } else if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
202 | - wp_send_json_error( array( 'message' => __( "Cannot re-authenticate the network. Please authenticate on the network settings panel.", 'google-analytics-for-wordpress' ) ) ); |
|
202 | + wp_send_json_error( array( 'message' => __( "Cannot re-authenticate the network. Please authenticate on the network settings panel.", 'google-analytics-for-wordpress' ) ) ); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $siteurl = add_query_arg( array( |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | wp_send_json_success( array( 'redirect' => $siteurl ) ); |
223 | 223 | } |
224 | 224 | |
225 | - public function reauthenticate_listener(){ |
|
225 | + public function reauthenticate_listener() { |
|
226 | 226 | // Make sure it's for us |
227 | 227 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'reauth' ) { |
228 | 228 | return; |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | |
241 | 241 | // Make sure has required params |
242 | 242 | if ( |
243 | - empty( $_REQUEST['ua'] ) || |
|
243 | + empty( $_REQUEST['ua'] ) || |
|
244 | 244 | empty( $_REQUEST['viewname'] ) || |
245 | - empty( $_REQUEST['a'] ) || |
|
246 | - empty( $_REQUEST['w'] ) || |
|
245 | + empty( $_REQUEST['a'] ) || |
|
246 | + empty( $_REQUEST['w'] ) || |
|
247 | 247 | empty( $_REQUEST['p'] ) |
248 | 248 | ) { |
249 | 249 | return; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $where = $this->is_network_admin() ? 'network' : 'site'; |
282 | 282 | MonsterInsights()->reporting->delete_aggregate_data( $where ); |
283 | 283 | |
284 | - $url = $this->is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ) ; |
|
284 | + $url = $this->is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
285 | 285 | $url = add_query_arg( array( |
286 | 286 | 'mi_action' => 'reauth', |
287 | 287 | 'success' => 'true', |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | exit; |
291 | 291 | } |
292 | 292 | |
293 | - public function maybe_verify(){ |
|
293 | + public function maybe_verify() { |
|
294 | 294 | |
295 | 295 | // Check nonce |
296 | 296 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
297 | 297 | |
298 | 298 | // current user can verify |
299 | 299 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
300 | - wp_send_json_error( array( 'message' => __( "You don't have permission to verify MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
300 | + wp_send_json_error( array( 'message' => __( "You don't have permission to verify MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | if ( ! empty( $_REQUEST['isnetwork'] ) && $_REQUEST['isnetwork'] ) { |
@@ -306,25 +306,25 @@ discard block |
||
306 | 306 | |
307 | 307 | // we have an auth to verify |
308 | 308 | if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
309 | - wp_send_json_error( array( 'message' => __( "Cannot verify. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
309 | + wp_send_json_error( array( 'message' => __( "Cannot verify. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
310 | 310 | } else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
311 | - wp_send_json_error( array( 'message' => __( "Cannot verify. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
311 | + wp_send_json_error( array( 'message' => __( "Cannot verify. Please authenticate.", 'google-analytics-for-wordpress' ) ) ); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | $valid = is_network_admin() ? MonsterInsights()->license->is_network_licensed() : MonsterInsights()->license->is_site_licensed(); |
315 | 315 | if ( monsterinsights_is_pro_version() && ! $valid ) { |
316 | - wp_send_json_error( array( 'message' => __( "Cannot verify. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
316 | + wp_send_json_error( array( 'message' => __( "Cannot verify. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | $worked = $this->verify_auth(); |
320 | - if ( $worked && ! is_wp_error( $worked ) ) { |
|
320 | + if ( $worked && ! is_wp_error( $worked ) ) { |
|
321 | 321 | wp_send_json_success( array( 'message' => __( "Successfully verified.", 'google-analytics-for-wordpress' ) ) ); |
322 | 322 | } else { |
323 | 323 | wp_send_json_error( array( 'message' => __( "Could not verify.", 'google-analytics-for-wordpress' ) ) ); |
324 | 324 | } |
325 | 325 | } |
326 | 326 | |
327 | - public function verify_auth( $credentials = array() ){ |
|
327 | + public function verify_auth( $credentials = array() ) { |
|
328 | 328 | $creds = ! empty( $credentials ) ? $credentials : ( $this->is_network_admin() ? MonsterInsights()->auth->get_network_analytics_profile( true ) : MonsterInsights()->auth->get_analytics_profile( true ) ); |
329 | 329 | |
330 | 330 | if ( empty( $creds['key'] ) ) { |
@@ -341,14 +341,14 @@ discard block |
||
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
344 | - public function maybe_delete(){ |
|
344 | + public function maybe_delete() { |
|
345 | 345 | |
346 | 346 | // Check nonce |
347 | 347 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
348 | 348 | |
349 | 349 | // current user can delete |
350 | 350 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
351 | - wp_send_json_error( array( 'message' => __( "You don't have permission to deauthenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
351 | + wp_send_json_error( array( 'message' => __( "You don't have permission to deauthenticate MonsterInsights.", 'google-analytics-for-wordpress' ) ) ); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | if ( ! empty( $_REQUEST['isnetwork'] ) && $_REQUEST['isnetwork'] ) { |
@@ -357,20 +357,20 @@ discard block |
||
357 | 357 | |
358 | 358 | // we have an auth to delete |
359 | 359 | if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
360 | - wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. You are not currently authed.", 'google-analytics-for-wordpress' ) ) ); |
|
360 | + wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. You are not currently authed.", 'google-analytics-for-wordpress' ) ) ); |
|
361 | 361 | } else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
362 | - wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. You are not currently authed.", 'google-analytics-for-wordpress' ) ) ); |
|
362 | + wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. You are not currently authed.", 'google-analytics-for-wordpress' ) ) ); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | $valid = is_network_admin() ? MonsterInsights()->license->is_network_licensed() : MonsterInsights()->license->is_site_licensed(); |
366 | 366 | if ( monsterinsights_is_pro_version() && ! $valid ) { |
367 | - wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
367 | + wp_send_json_error( array( 'message' => __( "Cannot deauthenticate. Please enter a valid, active license key for MonsterInsights Pro into the settings.", 'google-analytics-for-wordpress' ) ) ); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | $force = ! empty( $_REQUEST['forcedelete'] ) && $_REQUEST['forcedelete'] === 'true'; |
371 | 371 | |
372 | 372 | $worked = $this->delete_auth( $force ); |
373 | - if ( $worked && ! is_wp_error( $worked ) ) { |
|
373 | + if ( $worked && ! is_wp_error( $worked ) ) { |
|
374 | 374 | wp_send_json_success( array( 'message' => __( "Successfully deauthenticated.", 'google-analytics-for-wordpress' ) ) ); |
375 | 375 | } else { |
376 | 376 | if ( $force ) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
384 | - public function delete_auth( $force = false ){ |
|
384 | + public function delete_auth( $force = false ) { |
|
385 | 385 | if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
386 | 386 | return false; |
387 | 387 | } else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
@@ -425,6 +425,6 @@ discard block |
||
425 | 425 | } |
426 | 426 | |
427 | 427 | public function get_sitei() { |
428 | - return mb_strimwidth( rtrim( ltrim( sanitize_text_field( preg_replace('/[^a-zA-Z0-9]/', '', AUTH_KEY . SECURE_AUTH_KEY . LOGGED_IN_KEY ) ) ) ), 0, 30 ); |
|
428 | + return mb_strimwidth( rtrim( ltrim( sanitize_text_field( preg_replace( '/[^a-zA-Z0-9]/', '', AUTH_KEY . SECURE_AUTH_KEY . LOGGED_IN_KEY ) ) ) ), 0, 30 ); |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | } |
26 | 26 | |
27 | - public function add_report( $report = false ){ |
|
27 | + public function add_report( $report = false ) { |
|
28 | 28 | if ( empty( $report ) || ! is_object( $report ) ) { |
29 | 29 | return; |
30 | 30 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | } |
26 | 26 | |
27 | - public function add_report( $report = false ){ |
|
27 | + public function add_report( $report = false ) { |
|
28 | 28 | if ( empty( $report ) || ! is_object( $report ) ) { |
29 | 29 | return; |
30 | 30 | } |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | $data['email'] = get_bloginfo( 'admin_email' ); |
94 | 94 | $data['key'] = monsterinsights_get_license_key(); |
95 | 95 | $data['sas'] = monsterinsights_get_shareasale_id(); |
96 | - $data['settings'] = monsterinsights_get_options(); |
|
96 | + $data['settings'] = monsterinsights_get_options(); |
|
97 | 97 | $data['tracking_mode'] = $tracking_mode; |
98 | 98 | $data['events_mode'] = $events_mode; |
99 | 99 | $data['autoupdate'] = $update_mode; |
100 | 100 | |
101 | 101 | // Retrieve current plugin information |
102 | - if( ! function_exists( 'get_plugins' ) ) { |
|
102 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
103 | 103 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
104 | 104 | } |
105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach ( $plugins as $key => $plugin ) { |
110 | 110 | if ( in_array( $plugin, $active_plugins ) ) { |
111 | 111 | // Remove active plugins from list so we can show active and inactive separately |
112 | - unset( $plugins[ $key ] ); |
|
112 | + unset( $plugins[$key] ); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
136 | - if( ! $this->tracking_allowed() && ! $override ) { |
|
136 | + if ( ! $this->tracking_allowed() && ! $override ) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | |
146 | - $hours = (int) rand( 0 , 23 ); |
|
147 | - $minutes = (int) rand( 0 , 59 ); |
|
148 | - $seconds = (int) rand( 0 , 59 ); |
|
146 | + $hours = (int) rand( 0, 23 ); |
|
147 | + $minutes = (int) rand( 0, 59 ); |
|
148 | + $seconds = (int) rand( 0, 59 ); |
|
149 | 149 | wp_schedule_single_event( time() + ( $hours * $minutes * $seconds ), 'monsterinsights_send_tracking_data' ); |
150 | 150 | return true; |
151 | 151 | } |
@@ -33,24 +33,24 @@ discard block |
||
33 | 33 | $hook = 'monsterinsights_settings'; |
34 | 34 | |
35 | 35 | if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
36 | - // If dashboards disabled, first settings page |
|
37 | - add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
38 | - $hook = 'monsterinsights_settings'; |
|
36 | + // If dashboards disabled, first settings page |
|
37 | + add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
38 | + $hook = 'monsterinsights_settings'; |
|
39 | 39 | |
40 | - 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 - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' ); |
|
40 | + 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 - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' ); |
|
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', plugins_url( 'assets/css/images/[email protected]', $base->file ), '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', plugins_url( 'assets/css/images/[email protected]', $base->file ), '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 | - add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' ); |
|
53 | + add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' ); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // then addons |
61 | 61 | $network_key = MonsterInsights()->license->get_network_license_key(); |
62 | 62 | if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) { |
63 | - 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' ); |
|
63 | + 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' ); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | add_action( 'admin_menu', 'monsterinsights_admin_menu' ); |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | // First, let's see if this is an MS network enabled plugin. If it is, we should load the license |
75 | 75 | // menu page and the updater on the network panel |
76 | 76 | if ( ! function_exists( 'is_plugin_active_for_network' ) ) { |
77 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
77 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE ); |
81 | 81 | if ( ! is_plugin_active_for_network( $plugin ) ) { |
82 | - return; |
|
82 | + return; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $hook = 'monsterinsights_network'; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | function monsterinsights_add_admin_body_class( $classes ) { |
104 | 104 | $screen = get_current_screen(); |
105 | 105 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
106 | - return $classes; |
|
106 | + return $classes; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return "$classes monsterinsights_page "; |
@@ -123,17 +123,17 @@ discard block |
||
123 | 123 | |
124 | 124 | // If lite, show a link where they can get pro from |
125 | 125 | if ( ! monsterinsights_is_pro_version() ) { |
126 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
127 | - array_unshift( $links, $get_pro ); |
|
126 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
127 | + array_unshift( $links, $get_pro ); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | // If Lite, support goes to forum. If pro, it goes to our website |
131 | 131 | if ( monsterinsights_is_pro_version() ) { |
132 | - $support = '<a title="MonsterInsights Pro Support" href="https://www.monsterinsights.com/my-account/support/">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
133 | - array_unshift( $links, $support ); |
|
132 | + $support = '<a title="MonsterInsights Pro Support" href="https://www.monsterinsights.com/my-account/support/">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
133 | + array_unshift( $links, $support ); |
|
134 | 134 | } else { |
135 | - $support = '<a title="MonsterInsights Lite Support" href="https://wordpress.org/support/plugin/google-analytics-for-wordpress">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
136 | - array_unshift( $links, $support ); |
|
135 | + $support = '<a title="MonsterInsights Lite Support" href="https://wordpress.org/support/plugin/google-analytics-for-wordpress">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
136 | + array_unshift( $links, $support ); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>'; |
@@ -158,26 +158,26 @@ discard block |
||
158 | 158 | function monsterinsights_load_admin_partial( $template, $data = array() ) { |
159 | 159 | |
160 | 160 | if ( monsterinsights_is_pro_version() ) { |
161 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
161 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
162 | 162 | |
163 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
164 | - require_once( $dir . $template . '.php' ); |
|
165 | - return true; |
|
166 | - } |
|
163 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
164 | + require_once( $dir . $template . '.php' ); |
|
165 | + return true; |
|
166 | + } |
|
167 | 167 | } else { |
168 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
168 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
169 | 169 | |
170 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
171 | - require_once( $dir . $template . '.php' ); |
|
172 | - return true; |
|
173 | - } |
|
170 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
171 | + require_once( $dir . $template . '.php' ); |
|
172 | + return true; |
|
173 | + } |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
177 | 177 | |
178 | 178 | if ( file_exists( $dir . $template . '.php' ) ) { |
179 | - require_once( $dir . $template . '.php' ); |
|
180 | - return true; |
|
179 | + require_once( $dir . $template . '.php' ); |
|
180 | + return true; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return false; |
@@ -193,15 +193,15 @@ discard block |
||
193 | 193 | // Get the current screen, and check whether we're viewing a MonsterInsights screen; |
194 | 194 | $screen = get_current_screen(); |
195 | 195 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
196 | - return; |
|
196 | + return; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | // If here, we're on an MonsterInsights screen, so output the header. |
200 | 200 | monsterinsights_load_admin_partial( 'header', array( |
201 | - 'mascot' => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ), |
|
202 | - 'logo' => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ), |
|
203 | - '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
204 | - '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
201 | + 'mascot' => plugins_url( 'assets/css/images/mascot.png', MonsterInsights()->file ), |
|
202 | + 'logo' => plugins_url( 'assets/css/images/logo.png', MonsterInsights()->file ), |
|
203 | + '2xmascot' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
204 | + '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
|
205 | 205 | ) ); |
206 | 206 | } |
207 | 207 | add_action( 'in_admin_header','monsterinsights_admin_header', 100 ); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | function monsterinsights_welcome_redirect() { |
210 | 210 | // Bail if no activation redirect |
211 | 211 | if ( ! get_transient( '_monsterinsights_activation_redirect' ) ) { |
212 | - return; |
|
212 | + return; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | // Delete the redirect transient |
@@ -217,15 +217,15 @@ discard block |
||
217 | 217 | |
218 | 218 | // Bail if activating from network, or bulk |
219 | 219 | if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
220 | - return; |
|
220 | + return; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | $upgrade = get_option( 'monsterinsights_version_upgraded_from' ); |
224 | 224 | if( ! $upgrade ) { // First time install |
225 | - //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
|
225 | + //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
|
226 | 226 | } else { // Update |
227 | - return; |
|
228 | - //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
|
227 | + return; |
|
228 | + //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | //add_action( 'admin_init', 'monsterinsights_welcome_redirect', 11 ); @todo: Investigate |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | function monsterinsights_admin_footer( $text ) { |
242 | 242 | global $current_screen; |
243 | 243 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
244 | - $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
245 | - $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">★★★★★</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
244 | + $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
245 | + $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">★★★★★</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
246 | 246 | } |
247 | 247 | return $text; |
248 | 248 | } |
@@ -253,12 +253,12 @@ discard block |
||
253 | 253 | // Don't show on MonsterInsights pages |
254 | 254 | $screen = get_current_screen(); |
255 | 255 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) { |
256 | - return; |
|
256 | + return; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | // Make sure they have the permissions to do something |
260 | 260 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
261 | - return; |
|
261 | + return; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | // Priority: |
@@ -271,151 +271,151 @@ discard block |
||
271 | 271 | |
272 | 272 | // 1. Google Analytics not authenticated |
273 | 273 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
274 | - $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
275 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
276 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
277 | - return; |
|
274 | + $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
275 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
276 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
277 | + return; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | // 2. License key not entered for pro |
281 | 281 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
282 | 282 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
283 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
284 | - $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>' ); |
|
285 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
286 | - return; |
|
283 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
284 | + $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>' ); |
|
285 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
286 | + return; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | // 3. License key not valid/okay for pro |
290 | 290 | if ( monsterinsights_is_pro_version() ) { |
291 | - $message = ''; |
|
292 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
293 | - if ( MonsterInsights()->license->site_license_expired() ) { |
|
294 | - $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
295 | - } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
296 | - $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
297 | - } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
298 | - $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' ); |
|
299 | - } |
|
300 | - } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
301 | - if ( MonsterInsights()->license->network_license_expired() ) { |
|
302 | - $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
303 | - } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
304 | - $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
305 | - } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
306 | - $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' ); |
|
307 | - } |
|
308 | - } |
|
309 | - if ( ! empty( $message ) ) { |
|
310 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
311 | - return; |
|
312 | - } |
|
291 | + $message = ''; |
|
292 | + if ( MonsterInsights()->license->get_site_license_key() ){ |
|
293 | + if ( MonsterInsights()->license->site_license_expired() ) { |
|
294 | + $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
295 | + } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
296 | + $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
297 | + } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
298 | + $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' ); |
|
299 | + } |
|
300 | + } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
301 | + if ( MonsterInsights()->license->network_license_expired() ) { |
|
302 | + $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
303 | + } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
304 | + $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
305 | + } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
306 | + $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' ); |
|
307 | + } |
|
308 | + } |
|
309 | + if ( ! empty( $message ) ) { |
|
310 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
311 | + return; |
|
312 | + } |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | // 4. Optin setting not configured |
316 | 316 | if ( ! is_network_admin() ) { |
317 | - if ( ! get_option( 'monsterinsights_tracking_notice' ) ) { |
|
318 | - if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) { |
|
319 | - if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) { |
|
320 | - if ( monsterinsights_is_pro_version() ) { |
|
321 | - monsterinsights_update_option( 'anonymous_data', 1 ); |
|
322 | - return; |
|
323 | - } |
|
324 | - $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' ); |
|
325 | - $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' ); |
|
326 | - echo '<div class="updated"><p>'; |
|
327 | - echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' ); |
|
328 | - echo ' <a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>'; |
|
329 | - echo ' <a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>'; |
|
330 | - echo '</p></div>'; |
|
331 | - return; |
|
332 | - } else { |
|
333 | - // is testing site |
|
334 | - update_option( 'monsterinsights_tracking_notice', '1' ); |
|
335 | - } |
|
336 | - } |
|
337 | - } |
|
317 | + if ( ! get_option( 'monsterinsights_tracking_notice' ) ) { |
|
318 | + if ( ! monsterinsights_get_option( 'anonymous_data', false ) ) { |
|
319 | + if ( ! monsterinsights_is_dev_url( network_site_url( '/' ) ) ) { |
|
320 | + if ( monsterinsights_is_pro_version() ) { |
|
321 | + monsterinsights_update_option( 'anonymous_data', 1 ); |
|
322 | + return; |
|
323 | + } |
|
324 | + $optin_url = add_query_arg( 'mi_action', 'opt_into_tracking' ); |
|
325 | + $optout_url = add_query_arg( 'mi_action', 'opt_out_of_tracking' ); |
|
326 | + echo '<div class="updated"><p>'; |
|
327 | + echo esc_html__( 'Allow MonsterInsights to track plugin usage? Opt-in to tracking and our newsletter to stay informed of the latest changes to MonsterInsights and help us ensure compatibility.', 'google-analytics-for-wordpress' ); |
|
328 | + echo ' <a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'google-analytics-for-wordpress' ) . '</a>'; |
|
329 | + echo ' <a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'google-analytics-for-wordpress' ) . '</a>'; |
|
330 | + echo '</p></div>'; |
|
331 | + return; |
|
332 | + } else { |
|
333 | + // is testing site |
|
334 | + update_option( 'monsterinsights_tracking_notice', '1' ); |
|
335 | + } |
|
336 | + } |
|
337 | + } |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | $notices = array(); |
341 | 341 | if ( ! is_network_admin() || ( ! monsterinsights_is_pro_version() && ( class_exists( 'WooCommerce' ) || class_exists( 'Easy_Digital_Downloads' ) ) ) ) { |
342 | - $notices = get_option( 'monsterinsights_notices' ); |
|
343 | - if ( ! is_array( $notices ) ) { |
|
344 | - $notices = array(); |
|
345 | - } |
|
342 | + $notices = get_option( 'monsterinsights_notices' ); |
|
343 | + if ( ! is_array( $notices ) ) { |
|
344 | + $notices = array(); |
|
345 | + } |
|
346 | 346 | } |
347 | 347 | // 5. Automatic updates not configured |
348 | 348 | if ( ! is_network_admin() ) { |
349 | - $updates = monsterinsights_get_option( 'automatic_updates', false ); |
|
350 | - $url = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
351 | - |
|
352 | - if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
|
353 | - echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">'; |
|
354 | - echo '<p>'; |
|
355 | - echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
356 | - echo '</p>'; |
|
357 | - echo '</div>'; |
|
358 | - return; |
|
359 | - } |
|
349 | + $updates = monsterinsights_get_option( 'automatic_updates', false ); |
|
350 | + $url = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
351 | + |
|
352 | + if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
|
353 | + echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">'; |
|
354 | + echo '<p>'; |
|
355 | + echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
356 | + echo '</p>'; |
|
357 | + echo '</div>'; |
|
358 | + return; |
|
359 | + } |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
363 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
364 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
365 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
366 | - echo '<p><strong>'; |
|
367 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
368 | - echo '</strong></p>'; |
|
369 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
370 | - echo '<p>'; |
|
371 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
372 | - echo '</p>'; |
|
373 | - echo '<p>'; |
|
374 | - 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' ); |
|
375 | - echo '</p>'; |
|
376 | - echo '<p>'; |
|
377 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
378 | - echo '</p>'; |
|
379 | - echo '<p>'; |
|
380 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
381 | - echo '</p>'; |
|
382 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=woocommercelite">', ' »</a>' ); |
|
383 | - echo '</p>'; |
|
384 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
385 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
386 | - echo '</div>'; |
|
387 | - echo '</div>'; |
|
388 | - return; |
|
389 | - } |
|
363 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
364 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
365 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
366 | + echo '<p><strong>'; |
|
367 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
368 | + echo '</strong></p>'; |
|
369 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
370 | + echo '<p>'; |
|
371 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
372 | + echo '</p>'; |
|
373 | + echo '<p>'; |
|
374 | + 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' ); |
|
375 | + echo '</p>'; |
|
376 | + echo '<p>'; |
|
377 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
378 | + echo '</p>'; |
|
379 | + echo '<p>'; |
|
380 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
381 | + echo '</p>'; |
|
382 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=woocommercelite">', ' »</a>' ); |
|
383 | + echo '</p>'; |
|
384 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
385 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
386 | + echo '</div>'; |
|
387 | + echo '</div>'; |
|
388 | + return; |
|
389 | + } |
|
390 | 390 | } |
391 | 391 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
392 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
393 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
394 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
395 | - echo '<p><strong>'; |
|
396 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
397 | - echo '</strong></p>'; |
|
398 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
399 | - echo '<p>'; |
|
400 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
401 | - echo '</p>'; |
|
402 | - echo '<p>'; |
|
403 | - 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' ); |
|
404 | - echo '</p>'; |
|
405 | - echo '<p>'; |
|
406 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
407 | - echo '</p>'; |
|
408 | - echo '<p>'; |
|
409 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
410 | - echo '</p>'; |
|
411 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=eddlite">', ' »</a>' ); |
|
412 | - echo '</p>'; |
|
413 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
414 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
415 | - echo '</div>'; |
|
416 | - echo '</div>'; |
|
417 | - return; |
|
418 | - } |
|
392 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
393 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
394 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
395 | + echo '<p><strong>'; |
|
396 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
397 | + echo '</strong></p>'; |
|
398 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
399 | + echo '<p>'; |
|
400 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
401 | + echo '</p>'; |
|
402 | + echo '<p>'; |
|
403 | + 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' ); |
|
404 | + echo '</p>'; |
|
405 | + echo '<p>'; |
|
406 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
407 | + echo '</p>'; |
|
408 | + echo '<p>'; |
|
409 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
410 | + echo '</p>'; |
|
411 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="https://www.monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=eddlite">', ' »</a>' ); |
|
412 | + echo '</p>'; |
|
413 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
414 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
415 | + echo '</div>'; |
|
416 | + echo '</div>'; |
|
417 | + return; |
|
418 | + } |
|
419 | 419 | } |
420 | 420 | } |
421 | 421 | add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' ); |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | |
35 | 35 | if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
36 | 36 | // If dashboards disabled, first settings page |
37 | - add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
37 | + add_menu_page( __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
38 | 38 | $hook = 'monsterinsights_settings'; |
39 | 39 | |
40 | 40 | add_submenu_page( $hook, __( 'Settings:', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
41 | 41 | add_submenu_page( $hook, __( 'Settings - Tracking:', 'google-analytics-for-wordpress' ), __( 'Settings - Tracking', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_tracking', 'monsterinsights_tracking_page' ); |
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', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
45 | 45 | |
46 | 46 | $hook = 'monsterinsights_reports'; |
47 | 47 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $hook = 'monsterinsights_network'; |
86 | - add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
86 | + add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', plugins_url( 'assets/css/images/[email protected]', $base->file ), '100.00013467543' ); |
|
87 | 87 | |
88 | 88 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
89 | 89 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | // If lite, show a link where they can get pro from |
125 | 125 | if ( ! monsterinsights_is_pro_version() ) { |
126 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
126 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="https://www.monsterinsights.com/lite/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
127 | 127 | array_unshift( $links, $get_pro ); |
128 | 128 | } |
129 | 129 | |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
162 | 162 | |
163 | 163 | if ( file_exists( $dir . $template . '.php' ) ) { |
164 | - require_once( $dir . $template . '.php' ); |
|
164 | + require_once( $dir . $template . '.php' ); |
|
165 | 165 | return true; |
166 | 166 | } |
167 | 167 | } else { |
168 | 168 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
169 | 169 | |
170 | 170 | if ( file_exists( $dir . $template . '.php' ) ) { |
171 | - require_once( $dir . $template . '.php' ); |
|
171 | + require_once( $dir . $template . '.php' ); |
|
172 | 172 | return true; |
173 | 173 | } |
174 | 174 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
177 | 177 | |
178 | 178 | if ( file_exists( $dir . $template . '.php' ) ) { |
179 | - require_once( $dir . $template . '.php' ); |
|
179 | + require_once( $dir . $template . '.php' ); |
|
180 | 180 | return true; |
181 | 181 | } |
182 | 182 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
205 | 205 | ) ); |
206 | 206 | } |
207 | -add_action( 'in_admin_header','monsterinsights_admin_header', 100 ); |
|
207 | +add_action( 'in_admin_header', 'monsterinsights_admin_header', 100 ); |
|
208 | 208 | |
209 | 209 | function monsterinsights_welcome_redirect() { |
210 | 210 | // Bail if no activation redirect |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | $upgrade = get_option( 'monsterinsights_version_upgraded_from' ); |
224 | - if( ! $upgrade ) { // First time install |
|
224 | + if ( ! $upgrade ) { // First time install |
|
225 | 225 | //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
226 | 226 | } else { // Update |
227 | 227 | return; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | global $current_screen; |
243 | 243 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
244 | 244 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
245 | - $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">★★★★★</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
245 | + $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">★★★★★</a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
246 | 246 | } |
247 | 247 | return $text; |
248 | 248 | } |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | // 1. Google Analytics not authenticated |
273 | 273 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
274 | 274 | $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
275 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
276 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
275 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' ); |
|
276 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
277 | 277 | return; |
278 | 278 | } |
279 | 279 | |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
282 | 282 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
283 | 283 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
284 | - $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>' ); |
|
285 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
284 | + $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>' ); |
|
285 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
286 | 286 | return; |
287 | 287 | } |
288 | 288 | |
289 | 289 | // 3. License key not valid/okay for pro |
290 | 290 | if ( monsterinsights_is_pro_version() ) { |
291 | 291 | $message = ''; |
292 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
292 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
293 | 293 | if ( MonsterInsights()->license->site_license_expired() ) { |
294 | 294 | $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
295 | 295 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | } |
309 | 309 | if ( ! empty( $message ) ) { |
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 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | $notices = array(); |
341 | 341 | if ( ! is_network_admin() || ( ! monsterinsights_is_pro_version() && ( class_exists( 'WooCommerce' ) || class_exists( 'Easy_Digital_Downloads' ) ) ) ) { |
342 | - $notices = get_option( 'monsterinsights_notices' ); |
|
342 | + $notices = get_option( 'monsterinsights_notices' ); |
|
343 | 343 | if ( ! is_array( $notices ) ) { |
344 | 344 | $notices = array(); |
345 | 345 | } |
@@ -349,10 +349,10 @@ discard block |
||
349 | 349 | $updates = monsterinsights_get_option( 'automatic_updates', false ); |
350 | 350 | $url = admin_url( 'admin.php?page=monsterinsights_settings' ); |
351 | 351 | |
352 | - if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
|
352 | + if ( empty( $updates ) && ! isset( $notices['monsterinsights_automatic_updates'] ) ) { |
|
353 | 353 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">'; |
354 | 354 | echo '<p>'; |
355 | - echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
355 | + echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
356 | 356 | echo '</p>'; |
357 | 357 | echo '</div>'; |
358 | 358 | return; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
363 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
363 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
364 | 364 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
365 | 365 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
366 | 366 | echo '<p><strong>'; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | } |
390 | 390 | } |
391 | 391 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
392 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
392 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
393 | 393 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
394 | 394 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
395 | 395 | echo '<p><strong>'; |
@@ -221,9 +221,11 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | $upgrade = get_option( 'monsterinsights_version_upgraded_from' ); |
224 | - if( ! $upgrade ) { // First time install |
|
224 | + if( ! $upgrade ) { |
|
225 | +// First time install |
|
225 | 226 | //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
226 | - } else { // Update |
|
227 | + } else { |
|
228 | +// Update |
|
227 | 229 | return; |
228 | 230 | //wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_settings#monsterinsights-main-tab-general' ) ); exit; |
229 | 231 | } |
@@ -289,7 +291,7 @@ discard block |
||
289 | 291 | // 3. License key not valid/okay for pro |
290 | 292 | if ( monsterinsights_is_pro_version() ) { |
291 | 293 | $message = ''; |
292 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
294 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
293 | 295 | if ( MonsterInsights()->license->site_license_expired() ) { |
294 | 296 | $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="https://www.monsterinsights.com/login/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
295 | 297 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
@@ -349,7 +351,7 @@ discard block |
||
349 | 351 | $updates = monsterinsights_get_option( 'automatic_updates', false ); |
350 | 352 | $url = admin_url( 'admin.php?page=monsterinsights_settings' ); |
351 | 353 | |
352 | - if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
|
354 | + if ( empty( $updates) && ! isset( $notices['monsterinsights_automatic_updates' ] ) ) { |
|
353 | 355 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_automatic_updates">'; |
354 | 356 | echo '<p>'; |
355 | 357 | echo sprintf( esc_html__( 'Important: Please %1$sconfigure the Automatic Updates Settings%2$s in MonsterInsights.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
@@ -360,7 +362,7 @@ discard block |
||
360 | 362 | } |
361 | 363 | |
362 | 364 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
363 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
365 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
364 | 366 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
365 | 367 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
366 | 368 | echo '<p><strong>'; |
@@ -389,7 +391,7 @@ discard block |
||
389 | 391 | } |
390 | 392 | } |
391 | 393 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
392 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
394 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
393 | 395 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
394 | 396 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
395 | 397 | echo '<p><strong>'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @since 6.0.0 |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10 , 3 ); |
|
33 | + add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10, 3 ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | - public function additional_data(){ |
|
43 | + public function additional_data() { |
|
44 | 44 | return array(); |
45 | 45 | } |
46 | 46 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function show_report( $args = array() ) { |
52 | 52 | |
53 | 53 | if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) { |
54 | - return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) ); |
|
54 | + return monsterinsights_get_message( 'error', esc_html__( 'Access denied', 'google-analytics-for-wordpress' ) ); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ( monsterinsights_is_pro_version() ){ |
|
72 | + if ( monsterinsights_is_pro_version() ) { |
|
73 | 73 | if ( ! MonsterInsights()->license->has_license() ) { |
74 | 74 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
75 | - return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' ); |
|
75 | + return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
76 | 76 | } else if ( MonsterInsights()->license->license_has_error() ) { |
77 | 77 | return monsterinsights_get_message( 'error', $this->get_license_error() ); |
78 | 78 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | return monsterinsights_get_message( 'error', $args['error'] ); |
108 | 108 | } |
109 | 109 | |
110 | - if ( empty( $args['data' ] ) || ! is_array( $args['data' ] ) ) { |
|
110 | + if ( empty( $args['data'] ) || ! is_array( $args['data'] ) ) { |
|
111 | 111 | if ( monsterinsights_is_pro_version() ) { |
112 | 112 | return ''; |
113 | 113 | } else { |
114 | 114 | // Try to get default data. |
115 | 115 | $args = $this->get_data( array( 'default' => true ) ); |
116 | - if ( empty( $args['data'] ) || is_array( $args['data' ] ) ) { |
|
116 | + if ( empty( $args['data'] ) || is_array( $args['data'] ) ) { |
|
117 | 117 | return monsterinsights_get_message( 'error', __( 'No data found', 'google-analytics-for-wordpress' ) ); |
118 | 118 | } |
119 | 119 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | $start = ! empty( $args['start'] ) && $this->is_valid_date( $args['start'] ) ? $args['start'] : ''; |
150 | - $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
150 | + $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
151 | 151 | |
152 | 152 | if ( ! MonsterInsights()->license->license_can( $this->level ) ) { |
153 | 153 | return array( |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | $data = ! $site_auth && $ms_auth ? get_site_transient( $transient ) : get_transient( $transient ); |
203 | 203 | } |
204 | 204 | |
205 | - if ( ! empty( $data ) && |
|
206 | - ! empty( $data['expires'] ) && |
|
205 | + if ( ! empty( $data ) && |
|
206 | + ! empty( $data['expires'] ) && |
|
207 | 207 | $data['expires'] >= date() && |
208 | - ! empty( $data['data'] ) && |
|
209 | - ! empty( $data['p'] ) && |
|
208 | + ! empty( $data['data'] ) && |
|
209 | + ! empty( $data['p'] ) && |
|
210 | 210 | $data['p'] === $p |
211 | 211 | ) { |
212 | 212 | return array( |
@@ -216,12 +216,12 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | // Nothing in cache, either not saved before, expired or mismatch. Let's grab from API |
219 | - $api_options = array( 'start' => $start, 'end' => $end); |
|
219 | + $api_options = array( 'start' => $start, 'end' => $end ); |
|
220 | 220 | if ( ! $site_auth && $ms_auth ) { |
221 | 221 | $api_options['network'] = true; |
222 | 222 | } |
223 | 223 | |
224 | - $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
224 | + $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
225 | 225 | |
226 | 226 | $additional_data = $this->additional_data(); |
227 | 227 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $api->set_additional_data( $additional_data ); |
230 | 230 | } |
231 | 231 | |
232 | - $ret = $api->request(); |
|
232 | + $ret = $api->request(); |
|
233 | 233 | //echo print_r( $ret['data']);wp_die(); |
234 | 234 | |
235 | 235 | if ( is_wp_error( $ret ) ) { |
@@ -290,44 +290,44 @@ discard block |
||
290 | 290 | // Is a valid date value |
291 | 291 | public function is_valid_date( $date = '' ) { |
292 | 292 | $d = MonsterInsightsDateTime::createFromFormat( 'Y-m-d', $date ); |
293 | - return $d && $d->format('Y-m-d') === $date; |
|
293 | + return $d && $d->format( 'Y-m-d' ) === $date; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
297 | 297 | * Do not use the functions below this. They are unused and are just here so people |
298 | 298 | * with out of date MonsterInsights addons won't get fatal errors. |
299 | 299 | */ |
300 | - protected function get_api_max_limit() {return 300;} |
|
301 | - protected function get_date_range() {return array();} |
|
300 | + protected function get_api_max_limit() {return 300; } |
|
301 | + protected function get_date_range() {return array(); } |
|
302 | 302 | |
303 | 303 | public function get_upsell_notice() { |
304 | 304 | $has_level = MonsterInsights()->license->get_license_type(); |
305 | 305 | $has_level = $has_level ? $has_level : 'lite'; |
306 | 306 | $message = sprintf( __( 'You currently have a %s level license, but this report requires at least a %s level license to view the %s. Please upgrade to view this report.', 'google-analytics-for-wordpress' ), $has_level, $this->level, $this->title ); |
307 | - ob_start();?> |
|
308 | - <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name;?>-bg"> |
|
307 | + ob_start(); ?> |
|
308 | + <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name; ?>-bg"> |
|
309 | 309 | <div class="monsterinsights-upsell-container"> |
310 | 310 | <div class="row justify-content-center"> |
311 | 311 | <div class="col-lg-10 col-lg-offset-1 align-self-center"> |
312 | 312 | <div class="monsterinsights-upsell-card"> |
313 | - <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/[email protected] 2x" alt=""> |
|
313 | + <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/[email protected] 2x" alt=""> |
|
314 | 314 | <div class="monsterinsights-upsell-card-card-content"> |
315 | - <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' );?></span> |
|
316 | - <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' );?></strong></p> |
|
315 | + <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' ); ?></span> |
|
316 | + <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' ); ?></strong></p> |
|
317 | 317 | <?php if ( monsterinsights_is_pro_version() ) { ?> |
318 | 318 | <p ><?php echo sprintf( esc_html__( "Hey there! It looks like you've got the %s license installed on your site. |
319 | - That's awesome! %s",'google-analytics-for-wordpress'), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
319 | + That's awesome! %s",'google-analytics-for-wordpress' ), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
320 | 320 | |
321 | - <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. You'll need to upgrade your license to get instant access.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="https://monsterinsights.com/my-account/">' . $this->level,'</a>' ); ?></p> |
|
322 | - <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.",'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/my-account/?utm_source=wpdashboard&utm_campaign=reportupsellpro"><strong>','</strong></a>', '<a href="https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
323 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
321 | + <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. You'll need to upgrade your license to get instant access.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="https://monsterinsights.com/my-account/">' . $this->level, '</a>' ); ?></p> |
|
322 | + <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.", 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/my-account/?utm_source=wpdashboard&utm_campaign=reportupsellpro"><strong>', '</strong></a>', '<a href="https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
323 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
324 | 324 | <?php } else { ?> |
325 | 325 | <p><?php echo sprintf( esc_html__( "Hey there! %s It looks like you've got the free version of MonsterInsights installed on your site. |
326 | - That's awesome!",'google-analytics-for-wordpress'), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
326 | + That's awesome!",'google-analytics-for-wordpress' ), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
327 | 327 | |
328 | - <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="https://monsterinsights.com/lite/">' . $this->level,'</a>' ); ?></p> |
|
329 | - <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.",'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=reportupselllite"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="https://www.monsterinsights.com/docs/go-lite-pro/">', '</a>' ); ?></p> |
|
330 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
328 | + <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="https://monsterinsights.com/lite/">' . $this->level, '</a>' ); ?></p> |
|
329 | + <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.", 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/lite/?utm_source=wpdashboard&utm_campaign=reportupselllite"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="https://www.monsterinsights.com/docs/go-lite-pro/">', '</a>' ); ?></p> |
|
330 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
331 | 331 | <?php } ?> |
332 | 332 | </div> |
333 | 333 | <div class="monsterinsights-upsell-card-action"> |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range) |
37 | - protected function get_report_html( $args = array() ) { |
|
37 | + protected function get_report_html( $args = array() ) { |
|
38 | 38 | /* Defined in the report class */ |
39 | 39 | // For ajax, args start, end, and data will be set with the data to use. Else call $this->get_data( array( 'default' => true ) ) |
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | - public function additional_data(){ |
|
43 | + public function additional_data() { |
|
44 | 44 | return array(); |
45 | 45 | } |
46 | 46 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) ); |
55 | 55 | } |
56 | 56 | |
57 | - if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
|
57 | + if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
|
58 | 58 | if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
59 | 59 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
60 | 60 | return monsterinsights_get_message( 'error', |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ( monsterinsights_is_pro_version() ){ |
|
72 | + if ( monsterinsights_is_pro_version() ) { |
|
73 | 73 | if ( ! MonsterInsights()->license->has_license() ) { |
74 | 74 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
75 | 75 | return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' ); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | if ( ! class_exists( 'MonsterInsightsDateTime' ) ) { |
352 | 352 | class MonsterInsightsDateTime extends DateTime { |
353 | 353 | public static function createFromFormat( $format, $time, $timezone = null ) { |
354 | - if ( ! $timezone ) { |
|
354 | + if ( ! $timezone ) { |
|
355 | 355 | $timezone = new DateTimeZone( date_default_timezone_get() ); |
356 | 356 | } |
357 | 357 | if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | // Outputs the report. |
39 | - protected function get_report_html( $data = array() ){ |
|
39 | + protected function get_report_html( $data = array() ) { |
|
40 | 40 | ob_start(); |
41 | 41 | if ( ! empty( $data['overviewgraph']['count'] ) && $data['overviewgraph']['count'] > 0 ) { |
42 | 42 | ?> |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | <img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/> |
94 | 94 | <?php echo esc_html( $data['infobox']['sessions']['prev'] ) . '%'; ?> |
95 | 95 | </div> |
96 | - <?php } else { ?> |
|
96 | + <?php } else { ?> |
|
97 | 97 | <div class="monsterinsights-reports-infobox-prev"> |
98 | 98 | <img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/> |
99 | 99 | <?php echo esc_html( absint( $data['infobox']['sessions']['prev'] ) ) . '%'; ?> |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | <img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/> |
121 | 121 | <?php echo esc_html( $data['infobox']['pageviews']['prev'] ) . '%'; ?> |
122 | 122 | </div> |
123 | - <?php } else { ?> |
|
123 | + <?php } else { ?> |
|
124 | 124 | <div class="monsterinsights-reports-infobox-prev"> |
125 | 125 | <img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/> |
126 | 126 | <?php echo esc_html( absint( $data['infobox']['pageviews']['prev'] ) ) . '%'; ?> |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | <img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/> |
148 | 148 | <?php echo esc_html( $data['infobox']['duration']['prev'] ) . '%'; ?> |
149 | 149 | </div> |
150 | - <?php } else { ?> |
|
150 | + <?php } else { ?> |
|
151 | 151 | <div class="monsterinsights-reports-infobox-prev"> |
152 | 152 | <img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/> |
153 | - <?php echo esc_html( absint( $data['infobox']['duration']['prev'] ) ) . '%'; ?> |
|
153 | + <?php echo esc_html( absint( $data['infobox']['duration']['prev'] ) ) . '%'; ?> |
|
154 | 154 | </div> |
155 | 155 | <?php } ?> |
156 | 156 | <div class="monsterinsights-reports-infobox-compare"> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | <img src="<?php echo $up; ?>" srcset="<?php echo $up2x; ?> 2x" alt="<?php echo $uplabel; ?>"/> |
175 | 175 | <?php echo esc_html( $data['infobox']['bounce']['prev'] ) . '%'; ?> |
176 | 176 | </div> |
177 | - <?php } else { ?> |
|
177 | + <?php } else { ?> |
|
178 | 178 | <div class="monsterinsights-reports-infobox-prev"> |
179 | 179 | <img src="<?php echo $down; ?>" srcset="<?php echo $down2x; ?> 2x" alt="<?php echo $downlabel; ?>"/> |
180 | 180 | <?php echo esc_html( absint( $data['infobox']['bounce']['prev'] ) ) . '%'; ?> |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | </div> |
187 | 187 | </div> |
188 | 188 | <?php } ?> |
189 | - <?php if ( ! empty( $data['newvsreturn'] ) && ! empty( $data['devices'] ) ) { ?> |
|
189 | + <?php if ( ! empty( $data['newvsreturn'] ) && ! empty( $data['devices'] ) ) { ?> |
|
190 | 190 | <div class="monsterinsights-reports-2-column-container row"> |
191 | 191 | <div class="monsterinsights-reports-2-column-item col-md-6"> |
192 | 192 | <div class="monsterinsights-reports-2-column-panel panel monsterinsights-pie-chart-panel chart-panel"> |
193 | 193 | <div class="monsterinsights-reports-panel-title"> |
194 | - <?php echo esc_html__( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' );?> |
|
194 | + <?php echo esc_html__( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' ); ?> |
|
195 | 195 | </div> |
196 | 196 | <div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'New vs. Returning Visitors', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This graph shows what percent of your user sessions come from new versus repeat visitors.', 'google-analytics-for-wordpress' ) ); ?>"></div> |
197 | 197 | <div class="monsterinsights-reports-pie-graph monsterinsights-clear"> |
@@ -281,8 +281,8 @@ discard block |
||
281 | 281 | }], |
282 | 282 | values: [<?php echo esc_js( $data['newvsreturn']['new'] ); ?>,<?php echo esc_js( $data['newvsreturn']['returning'] ); ?> ], |
283 | 283 | labels: [ |
284 | - "<?php echo esc_js( __('New', 'google-analytics-for-wordpress' ) ); ?>", |
|
285 | - "<?php echo esc_js( __('Returning', 'google-analytics-for-wordpress' ) ); ?>", |
|
284 | + "<?php echo esc_js( __( 'New', 'google-analytics-for-wordpress' ) ); ?>", |
|
285 | + "<?php echo esc_js( __( 'Returning', 'google-analytics-for-wordpress' ) ); ?>", |
|
286 | 286 | ] |
287 | 287 | }, |
288 | 288 | options: { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | <div class="monsterinsights-reports-2-column-item col-md-6"> |
341 | 341 | <div class="monsterinsights-reports-2-column-panel panel monsterinsights-pie-chart-panel chart-panel"> |
342 | 342 | <div class="monsterinsights-reports-panel-title"> |
343 | - <?php echo esc_html__( 'Device Breakdown', 'google-analytics-for-wordpress' );?> |
|
343 | + <?php echo esc_html__( 'Device Breakdown', 'google-analytics-for-wordpress' ); ?> |
|
344 | 344 | </div> |
345 | 345 | <div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Device Breakdown', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This graph shows what percent of your visitor sessions are done using a traditional computer or laptop, tablet or mobile device to view your site.', 'google-analytics-for-wordpress' ) ); ?>"></div> |
346 | 346 | <div class="monsterinsights-reports-pie-graph monsterinsights-clear"> |
@@ -432,9 +432,9 @@ discard block |
||
432 | 432 | }], |
433 | 433 | values: [<?php echo esc_js( $data['devices']['desktop'] ); ?>,<?php echo esc_js( $data['devices']['tablet'] ); ?>,<?php echo esc_js( $data['devices']['mobile'] ); ?> ], |
434 | 434 | labels: [ |
435 | - "<?php echo esc_js( __('Desktop', 'google-analytics-for-wordpress' ) ); ?>", |
|
436 | - "<?php echo esc_js( __('Tablet', 'google-analytics-for-wordpress' ) ); ?>", |
|
437 | - "<?php echo esc_js( __('Mobile', 'google-analytics-for-wordpress' ) ); ?>", |
|
435 | + "<?php echo esc_js( __( 'Desktop', 'google-analytics-for-wordpress' ) ); ?>", |
|
436 | + "<?php echo esc_js( __( 'Tablet', 'google-analytics-for-wordpress' ) ); ?>", |
|
437 | + "<?php echo esc_js( __( 'Mobile', 'google-analytics-for-wordpress' ) ); ?>", |
|
438 | 438 | ] |
439 | 439 | }, |
440 | 440 | options: { |
@@ -492,12 +492,12 @@ discard block |
||
492 | 492 | </div> |
493 | 493 | <?php } ?> |
494 | 494 | |
495 | - <?php if ( ! empty( $data['countries'] ) && ! empty( $data['referrals'] ) ) { ?> |
|
495 | + <?php if ( ! empty( $data['countries'] ) && ! empty( $data['referrals'] ) ) { ?> |
|
496 | 496 | <div class="monsterinsights-reports-2-column-container row"> |
497 | 497 | <div class="monsterinsights-reports-2-column-item col-md-6 list-has-icons"> |
498 | 498 | <div class="monsterinsights-reports-2-column-panel panel nopadding"> |
499 | 499 | <div class="monsterinsights-reports-panel-title"> |
500 | - <?php echo esc_html__( 'Top 10 Countries', 'google-analytics-for-wordpress' );?> |
|
500 | + <?php echo esc_html__( 'Top 10 Countries', 'google-analytics-for-wordpress' ); ?> |
|
501 | 501 | </div> |
502 | 502 | <div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Top 10 Countries', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the top countries your website visitors are from.', 'google-analytics-for-wordpress' ) ); ?>"></div> |
503 | 503 | <div class="monsterinsights-reports-list"> |
@@ -505,11 +505,11 @@ discard block |
||
505 | 505 | <?php |
506 | 506 | $countries = monsterinsights_get_country_list( false ); |
507 | 507 | $i = 1; |
508 | - foreach( $data['countries'] as $icountry => $countrydata ) { |
|
509 | - if ( ! empty( $countries[ $countrydata['iso'] ] ) ) { |
|
510 | - echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $i .'.</span><span class="monsterinsights-reports-country-flag monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countries[ $countrydata['iso'] ] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
|
508 | + foreach ( $data['countries'] as $icountry => $countrydata ) { |
|
509 | + if ( ! empty( $countries[$countrydata['iso']] ) ) { |
|
510 | + echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $i . '.</span><span class="monsterinsights-reports-country-flag monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countries[$countrydata['iso']] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
|
511 | 511 | } else { |
512 | - echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $num .'</span><span class="monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countrydata['iso'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
|
512 | + echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $num . '</span><span class="monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countrydata['iso'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
|
513 | 513 | } |
514 | 514 | $i++; |
515 | 515 | } |
@@ -517,35 +517,35 @@ discard block |
||
517 | 517 | </ul> |
518 | 518 | </div> |
519 | 519 | <?php |
520 | - $referral_url = 'https://analytics.google.com/analytics/web/#report/visitors-geo/'. MonsterInsights()->auth->get_referral_url(); |
|
520 | + $referral_url = 'https://analytics.google.com/analytics/web/#report/visitors-geo/' . MonsterInsights()->auth->get_referral_url(); |
|
521 | 521 | ?> |
522 | 522 | <div class="monsterinsights-reports-panel-footer"> |
523 | - <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Countries Report', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Countries Report', 'google-analytics-for-wordpress' );?></a> |
|
523 | + <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Countries Report', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Countries Report', 'google-analytics-for-wordpress' ); ?></a> |
|
524 | 524 | </div> |
525 | 525 | </div> |
526 | 526 | </div> |
527 | 527 | <div class="monsterinsights-reports-2-column-item col-md-6 list-has-icons"> |
528 | 528 | <div class="monsterinsights-reports-2-column-panel panel nopadding"> |
529 | 529 | <div class="monsterinsights-reports-panel-title"> |
530 | - <?php echo esc_html__( 'Referrals', 'google-analytics-for-wordpress' );?> |
|
530 | + <?php echo esc_html__( 'Referrals', 'google-analytics-for-wordpress' ); ?> |
|
531 | 531 | </div> |
532 | 532 | <div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Referrals', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the top websites that send your website traffic, known as "referral traffic".', 'google-analytics-for-wordpress' ) ); ?>"></div> |
533 | 533 | <div class="monsterinsights-reports-list"> |
534 | 534 | <ul class="monsterinsights-reports-referral-list list-group"> |
535 | 535 | <?php |
536 | 536 | $i = 1; |
537 | - foreach( $data['referrals'] as $ireferrals => $referralsdata ) { |
|
538 | - echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $i .'.</span><img class="monsterinsights-reports-referral-icon" src="https://www.google.com/s2/favicons?domain=' . $referralsdata['url'] . '" width="16px" height="16px" /><span class="monsterinsights-reports-list-text">' . $referralsdata['url'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $referralsdata['sessions'] ) . '</span>'; |
|
537 | + foreach ( $data['referrals'] as $ireferrals => $referralsdata ) { |
|
538 | + echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $i . '.</span><img class="monsterinsights-reports-referral-icon" src="https://www.google.com/s2/favicons?domain=' . $referralsdata['url'] . '" width="16px" height="16px" /><span class="monsterinsights-reports-list-text">' . $referralsdata['url'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $referralsdata['sessions'] ) . '</span>'; |
|
539 | 539 | $i++; |
540 | 540 | } |
541 | 541 | ?> |
542 | 542 | </ul> |
543 | 543 | </div> |
544 | 544 | <?php |
545 | - $referral_url = 'https://analytics.google.com/analytics/web/#report/trafficsources-referrals/'. MonsterInsights()->auth->get_referral_url(); |
|
545 | + $referral_url = 'https://analytics.google.com/analytics/web/#report/trafficsources-referrals/' . MonsterInsights()->auth->get_referral_url(); |
|
546 | 546 | ?> |
547 | 547 | <div class="monsterinsights-reports-panel-footer"> |
548 | - <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View All Referral Resources', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Referral Resources', 'google-analytics-for-wordpress' );?></a> |
|
548 | + <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View All Referral Resources', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button"><?php echo esc_html__( 'View All Referral Resources', 'google-analytics-for-wordpress' ); ?></a> |
|
549 | 549 | </div> |
550 | 550 | </div> |
551 | 551 | </div> |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | <?php if ( ! empty( $data['toppages'] ) ) { ?> |
556 | 556 | <div class="monsterinsights-reports-1-column-row panel row container-fluid nopadding list-no-icons" style="position: relative;"> |
557 | 557 | <div class="monsterinsights-reports-panel-title"> |
558 | - <?php echo esc_html__( 'Top Posts / Pages', 'google-analytics-for-wordpress' );?> |
|
558 | + <?php echo esc_html__( 'Top Posts / Pages', 'google-analytics-for-wordpress' ); ?> |
|
559 | 559 | </div> |
560 | 560 | |
561 | 561 | <div class="monsterinsights-reports-uright-tooltip" data-tooltip-title="<?php echo esc_attr( __( 'Top Posts / Pages', 'google-analytics-for-wordpress' ) ); ?>" data-tooltip-description="<?php echo esc_attr( __( 'This list shows the most viewed posts and pages on your website.', 'google-analytics-for-wordpress' ) ); ?>"></div> |
@@ -563,25 +563,25 @@ discard block |
||
563 | 563 | <ul class="monsterinsights-reports-pages-list list-group"> |
564 | 564 | <?php |
565 | 565 | $i = 1; |
566 | - foreach( $data['toppages'] as $itoppages => $toppagesdata ) { |
|
567 | - $hide = $i > 10 ? ' style="display: none;" ': ''; |
|
568 | - echo '<li class="list-group-item monsterinsights-listing-table-row"' . $hide . '><span class="monsterinsights-reports-list-count">'. $i .'. </span> <span class="monsterinsights-reports-list-text">' . $toppagesdata['title'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $toppagesdata['sessions'] ) . '</span>'; |
|
566 | + foreach ( $data['toppages'] as $itoppages => $toppagesdata ) { |
|
567 | + $hide = $i > 10 ? ' style="display: none;" ' : ''; |
|
568 | + echo '<li class="list-group-item monsterinsights-listing-table-row"' . $hide . '><span class="monsterinsights-reports-list-count">' . $i . '. </span> <span class="monsterinsights-reports-list-text">' . $toppagesdata['title'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $toppagesdata['sessions'] ) . '</span>'; |
|
569 | 569 | $i++; |
570 | 570 | } |
571 | 571 | ?> |
572 | 572 | </ul> |
573 | 573 | </div> |
574 | 574 | <?php |
575 | - $referral_url = 'https://analytics.google.com/analytics/web/#report/content-pages/'. MonsterInsights()->auth->get_referral_url(); |
|
575 | + $referral_url = 'https://analytics.google.com/analytics/web/#report/content-pages/' . MonsterInsights()->auth->get_referral_url(); |
|
576 | 576 | ?> |
577 | 577 | <div class="monsterinsights-reports-panel-footer monsterinsights-reports-panel-footer-large"> |
578 | - <?php echo esc_html__( 'Show', 'google-analytics-for-wordpress' );?> |
|
579 | - <div class="monsterinsights-reports-show-selector-group btn-group" role="group" aria-label="<?php echo esc_html__( 'How many to show', 'google-analytics-for-wordpress' );?>"> |
|
578 | + <?php echo esc_html__( 'Show', 'google-analytics-for-wordpress' ); ?> |
|
579 | + <div class="monsterinsights-reports-show-selector-group btn-group" role="group" aria-label="<?php echo esc_html__( 'How many to show', 'google-analytics-for-wordpress' ); ?>"> |
|
580 | 580 | <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button ten btn btn-default active" disabled="disabled">10</button> |
581 | 581 | <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button twentyfive btn btn-default">25</button> |
582 | 582 | <button type="button" data-tid="monsterinsights-report-top-page-list" class="monsterinsights-reports-show-selector-button fifty btn btn-default">50</button> |
583 | 583 | </div> |
584 | - <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' );?>" class="monsterinsights-reports-panel-footer-button alignright" style="margin-right: 20px;"><?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' );?></a> |
|
584 | + <a href="<?php echo $referral_url; ?>" target="_blank" title="<?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' ); ?>" class="monsterinsights-reports-panel-footer-button alignright" style="margin-right: 20px;"><?php echo esc_html__( 'View Full Post/Page Report', 'google-analytics-for-wordpress' ); ?></a> |
|
585 | 585 | </div> |
586 | 586 | </div> |
587 | 587 | <?php } ?> |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | |
619 | 619 | ob_start(); ?> |
620 | 620 | <div class="monsterinsights-reports-box-datagraph" style="position:relative;"> |
621 | - <canvas id="monsterinsights-overview-<?php echo $class;?>" width="400px" height="400px"></canvas> |
|
621 | + <canvas id="monsterinsights-overview-<?php echo $class; ?>" width="400px" height="400px"></canvas> |
|
622 | 622 | <script> |
623 | 623 | jQuery(document).ready(function() { |
624 | 624 | if ( window.uorigindetected != null){ |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | } |
650 | 650 | }); |
651 | 651 | |
652 | - var ctx = document.getElementById("monsterinsights-overview-<?php echo $class;?>"); |
|
652 | + var ctx = document.getElementById("monsterinsights-overview-<?php echo $class; ?>"); |
|
653 | 653 | var data = { |
654 | 654 | labels: [<?php echo implode( ', ', $labels ); ?>], |
655 | 655 | datasets: [ |
@@ -674,8 +674,8 @@ discard block |
||
674 | 674 | pointHoverRadius: 6,//The radius of the point when hovered. |
675 | 675 | |
676 | 676 | |
677 | - labels: [<?php echo implode( ', ', $labels ); ?>], |
|
678 | - data: [<?php echo implode( ', ', $datapoints ); ?>], |
|
677 | + labels: [<?php echo implode( ', ', $labels ); ?>], |
|
678 | + data: [<?php echo implode( ', ', $datapoints ); ?>], |
|
679 | 679 | trend: [<?php echo implode( ', ', $trendpoints ); ?>], |
680 | 680 | }, |
681 | 681 | ] |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | }); |
758 | 758 | }; |
759 | 759 | |
760 | - var MonsterInsightsOverview<?php echo time();?> = new Chart(ctx, { |
|
760 | + var MonsterInsightsOverview<?php echo time(); ?> = new Chart(ctx, { |
|
761 | 761 | type: 'LineWithLine', |
762 | 762 | data: data, |
763 | 763 | plugins: [{ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | // Outputs the report. |
39 | - protected function get_report_html( $data = array() ){ |
|
39 | + protected function get_report_html( $data = array() ) { |
|
40 | 40 | ob_start(); |
41 | 41 | if ( ! empty( $data['overviewgraph']['count'] ) && $data['overviewgraph']['count'] > 0 ) { |
42 | 42 | ?> |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | foreach( $data['countries'] as $icountry => $countrydata ) { |
509 | 509 | if ( ! empty( $countries[ $countrydata['iso'] ] ) ) { |
510 | 510 | echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $i .'.</span><span class="monsterinsights-reports-country-flag monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countries[ $countrydata['iso'] ] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
511 | - } else { |
|
511 | + } else { |
|
512 | 512 | echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">'. $num .'</span><span class="monsterinsights-flag-icon monsterinsights-flag-icon-' . strtolower( $countrydata['iso'] ) . ' "></span><span class="monsterinsights-reports-list-text">' . $countrydata['iso'] . '</span><span class="monsterinsights-reports-list-number">' . number_format_i18n( $countrydata['sessions'] ) . '</span>'; |
513 | 513 | } |
514 | 514 | $i++; |