@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -270,7 +270,7 @@ |
||
| 270 | 270 | ), |
| 271 | 271 | admin_url( 'admin.php' ) |
| 272 | 272 | ); |
| 273 | - $url = esc_url( $url ); |
|
| 273 | + $url = esc_url( $url ); |
|
| 274 | 274 | |
| 275 | 275 | ob_start(); |
| 276 | 276 | if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) { |
@@ -52,7 +52,8 @@ |
||
| 52 | 52 | // Check for wizard-specific parameter |
| 53 | 53 | // Allow plugins to disable the onboarding wizard |
| 54 | 54 | // Check if current user is allowed to save settings. |
| 55 | - if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { // WPCS: CSRF ok, input var ok. |
|
| 55 | + if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { |
|
| 56 | +// WPCS: CSRF ok, input var ok. |
|
| 56 | 57 | return; |
| 57 | 58 | } |
| 58 | 59 | |
@@ -28,7 +28,8 @@ |
||
| 28 | 28 | delete_transient( '_monsterinsights_activation_redirect' ); |
| 29 | 29 | |
| 30 | 30 | // Bail if activating from network, or bulk. |
| 31 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { // WPCS: CSRF ok, input var ok. |
|
| 31 | + if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
| 32 | +// WPCS: CSRF ok, input var ok. |
|
| 32 | 33 | return; |
| 33 | 34 | } |
| 34 | 35 | |
@@ -155,25 +155,25 @@ discard block |
||
| 155 | 155 | $this->network = is_network_admin() || ! empty( $args['network'] ); |
| 156 | 156 | |
| 157 | 157 | $default_token = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token(); |
| 158 | - $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
| 158 | + $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
| 159 | 159 | |
| 160 | - $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
| 161 | - $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
| 162 | - $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
| 163 | - $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
| 164 | - $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
| 165 | - $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
| 160 | + $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
| 161 | + $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
| 162 | + $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
| 163 | + $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
| 164 | + $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
| 165 | + $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
| 166 | 166 | |
| 167 | 167 | // We need to do this hack so that the network panel + the site_url of the main site are distinct |
| 168 | 168 | $this->site_url = is_network_admin() ? network_admin_url() : site_url(); |
| 169 | 169 | |
| 170 | 170 | if ( monsterinsights_is_pro_version() ) { |
| 171 | - $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
| 171 | + $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
| 172 | 172 | } |
| 173 | 173 | $this->plugin = MonsterInsights()->plugin_slug; |
| 174 | 174 | $this->miversion = MONSTERINSIGHTS_VERSION; |
| 175 | - $this->sitei = ! empty( $args['sitei'] ) ? $args['sitei'] : ''; |
|
| 176 | - $this->testurl = ! empty( $args['testurl'] ) ? $args['testurl'] : ''; |
|
| 175 | + $this->sitei = ! empty( $args['sitei'] ) ? $args['sitei'] : ''; |
|
| 176 | + $this->testurl = ! empty( $args['testurl'] ) ? $args['testurl'] : ''; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | public function request() { |
| 187 | 187 | // Make sure we're not blocked |
| 188 | 188 | $blocked = $this->is_blocked( $this->url ); |
| 189 | - if ( $blocked || is_wp_error( $blocked ) ) { |
|
| 189 | + if ( $blocked || is_wp_error( $blocked ) ) { |
|
| 190 | 190 | if ( is_wp_error( $blocked ) ) { |
| 191 | 191 | return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) ); |
| 192 | 192 | } else { |
@@ -243,14 +243,14 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | if ( 'GET' == $this->method ) { |
| 246 | - $body['time'] = time(); // just to avoid caching |
|
| 246 | + $body['time'] = time(); // just to avoid caching |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $body['timezone'] = date('e'); |
|
| 249 | + $body['timezone'] = date( 'e' ); |
|
| 250 | 250 | |
| 251 | 251 | $body['network'] = $this->network ? 'network' : 'site'; |
| 252 | 252 | |
| 253 | - $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
| 253 | + $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
| 254 | 254 | |
| 255 | 255 | // This filter will be removed in the future. |
| 256 | 256 | $body = apply_filters( 'monsterinsights_api_request_body', $body ); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | ); |
| 282 | 282 | |
| 283 | 283 | // Perform the query and retrieve the response. |
| 284 | - $response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data ); |
|
| 284 | + $response = 'GET' == $this->method ? wp_remote_get( esc_url_raw( $this->url ) . '?' . $string, $data ) : wp_remote_post( esc_url_raw( $this->url ), $data ); |
|
| 285 | 285 | |
| 286 | 286 | //return new WP_Error( 'debug', '<pre>' . var_export( $response, true ) . '</pre>' ); |
| 287 | 287 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | // If not a 200 status header, send back error. |
| 302 | 302 | if ( 200 != $response_code ) { |
| 303 | - $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
| 303 | + $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
| 304 | 304 | |
| 305 | 305 | if ( empty( $response_code ) ) { |
| 306 | 306 | return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) ); |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | // and for image linking purposes in Google Images. We use it to test outbound connections since it is run on google.com |
| 388 | 388 | // and is only a few bytes large. Plus on Google's main CDN so it loads in most places in 0.07 seconds or less. Perfect for our |
| 389 | 389 | // use case of quickly testing outbound connections. |
| 390 | - $testurl = ! empty( $this->testurl ) ? $this->testurl :'http://www.google.com/blank.html'; |
|
| 390 | + $testurl = ! empty( $this->testurl ) ? $this->testurl : 'http://www.google.com/blank.html'; |
|
| 391 | 391 | if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) { |
| 392 | 392 | if ( defined( 'WP_ACCESSIBLE_HOSTS' ) ) { |
| 393 | 393 | $wp_http = new WP_Http(); |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | 'body' => '' |
| 403 | 403 | ); |
| 404 | 404 | $response = wp_remote_get( $testurl, $params ); |
| 405 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 405 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 406 | 406 | return false; |
| 407 | 407 | } else { |
| 408 | 408 | if ( is_wp_error( $response ) ) { |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | ); |
| 425 | 425 | $response = wp_remote_get( $testurl, $params ); |
| 426 | 426 | |
| 427 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 427 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 428 | 428 | return false; |
| 429 | 429 | } else { |
| 430 | 430 | if ( is_wp_error( $response ) ) { |
@@ -276,7 +276,7 @@ |
||
| 276 | 276 | // 3. License key not valid/okay for pro |
| 277 | 277 | if ( monsterinsights_is_pro_version() ) { |
| 278 | 278 | $message = ''; |
| 279 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 279 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
| 280 | 280 | if ( MonsterInsights()->license->site_license_expired() ) { |
| 281 | 281 | $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
| 282 | 282 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
@@ -34,23 +34,23 @@ discard block |
||
| 34 | 34 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
| 35 | 35 | |
| 36 | 36 | if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
| 37 | - // If dashboards disabled, first settings page |
|
| 38 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 39 | - $hook = 'monsterinsights_settings'; |
|
| 37 | + // If dashboards disabled, first settings page |
|
| 38 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 39 | + $hook = 'monsterinsights_settings'; |
|
| 40 | 40 | |
| 41 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
| 41 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
| 42 | 42 | } else { |
| 43 | - // if dashboards enabled, first dashboard |
|
| 44 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 43 | + // if dashboards enabled, first dashboard |
|
| 44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 45 | 45 | |
| 46 | - $hook = 'monsterinsights_reports'; |
|
| 46 | + $hook = 'monsterinsights_reports'; |
|
| 47 | 47 | |
| 48 | - add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
| 48 | + add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
| 49 | 49 | |
| 50 | - // then settings page |
|
| 51 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
| 50 | + // then settings page |
|
| 51 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
| 52 | 52 | |
| 53 | - // Add dashboard submenu. |
|
| 53 | + // Add dashboard submenu. |
|
| 54 | 54 | add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | // First, let's see if this is an MS network enabled plugin. If it is, we should load the license |
| 78 | 78 | // menu page and the updater on the network panel |
| 79 | 79 | if ( ! function_exists( 'is_plugin_active_for_network' ) ) { |
| 80 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
| 80 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE ); |
| 84 | 84 | if ( ! is_plugin_active_for_network( $plugin ) ) { |
| 85 | - return; |
|
| 85 | + return; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | function monsterinsights_add_admin_body_class( $classes ) { |
| 109 | 109 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 110 | 110 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
| 111 | - return $classes; |
|
| 111 | + return $classes; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | return "$classes monsterinsights_page "; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 126 | 126 | |
| 127 | 127 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
| 128 | - return $classes; |
|
| 128 | + return $classes; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return "$classes insights_page_monsterinsights_tools "; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
| 142 | 142 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 143 | 143 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
| 144 | - return $classes; |
|
| 144 | + return $classes; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return "$classes insights_page_monsterinsights_addons "; |
@@ -161,17 +161,17 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | // If lite, show a link where they can get pro from |
| 163 | 163 | if ( ! monsterinsights_is_pro_version() ) { |
| 164 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 165 | - array_unshift( $links, $get_pro ); |
|
| 164 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 165 | + array_unshift( $links, $get_pro ); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // If Lite, support goes to forum. If pro, it goes to our website |
| 169 | 169 | if ( monsterinsights_is_pro_version() ) { |
| 170 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 171 | - array_unshift( $links, $support ); |
|
| 170 | + $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 171 | + array_unshift( $links, $support ); |
|
| 172 | 172 | } else { |
| 173 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 174 | - array_unshift( $links, $support ); |
|
| 173 | + $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 174 | + array_unshift( $links, $support ); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>'; |
@@ -196,26 +196,26 @@ discard block |
||
| 196 | 196 | function monsterinsights_load_admin_partial( $template, $data = array() ) { |
| 197 | 197 | |
| 198 | 198 | if ( monsterinsights_is_pro_version() ) { |
| 199 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
| 199 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
| 200 | 200 | |
| 201 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 202 | - require_once( $dir . $template . '.php' ); |
|
| 203 | - return true; |
|
| 204 | - } |
|
| 201 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 202 | + require_once( $dir . $template . '.php' ); |
|
| 203 | + return true; |
|
| 204 | + } |
|
| 205 | 205 | } else { |
| 206 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
| 206 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
| 207 | 207 | |
| 208 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 209 | - require_once( $dir . $template . '.php' ); |
|
| 210 | - return true; |
|
| 211 | - } |
|
| 208 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 209 | + require_once( $dir . $template . '.php' ); |
|
| 210 | + return true; |
|
| 211 | + } |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
| 215 | 215 | |
| 216 | 216 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 217 | - require_once( $dir . $template . '.php' ); |
|
| 218 | - return true; |
|
| 217 | + require_once( $dir . $template . '.php' ); |
|
| 218 | + return true; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | return false; |
@@ -232,8 +232,8 @@ discard block |
||
| 232 | 232 | function monsterinsights_admin_footer( $text ) { |
| 233 | 233 | global $current_screen; |
| 234 | 234 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
| 235 | - $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
| 236 | - $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 235 | + $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
| 236 | + $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 237 | 237 | } |
| 238 | 238 | return $text; |
| 239 | 239 | } |
@@ -244,12 +244,12 @@ discard block |
||
| 244 | 244 | // Don't show on MonsterInsights pages |
| 245 | 245 | $screen = get_current_screen(); |
| 246 | 246 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) { |
| 247 | - return; |
|
| 247 | + return; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // Make sure they have the permissions to do something |
| 251 | 251 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
| 252 | - return; |
|
| 252 | + return; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // Priority: |
@@ -266,45 +266,45 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // 1. Google Analytics not authenticated |
| 268 | 268 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
| 269 | - $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 270 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
| 271 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 272 | - return; |
|
| 269 | + $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 270 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
| 271 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 272 | + return; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // 2. License key not entered for pro |
| 276 | 276 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
| 277 | 277 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
| 278 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 279 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 280 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 281 | - return; |
|
| 278 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 279 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 280 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 281 | + return; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | // 3. License key not valid/okay for pro |
| 285 | 285 | if ( monsterinsights_is_pro_version() ) { |
| 286 | - $message = ''; |
|
| 287 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 288 | - if ( MonsterInsights()->license->site_license_expired() ) { |
|
| 289 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 290 | - } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
| 291 | - $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 292 | - } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
| 293 | - $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 294 | - } |
|
| 295 | - } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
| 296 | - if ( MonsterInsights()->license->network_license_expired() ) { |
|
| 297 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 298 | - } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
| 299 | - $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 300 | - } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
| 301 | - $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 302 | - } |
|
| 303 | - } |
|
| 304 | - if ( ! empty( $message ) ) { |
|
| 305 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 306 | - return; |
|
| 307 | - } |
|
| 286 | + $message = ''; |
|
| 287 | + if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 288 | + if ( MonsterInsights()->license->site_license_expired() ) { |
|
| 289 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 290 | + } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
| 291 | + $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 292 | + } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
| 293 | + $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 294 | + } |
|
| 295 | + } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
| 296 | + if ( MonsterInsights()->license->network_license_expired() ) { |
|
| 297 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 298 | + } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
| 299 | + $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 300 | + } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
| 301 | + $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 302 | + } |
|
| 303 | + } |
|
| 304 | + if ( ! empty( $message ) ) { |
|
| 305 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 306 | + return; |
|
| 307 | + } |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | // 4. Notices for PHP/WP version deprecations |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | $notices = get_option( 'monsterinsights_notices' ); |
| 370 | 370 | if ( ! is_array( $notices ) ) { |
| 371 | - $notices = array(); |
|
| 371 | + $notices = array(); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | // 6. Authenticate, not manual |
@@ -376,12 +376,12 @@ discard block |
||
| 376 | 376 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 377 | 377 | |
| 378 | 378 | if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
| 379 | - echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
| 380 | - echo '<p>'; |
|
| 381 | - echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
| 382 | - echo '</p>'; |
|
| 383 | - echo '</div>'; |
|
| 384 | - return; |
|
| 379 | + echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
| 380 | + echo '<p>'; |
|
| 381 | + echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
| 382 | + echo '</p>'; |
|
| 383 | + echo '</div>'; |
|
| 384 | + return; |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | // 7. Automatic updates not configured |
@@ -401,64 +401,64 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | // 8. WooUpsell |
| 403 | 403 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
| 404 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 405 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
| 406 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 407 | - echo '<p><strong>'; |
|
| 408 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
| 409 | - echo '</strong></p>'; |
|
| 410 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 411 | - echo '<p>'; |
|
| 412 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 413 | - echo '</p>'; |
|
| 414 | - echo '<p>'; |
|
| 415 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 416 | - echo '</p>'; |
|
| 417 | - echo '<p>'; |
|
| 418 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 419 | - echo '</p>'; |
|
| 420 | - echo '<p>'; |
|
| 421 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 422 | - echo '</p>'; |
|
| 423 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 424 | - echo '</p>'; |
|
| 425 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 426 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 427 | - echo '</div>'; |
|
| 428 | - echo '</div>'; |
|
| 429 | - return; |
|
| 430 | - } |
|
| 404 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 405 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
| 406 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 407 | + echo '<p><strong>'; |
|
| 408 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
| 409 | + echo '</strong></p>'; |
|
| 410 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 411 | + echo '<p>'; |
|
| 412 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 413 | + echo '</p>'; |
|
| 414 | + echo '<p>'; |
|
| 415 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 416 | + echo '</p>'; |
|
| 417 | + echo '<p>'; |
|
| 418 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 419 | + echo '</p>'; |
|
| 420 | + echo '<p>'; |
|
| 421 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 422 | + echo '</p>'; |
|
| 423 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 424 | + echo '</p>'; |
|
| 425 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 426 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 427 | + echo '</div>'; |
|
| 428 | + echo '</div>'; |
|
| 429 | + return; |
|
| 430 | + } |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | // 9. EDDUpsell |
| 434 | 434 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
| 435 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 436 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
| 437 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 438 | - echo '<p><strong>'; |
|
| 439 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
| 440 | - echo '</strong></p>'; |
|
| 441 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 442 | - echo '<p>'; |
|
| 443 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 444 | - echo '</p>'; |
|
| 445 | - echo '<p>'; |
|
| 446 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 447 | - echo '</p>'; |
|
| 448 | - echo '<p>'; |
|
| 449 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 450 | - echo '</p>'; |
|
| 451 | - echo '<p>'; |
|
| 452 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 453 | - echo '</p>'; |
|
| 454 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 455 | - echo '</p>'; |
|
| 456 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 457 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 458 | - echo '</div>'; |
|
| 459 | - echo '</div>'; |
|
| 460 | - return; |
|
| 461 | - } |
|
| 435 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 436 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
| 437 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 438 | + echo '<p><strong>'; |
|
| 439 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
| 440 | + echo '</strong></p>'; |
|
| 441 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 442 | + echo '<p>'; |
|
| 443 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 444 | + echo '</p>'; |
|
| 445 | + echo '<p>'; |
|
| 446 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 447 | + echo '</p>'; |
|
| 448 | + echo '<p>'; |
|
| 449 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 450 | + echo '</p>'; |
|
| 451 | + echo '<p>'; |
|
| 452 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 453 | + echo '</p>'; |
|
| 454 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 455 | + echo '</p>'; |
|
| 456 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 457 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 458 | + echo '</div>'; |
|
| 459 | + echo '</div>'; |
|
| 460 | + return; |
|
| 461 | + } |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) { |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | // AM Notices |
| 477 | 477 | function monsterinsights_am_notice_optout( $super_admin ) { |
| 478 | 478 | if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) { |
| 479 | - return false; |
|
| 479 | + return false; |
|
| 480 | 480 | } |
| 481 | 481 | return $super_admin; |
| 482 | 482 | } |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
| 37 | 37 | // If dashboards disabled, first settings page |
| 38 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 38 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 39 | 39 | $hook = 'monsterinsights_settings'; |
| 40 | 40 | |
| 41 | 41 | add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
| 42 | 42 | } else { |
| 43 | 43 | // if dashboards enabled, first dashboard |
| 44 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 45 | 45 | |
| 46 | 46 | $hook = 'monsterinsights_reports'; |
| 47 | 47 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
| 89 | 89 | $hook = 'monsterinsights_network'; |
| 90 | 90 | $submenu_base = add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ); |
| 91 | - add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
| 91 | + add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
| 92 | 92 | |
| 93 | 93 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
| 94 | 94 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | function monsterinsights_add_admin_body_class_tools_page( $classes ) { |
| 125 | 125 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 126 | 126 | |
| 127 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
| 127 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
| 128 | 128 | return $classes; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
| 142 | 142 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 143 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
| 143 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
| 144 | 144 | return $classes; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -156,21 +156,21 @@ discard block |
||
| 156 | 156 | * @return array $links |
| 157 | 157 | */ |
| 158 | 158 | function monsterinsights_add_action_links( $links ) { |
| 159 | - $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 159 | + $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '"">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 160 | 160 | array_unshift( $links, $docs ); |
| 161 | 161 | |
| 162 | 162 | // If lite, show a link where they can get pro from |
| 163 | 163 | if ( ! monsterinsights_is_pro_version() ) { |
| 164 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 164 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 165 | 165 | array_unshift( $links, $get_pro ); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // If Lite, support goes to forum. If pro, it goes to our website |
| 169 | 169 | if ( monsterinsights_is_pro_version() ) { |
| 170 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 170 | + $support = '<a title="MonsterInsights Pro Support" href="' . monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 171 | 171 | array_unshift( $links, $support ); |
| 172 | 172 | } else { |
| 173 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 173 | + $support = '<a title="MonsterInsights Lite Support" href="' . monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 174 | 174 | array_unshift( $links, $support ); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -199,14 +199,14 @@ discard block |
||
| 199 | 199 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
| 200 | 200 | |
| 201 | 201 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 202 | - require_once( $dir . $template . '.php' ); |
|
| 202 | + require_once( $dir . $template . '.php' ); |
|
| 203 | 203 | return true; |
| 204 | 204 | } |
| 205 | 205 | } else { |
| 206 | 206 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
| 207 | 207 | |
| 208 | 208 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 209 | - require_once( $dir . $template . '.php' ); |
|
| 209 | + require_once( $dir . $template . '.php' ); |
|
| 210 | 210 | return true; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
| 215 | 215 | |
| 216 | 216 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 217 | - require_once( $dir . $template . '.php' ); |
|
| 217 | + require_once( $dir . $template . '.php' ); |
|
| 218 | 218 | return true; |
| 219 | 219 | } |
| 220 | 220 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | global $current_screen; |
| 234 | 234 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
| 235 | 235 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
| 236 | - $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 236 | + $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 237 | 237 | } |
| 238 | 238 | return $text; |
| 239 | 239 | } |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | // 1. Google Analytics not authenticated |
| 268 | 268 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
| 269 | 269 | $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 270 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
| 271 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 270 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' ); |
|
| 271 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 272 | 272 | return; |
| 273 | 273 | } |
| 274 | 274 | |
@@ -276,17 +276,17 @@ discard block |
||
| 276 | 276 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
| 277 | 277 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
| 278 | 278 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 279 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 280 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 279 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
| 280 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 281 | 281 | return; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | // 3. License key not valid/okay for pro |
| 285 | 285 | if ( monsterinsights_is_pro_version() ) { |
| 286 | 286 | $message = ''; |
| 287 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 287 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
| 288 | 288 | if ( MonsterInsights()->license->site_license_expired() ) { |
| 289 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 289 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 290 | 290 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
| 291 | 291 | $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
| 292 | 292 | } else if ( MonsterInsights()->license->site_license_invalid() ) { |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | } else if ( MonsterInsights()->license->get_network_license_key() ) { |
| 296 | 296 | if ( MonsterInsights()->license->network_license_expired() ) { |
| 297 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 297 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 298 | 298 | } else if ( MonsterInsights()->license->network_license_disabled() ) { |
| 299 | 299 | $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
| 300 | 300 | } else if ( MonsterInsights()->license->network_license_invalid() ) { |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | if ( ! empty( $message ) ) { |
| 305 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 305 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 306 | 306 | return; |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -315,14 +315,14 @@ discard block |
||
| 315 | 315 | if ( version_compare( phpversion(), '5.4', '<' ) ) { |
| 316 | 316 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
| 317 | 317 | $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
| 318 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 318 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 319 | 319 | return; |
| 320 | 320 | } |
| 321 | 321 | // WordPress 3.0 - 4.5 |
| 322 | 322 | else if ( version_compare( $wp_version, '4.6', '<' ) ) { |
| 323 | 323 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
| 324 | 324 | $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.6 in April, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
| 325 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 325 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 326 | 326 | return; |
| 327 | 327 | } |
| 328 | 328 | // PHP 5.4/5.5 |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | // } |
| 367 | 367 | // } |
| 368 | 368 | |
| 369 | - $notices = get_option( 'monsterinsights_notices' ); |
|
| 369 | + $notices = get_option( 'monsterinsights_notices' ); |
|
| 370 | 370 | if ( ! is_array( $notices ) ) { |
| 371 | 371 | $notices = array(); |
| 372 | 372 | } |
@@ -375,10 +375,10 @@ discard block |
||
| 375 | 375 | $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed(); |
| 376 | 376 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 377 | 377 | |
| 378 | - if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
|
| 378 | + if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { |
|
| 379 | 379 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
| 380 | 380 | echo '<p>'; |
| 381 | - echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
| 381 | + echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
| 382 | 382 | echo '</p>'; |
| 383 | 383 | echo '</div>'; |
| 384 | 384 | return; |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | // 8. WooUpsell |
| 403 | 403 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
| 404 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 404 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
| 405 | 405 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
| 406 | 406 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
| 407 | 407 | echo '<p><strong>'; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | echo '<p>'; |
| 421 | 421 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
| 422 | 422 | echo '</p>'; |
| 423 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 423 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) . '">', ' »</a>' ); |
|
| 424 | 424 | echo '</p>'; |
| 425 | 425 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
| 426 | 426 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | // 9. EDDUpsell |
| 434 | 434 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
| 435 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 435 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
| 436 | 436 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
| 437 | 437 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
| 438 | 438 | echo '<p><strong>'; |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | echo '<p>'; |
| 452 | 452 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
| 453 | 453 | echo '</p>'; |
| 454 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 454 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) . '">', ' »</a>' ); |
|
| 455 | 455 | echo '</p>'; |
| 456 | 456 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
| 457 | 457 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -464,8 +464,8 @@ discard block |
||
| 464 | 464 | if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) { |
| 465 | 465 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 466 | 466 | $page = $page . '#/advanced'; |
| 467 | - $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 468 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>'; |
|
| 467 | + $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
| 468 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>' . $message . '</p></div>'; |
|
| 469 | 469 | return; |
| 470 | 470 | } |
| 471 | 471 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | 'kad_admin_js', // Pinnacle theme |
| 354 | 354 | 'dt-chart', // DesignThemes core features plugin |
| 355 | 355 | 'tweeetshare_font_script', // TweetShare - Click To Tweet |
| 356 | - 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
| 356 | + 'tweeetshare_jquery_script', // TweetShare - Click To Tweet |
|
| 357 | 357 | 'tweeetshare_jqueryui_script', // TweetShare - Click To Tweet |
| 358 | 358 | 'tweeetshare_custom_script', // TweetShare - Click To Tweet |
| 359 | 359 | 'imagify-promise-polyfill', // Imagify |
@@ -372,16 +372,16 @@ discard block |
||
| 372 | 372 | 'rml-modal', // WP Real Media Library |
| 373 | 373 | 'rml-order', // WP Real Media Library |
| 374 | 374 | 'rml-meta', // WP Real Media Library |
| 375 | - 'rml-uploader', // WP Real Media Library |
|
| 376 | - 'rml-options', // WP Real Media Library |
|
| 377 | - 'rml-usersettings', // WP Real Media Library |
|
| 375 | + 'rml-uploader', // WP Real Media Library |
|
| 376 | + 'rml-options', // WP Real Media Library |
|
| 377 | + 'rml-usersettings', // WP Real Media Library |
|
| 378 | 378 | 'rml-main', // WP Real Media Library |
| 379 | 379 | 'control-panel-sweet-alert', // Ken Theme |
| 380 | 380 | 'sweet-alert-js', // Vitrine Theme |
| 381 | 381 | 'theme-admin-script', // Vitrine Theme |
| 382 | 382 | 'sweetalert', // Church Suite Theme by Webnus |
| 383 | 383 | 'be_alerts_charts', // WooCommerce bolder product alerts |
| 384 | - 'magayo-lottery-results', // Magayo Lottery Results |
|
| 384 | + 'magayo-lottery-results', // Magayo Lottery Results |
|
| 385 | 385 | 'control-panel-sweet-alert', // Ken Theme |
| 386 | 386 | 'cpm_chart', // WP Project Manager |
| 387 | 387 | 'adminscripts', // Artisan Nayma Theme |
@@ -472,20 +472,20 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | global $wp_styles; |
| 474 | 474 | foreach ( $wp_styles->queue as $handle ) { |
| 475 | - if ( strpos( $wp_styles->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
| 475 | + if ( strpos( $wp_styles->registered[$handle]->src, 'wp-content' ) === false ) { |
|
| 476 | 476 | return; |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
| 479 | + if ( strpos( $wp_styles->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
| 480 | 480 | return; |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | foreach ( $third_party as $partial ) { |
| 484 | - if ( strpos( $wp_styles->registered[ $handle ]->handle, $partial ) !== false ) { |
|
| 484 | + if ( strpos( $wp_styles->registered[$handle]->handle, $partial ) !== false ) { |
|
| 485 | 485 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
| 486 | 486 | wp_deregister_style( $handle ); |
| 487 | 487 | break; |
| 488 | - } else if ( strpos( $wp_styles->registered[ $handle ]->src, $partial ) !== false ) { |
|
| 488 | + } else if ( strpos( $wp_styles->registered[$handle]->src, $partial ) !== false ) { |
|
| 489 | 489 | wp_dequeue_style( $handle ); // Remove css file from MI screen |
| 490 | 490 | wp_deregister_style( $handle ); |
| 491 | 491 | break; |
@@ -495,20 +495,20 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | global $wp_scripts; |
| 497 | 497 | foreach ( $wp_scripts->queue as $handle ) { |
| 498 | - if ( strpos( $wp_scripts->registered[ $handle ]->src, 'wp-content' ) === false ) { |
|
| 498 | + if ( strpos( $wp_scripts->registered[$handle]->src, 'wp-content' ) === false ) { |
|
| 499 | 499 | return; |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, 'monsterinsights' ) !== false ) { |
|
| 502 | + if ( strpos( $wp_scripts->registered[$handle]->handle, 'monsterinsights' ) !== false ) { |
|
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | foreach ( $third_party as $partial ) { |
| 507 | - if ( strpos( $wp_scripts->registered[ $handle ]->handle, $partial ) !== false ) { |
|
| 507 | + if ( strpos( $wp_scripts->registered[$handle]->handle, $partial ) !== false ) { |
|
| 508 | 508 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
| 509 | 509 | wp_deregister_script( $handle ); |
| 510 | 510 | break; |
| 511 | - } else if ( strpos( $wp_scripts->registered[ $handle ]->src, $partial ) !== false ) { |
|
| 511 | + } else if ( strpos( $wp_scripts->registered[$handle]->src, $partial ) !== false ) { |
|
| 512 | 512 | wp_dequeue_script( $handle ); // Remove JS file from MI screen |
| 513 | 513 | wp_deregister_script( $handle ); |
| 514 | 514 | break; |
@@ -582,14 +582,14 @@ discard block |
||
| 582 | 582 | foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { |
| 583 | 583 | foreach ( $hooks as $name => $arr ) { |
| 584 | 584 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 585 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 585 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
| 586 | 586 | continue; |
| 587 | 587 | } |
| 588 | 588 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 589 | 589 | continue; |
| 590 | 590 | } |
| 591 | 591 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 592 | - unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 592 | + unset( $wp_filter['user_admin_notices']->callbacks[$priority][$name] ); |
|
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | } |
@@ -599,14 +599,14 @@ discard block |
||
| 599 | 599 | foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { |
| 600 | 600 | foreach ( $hooks as $name => $arr ) { |
| 601 | 601 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 602 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 602 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
| 603 | 603 | continue; |
| 604 | 604 | } |
| 605 | 605 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 606 | 606 | continue; |
| 607 | 607 | } |
| 608 | 608 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 609 | - unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 609 | + unset( $wp_filter['admin_notices']->callbacks[$priority][$name] ); |
|
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | } |
@@ -616,14 +616,14 @@ discard block |
||
| 616 | 616 | foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { |
| 617 | 617 | foreach ( $hooks as $name => $arr ) { |
| 618 | 618 | if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) { |
| 619 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 619 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
| 620 | 620 | continue; |
| 621 | 621 | } |
| 622 | 622 | if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'monsterinsights' ) !== false ) { |
| 623 | 623 | continue; |
| 624 | 624 | } |
| 625 | 625 | if ( ! empty( $name ) && strpos( $name, 'monsterinsights' ) === false ) { |
| 626 | - unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); |
|
| 626 | + unset( $wp_filter['all_admin_notices']->callbacks[$priority][$name] ); |
|
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | 629 | } |
@@ -684,10 +684,10 @@ discard block |
||
| 684 | 684 | // Put together redirect URL |
| 685 | 685 | $url = add_query_arg( |
| 686 | 686 | array( |
| 687 | - 'utm_source' => $source, // Pro/Lite Plugin |
|
| 688 | - 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
| 687 | + 'utm_source' => $source, // Pro/Lite Plugin |
|
| 688 | + 'utm_medium' => sanitize_key( $medium ), // Area of MonsterInsights (example Reports) |
|
| 689 | 689 | 'utm_campaign' => sanitize_key( $campaign ), // Which link (example eCommerce Report) |
| 690 | - 'utm_content' => $content, // Version number of MI |
|
| 690 | + 'utm_content' => $content, // Version number of MI |
|
| 691 | 691 | ), |
| 692 | 692 | trailingslashit( $url ) |
| 693 | 693 | ); |
@@ -87,7 +87,8 @@ |
||
| 87 | 87 | wp_cache_flush(); |
| 88 | 88 | $cachec = true; |
| 89 | 89 | } |
| 90 | - } else { // if existing install |
|
| 90 | + } else { |
|
| 91 | +// if existing install |
|
| 91 | 92 | if ( version_compare( $version, '6.0.11', '<' ) ) { |
| 92 | 93 | if ( ! $cachec ) { |
| 93 | 94 | wp_cache_flush(); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // if new install or Yoast Era instal |
| 64 | 64 | if ( ! $version ) { |
| 65 | 65 | // See if from Yoast |
| 66 | - $yoast = get_option( 'yst_ga', false ); |
|
| 66 | + $yoast = get_option( 'yst_ga', false ); |
|
| 67 | 67 | |
| 68 | 68 | // In case from Yoast, start from scratch |
| 69 | 69 | delete_option( 'yoast-ga-access_token' ); |
@@ -297,25 +297,25 @@ discard block |
||
| 297 | 297 | public function v700_upgrades() { |
| 298 | 298 | // 1. Default all event tracking and tracking to GA + JS respectively |
| 299 | 299 | // 3a Set tracking_mode to use analytics.js |
| 300 | - $this->new_settings['tracking_mode' ] = 'analytics'; |
|
| 300 | + $this->new_settings['tracking_mode'] = 'analytics'; |
|
| 301 | 301 | |
| 302 | 302 | |
| 303 | 303 | // 3b Set events mode to use JS if the events mode is not set explicitly to none |
| 304 | - if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) { |
|
| 305 | - $this->new_settings['events_mode' ] = 'js'; |
|
| 304 | + if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) { |
|
| 305 | + $this->new_settings['events_mode'] = 'js'; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // 2. Migrate manual UA codes |
| 309 | 309 | // 2a Manual UA has the lowest priority |
| 310 | - if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) { |
|
| 310 | + if ( ! empty( $this->new_settings['manual_ua_code'] ) ) { |
|
| 311 | 311 | // Set as manual UA code |
| 312 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ); |
|
| 312 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // 2b Then try the oAuth UA code |
| 316 | - if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) { |
|
| 316 | + if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) { |
|
| 317 | 317 | // Set as manual UA code |
| 318 | - is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ); |
|
| 318 | + is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // 3. Migrate License keys |
@@ -357,8 +357,8 @@ discard block |
||
| 357 | 357 | 'track_internal_as_label', |
| 358 | 358 | ); |
| 359 | 359 | foreach ( $settings as $setting ) { |
| 360 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 361 | - unset( $this->new_settings[ $setting ] ); |
|
| 360 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 361 | + unset( $this->new_settings[$setting] ); |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | } |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | ); |
| 403 | 403 | |
| 404 | 404 | foreach ( $settings as $setting ) { |
| 405 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 406 | - unset( $this->new_settings[ $setting ] ); |
|
| 405 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 406 | + unset( $this->new_settings[$setting] ); |
|
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | ); |
| 443 | 443 | |
| 444 | 444 | foreach ( $settings as $setting ) { |
| 445 | - if ( ! empty( $this->new_settings[ $setting ] ) ) { |
|
| 446 | - unset( $this->new_settings[ $setting ] ); |
|
| 445 | + if ( ! empty( $this->new_settings[$setting] ) ) { |
|
| 446 | + unset( $this->new_settings[$setting] ); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | preg_match( $regex, $cross_domain['domain'], $matches ); |
| 536 | 536 | if ( count( $matches ) > 0 ) { |
| 537 | - unset( $this->new_settings['cross_domains'][ $key ] ); |
|
| 537 | + unset( $this->new_settings['cross_domains'][$key] ); |
|
| 538 | 538 | } |
| 539 | 539 | } |
| 540 | 540 | } |
@@ -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 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @return string Javascript to output. |
| 174 | 174 | */ |
| 175 | 175 | public function frontend_output( ) { |
| 176 | - $options = $this->frontend_tracking_options(); |
|
| 176 | + $options = $this->frontend_tracking_options(); |
|
| 177 | 177 | $src = apply_filters( 'monsterinsights_frontend_output_analytics_src', '//www.google-analytics.com/analytics.js' ); |
| 178 | 178 | $compat = monsterinsights_get_option( 'gatracker_compatibility_mode', false ); |
| 179 | 179 | $compat = $compat ? 'window.ga = __gaTracker;' : ''; |
@@ -181,10 +181,10 @@ discard block |
||
| 181 | 181 | $ua = monsterinsights_get_ua(); |
| 182 | 182 | $output = ''; |
| 183 | 183 | $reason = ''; |
| 184 | - $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
| 184 | + $attributes = apply_filters( 'monsterinsights_tracking_analytics_script_attributes', array( 'type' => "text/javascript", 'data-cfasync' => 'false' ) ); |
|
| 185 | 185 | $attr_string = ''; |
| 186 | 186 | if ( ! empty( $attributes ) ) { |
| 187 | - foreach( $attributes as $attr_name => $attr_value ) { |
|
| 187 | + foreach ( $attributes as $attr_name => $attr_value ) { |
|
| 188 | 188 | if ( ! empty( $attr_name ) ) { |
| 189 | 189 | $attr_string .= ' ' . sanitize_key( $attr_name ) . '="' . esc_attr( $attr_value ) . '"'; |
| 190 | 190 | } else { |
@@ -198,21 +198,21 @@ discard block |
||
| 198 | 198 | <?php if ( ! $track_user ) { |
| 199 | 199 | if ( empty( $ua ) ) { |
| 200 | 200 | $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' ); |
| 201 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 201 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 202 | 202 | } else if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
| 203 | - $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' ); |
|
| 204 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 203 | + $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' ); |
|
| 204 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 205 | 205 | } else { |
| 206 | 206 | $reason = __( 'Note: The site owner has disabled Google Analytics tracking for your user role.', 'google-analytics-for-wordpress' ); |
| 207 | - $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 207 | + $output .= '<!-- ' . esc_html( $reason ) . ' -->' . PHP_EOL; |
|
| 208 | 208 | } |
| 209 | 209 | echo $output; |
| 210 | 210 | } ?> |
| 211 | 211 | <?php if ( $ua ) { ?> |
| 212 | -<script<?php echo $attr_string;?>> |
|
| 212 | +<script<?php echo $attr_string; ?>> |
|
| 213 | 213 | var mi_version = '<?php echo MONSTERINSIGHTS_VERSION; ?>'; |
| 214 | 214 | var mi_track_user = <?php echo ( $track_user ? 'true' : 'false' ); ?>; |
| 215 | - var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason) . "'": "''" ); ?>; |
|
| 215 | + var mi_no_track_reason = <?php echo ( $reason ? "'" . esc_js( $reason ) . "'" : "''" ); ?>; |
|
| 216 | 216 | <?php do_action( 'monsterinsights_tracking_analytics_frontend_output_after_mi_track_user' ); ?> |
| 217 | 217 | |
| 218 | 218 | <?php if ( $this->should_do_optout() ) { ?> |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ?> |
| 257 | 257 | } else { |
| 258 | 258 | <?php if ( $this->should_do_optout() ) { ?> |
| 259 | - console.log( "<?php echo esc_js( $reason );?>" ); |
|
| 259 | + console.log( "<?php echo esc_js( $reason ); ?>" ); |
|
| 260 | 260 | (function() { |
| 261 | 261 | /* https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ |
| 262 | 262 | var noopfn = function() { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | var f = arguments[len-1]; |
| 281 | 281 | if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) { |
| 282 | - 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 ); |
|
| 282 | + 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 ); |
|
| 283 | 283 | return; |
| 284 | 284 | } |
| 285 | 285 | try { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ( ! is_array( $inbound_paths ) ) { |
| 62 | 62 | $inbound_paths = array(); |
| 63 | 63 | } else { |
| 64 | - foreach( $inbound_paths as $index => $pair ) { |
|
| 64 | + foreach ( $inbound_paths as $index => $pair ) { |
|
| 65 | 65 | // if empty pair, unset and continue |
| 66 | 66 | if ( empty( $pair['path'] ) ) { |
| 67 | 67 | unset( $inbound_paths[$index] ); |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | $download_extensions = array( $download_extensions ); |
| 88 | 88 | } |
| 89 | 89 | $i = 0; |
| 90 | - foreach( $download_extensions as $extension ){ |
|
| 91 | - $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
|
| 90 | + foreach ( $download_extensions as $extension ) { |
|
| 91 | + $download_extensions[$i] = esc_js( trim( $extension ) ); |
|
| 92 | 92 | $i++; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $download_extensions = array( $download_extensions ); |
| 88 | 88 | } |
| 89 | 89 | $i = 0; |
| 90 | - foreach( $download_extensions as $extension ){ |
|
| 90 | + foreach( $download_extensions as $extension ) { |
|
| 91 | 91 | $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
| 92 | 92 | $i++; |
| 93 | 93 | } |