@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | ?> |
27 | 27 | <div id="monsterinsights-settings-general"> |
28 | 28 | <?php |
29 | - ?> |
|
29 | + ?> |
|
30 | 30 | <?php //Status page coming soon. ?> |
31 | 31 | <!-- <hr /> --> |
32 | 32 | </div> |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function monsterinsights_system_info() { |
42 | 42 | if ( ! empty( $_REQUEST['monsterinsights-action'] ) && $_REQUEST['monsterinsights-action'] === 'download_sysinfo' ) { |
43 | - if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
|
44 | - return; |
|
45 | - } |
|
46 | - nocache_headers(); |
|
47 | - header( 'Content-Type: text/plain' ); |
|
48 | - header( 'Content-Disposition: attachment; filename="monsterinsights-system-info.txt"' ); |
|
49 | - echo wp_strip_all_tags( $_POST['monsterinsights-sysinfo'] ); |
|
50 | - die(); |
|
43 | + if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
|
44 | + return; |
|
45 | + } |
|
46 | + nocache_headers(); |
|
47 | + header( 'Content-Type: text/plain' ); |
|
48 | + header( 'Content-Disposition: attachment; filename="monsterinsights-system-info.txt"' ); |
|
49 | + echo wp_strip_all_tags( $_POST['monsterinsights-sysinfo'] ); |
|
50 | + die(); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | //add_action( 'admin_init', 'monsterinsights_system_info' ); |
54 | 54 | \ No newline at end of file |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | 38 | |
39 | - // Populate $notices |
|
40 | - $this->notices = get_option( 'monsterinsights_notices' ); |
|
41 | - if ( ! is_array( $this->notices ) ) { |
|
42 | - $this->notices = array(); |
|
43 | - } |
|
39 | + // Populate $notices |
|
40 | + $this->notices = get_option( 'monsterinsights_notices' ); |
|
41 | + if ( ! is_array( $this->notices ) ) { |
|
42 | + $this->notices = array(); |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | */ |
56 | 56 | |
57 | 57 | public function is_dismissed( $notice ) { |
58 | - if ( ! isset( $this->notices[ $notice ] ) ) { |
|
59 | - return false; |
|
60 | - } |
|
61 | - return true; |
|
58 | + if ( ! isset( $this->notices[ $notice ] ) ) { |
|
59 | + return false; |
|
60 | + } |
|
61 | + return true; |
|
62 | 62 | |
63 | 63 | } |
64 | 64 | |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @return null |
73 | 73 | */ |
74 | 74 | public function dismiss( $notice ) { |
75 | - $this->notices[ $notice ] = true; |
|
76 | - update_option( 'monsterinsights_notices', $this->notices ); |
|
75 | + $this->notices[ $notice ] = true; |
|
76 | + update_option( 'monsterinsights_notices', $this->notices ); |
|
77 | 77 | |
78 | 78 | } |
79 | 79 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | * @return null |
89 | 89 | */ |
90 | 90 | public function undismiss( $notice ) { |
91 | - unset( $this->notices[ $notice ] ); |
|
92 | - update_option( 'monsterinsights_notices', $this->notices ); |
|
91 | + unset( $this->notices[ $notice ] ); |
|
92 | + update_option( 'monsterinsights_notices', $this->notices ); |
|
93 | 93 | |
94 | 94 | } |
95 | 95 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param bool $is_dismissible User can Dismiss Message (default: false) |
109 | 109 | */ |
110 | 110 | public function display_inline_notice( $name, $title, $message, $type = 'success', $is_dismissible = false, $args = array() ) { |
111 | - /* Available/Planned $args options |
|
111 | + /* Available/Planned $args options |
|
112 | 112 | * $args = array( |
113 | 113 | * 'primary' => array( |
114 | 114 | * 'text' => '', |
@@ -127,110 +127,110 @@ discard block |
||
127 | 127 | */ |
128 | 128 | |
129 | 129 | |
130 | - // Check if the notice is dismissible, and if so has been dismissed. |
|
131 | - if ( $is_dismissible && $this->is_dismissed( $name ) ) { |
|
132 | - // Nothing to show here, return! |
|
133 | - return ''; |
|
134 | - } |
|
130 | + // Check if the notice is dismissible, and if so has been dismissed. |
|
131 | + if ( $is_dismissible && $this->is_dismissed( $name ) ) { |
|
132 | + // Nothing to show here, return! |
|
133 | + return ''; |
|
134 | + } |
|
135 | 135 | |
136 | - $dismissible = ( $is_dismissible ) ? ' is-dismissible': ''; |
|
136 | + $dismissible = ( $is_dismissible ) ? ' is-dismissible': ''; |
|
137 | 137 | |
138 | - // Display inline notice |
|
139 | - ob_start(); |
|
140 | - ?> |
|
138 | + // Display inline notice |
|
139 | + ob_start(); |
|
140 | + ?> |
|
141 | 141 | <div class="monsterinsights-notice <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice' . $dismissible; ?>" data-notice="<?php echo esc_attr( $name ); ?>"> |
142 | 142 | <div class="monsterinsights-notice-icon <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-icon'?>"> |
143 | 143 | </div> |
144 | 144 | <div class="monsterinsights-notice-text <?php echo 'monsterinsights-' . esc_attr( $type ) . '-notice-text'?>"> |
145 | 145 | <?php |
146 | - // Title |
|
147 | - if ( ! empty ( $title ) ) { |
|
148 | - ?> |
|
146 | + // Title |
|
147 | + if ( ! empty ( $title ) ) { |
|
148 | + ?> |
|
149 | 149 | <p class="monsterinsights-notice-title"><?php echo esc_html( $title ); ?></p> |
150 | 150 | <?php |
151 | - } |
|
151 | + } |
|
152 | 152 | |
153 | - // Message |
|
154 | - if ( ! empty( $message ) ) { |
|
155 | - if ( empty( $args['skip_message_escape'] ) ) { |
|
156 | - ?> |
|
153 | + // Message |
|
154 | + if ( ! empty( $message ) ) { |
|
155 | + if ( empty( $args['skip_message_escape'] ) ) { |
|
156 | + ?> |
|
157 | 157 | <p class="monsterinsights-notice-message"><?php echo esc_html( $message ); ?></p> |
158 | 158 | <?php |
159 | - } else { |
|
160 | - ?> |
|
159 | + } else { |
|
160 | + ?> |
|
161 | 161 | <p class="monsterinsights-notice-message"><?php echo $message; ?></p> |
162 | 162 | <?php |
163 | - } |
|
164 | - } |
|
163 | + } |
|
164 | + } |
|
165 | 165 | |
166 | - // Primary Button |
|
167 | - if ( ! empty( $args['primary']['text'] ) ) { |
|
166 | + // Primary Button |
|
167 | + if ( ! empty( $args['primary']['text'] ) ) { |
|
168 | 168 | |
169 | - $text = ''; |
|
170 | - if ( ! empty( $args['primary']['text'] ) ) { |
|
171 | - $text = $args['primary']['text']; |
|
172 | - } |
|
173 | - |
|
174 | - $url = '#'; |
|
175 | - if ( ! empty( $args['primary']['url'] ) ) { |
|
176 | - $url = $args['primary']['url']; |
|
177 | - } |
|
178 | - |
|
179 | - $target = ''; |
|
180 | - if ( ! empty( $args['primary']['target'] ) && $args['primary']['target'] === 'blank') { |
|
181 | - $target = ' target="_blank" rel="noopener noreferrer"'; |
|
182 | - } |
|
183 | - |
|
184 | - $class = 'button button-primary'; |
|
185 | - if ( ! empty( $args['primary']['class'] ) ) { |
|
186 | - $class = ' class="'. $args['primary']['class'] . '"'; |
|
187 | - } |
|
188 | - ?> |
|
169 | + $text = ''; |
|
170 | + if ( ! empty( $args['primary']['text'] ) ) { |
|
171 | + $text = $args['primary']['text']; |
|
172 | + } |
|
173 | + |
|
174 | + $url = '#'; |
|
175 | + if ( ! empty( $args['primary']['url'] ) ) { |
|
176 | + $url = $args['primary']['url']; |
|
177 | + } |
|
178 | + |
|
179 | + $target = ''; |
|
180 | + if ( ! empty( $args['primary']['target'] ) && $args['primary']['target'] === 'blank') { |
|
181 | + $target = ' target="_blank" rel="noopener noreferrer"'; |
|
182 | + } |
|
183 | + |
|
184 | + $class = 'button button-primary'; |
|
185 | + if ( ! empty( $args['primary']['class'] ) ) { |
|
186 | + $class = ' class="'. $args['primary']['class'] . '"'; |
|
187 | + } |
|
188 | + ?> |
|
189 | 189 | <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class;?>><?php echo esc_html( $text ); ?></a> |
190 | 190 | <?php |
191 | - } |
|
191 | + } |
|
192 | 192 | |
193 | - // Secondary Button |
|
194 | - if ( ! empty( $args['secondary']['text'] ) ) { |
|
193 | + // Secondary Button |
|
194 | + if ( ! empty( $args['secondary']['text'] ) ) { |
|
195 | 195 | |
196 | - $text = ''; |
|
197 | - if ( ! empty( $args['secondary']['text'] ) ) { |
|
198 | - $text = $args['secondary']['text']; |
|
199 | - } |
|
200 | - |
|
201 | - $url = '#'; |
|
202 | - if ( ! empty( $args['secondary']['url'] ) ) { |
|
203 | - $url = $args['secondary']['url']; |
|
204 | - } |
|
205 | - |
|
206 | - $target = ''; |
|
207 | - if ( ! empty( $args['secondary']['target'] ) && $args['secondary']['target'] === 'blank') { |
|
208 | - $target = ' target="_blank" rel="noopener noreferrer"'; |
|
209 | - } |
|
210 | - |
|
211 | - $class = 'button button-secondary'; |
|
212 | - if ( ! empty( $args['secondary']['class'] ) ) { |
|
213 | - $class = ' class="'. $args['secondary']['class'] . '"'; |
|
214 | - } |
|
215 | - ?> |
|
196 | + $text = ''; |
|
197 | + if ( ! empty( $args['secondary']['text'] ) ) { |
|
198 | + $text = $args['secondary']['text']; |
|
199 | + } |
|
200 | + |
|
201 | + $url = '#'; |
|
202 | + if ( ! empty( $args['secondary']['url'] ) ) { |
|
203 | + $url = $args['secondary']['url']; |
|
204 | + } |
|
205 | + |
|
206 | + $target = ''; |
|
207 | + if ( ! empty( $args['secondary']['target'] ) && $args['secondary']['target'] === 'blank') { |
|
208 | + $target = ' target="_blank" rel="noopener noreferrer"'; |
|
209 | + } |
|
210 | + |
|
211 | + $class = 'button button-secondary'; |
|
212 | + if ( ! empty( $args['secondary']['class'] ) ) { |
|
213 | + $class = ' class="'. $args['secondary']['class'] . '"'; |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class;?>><?php echo esc_html( $text ); ?></a> |
217 | 217 | <?php |
218 | - } |
|
218 | + } |
|
219 | 219 | |
220 | - // Dismiss Button |
|
221 | - if ( $is_dismissible ) { |
|
222 | - ?> |
|
220 | + // Dismiss Button |
|
221 | + if ( $is_dismissible ) { |
|
222 | + ?> |
|
223 | 223 | <button type="button" class="notice-dismiss<?php echo $dismissible; ?>"> |
224 | 224 | <span class="screen-reader-text"> |
225 | 225 | <?php esc_html_e( 'Dismiss this notice', 'google-analytics-for-wordpress' ); ?> |
226 | 226 | </span> |
227 | 227 | </button> |
228 | 228 | <?php |
229 | - } |
|
230 | - ?> |
|
229 | + } |
|
230 | + ?> |
|
231 | 231 | </div> |
232 | 232 | </div> |
233 | 233 | <?php |
234 | - return ob_get_clean(); |
|
234 | + return ob_get_clean(); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function __construct( $args = array() ) { |
27 | 27 | |
28 | - parent::__construct(); |
|
28 | + parent::__construct(); |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function set_upgrader( &$upgrader ) { |
40 | 40 | |
41 | - if ( is_object( $upgrader ) ) { |
|
42 | - $this->upgrader =& $upgrader; |
|
43 | - } |
|
41 | + if ( is_object( $upgrader ) ) { |
|
42 | + $this->upgrader =& $upgrader; |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function set_result( $result ) { |
55 | 55 | |
56 | - $this->result = $result; |
|
56 | + $this->result = $result; |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | */ |
83 | 83 | function error( $errors ) { |
84 | 84 | |
85 | - if ( ! empty( $errors ) ) { |
|
86 | - echo json_encode( array( 'error' => esc_html__( 'There was an error installing the addon. Please try again.', 'google-analytics-for-wordpress' ) ) ); |
|
87 | - die; |
|
88 | - } |
|
85 | + if ( ! empty( $errors ) ) { |
|
86 | + echo json_encode( array( 'error' => esc_html__( 'There was an error installing the addon. Please try again.', 'google-analytics-for-wordpress' ) ) ); |
|
87 | + die; |
|
88 | + } |
|
89 | 89 | |
90 | 90 | } |
91 | 91 |
@@ -13,20 +13,20 @@ discard block |
||
13 | 13 | |
14 | 14 | // If this is multisite and is not on the main site, return early. |
15 | 15 | if ( is_multisite() && ! is_main_site() ) { |
16 | - return $update; |
|
16 | + return $update; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // If we don't have everything we need, return early. |
20 | 20 | $item = (array) $item; |
21 | 21 | if ( ! isset( $item['new_version'] ) || ! isset( $item['slug'] ) ) { |
22 | - return $update; |
|
22 | + return $update; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | // If the plugin isn't ours, return early. |
26 | 26 | $is_free = 'google-analytics-for-wordpress' === $item['slug']; |
27 | 27 | $is_paid = isset( $item['monsterinsights_plugin'] ); // see updater class |
28 | 28 | if ( ! $is_free && ! $is_paid ) { |
29 | - return $update; |
|
29 | + return $update; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $version = $is_free ? MONSTERINSIGHTS_LITE_VERSION : $item['old_version']; |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | |
37 | 37 | // If the opt in update allows major updates but there is no major version update, return early. |
38 | 38 | if ( $current_major < $new_major ) { |
39 | - if ( $automatic_updates === 'all' ) { |
|
40 | - return true; |
|
41 | - } else { |
|
42 | - return $update; |
|
43 | - } |
|
39 | + if ( $automatic_updates === 'all' ) { |
|
40 | + return true; |
|
41 | + } else { |
|
42 | + return $update; |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // If the opt in update allows minor updates but there is no minor version update, return early. |
47 | 47 | if ( $current_major == $new_major ) { |
48 | - if ( $automatic_updates === 'all' || $automatic_updates === 'minor' ) { |
|
49 | - return true; |
|
50 | - } else { |
|
51 | - return $update; |
|
52 | - } |
|
48 | + if ( $automatic_updates === 'all' || $automatic_updates === 'minor' ) { |
|
49 | + return true; |
|
50 | + } else { |
|
51 | + return $update; |
|
52 | + } |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // All our checks have passed - this plugin can be updated! |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | function monsterinsights_get_major_version( $version ) { |
88 | 88 | $exploded_version = explode( '.', $version ); |
89 | 89 | if ( isset( $exploded_version[2] ) ) { |
90 | - return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2]; |
|
90 | + return $exploded_version[0] . '.' . $exploded_version[1] . '.' . $exploded_version[2]; |
|
91 | 91 | } else { |
92 | - return $exploded_version[0] . '.' . $exploded_version[1] . '.0'; |
|
92 | + return $exploded_version[0] . '.' . $exploded_version[1] . '.0'; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | \ No newline at end of file |
@@ -24,9 +24,9 @@ |
||
24 | 24 | ?> |
25 | 25 | <div id="monsterinsights-settings-general"> |
26 | 26 | <?php |
27 | - // Output any notices now |
|
28 | - do_action( 'monsterinsights_settings_support_tab_notice' ); |
|
29 | - ?> |
|
27 | + // Output any notices now |
|
28 | + do_action( 'monsterinsights_settings_support_tab_notice' ); |
|
29 | + ?> |
|
30 | 30 | <?php //Status page coming soon. ?> |
31 | 31 | <!-- <hr /> --> |
32 | 32 | </div> |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
198 | - * Helper method for deleting a setting's value. |
|
199 | - * |
|
200 | - * @since 6.0.0 |
|
201 | - * @access public |
|
202 | - * |
|
203 | - * @param string $key The setting key. |
|
204 | - * @return boolean True if removed, false if not. |
|
205 | - */ |
|
198 | + * Helper method for deleting a setting's value. |
|
199 | + * |
|
200 | + * @since 6.0.0 |
|
201 | + * @access public |
|
202 | + * |
|
203 | + * @param string $key The setting key. |
|
204 | + * @return boolean True if removed, false if not. |
|
205 | + */ |
|
206 | 206 | function monsterinsights_delete_option( $key = '' ) { |
207 | 207 | // If no key, exit |
208 | 208 | if ( empty( $key ) ){ |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * Helper method for deleting multiple settings value. |
|
249 | - * |
|
250 | - * @since 6.0.0 |
|
251 | - * @access public |
|
252 | - * |
|
253 | - * @param string $key The setting key. |
|
254 | - * @return boolean True if removed, false if not. |
|
255 | - */ |
|
248 | + * Helper method for deleting multiple settings value. |
|
249 | + * |
|
250 | + * @since 6.0.0 |
|
251 | + * @access public |
|
252 | + * |
|
253 | + * @param string $key The setting key. |
|
254 | + * @return boolean True if removed, false if not. |
|
255 | + */ |
|
256 | 256 | function monsterinsights_delete_options( $keys = array() ) { |
257 | 257 | // If no keys, exit |
258 | 258 | if ( empty( $keys ) || ! is_array( $keys ) ){ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return array Array of the options to use. |
59 | 59 | */ |
60 | 60 | public function frontend_tracking_options( ) { |
61 | - return array(); |
|
61 | + return array(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | * @return string Javascript to output. |
75 | 75 | */ |
76 | 76 | public function frontend_output( ) { |
77 | - return "<!-- MonsterInsights Abstract Tracking class -->"; |
|
77 | + return "<!-- MonsterInsights Abstract Tracking class -->"; |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | \ No newline at end of file |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return array Array of the options to use. |
58 | 58 | */ |
59 | 59 | public function frontend_tracking_options( ) { |
60 | - return array(); |
|
60 | + return array(); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | * @return string Javascript to output. |
74 | 74 | */ |
75 | 75 | public function frontend_output( ) { |
76 | - $output = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->'; |
|
77 | - $output .= '<!-- ' . esc_html__( "You are currently in a preview window. MonsterInsights doesn't track preview window traffic to avoid false visit reports.", 'google-analytics-for-wordpress' ) . ' -->'; |
|
78 | - $output .= '<!-- / Google Analytics by MonsterInsights -->'; |
|
79 | - return $output; |
|
76 | + $output = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->'; |
|
77 | + $output .= '<!-- ' . esc_html__( "You are currently in a preview window. MonsterInsights doesn't track preview window traffic to avoid false visit reports.", 'google-analytics-for-wordpress' ) . ' -->'; |
|
78 | + $output .= '<!-- / Google Analytics by MonsterInsights -->'; |
|
79 | + return $output; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return array Array of the options to use. |
59 | 59 | */ |
60 | 60 | public function frontend_tracking_options( ) { |
61 | - return array(); |
|
61 | + return array(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | * @return string Javascript to output. |
75 | 75 | */ |
76 | 76 | public function frontend_output( ) { |
77 | - $output = PHP_EOL . '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->' . PHP_EOL; |
|
78 | - $ua = monsterinsights_get_ua(); |
|
79 | - if ( empty( $ua ) ) { |
|
80 | - $output .= '<!-- ' . esc_html__( 'MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
81 | - } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
|
82 | - $output .= '<!-- ' . esc_html__( 'MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data. To view the Google Analytics code, view the source code either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
83 | - } else { |
|
84 | - $output .= '<!-- ' . esc_html__( 'The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
85 | - } |
|
86 | - $output .= '<!-- / Google Analytics by MonsterInsights -->' . PHP_EOL . PHP_EOL; |
|
87 | - return $output; |
|
77 | + $output = PHP_EOL . '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->' . PHP_EOL; |
|
78 | + $ua = monsterinsights_get_ua(); |
|
79 | + if ( empty( $ua ) ) { |
|
80 | + $output .= '<!-- ' . esc_html__( 'MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
81 | + } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
|
82 | + $output .= '<!-- ' . esc_html__( 'MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data. To view the Google Analytics code, view the source code either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
83 | + } else { |
|
84 | + $output .= '<!-- ' . esc_html__( 'The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; |
|
85 | + } |
|
86 | + $output .= '<!-- / Google Analytics by MonsterInsights -->' . PHP_EOL . PHP_EOL; |
|
87 | + return $output; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | \ No newline at end of file |