@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | self::$instance->notices = new MonsterInsights_Notice_Admin(); |
229 | 229 | self::$instance->license_actions = new MonsterInsights_License_Actions(); |
230 | 230 | self::$instance->reporting = new MonsterInsights_Reporting(); |
231 | - self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
231 | + self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
232 | 232 | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
233 | 233 | self::$instance->require_updater(); |
234 | 234 | } else { |
@@ -352,19 +352,19 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) { |
355 | - define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
355 | + define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | if ( ! defined( 'GAWP_PATH' ) ) { |
359 | - define( 'GAWP_PATH', MONSTERINSIGHTS_PLUGIN_DIR ); |
|
359 | + define( 'GAWP_PATH', MONSTERINSIGHTS_PLUGIN_DIR ); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) { |
363 | - define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
363 | + define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | if ( ! defined( 'GAWP_URL' ) ) { |
367 | - define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL ); |
|
367 | + define( 'GAWP_URL', MONSTERINSIGHTS_PLUGIN_URL ); |
|
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | } |
385 | 385 | |
386 | 386 | // Traditional WordPress plugin locale filter. |
387 | - $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
387 | + $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
388 | 388 | $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); |
389 | 389 | |
390 | 390 | // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | public function monsterinsights_wp_notice() { |
442 | 442 | $url = admin_url( 'plugins.php' ); |
443 | 443 | // Check for MS dashboard |
444 | - if( is_network_admin() ) { |
|
444 | + if ( is_network_admin() ) { |
|
445 | 445 | $url = network_admin_url( 'plugins.php' ); |
446 | 446 | } |
447 | 447 | ?> |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | public function monsterinsights_pro_notice() { |
463 | 463 | $url = admin_url( 'plugins.php' ); |
464 | 464 | // Check for MS dashboard |
465 | - if( is_network_admin() ) { |
|
465 | + if ( is_network_admin() ) { |
|
466 | 466 | $url = network_admin_url( 'plugins.php' ); |
467 | 467 | } |
468 | 468 | ?> |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php'; |
489 | 489 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php'; |
490 | 490 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php'; |
491 | - $monsterinsights_settings = monsterinsights_get_options(); |
|
491 | + $monsterinsights_settings = monsterinsights_get_options(); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * |
503 | 503 | * @return void |
504 | 504 | */ |
505 | - public function load_licensing(){ |
|
505 | + public function load_licensing() { |
|
506 | 506 | if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
507 | 507 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/license.php'; |
508 | 508 | self::$instance->license = new MonsterInsights_License(); |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $instance->api_auth->delete_auth(); |
681 | 681 | |
682 | 682 | // Delete data |
683 | - $instance->reporting->delete_aggregate_data('site'); |
|
683 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
684 | 684 | |
685 | 685 | // Delete license |
686 | 686 | $instance->license->delete_site_license(); |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | $instance->api_auth->uninstall_network_auth(); |
692 | 692 | |
693 | 693 | // Delete network data |
694 | - $instance->reporting->delete_aggregate_data('network'); |
|
694 | + $instance->reporting->delete_aggregate_data( 'network' ); |
|
695 | 695 | |
696 | 696 | // Delete network license |
697 | 697 | $instance->license->delete_network_license(); |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | $instance->api_auth->delete_auth(); |
701 | 701 | |
702 | 702 | // Delete data |
703 | - $instance->reporting->delete_aggregate_data('site'); |
|
703 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
704 | 704 | |
705 | 705 | // Delete license |
706 | 706 | $instance->license->delete_site_license(); |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | * |
796 | 796 | * @return void |
797 | 797 | */ |
798 | -function monsterinsights_lite_call_install_and_upgrade(){ |
|
798 | +function monsterinsights_lite_call_install_and_upgrade() { |
|
799 | 799 | add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' ); |
800 | 800 | } |
801 | 801 |
@@ -146,20 +146,20 @@ discard block |
||
146 | 146 | $this->network = is_network_admin() || ! empty( $args['network'] ); |
147 | 147 | |
148 | 148 | $default_token = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token(); |
149 | - $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
149 | + $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
150 | 150 | |
151 | - $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
152 | - $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
153 | - $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
154 | - $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
155 | - $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
156 | - $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
151 | + $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
152 | + $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
153 | + $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
154 | + $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
155 | + $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
156 | + $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
157 | 157 | |
158 | 158 | // We need to do this hack so that the network panel + the site_url of the main site are distinct |
159 | 159 | $this->site_url = is_network_admin() ? network_admin_url() : site_url(); |
160 | 160 | |
161 | 161 | if ( monsterinsights_is_pro_version() ) { |
162 | - $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
162 | + $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
163 | 163 | } |
164 | 164 | $this->plugin = MonsterInsights()->plugin_slug; |
165 | 165 | $this->miversion = MONSTERINSIGHTS_VERSION; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | public function request() { |
177 | 177 | // Make sure we're not blocked |
178 | 178 | $blocked = $this->is_blocked( $this->url ); |
179 | - if ( $blocked || is_wp_error( $blocked ) ) { |
|
179 | + if ( $blocked || is_wp_error( $blocked ) ) { |
|
180 | 180 | if ( is_wp_error( $blocked ) ) { |
181 | 181 | return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) ); |
182 | 182 | } else { |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | if ( 'GET' == $this->method ) { |
236 | - $body['time'] = time(); // just to avoid caching |
|
236 | + $body['time'] = time(); // just to avoid caching |
|
237 | 237 | } |
238 | 238 | |
239 | - $body['timezone'] = date('e'); |
|
239 | + $body['timezone'] = date( 'e' ); |
|
240 | 240 | |
241 | 241 | $body['network'] = $this->network ? 'network' : 'site'; |
242 | 242 | |
243 | - $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
243 | + $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
244 | 244 | |
245 | 245 | // This filter will be removed in the future. |
246 | 246 | $body = apply_filters( 'monsterinsights_api_request_body', $body ); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | // If not a 200 status header, send back error. |
286 | 286 | if ( 200 != $response_code ) { |
287 | - $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
287 | + $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
288 | 288 | |
289 | 289 | if ( empty( $response_code ) ) { |
290 | 290 | return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) ); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | 'body' => '' |
390 | 390 | ); |
391 | 391 | $response = wp_remote_get( $testurl, $params ); |
392 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
392 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
393 | 393 | return false; |
394 | 394 | } else { |
395 | 395 | if ( is_wp_error( $response ) ) { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | ); |
412 | 412 | $response = wp_remote_get( $testurl, $params ); |
413 | 413 | |
414 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
414 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
415 | 415 | return false; |
416 | 416 | } else { |
417 | 417 | if ( is_wp_error( $response ) ) { |
@@ -34,13 +34,13 @@ |
||
34 | 34 | $track_user = monsterinsights_track_user(); |
35 | 35 | |
36 | 36 | if ( $track_user && ( $events_mode === 'js' || $events_mode === 'php' ) ) { |
37 | - require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
38 | - new MonsterInsights_Analytics_Events(); |
|
37 | + require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
38 | + new MonsterInsights_Analytics_Events(); |
|
39 | 39 | |
40 | - // Let's run form tracking if we find it |
|
41 | - if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
42 | - monsterinsights_forms_output_after_script( array() ); |
|
43 | - } |
|
40 | + // Let's run form tracking if we find it |
|
41 | + if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
42 | + monsterinsights_forms_output_after_script( array() ); |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | add_action( 'seedprod_monsterinsights_output_tracking', 'monsterinsights_seedprod_tracking', 6, 1 ); |
47 | 47 | \ No newline at end of file |
@@ -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 | 'resume_report_title' => esc_html__( 'Real-Time Report Paused', 'google-analytics-for-wordpress' ), |
185 | 185 | 'resume_report_text' => esc_html__( 'The Real-Time Report automatically paused due to inactivity. Please refresh the page to resume the Real-Time Report.', 'google-analytics-for-wordpress' ), |
186 | 186 | ) |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'kad_admin_js', // Pinnacle theme |
245 | 245 | 'dt-chart', // DesignThemes core features plugin |
246 | 246 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
247 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
247 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
248 | 248 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
249 | 249 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
250 | 250 | 'imagify-promise-polyfill', // Imagify |
@@ -263,16 +263,16 @@ discard block |
||
263 | 263 | 'rml-modal', // WP Real Media Library |
264 | 264 | 'rml-order', // WP Real Media Library |
265 | 265 | 'rml-meta', // WP Real Media Library |
266 | - 'rml-uploader', // WP Real Media Library |
|
267 | - 'rml-options', // WP Real Media Library |
|
268 | - 'rml-usersettings', // WP Real Media Library |
|
266 | + 'rml-uploader', // WP Real Media Library |
|
267 | + 'rml-options', // WP Real Media Library |
|
268 | + 'rml-usersettings', // WP Real Media Library |
|
269 | 269 | 'rml-main', // WP Real Media Library |
270 | 270 | 'control-panel-sweet-alert', // Ken Theme |
271 | 271 | 'sweet-alert-js', // Vitrine Theme |
272 | 272 | 'theme-admin-script', // Vitrine Theme |
273 | 273 | 'sweetalert', // Church Suite Theme by Webnus |
274 | 274 | 'be_alerts_charts', // WooCommerce bolder product alerts |
275 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
275 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
276 | 276 | 'control-panel-sweet-alert', // Ken Theme |
277 | 277 | 'cpm_chart', // WP Project Manager |
278 | 278 | 'adminscripts', // Artisan Nayma Theme |
@@ -358,15 +358,15 @@ discard block |
||
358 | 358 | |
359 | 359 | global $wp_styles; |
360 | 360 | foreach ( $wp_styles->queue as $handle ) { |
361 | - if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content') === false ) { |
|
361 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
362 | 362 | return; |
363 | 363 | } |
364 | 364 | |
365 | - if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
365 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
366 | 366 | return; |
367 | 367 | } |
368 | 368 | |
369 | - foreach( $third_party as $partial ) { |
|
369 | + foreach ( $third_party as $partial ) { |
|
370 | 370 | if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
371 | 371 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
372 | 372 | wp_deregister_style( $handle ); |
@@ -381,15 +381,15 @@ discard block |
||
381 | 381 | |
382 | 382 | global $wp_scripts; |
383 | 383 | foreach ( $wp_scripts->queue as $handle ) { |
384 | - if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content') === false ) { |
|
384 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
385 | 385 | return; |
386 | 386 | } |
387 | 387 | |
388 | - if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights') !== false ) { |
|
388 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
389 | 389 | return; |
390 | 390 | } |
391 | 391 | |
392 | - foreach( $third_party as $partial ) { |
|
392 | + foreach ( $third_party as $partial ) { |
|
393 | 393 | if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
394 | 394 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
395 | 395 | wp_deregister_script( $handle ); |
@@ -404,47 +404,47 @@ discard block |
||
404 | 404 | |
405 | 405 | // Remove actions from themes that are not following best practices and break the admin doing so |
406 | 406 | // Theme: Newspaper by tagDiv |
407 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_js'); |
|
408 | - remove_action('admin_enqueue_scripts', 'load_wp_admin_css'); |
|
409 | - remove_action('admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic'); |
|
410 | - remove_action('admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic'); |
|
411 | - remove_action('admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999); |
|
412 | - remove_action('print_media_templates', 'td_custom_gallery_settings_hook'); |
|
413 | - remove_action('print_media_templates', 'td_change_backbone_js_hook'); |
|
414 | - remove_action('admin_head', 'tdc_on_admin_head'); // TagDiv Composer Fix |
|
415 | - remove_action('print_media_templates', 'us_media_templates'); // Impreza Theme Fix |
|
416 | - remove_action('admin_footer', 'gt3pg_add_gallery_template'); // GT3 Photo & Video Gallery By GT3 Themes Plugin Fix |
|
407 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_js' ); |
|
408 | + remove_action( 'admin_enqueue_scripts', 'load_wp_admin_css' ); |
|
409 | + remove_action( 'admin_print_scripts-widgets.php', 'td_on_admin_print_scripts_farbtastic' ); |
|
410 | + remove_action( 'admin_print_styles-widgets.php', 'td_on_admin_print_styles_farbtastic' ); |
|
411 | + remove_action( 'admin_print_footer_scripts', 'check_if_media_uploads_is_loaded', 9999 ); |
|
412 | + remove_action( 'print_media_templates', 'td_custom_gallery_settings_hook' ); |
|
413 | + remove_action( 'print_media_templates', 'td_change_backbone_js_hook' ); |
|
414 | + remove_action( 'admin_head', 'tdc_on_admin_head' ); // TagDiv Composer Fix |
|
415 | + remove_action( 'print_media_templates', 'us_media_templates' ); // Impreza Theme Fix |
|
416 | + remove_action( 'admin_footer', 'gt3pg_add_gallery_template' ); // GT3 Photo & Video Gallery By GT3 Themes Plugin Fix |
|
417 | 417 | // Plugin WP Booklist: |
418 | - remove_action('admin_footer', 'wpbooklist_jre_dismiss_prem_notice_forever_action_javascript'); |
|
419 | - remove_action('admin_footer', 'wpbooklist_dashboard_add_book_action_javascript'); |
|
420 | - remove_action('admin_footer', 'wpbooklist_edit_book_show_form_action_javascript'); |
|
421 | - remove_action('admin_footer', 'wpbooklist_show_book_in_colorbox_action_javascript'); |
|
422 | - remove_action('admin_footer', 'wpbooklist_new_lib_shortcode_action_javascript'); |
|
423 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_library_display_options_action_javascript'); |
|
424 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_post_display_options_action_javascript'); |
|
425 | - remove_action('admin_footer', 'wpbooklist_dashboard_save_page_display_options_action_javascript'); |
|
426 | - remove_action('admin_footer', 'wpbooklist_update_display_options_action_javascript'); |
|
427 | - remove_action('admin_footer', 'wpbooklist_edit_book_pagination_action_javascript'); |
|
428 | - remove_action('admin_footer', 'wpbooklist_edit_book_switch_lib_action_javascript'); |
|
429 | - remove_action('admin_footer', 'wpbooklist_edit_book_search_action_javascript'); |
|
430 | - remove_action('admin_footer', 'wpbooklist_edit_book_actual_action_javascript'); |
|
431 | - remove_action('admin_footer', 'wpbooklist_delete_book_action_javascript'); |
|
432 | - remove_action('admin_footer', 'wpbooklist_user_apis_action_javascript'); |
|
433 | - remove_action('admin_footer', 'wpbooklist_upload_new_stylepak_action_javascript'); |
|
434 | - remove_action('admin_footer', 'wpbooklist_upload_new_post_template_action_javascript'); |
|
435 | - remove_action('admin_footer', 'wpbooklist_upload_new_page_template_action_javascript'); |
|
436 | - remove_action('admin_footer', 'wpbooklist_create_db_library_backup_action_javascript'); |
|
437 | - remove_action('admin_footer', 'wpbooklist_restore_db_library_backup_action_javascript'); |
|
438 | - remove_action('admin_footer', 'wpbooklist_create_csv_action_javascript'); |
|
439 | - remove_action('admin_footer', 'wpbooklist_amazon_localization_action_javascript'); |
|
440 | - remove_action('admin_footer', 'wpbooklist_delete_book_bulk_action_javascript'); |
|
441 | - remove_action('admin_footer', 'wpbooklist_reorder_action_javascript'); |
|
442 | - remove_action('admin_footer', 'wpbooklist_exit_results_action_javascript'); |
|
443 | - remove_action('admin_footer', 'wpbooklist_storytime_select_category_action_javascript'); |
|
444 | - remove_action('admin_footer', 'wpbooklist_storytime_get_story_action_javascript'); |
|
445 | - remove_action('admin_footer', 'wpbooklist_storytime_expand_browse_action_javascript'); |
|
446 | - remove_action('admin_footer', 'wpbooklist_storytime_save_settings_action_javascript'); |
|
447 | - remove_action('admin_footer', 'wpbooklist_delete_story_action_javascript'); |
|
418 | + remove_action( 'admin_footer', 'wpbooklist_jre_dismiss_prem_notice_forever_action_javascript' ); |
|
419 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_add_book_action_javascript' ); |
|
420 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_show_form_action_javascript' ); |
|
421 | + remove_action( 'admin_footer', 'wpbooklist_show_book_in_colorbox_action_javascript' ); |
|
422 | + remove_action( 'admin_footer', 'wpbooklist_new_lib_shortcode_action_javascript' ); |
|
423 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_library_display_options_action_javascript' ); |
|
424 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_post_display_options_action_javascript' ); |
|
425 | + remove_action( 'admin_footer', 'wpbooklist_dashboard_save_page_display_options_action_javascript' ); |
|
426 | + remove_action( 'admin_footer', 'wpbooklist_update_display_options_action_javascript' ); |
|
427 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_pagination_action_javascript' ); |
|
428 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_switch_lib_action_javascript' ); |
|
429 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_search_action_javascript' ); |
|
430 | + remove_action( 'admin_footer', 'wpbooklist_edit_book_actual_action_javascript' ); |
|
431 | + remove_action( 'admin_footer', 'wpbooklist_delete_book_action_javascript' ); |
|
432 | + remove_action( 'admin_footer', 'wpbooklist_user_apis_action_javascript' ); |
|
433 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_stylepak_action_javascript' ); |
|
434 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_post_template_action_javascript' ); |
|
435 | + remove_action( 'admin_footer', 'wpbooklist_upload_new_page_template_action_javascript' ); |
|
436 | + remove_action( 'admin_footer', 'wpbooklist_create_db_library_backup_action_javascript' ); |
|
437 | + remove_action( 'admin_footer', 'wpbooklist_restore_db_library_backup_action_javascript' ); |
|
438 | + remove_action( 'admin_footer', 'wpbooklist_create_csv_action_javascript' ); |
|
439 | + remove_action( 'admin_footer', 'wpbooklist_amazon_localization_action_javascript' ); |
|
440 | + remove_action( 'admin_footer', 'wpbooklist_delete_book_bulk_action_javascript' ); |
|
441 | + remove_action( 'admin_footer', 'wpbooklist_reorder_action_javascript' ); |
|
442 | + remove_action( 'admin_footer', 'wpbooklist_exit_results_action_javascript' ); |
|
443 | + remove_action( 'admin_footer', 'wpbooklist_storytime_select_category_action_javascript' ); |
|
444 | + remove_action( 'admin_footer', 'wpbooklist_storytime_get_story_action_javascript' ); |
|
445 | + remove_action( 'admin_footer', 'wpbooklist_storytime_expand_browse_action_javascript' ); |
|
446 | + remove_action( 'admin_footer', 'wpbooklist_storytime_save_settings_action_javascript' ); |
|
447 | + remove_action( 'admin_footer', 'wpbooklist_delete_story_action_javascript' ); |
|
448 | 448 | } |
449 | 449 | add_action( 'admin_enqueue_scripts', 'monsterinsights_remove_conflicting_asset_files', 9999 ); |
450 | 450 | |
@@ -456,66 +456,66 @@ discard block |
||
456 | 456 | * |
457 | 457 | * @return null Return early if not on the proper screen. |
458 | 458 | */ |
459 | -function hide_non_monsterinsights_warnings () { |
|
459 | +function hide_non_monsterinsights_warnings() { |
|
460 | 460 | // Bail if we're not on a MonsterInsights screen. |
461 | 461 | if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], 'monsterinsights' ) === false ) { |
462 | 462 | return; |
463 | 463 | } |
464 | 464 | |
465 | 465 | global $wp_filter; |
466 | - if ( !empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
467 | - foreach( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
466 | + if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { |
|
467 | + foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
|
468 | 468 | foreach ( $hooks as $name => $arr ) { |
469 | 469 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
470 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
470 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
471 | 471 | continue; |
472 | 472 | } |
473 | 473 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
474 | 474 | continue; |
475 | 475 | } |
476 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
476 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
477 | 477 | unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
478 | 478 | } |
479 | 479 | } |
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
483 | - if ( !empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
484 | - foreach( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
483 | + if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { |
|
484 | + foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
|
485 | 485 | foreach ( $hooks as $name => $arr ) { |
486 | 486 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
487 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
487 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
488 | 488 | continue; |
489 | 489 | } |
490 | 490 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
491 | 491 | continue; |
492 | 492 | } |
493 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
493 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
494 | 494 | unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
495 | 495 | } |
496 | 496 | } |
497 | 497 | } |
498 | 498 | } |
499 | 499 | |
500 | - if ( !empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
501 | - foreach( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
500 | + if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { |
|
501 | + foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
|
502 | 502 | foreach ( $hooks as $name => $arr ) { |
503 | 503 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
504 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
504 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
505 | 505 | continue; |
506 | 506 | } |
507 | 507 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
508 | 508 | continue; |
509 | 509 | } |
510 | - if ( !empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
510 | + if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
|
511 | 511 | unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
512 | 512 | } |
513 | 513 | } |
514 | 514 | } |
515 | 515 | } |
516 | 516 | } |
517 | -add_action('admin_print_scripts', 'hide_non_monsterinsights_warnings'); |
|
518 | -add_action('admin_head', 'hide_non_monsterinsights_warnings', PHP_INT_MAX ); |
|
517 | +add_action( 'admin_print_scripts', 'hide_non_monsterinsights_warnings' ); |
|
518 | +add_action( 'admin_head', 'hide_non_monsterinsights_warnings', PHP_INT_MAX ); |
|
519 | 519 | |
520 | 520 | /** |
521 | 521 | * Called whenever an upgrade button / link is displayed in Lite, this function will |
@@ -544,33 +544,33 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | // Get the ShareASale ID |
547 | - $shareasale_id = monsterinsights_get_shareasale_id(); |
|
547 | + $shareasale_id = monsterinsights_get_shareasale_id(); |
|
548 | 548 | |
549 | 549 | // If we have a shareasale ID return the shareasale url |
550 | 550 | if ( ! empty( $shareasale_id ) ) { |
551 | - $shareasale_id = absint( $shareasale_id ); |
|
551 | + $shareasale_id = absint( $shareasale_id ); |
|
552 | 552 | return esc_url( monsterinsights_get_shareasale_url( $shareasale_id, $url ) ); |
553 | 553 | } else { |
554 | 554 | return esc_url( $url ); |
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
558 | -function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true ) { |
|
558 | +function monsterinsights_get_url( $medium = '', $campaign = '', $url = '', $escape = true ) { |
|
559 | 559 | // Setup Campaign variables |
560 | - $source = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin'; |
|
561 | - $medium = ! empty( $medium ) ? $medium : 'defaultmedium'; |
|
562 | - $campaign = ! empty( $campaign ) ? $campaign : 'defaultcampaign'; |
|
563 | - $content = MONSTERINSIGHTS_VERSION; |
|
564 | - $default_url = monsterinsights_is_pro_version() ? '' : 'lite/'; |
|
560 | + $source = monsterinsights_is_pro_version() ? 'proplugin' : 'liteplugin'; |
|
561 | + $medium = ! empty( $medium ) ? $medium : 'defaultmedium'; |
|
562 | + $campaign = ! empty( $campaign ) ? $campaign : 'defaultcampaign'; |
|
563 | + $content = MONSTERINSIGHTS_VERSION; |
|
564 | + $default_url = monsterinsights_is_pro_version() ? '' : 'lite/'; |
|
565 | 565 | $url = ! empty( $url ) ? $url : 'https://www.monsterinsights.com/' . $default_url; |
566 | 566 | |
567 | 567 | // Put together redirect URL |
568 | 568 | $url = add_query_arg( |
569 | 569 | array( |
570 | - 'utm_source' => $source, // Pro/Lite Plugin |
|
571 | - 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
570 | + 'utm_source' => $source, // Pro/Lite Plugin |
|
571 | + 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
572 | 572 | 'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report) |
573 | - 'utm_content' => $content, // Version number of MI |
|
573 | + 'utm_content' => $content, // Version number of MI |
|
574 | 574 | ), |
575 | 575 | trailingslashit( $url ) |
576 | 576 | ); |
@@ -608,13 +608,13 @@ discard block |
||
608 | 608 | $custom = false; |
609 | 609 | if ( defined( 'MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL' ) ) { |
610 | 610 | $shareasale_redirect = MONSTERINSIGHTS_SHAREASALE_REDIRECT_URL; |
611 | - $custom = true; |
|
611 | + $custom = true; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | // If there's no constant, check if there's an option. |
615 | 615 | if ( empty( $custom ) ) { |
616 | 616 | $shareasale_redirect = get_option( 'monsterinsights_shareasale_redirect_url', '' ); |
617 | - $custom = true; |
|
617 | + $custom = true; |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | // Whether we have an ID or not, filter the ID. |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | return $shareasale_url; |
624 | 624 | } |
625 | 625 | |
626 | -function monsterinsights_settings_ublock_error_js(){ |
|
626 | +function monsterinsights_settings_ublock_error_js() { |
|
627 | 627 | echo "<script type='text/javascript'>\n"; |
628 | 628 | echo "jQuery( document ).ready( function( $ ) { |
629 | 629 | if ( window.uorigindetected == null){ |
@@ -639,9 +639,9 @@ discard block |
||
639 | 639 | } |
640 | 640 | |
641 | 641 | function monsterinsights_ublock_notice() { |
642 | - ob_start();?> |
|
642 | + ob_start(); ?> |
|
643 | 643 | <div id="monsterinsights-ublock-origin-error" class="error inline" style="display:none;"> |
644 | - <?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">'); |
|
644 | + <?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">' ); |
|
645 | 645 | ?> |
646 | 646 | </div> |
647 | 647 | <?php |