@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | |
99 | 99 | if ( $create && ! empty( $create ) && is_array( $create ) ) { |
100 | 100 | $create = json_encode( $create ); |
101 | - $create = str_replace( '"', "'", $create ); |
|
102 | - $options['create'] = "'create', '" . esc_js( $ua_code ). "', '" . esc_js( $domain ) . "', " . $create; |
|
101 | + $create = str_replace( '"', "'", $create ); |
|
102 | + $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "', " . $create; |
|
103 | 103 | } else { |
104 | 104 | $options['create'] = "'create', '" . esc_js( $ua_code ) . "', '" . esc_js( $domain ) . "'"; |
105 | 105 | } |
@@ -175,21 +175,21 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function frontend_output( ) { |
177 | 177 | $options = $this->frontend_tracking_options(); |
178 | - $is_debug_mode = monsterinsights_is_debug_mode(); |
|
179 | - $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
|
178 | + $is_debug_mode = monsterinsights_is_debug_mode(); |
|
179 | + $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
|
180 | 180 | if ( current_user_can( 'manage_options' ) && $is_debug_mode ) { |
181 | - $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' ); |
|
181 | + $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics_debug.js' ); |
|
182 | 182 | } |
183 | 183 | $compat = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
184 | - $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
|
184 | + $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
|
185 | 185 | $track_user = monsterinsights_track_user(); |
186 | 186 | $ua = monsterinsights_get_ua(); |
187 | 187 | $output = ''; |
188 | 188 | $reason = ''; |
189 | - $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
189 | + $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
190 | 190 | $attr_string = ''; |
191 | 191 | if ( ! empty( $attributes ) ) { |
192 | - foreach( $attributes as $attr_name => $attr_value ) { |
|
192 | + foreach ( $attributes as $attr_name => $attr_value ) { |
|
193 | 193 | if ( ! empty( $attr_name ) ) { |
194 | 194 | $attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"'; |
195 | 195 | } else { |
@@ -203,21 +203,21 @@ discard block |
||
203 | 203 | <?php if ( ! $track_user ) { |
204 | 204 | if ( empty( $ua ) ) { |
205 | 205 | $reason = __( 'Note: MonsterInsights is not currently configured on this site. The site owner needs to authenticate with Google Analytics in the MonsterInsights settings panel.', 'google-analytics-for-wordpress' ); |
206 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
206 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
207 | 207 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
208 | - $reason = __( 'Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.'. PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
209 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
208 | + $reason = __( 'Note: MonsterInsights does not track you as a logged in site administrator to prevent site owners from accidentally skewing their own Google Analytics data.' . PHP_EOL . 'If you are testing Google Analytics code, please do so either logged out or in the private browsing/incognito mode of your web browser.', 'google-analytics-for-wordpress' ); |
|
209 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
210 | 210 | } else { |
211 | 211 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
212 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
212 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
213 | 213 | } |
214 | 214 | echo $output; |
215 | 215 | } ?> |
216 | 216 | <?php if ( $ua ) { ?> |
217 | -<script<?php echo $attr_string;?>> |
|
217 | +<script<?php echo $attr_string; ?>> |
|
218 | 218 | var mi_version = '<?php echo MONSTERINSIGHTS_VERSION; ?>'; |
219 | 219 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
220 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
220 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
221 | 221 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
222 | 222 | |
223 | 223 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | ?> |
266 | 266 | } else { |
267 | 267 | <?php if ( $this->should_do_optout() ) { ?> |
268 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
268 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
269 | 269 | (function() { |
270 | 270 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
271 | 271 | var noopfn = function() { |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | var f = arguments[len-1]; |
290 | 290 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
291 | - console.log( '<?php echo esc_js( __("Not running function", "google-analytics-for-wordpress" ) );?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) );?> " + mi_no_track_reason ); |
|
291 | + console.log( '<?php echo esc_js( __( "Not running function", "google-analytics-for-wordpress" ) ); ?> __gaTracker(' + arguments[0] + " ....) <?php echo esc_js( __( "because you are not being tracked.", 'google-analytics-for-wordpress' ) ); ?> " + mi_no_track_reason ); |
|
292 | 292 | return; |
293 | 293 | } |
294 | 294 | try { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | function monsterinsights_update_option( $key = '', $value = false ) { |
147 | 147 | |
148 | 148 | // If no key, exit |
149 | - if ( empty( $key ) ){ |
|
149 | + if ( empty( $key ) ) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | //} |
187 | 187 | |
188 | 188 | // If it updated, let's update the global variable |
189 | - if ( $did_update ){ |
|
189 | + if ( $did_update ) { |
|
190 | 190 | global $monsterinsights_settings; |
191 | 191 | $monsterinsights_settings[ $key ] = $value; |
192 | 192 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | function monsterinsights_delete_option( $key = '' ) { |
207 | 207 | // If no key, exit |
208 | - if ( empty( $key ) ){ |
|
208 | + if ( empty( $key ) ) { |
|
209 | 209 | return false; |
210 | 210 | } |
211 | 211 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | //} |
237 | 237 | |
238 | 238 | // If it updated, let's update the global variable |
239 | - if ( $did_update ){ |
|
239 | + if ( $did_update ) { |
|
240 | 240 | global $monsterinsights_settings; |
241 | 241 | $monsterinsights_settings = $settings; |
242 | 242 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function monsterinsights_delete_options( $keys = array() ) { |
257 | 257 | // If no keys, exit |
258 | - if ( empty( $keys ) || ! is_array( $keys ) ){ |
|
258 | + if ( empty( $keys ) || ! is_array( $keys ) ) { |
|
259 | 259 | return false; |
260 | 260 | } |
261 | 261 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | //} |
289 | 289 | |
290 | 290 | // If it updated, let's update the global variable |
291 | - if ( $did_update ){ |
|
291 | + if ( $did_update ) { |
|
292 | 292 | global $monsterinsights_settings; |
293 | 293 | $monsterinsights_settings = $settings; |
294 | 294 | } |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | $data['usagetracking'] = get_option( 'monsterinsights_usage_tracking_config', false ); |
95 | 95 | $data['usercount'] = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set'; |
96 | 96 | $data['usesauth'] = $usesauth; |
97 | - $data['timezoneoffset']= date('P'); |
|
98 | - $data['installed_lite']= get_option( 'monsterinsights_installed_lite', array() ); |
|
97 | + $data['timezoneoffset'] = date( 'P' ); |
|
98 | + $data['installed_lite'] = get_option( 'monsterinsights_installed_lite', array() ); |
|
99 | 99 | $data['installed_pro'] = get_option( 'monsterinsights_installed_pro', array() ); |
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | 103 | // Retrieve current plugin information |
104 | - if( ! function_exists( 'get_plugins' ) ) { |
|
104 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
105 | 105 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
106 | 106 | } |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ( $plugins as $key => $plugin ) { |
112 | 112 | if ( in_array( $plugin, $active_plugins ) ) { |
113 | 113 | // Remove active plugins from list so we can show active and inactive separately |
114 | - unset( $plugins[ $key ] ); |
|
114 | + unset( $plugins[$key] ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
132 | - if( ! $this->tracking_allowed() && ! $override ) { |
|
132 | + if ( ! $this->tracking_allowed() && ! $override ) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | public function schedule_send() { |
162 | 162 | if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) { |
163 | 163 | $tracking = array(); |
164 | - $tracking['day'] = rand( 0, 6 ); |
|
164 | + $tracking['day'] = rand( 0, 6 ); |
|
165 | 165 | $tracking['hour'] = rand( 0, 23 ); |
166 | 166 | $tracking['minute'] = rand( 0, 59 ); |
167 | 167 | $tracking['second'] = rand( 0, 59 ); |
168 | - $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
169 | - ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
168 | + $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
169 | + ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
170 | 170 | ( $tracking['minute'] * MINUTE_IN_SECONDS ) + |
171 | 171 | $tracking['second']; |
172 | - $tracking['initsend'] = strtotime("next sunday") + $tracking['offset']; |
|
172 | + $tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset']; |
|
173 | 173 | |
174 | 174 | wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' ); |
175 | 175 | update_option( 'monsterinsights_usage_tracking_config', $tracking ); |
@@ -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'] >= time() && |
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 want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %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>','<strong><a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'">' . $this->level,'</a></strong>' ); ?></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="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'"><strong>','</strong></a>', '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', '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 want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %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>', '<strong><a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '">' . $this->level, '</a></strong>' ); ?></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="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '"><strong>', '</strong></a>', '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', '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="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'">' . $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="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', '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="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '">' . $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="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', '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"> |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * @return string |
366 | 366 | */ |
367 | 367 | public function get_addons_page_link() { |
368 | - $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
368 | + $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
369 | 369 | return sprintf( '<a href="%1$s">%2$s</a>', $addons_url, esc_html__( 'Visit addons page', 'google-analytics-for-wordpress' ) ); |
370 | 370 | } |
371 | 371 |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $datapoints = array(); |
92 | - foreach ( $data[ $class ]['datapoints'] as $datapoint ) { |
|
92 | + foreach ( $data[$class]['datapoints'] as $datapoint ) { |
|
93 | 93 | $datapoints[] = esc_js( $datapoint ); |
94 | 94 | } |
95 | 95 | |
96 | 96 | $trendpoints = array(); |
97 | - foreach ( $data[ $class ]['trendpoints'] as $trendpoint ) { |
|
97 | + foreach ( $data[$class]['trendpoints'] as $trendpoint ) { |
|
98 | 98 | $trendpoints[] = esc_js( $trendpoint ); |
99 | 99 | } |
100 | 100 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | } ); |
134 | 134 | |
135 | - var ctx = document.getElementById( "monsterinsights-overview-<?php echo $class;?>" ); |
|
135 | + var ctx = document.getElementById( "monsterinsights-overview-<?php echo $class; ?>" ); |
|
136 | 136 | var data = { |
137 | 137 | labels: [<?php echo implode( ', ', $labels ); ?>], |
138 | 138 | datasets: [ |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | pointHoverRadius: 6,//The radius of the point when hovered. |
158 | 158 | |
159 | 159 | |
160 | - labels: [<?php echo implode( ', ', $labels ); ?>], |
|
161 | - data: [<?php echo implode( ', ', $datapoints ); ?>], |
|
160 | + labels: [<?php echo implode( ', ', $labels ); ?>], |
|
161 | + data: [<?php echo implode( ', ', $datapoints ); ?>], |
|
162 | 162 | trend: [<?php echo implode( ', ', $trendpoints ); ?>], |
163 | 163 | }, |
164 | 164 | ] |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | } ); |
247 | 247 | }; |
248 | 248 | |
249 | - var MonsterInsightsOverview<?php echo time();?> = new Chart( ctx, { |
|
249 | + var MonsterInsightsOverview<?php echo time(); ?> = new Chart( ctx, { |
|
250 | 250 | type: 'LineWithLine', |
251 | 251 | data: data, |
252 | 252 | plugins: [ |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | $countries = monsterinsights_get_country_list( true ); |
868 | 868 | $i = 1; |
869 | 869 | foreach ( $data['countries'] as $icountry => $countrydata ) { |
870 | - if ( ! empty( $countries[ $countrydata['iso'] ] ) ) { |
|
871 | - 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></li>'; |
|
870 | + if ( ! empty( $countries[$countrydata['iso']] ) ) { |
|
871 | + 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></li>'; |
|
872 | 872 | } else { |
873 | 873 | echo '<li class="list-group-item"><span class="monsterinsights-reports-list-count">' . $i . '</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></li>'; |
874 | 874 | } |
875 | - $i ++; |
|
875 | + $i++; |
|
876 | 876 | } |
877 | 877 | ?> |
878 | 878 | </ul> |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | . number_format_i18n( $referralsdata['sessions'] ) . |
914 | 914 | '</span>' . |
915 | 915 | '</li>'; |
916 | - $i ++; |
|
916 | + $i++; |
|
917 | 917 | } |
918 | 918 | ?> |
919 | 919 | </ul> |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | number_format_i18n( $toppagesdata['sessions'] ) . |
960 | 960 | '</span>' . |
961 | 961 | '</li>'; |
962 | - $i ++; |
|
962 | + $i++; |
|
963 | 963 | } |
964 | 964 | ?> |
965 | 965 | </ul> |
@@ -155,32 +155,32 @@ discard block |
||
155 | 155 | 'copytoclip' => esc_html__( 'Copy to Clipboard', 'google-analytics-for-wordpress' ), |
156 | 156 | 'failed' => esc_html__( 'Failed!', 'google-analytics-for-wordpress' ), |
157 | 157 | 'admin_nonce' => wp_create_nonce( 'mi-admin-nonce' ), |
158 | - 'shorten' => esc_html__( 'Shorten URL' ,'google-analytics-for-wordpress'), |
|
159 | - 'shortened' => esc_html__( 'Shortened!' ,'google-analytics-for-wordpress'), |
|
160 | - 'working' => esc_html__( 'Working...' ,'google-analytics-for-wordpress'), |
|
161 | - 'importtext' => esc_html__( 'Import' ,'google-analytics-for-wordpress'), |
|
162 | - 'imported' => esc_html__( 'Imported!' ,'google-analytics-for-wordpress'), |
|
163 | - 'redirect_loading_title_text' => esc_html__( 'Preparing to redirect:' ,'google-analytics-for-wordpress'), |
|
164 | - 'redirect_loading_text_text' => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
165 | - 'redirect_loading_error_title' => esc_html__( "Authentication Error:" ,'google-analytics-for-wordpress'), |
|
166 | - 'deauth_loading_title_text' => esc_html__( 'Deauthenticating....' ,'google-analytics-for-wordpress'), |
|
167 | - 'deauth_loading_text_text' => esc_html__( "We're deactivating your site. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
168 | - 'deauth_loading_error_title' => esc_html__( "Deactivation Error:" ,'google-analytics-for-wordpress'), |
|
169 | - 'deauth_success_title_text' => esc_html__( 'Deactivated Successfully!' ,'google-analytics-for-wordpress'), |
|
170 | - 'deauth_success_text_text' => esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore." ,'google-analytics-for-wordpress'), |
|
171 | - 'verify_loading_title_text' => esc_html__( 'Verifying....' ,'google-analytics-for-wordpress'), |
|
172 | - 'verify_loading_text_text' => esc_html__( "We're verifying your site. This may take a couple seconds." ,'google-analytics-for-wordpress'), |
|
173 | - 'verify_loading_error_title' => esc_html__( "Verification Error:" ,'google-analytics-for-wordpress'), |
|
174 | - 'verify_success_title_text' => esc_html__( 'Verified Successfully!' ,'google-analytics-for-wordpress'), |
|
175 | - 'verify_success_text_text' => esc_html__( "Your site is connected to MonsterInsights!" ,'google-analytics-for-wordpress'), |
|
176 | - 'ok_text' => esc_html__( "OK" ,'google-analytics-for-wordpress'), |
|
177 | - 'force_deauth_button_text' => esc_html__( "Force Deauthenticate" ,'google-analytics-for-wordpress'), |
|
158 | + 'shorten' => esc_html__( 'Shorten URL', 'google-analytics-for-wordpress' ), |
|
159 | + 'shortened' => esc_html__( 'Shortened!', 'google-analytics-for-wordpress' ), |
|
160 | + 'working' => esc_html__( 'Working...', 'google-analytics-for-wordpress' ), |
|
161 | + 'importtext' => esc_html__( 'Import', 'google-analytics-for-wordpress' ), |
|
162 | + 'imported' => esc_html__( 'Imported!', 'google-analytics-for-wordpress' ), |
|
163 | + 'redirect_loading_title_text' => esc_html__( 'Preparing to redirect:', 'google-analytics-for-wordpress' ), |
|
164 | + 'redirect_loading_text_text' => esc_html__( "You'll be redirected momentarily to complete authentication. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
165 | + 'redirect_loading_error_title' => esc_html__( "Authentication Error:", 'google-analytics-for-wordpress' ), |
|
166 | + 'deauth_loading_title_text' => esc_html__( 'Deauthenticating....', 'google-analytics-for-wordpress' ), |
|
167 | + 'deauth_loading_text_text' => esc_html__( "We're deactivating your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
168 | + 'deauth_loading_error_title' => esc_html__( "Deactivation Error:", 'google-analytics-for-wordpress' ), |
|
169 | + 'deauth_success_title_text' => esc_html__( 'Deactivated Successfully!', 'google-analytics-for-wordpress' ), |
|
170 | + 'deauth_success_text_text' => esc_html__( "You've disconnected your site from MonsterInsights. Your site is no longer being tracked by Google Analytics and you won't see reports anymore.", 'google-analytics-for-wordpress' ), |
|
171 | + 'verify_loading_title_text' => esc_html__( 'Verifying....', 'google-analytics-for-wordpress' ), |
|
172 | + 'verify_loading_text_text' => esc_html__( "We're verifying your site. This may take a couple seconds.", 'google-analytics-for-wordpress' ), |
|
173 | + 'verify_loading_error_title' => esc_html__( "Verification Error:", 'google-analytics-for-wordpress' ), |
|
174 | + 'verify_success_title_text' => esc_html__( 'Verified Successfully!', 'google-analytics-for-wordpress' ), |
|
175 | + 'verify_success_text_text' => esc_html__( "Your site is connected to MonsterInsights!", 'google-analytics-for-wordpress' ), |
|
176 | + 'ok_text' => esc_html__( "OK", 'google-analytics-for-wordpress' ), |
|
177 | + 'force_deauth_button_text' => esc_html__( "Force Deauthenticate", 'google-analytics-for-wordpress' ), |
|
178 | 178 | 'refresh_report_title' => esc_html__( 'Refreshing Report', 'google-analytics-for-wordpress' ), |
179 | 179 | 'refresh_report_text' => esc_html__( 'Loading new report data...', 'google-analytics-for-wordpress' ), |
180 | 180 | 'refresh_report_success_text' => esc_html__( 'Success', 'google-analytics-for-wordpress' ), |
181 | 181 | 'refresh_report_success_text' => esc_html__( 'Retrieved the new report data successfully', 'google-analytics-for-wordpress' ), |
182 | 182 | 'refresh_report_failure_title' => esc_html__( 'Error', 'google-analytics-for-wordpress' ), |
183 | - 'timezone' => date('e'), |
|
183 | + 'timezone' => date( 'e' ), |
|
184 | 184 | ) |
185 | 185 | ); |
186 | 186 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | 'kad_admin_js', // Pinnacle theme |
243 | 243 | 'dt-chart', // DesignThemes core features plugin |
244 | 244 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
245 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
245 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
246 | 246 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
247 | 247 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
248 | 248 | 'imagify-promise-polyfill', // Imagify |
@@ -261,16 +261,16 @@ discard block |
||
261 | 261 | 'rml-modal', // WP Real Media Library |
262 | 262 | 'rml-order', // WP Real Media Library |
263 | 263 | 'rml-meta', // WP Real Media Library |
264 | - 'rml-uploader', // WP Real Media Library |
|
265 | - 'rml-options', // WP Real Media Library |
|
266 | - 'rml-usersettings', // WP Real Media Library |
|
264 | + 'rml-uploader', // WP Real Media Library |
|
265 | + 'rml-options', // WP Real Media Library |
|
266 | + 'rml-usersettings', // WP Real Media Library |
|
267 | 267 | 'rml-main', // WP Real Media Library |
268 | 268 | 'control-panel-sweet-alert', // Ken Theme |
269 | 269 | 'sweet-alert-js', // Vitrine Theme |
270 | 270 | 'theme-admin-script', // Vitrine Theme |
271 | 271 | 'sweetalert', // Church Suite Theme by Webnus |
272 | 272 | 'be_alerts_charts', // WooCommerce bolder product alerts |
273 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
273 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
274 | 274 | 'control-panel-sweet-alert', // Ken Theme |
275 | 275 | 'cpm_chart', // WP Project Manager |
276 | 276 | 'adminscripts', // Artisan Nayma Theme |
@@ -343,15 +343,15 @@ discard block |
||
343 | 343 | |
344 | 344 | global $wp_styles; |
345 | 345 | foreach ( $wp_styles->queue as $handle ) { |
346 | - if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content') === false ) { |
|
346 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
347 | 347 | return; |
348 | 348 | } |
349 | 349 | |
350 | - if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
350 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
351 | 351 | return; |
352 | 352 | } |
353 | 353 | |
354 | - foreach( $third_party as $partial ) { |
|
354 | + foreach ( $third_party as $partial ) { |
|
355 | 355 | if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
356 | 356 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
357 | 357 | wp_deregister_style( $handle ); |
@@ -366,15 +366,15 @@ discard block |
||
366 | 366 | |
367 | 367 | global $wp_scripts; |
368 | 368 | foreach ( $wp_scripts->queue as $handle ) { |
369 | - if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content') === false ) { |
|
369 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
370 | 370 | return; |
371 | 371 | } |
372 | 372 | |
373 | - if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
373 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
374 | 374 | return; |
375 | 375 | } |
376 | 376 | |
377 | - foreach( $third_party as $partial ) { |
|
377 | + foreach ( $third_party as $partial ) { |
|
378 | 378 | if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
379 | 379 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
380 | 380 | wp_deregister_script( $handle ); |
@@ -389,47 +389,47 @@ discard block |
||
389 | 389 | |
390 | 390 | // Remove actions from themes that are not following best practices and break the admin doing so |
391 | 391 | // Theme: Newspaper by tagDiv |
392 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_js'); |
|
393 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_css'); |
|
394 | - remove_action('admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic'); |
|
395 | - remove_action('admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic'); |
|
396 | - remove_action('admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999); |
|
397 | - remove_action('print_media_templates', 'td_custom_gallery_settings_hook'); |
|
398 | - remove_action('print_media_templates', 'td_change_backbone_js_hook'); |
|
399 | - remove_action('admin_head', 'tdc_on_admin_head'); // TagDiv Composer Fix |
|
400 | - remove_action('print_media_templates', 'us_media_templates'); // Impreza Theme Fix |
|
401 | - remove_action('admin_footer', 'gt3pg_add_gallery_template'); // GT3 Photo & Video Gallery By GT3 Themes Plugin Fix |
|
392 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_js' ); |
|
393 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_css' ); |
|
394 | + remove_action( 'admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic' ); |
|
395 | + remove_action( 'admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic' ); |
|
396 | + remove_action( 'admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999 ); |
|
397 | + remove_action( 'print_media_templates', 'td_custom_gallery_settings_hook' ); |
|
398 | + remove_action( 'print_media_templates', 'td_change_backbone_js_hook' ); |
|
399 | + remove_action( 'admin_head', 'tdc_on_admin_head' ); // TagDiv Composer Fix |
|
400 | + remove_action( 'print_media_templates', 'us_media_templates' ); // Impreza Theme Fix |
|
401 | + remove_action( 'admin_footer', 'gt3pg_add_gallery_template' ); // GT3 Photo & Video Gallery By GT3 Themes Plugin Fix |
|
402 | 402 | // Plugin WP Booklist: |
403 | - remove_action('admin_footer', 'wpbooklist_jre_dismiss_prem_notice_forever_action_javascript'); |
|
404 | - remove_action('admin_footer', 'wpbooklist_dashboard_add_book_action_javascript'); |
|
405 | - remove_action('admin_footer', 'wpbooklist_edit_book_show_form_action_javascript'); |
|
406 | - remove_action('admin_footer', 'wpbooklist_show_book_in_colorbox_action_javascript'); |
|
407 | - remove_action('admin_footer', 'wpbooklist_new_lib_shortcode_action_javascript'); |
|
408 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_library_display_options_action_javascript'); |
|
409 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_post_display_options_action_javascript'); |
|
410 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_page_display_options_action_javascript'); |
|
411 | - remove_action('admin_footer', 'wpbooklist_update_display_options_action_javascript'); |
|
412 | - remove_action('admin_footer', 'wpbooklist_edit_book_pagination_action_javascript'); |
|
413 | - remove_action('admin_footer', 'wpbooklist_edit_book_switch_lib_action_javascript'); |
|
414 | - remove_action('admin_footer', 'wpbooklist_edit_book_search_action_javascript'); |
|
415 | - remove_action('admin_footer', 'wpbooklist_edit_book_actual_action_javascript'); |
|
416 | - remove_action('admin_footer', 'wpbooklist_delete_book_action_javascript'); |
|
417 | - remove_action('admin_footer', 'wpbooklist_user_apis_action_javascript'); |
|
418 | - remove_action('admin_footer', 'wpbooklist_upload_new_stylepak_action_javascript'); |
|
419 | - remove_action('admin_footer', 'wpbooklist_upload_new_post_template_action_javascript'); |
|
420 | - remove_action('admin_footer', 'wpbooklist_upload_new_page_template_action_javascript'); |
|
421 | - remove_action('admin_footer', 'wpbooklist_create_db_library_backup_action_javascript'); |
|
422 | - remove_action('admin_footer', 'wpbooklist_restore_db_library_backup_action_javascript'); |
|
423 | - remove_action('admin_footer', 'wpbooklist_create_csv_action_javascript'); |
|
424 | - remove_action('admin_footer', 'wpbooklist_amazon_localization_action_javascript'); |
|
425 | - remove_action('admin_footer', 'wpbooklist_delete_book_bulk_action_javascript'); |
|
426 | - remove_action('admin_footer', 'wpbooklist_reorder_action_javascript'); |
|
427 | - remove_action('admin_footer', 'wpbooklist_exit_results_action_javascript'); |
|
428 | - remove_action('admin_footer', 'wpbooklist_storytime_select_category_action_javascript'); |
|
429 | - remove_action('admin_footer', 'wpbooklist_storytime_get_story_action_javascript'); |
|
430 | - remove_action('admin_footer', 'wpbooklist_storytime_expand_browse_action_javascript'); |
|
431 | - remove_action('admin_footer', 'wpbooklist_storytime_save_settings_action_javascript'); |
|
432 | - remove_action('admin_footer', 'wpbooklist_delete_story_action_javascript'); |
|
403 | + remove_action( 'admin_footer', 'wpbooklist_jre_dismiss_prem_notice_forever_action_javascript' ); |
|
404 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_add_book_action_javascript' ); |
|
405 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_show_form_action_javascript' ); |
|
406 | + remove_action( 'admin_footer', 'wpbooklist_show_book_in_colorbox_action_javascript' ); |
|
407 | + remove_action( 'admin_footer', 'wpbooklist_new_lib_shortcode_action_javascript' ); |
|
408 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_library_display_options_action_javascript' ); |
|
409 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_post_display_options_action_javascript' ); |
|
410 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_page_display_options_action_javascript' ); |
|
411 | + remove_action( 'admin_footer', 'wpbooklist_update_display_options_action_javascript' ); |
|
412 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_pagination_action_javascript' ); |
|
413 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_switch_lib_action_javascript' ); |
|
414 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_search_action_javascript' ); |
|
415 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_actual_action_javascript' ); |
|
416 | + remove_action( 'admin_footer', 'wpbooklist_delete_book_action_javascript' ); |
|
417 | + remove_action( 'admin_footer', 'wpbooklist_user_apis_action_javascript' ); |
|
418 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_stylepak_action_javascript' ); |
|
419 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_post_template_action_javascript' ); |
|
420 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_page_template_action_javascript' ); |
|
421 | + remove_action( 'admin_footer', 'wpbooklist_create_db_library_backup_action_javascript' ); |
|
422 | + remove_action( 'admin_footer', 'wpbooklist_restore_db_library_backup_action_javascript' ); |
|
423 | + remove_action( 'admin_footer', 'wpbooklist_create_csv_action_javascript' ); |
|
424 | + remove_action( 'admin_footer', 'wpbooklist_amazon_localization_action_javascript' ); |
|
425 | + remove_action( 'admin_footer', 'wpbooklist_delete_book_bulk_action_javascript' ); |
|
426 | + remove_action( 'admin_footer', 'wpbooklist_reorder_action_javascript' ); |
|
427 | + remove_action( 'admin_footer', 'wpbooklist_exit_results_action_javascript' ); |
|
428 | + remove_action( 'admin_footer', 'wpbooklist_storytime_select_category_action_javascript' ); |
|
429 | + remove_action( 'admin_footer', 'wpbooklist_storytime_get_story_action_javascript' ); |
|
430 | + remove_action( 'admin_footer', 'wpbooklist_storytime_expand_browse_action_javascript' ); |
|
431 | + remove_action( 'admin_footer', 'wpbooklist_storytime_save_settings_action_javascript' ); |
|
432 | + remove_action( 'admin_footer', 'wpbooklist_delete_story_action_javascript' ); |
|
433 | 433 | } |
434 | 434 | add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 ); |
435 | 435 | |
@@ -441,65 +441,65 @@ discard block |
||
441 | 441 | * |
442 | 442 | * @return null Return early if not on the proper screen. |
443 | 443 | */ |
444 | -function hide_non_monsterinsights_warnings () { |
|
444 | +function hide_non_monsterinsights_warnings() { |
|
445 | 445 | // Bail if we're not on a MonsterInsights screen. |
446 | 446 | if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], 'monsterinsights' ) === false ) { |
447 | 447 | return; |
448 | 448 | } |
449 | 449 | |
450 | 450 | global $wp_filter; |
451 | - if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
452 | - foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
451 | + if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
452 | + foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
453 | 453 | foreach ( $hooks as $name => $arr ) { |
454 | 454 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
455 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
455 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
456 | 456 | continue; |
457 | 457 | } |
458 | 458 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
459 | 459 | continue; |
460 | 460 | } |
461 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
461 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
462 | 462 | unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
463 | 463 | } |
464 | 464 | } |
465 | 465 | } |
466 | 466 | } |
467 | 467 | |
468 | - if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
469 | - foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
468 | + if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
469 | + foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
470 | 470 | foreach ( $hooks as $name => $arr ) { |
471 | 471 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
472 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
472 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
473 | 473 | continue; |
474 | 474 | } |
475 | 475 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
476 | 476 | continue; |
477 | 477 | } |
478 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
478 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
479 | 479 | unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
480 | 480 | } |
481 | 481 | } |
482 | 482 | } |
483 | 483 | } |
484 | 484 | |
485 | - if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
486 | - foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
485 | + if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
486 | + foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
487 | 487 | foreach ( $hooks as $name => $arr ) { |
488 | 488 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
489 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
489 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
490 | 490 | continue; |
491 | 491 | } |
492 | 492 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
493 | 493 | continue; |
494 | 494 | } |
495 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
495 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
496 | 496 | unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
497 | 497 | } |
498 | 498 | } |
499 | 499 | } |
500 | 500 | } |
501 | 501 | } |
502 | -add_action('admin_print_scripts', 'hide_non_monsterinsights_warnings'); |
|
502 | +add_action( 'admin_print_scripts', 'hide_non_monsterinsights_warnings' ); |
|
503 | 503 | |
504 | 504 | /** |
505 | 505 | * Called whenever an upgrade button / link is displayed in Lite, this function will |
@@ -528,33 +528,33 @@ discard block |
||
528 | 528 | } |
529 | 529 | |
530 | 530 | // Get the ShareASale ID |
531 | - $shareasale_id = monsterinsights_get_shareasale_id(); |
|
531 | + $shareasale_id = monsterinsights_get_shareasale_id(); |
|
532 | 532 | |
533 | 533 | // If we have a shareasale ID return the shareasale url |
534 | 534 | if ( ! empty( $shareasale_id ) ) { |
535 | - $shareasale_id = absint( $shareasale_id ); |
|
535 | + $shareasale_id = absint( $shareasale_id ); |
|
536 | 536 | return esc_url( monsterinsights_get_shareasale_url( $shareasale_id, $url ) ); |
537 | 537 | } else { |
538 | 538 | return esc_url( $url ); |
539 | 539 | } |
540 | 540 | } |
541 | 541 | |
542 | -function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true ) { |
|
542 | +function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true ) { |
|
543 | 543 | // Setup Campaign variables |
544 | - $source = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin'; |
|
545 | - $medium = ! empty( $medium ) ? $medium : 'defaultmedium'; |
|
546 | - $campaign = ! empty( $campaign ) ? $campaign : 'defaultcampaign'; |
|
547 | - $content = MONSTERINSIGHTS_VERSION; |
|
548 | - $default_url = monsterinsights_is_pro_version() ? '' : 'lite/'; |
|
544 | + $source = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin'; |
|
545 | + $medium = ! empty( $medium ) ? $medium : 'defaultmedium'; |
|
546 | + $campaign = ! empty( $campaign ) ? $campaign : 'defaultcampaign'; |
|
547 | + $content = MONSTERINSIGHTS_VERSION; |
|
548 | + $default_url = monsterinsights_is_pro_version() ? '' : 'lite/'; |
|
549 | 549 | $url = ! empty( $url ) ? $url : 'https://www.monsterinsights.com/' . $default_url; |
550 | 550 | |
551 | 551 | // Put together redirect URL |
552 | 552 | $url = add_query_arg( |
553 | 553 | array( |
554 | - 'utm_source' => $source, // Pro/Lite Plugin |
|
555 | - 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
554 | + 'utm_source' => $source, // Pro/Lite Plugin |
|
555 | + 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
556 | 556 | 'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report) |
557 | - 'utm_content' => $content, // Version number of MI |
|
557 | + 'utm_content' => $content, // Version number of MI |
|
558 | 558 | ), |
559 | 559 | trailingslashit( $url ) |
560 | 560 | ); |
@@ -592,13 +592,13 @@ discard block |
||
592 | 592 | $custom = false; |
593 | 593 | if ( defined( 'MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL' ) ) { |
594 | 594 | $shareasale_redirect = MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL; |
595 | - $custom = true; |
|
595 | + $custom = true; |
|
596 | 596 | } |
597 | 597 | |
598 | 598 | // If there's no constant, check if there's an option. |
599 | 599 | if ( empty( $custom ) ) { |
600 | 600 | $shareasale_redirect = get_option( 'monsterinsights_shareasale_redirect_url', '' ); |
601 | - $custom = true; |
|
601 | + $custom = true; |
|
602 | 602 | } |
603 | 603 | |
604 | 604 | // Whether we have an ID or not, filter the ID. |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | return $shareasale_url; |
608 | 608 | } |
609 | 609 | |
610 | -function monsterinsights_settings_ublock_error_js(){ |
|
610 | +function monsterinsights_settings_ublock_error_js() { |
|
611 | 611 | echo "<script type='text/javascript'>\n"; |
612 | 612 | echo "jQuery( document ).ready( function( $ ) { |
613 | 613 | if ( window.uorigindetected == null){ |
@@ -623,9 +623,9 @@ discard block |
||
623 | 623 | } |
624 | 624 | |
625 | 625 | function monsterinsights_ublock_notice() { |
626 | - ob_start();?> |
|
626 | + ob_start(); ?> |
|
627 | 627 | <div id="monsterinsights-ublock-origin-error" class="error inline" style="display:none;"> |
628 | - <?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress'), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">'); |
|
628 | + <?php echo sprintf( esc_html__( 'MonsterInsights has detected that it\'s files are being blocked. This is usually caused by a adblock browser plugin (particularly uBlock Origin), or a conflicting WordPress theme or plugin. This issue only affects the admin side of MonsterInsights. To solve this, ensure MonsterInsights is whitelisted for your website URL in any adblock browser plugin you use. For step by step directions on how to do this, %1$sclick here%2$s. If this doesn\'t solve the issue (rare), send us a ticket %3$shere%2$s and we\'ll be happy to help diagnose the issue.', 'google-analytics-for-wordpress' ), '<a href="https://monsterinsights.com/docs/monsterinsights-asset-files-blocked/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>', '<a href="https://monsterinsights.com/contact/" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' ); |
|
629 | 629 | ?> |
630 | 630 | </div> |
631 | 631 | <?php |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | 33 | // Allow dashboard widget to be hidden on multisite installs |
34 | - $show_widget = is_multisite() ? apply_filters( 'monsterinsights_show_dashboard_widget', true ) : true; |
|
34 | + $show_widget = is_multisite() ? apply_filters( 'monsterinsights_show_dashboard_widget', true ) : true; |
|
35 | 35 | if ( ! $show_widget ) { |
36 | 36 | return false; |
37 | 37 | } |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | |
62 | 62 | // Attept to place the widget at the top. |
63 | 63 | $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; |
64 | - $widget_instance = array( self::WIDGET_KEY => $normal_dashboard[ self::WIDGET_KEY ] ); |
|
65 | - unset( $normal_dashboard[ self::WIDGET_KEY ] ); |
|
64 | + $widget_instance = array( self::WIDGET_KEY => $normal_dashboard[self::WIDGET_KEY] ); |
|
65 | + unset( $normal_dashboard[self::WIDGET_KEY] ); |
|
66 | 66 | $sorted_dashboard = array_merge( $widget_instance, $normal_dashboard ); |
67 | 67 | $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; |
68 | 68 | } |