@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | self::$instance->notices = new MonsterInsights_Notice_Admin(); |
234 | 234 | self::$instance->license_actions = new MonsterInsights_License_Actions(); |
235 | 235 | self::$instance->reporting = new MonsterInsights_Reporting(); |
236 | - self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
236 | + self::$instance->api_auth = new MonsterInsights_API_Auth(); |
|
237 | 237 | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
238 | 238 | self::$instance->require_updater(); |
239 | 239 | } else { |
240 | 240 | add_action( 'admin_init', array( self::$instance, 'require_updater' ) ); |
241 | 241 | } |
242 | 242 | |
243 | - self::$instance->routes = new MonsterInsights_Rest_Routes(); |
|
243 | + self::$instance->routes = new MonsterInsights_Rest_Routes(); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | if ( monsterinsights_is_pro_version() ) { |
@@ -351,11 +351,11 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) { |
354 | - define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
354 | + define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) { |
358 | - define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
358 | + define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | // Traditional WordPress plugin locale filter. |
378 | - $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
378 | + $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
379 | 379 | $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); |
380 | 380 | |
381 | 381 | // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | public function monsterinsights_wp_notice() { |
415 | 415 | $url = admin_url( 'plugins.php' ); |
416 | 416 | // Check for MS dashboard |
417 | - if( is_network_admin() ) { |
|
417 | + if ( is_network_admin() ) { |
|
418 | 418 | $url = network_admin_url( 'plugins.php' ); |
419 | 419 | } |
420 | 420 | ?> |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | public function monsterinsights_pro_notice() { |
436 | 436 | $url = admin_url( 'plugins.php' ); |
437 | 437 | // Check for MS dashboard |
438 | - if( is_network_admin() ) { |
|
438 | + if ( is_network_admin() ) { |
|
439 | 439 | $url = network_admin_url( 'plugins.php' ); |
440 | 440 | } |
441 | 441 | ?> |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php'; |
462 | 462 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php'; |
463 | 463 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php'; |
464 | - $monsterinsights_settings = monsterinsights_get_options(); |
|
464 | + $monsterinsights_settings = monsterinsights_get_options(); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | * |
476 | 476 | * @return void |
477 | 477 | */ |
478 | - public function load_licensing(){ |
|
478 | + public function load_licensing() { |
|
479 | 479 | if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
480 | 480 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/license.php'; |
481 | 481 | self::$instance->license = new MonsterInsights_License(); |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | $instance->api_auth->delete_auth(); |
643 | 643 | |
644 | 644 | // Delete data |
645 | - $instance->reporting->delete_aggregate_data('site'); |
|
645 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
646 | 646 | |
647 | 647 | // Delete license |
648 | 648 | $instance->license->delete_site_license(); |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $instance->api_auth->uninstall_network_auth(); |
654 | 654 | |
655 | 655 | // Delete network data |
656 | - $instance->reporting->delete_aggregate_data('network'); |
|
656 | + $instance->reporting->delete_aggregate_data( 'network' ); |
|
657 | 657 | |
658 | 658 | // Delete network license |
659 | 659 | $instance->license->delete_network_license(); |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | $instance->api_auth->delete_auth(); |
663 | 663 | |
664 | 664 | // Delete data |
665 | - $instance->reporting->delete_aggregate_data('site'); |
|
665 | + $instance->reporting->delete_aggregate_data( 'site' ); |
|
666 | 666 | |
667 | 667 | // Delete license |
668 | 668 | $instance->license->delete_site_license(); |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | * |
757 | 757 | * @return void |
758 | 758 | */ |
759 | -function monsterinsights_lite_call_install_and_upgrade(){ |
|
759 | +function monsterinsights_lite_call_install_and_upgrade() { |
|
760 | 760 | add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' ); |
761 | 761 | } |
762 | 762 |
@@ -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 ) ) ) { |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | $user = new WP_User( $user_id ); |
33 | 33 | } |
34 | 34 | |
35 | - $track_user = true; |
|
36 | - $roles = monsterinsights_get_option( 'ignore_users', array() ); |
|
35 | + $track_user = true; |
|
36 | + $roles = monsterinsights_get_option( 'ignore_users', array() ); |
|
37 | 37 | |
38 | 38 | if ( ! empty( $roles ) && is_array( $roles ) ) { |
39 | 39 | foreach ( $roles as $role ) { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | |
101 | 101 | $ga_cookie = $_COOKIE['_ga']; |
102 | - $cookie_parts = explode('.', $ga_cookie ); |
|
102 | + $cookie_parts = explode( '.', $ga_cookie ); |
|
103 | 103 | if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) { |
104 | 104 | $uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3]; |
105 | 105 | if ( is_string( $uuid ) ) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | $ga_cookie = $_COOKIE['_ga']; |
161 | - $cookie_parts = explode('.', $ga_cookie ); |
|
161 | + $cookie_parts = explode( '.', $ga_cookie ); |
|
162 | 162 | if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) { |
163 | 163 | $uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3]; |
164 | 164 | if ( is_string( $uuid ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | |
175 | 175 | function monsterinsights_generate_ga_client_id() { |
176 | - return rand(100000000,999999999) . '.' . time(); |
|
176 | + return rand( 100000000, 999999999 ) . '.' . time(); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $stop = time(); |
194 | 194 | } |
195 | 195 | |
196 | - $diff = (int) abs( $stop - $start ); |
|
196 | + $diff = (int) abs( $stop - $start ); |
|
197 | 197 | $hours = round( $diff / HOUR_IN_SECONDS ); |
198 | 198 | return $hours; |
199 | 199 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $editable_roles = apply_filters( 'editable_roles', $all_roles ); |
252 | 252 | |
253 | 253 | foreach ( $editable_roles as $id => $name ) { |
254 | - $roles[ $id ] = translate_user_role( $name['name'] ); |
|
254 | + $roles[$id] = translate_user_role( $name['name'] ); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | return $roles; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | foreach ( $editable_roles as $id => $role ) { |
279 | 279 | if ( isset( $role['capabilities']['manage_options'] ) && $role['capabilities']['manage_options'] ) { |
280 | - $roles[ $id ] = translate_user_role( $role['name'] ); |
|
280 | + $roles[$id] = translate_user_role( $role['name'] ); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | } |
325 | 325 | if ( substr_count( $host, '.' ) > 1 ) { |
326 | - $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
326 | + $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' ); |
|
327 | 327 | foreach ( $subdomains_to_check as $subdomain ) { |
328 | 328 | $subdomain = str_replace( '.', '(.)', $subdomain ); |
329 | 329 | $subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain ); |
@@ -339,16 +339,16 @@ discard block |
||
339 | 339 | |
340 | 340 | // Set cookie to expire in 2 years |
341 | 341 | function monsterinsights_get_cookie_expiration_date( $time ) { |
342 | - return date('D, j F Y H:i:s', time() + $time ); |
|
342 | + return date( 'D, j F Y H:i:s', time() + $time ); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | function monsterinsights_string_ends_with( $string, $ending ) { |
346 | - $strlen = strlen($string); |
|
347 | - $endinglen = strlen($ending); |
|
346 | + $strlen = strlen( $string ); |
|
347 | + $endinglen = strlen( $ending ); |
|
348 | 348 | if ( $endinglen > $strlen ) { |
349 | 349 | return false; |
350 | 350 | } |
351 | - return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0; |
|
351 | + return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | function monsterinsights_string_starts_with( $string, $start ) { |
@@ -872,11 +872,11 @@ discard block |
||
872 | 872 | return $countries; |
873 | 873 | } |
874 | 874 | |
875 | -function monsterinsights_get_api_url(){ |
|
875 | +function monsterinsights_get_api_url() { |
|
876 | 876 | return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' ); |
877 | 877 | } |
878 | 878 | |
879 | -function monsterinsights_get_licensing_url(){ |
|
879 | +function monsterinsights_get_licensing_url() { |
|
880 | 880 | return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' ); |
881 | 881 | } |
882 | 882 | |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | } |
921 | 921 | } |
922 | 922 | |
923 | -if ( ! function_exists ( 'remove_class_filter' ) ) { |
|
923 | +if ( ! function_exists( 'remove_class_filter' ) ) { |
|
924 | 924 | /** |
925 | 925 | * Remove Class Filter Without Access to Class Object |
926 | 926 | * |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) { |
942 | 942 | global $wp_filter; |
943 | 943 | // Check that filter actually exists first |
944 | - if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE; |
|
944 | + if ( ! isset( $wp_filter[$tag] ) ) return FALSE; |
|
945 | 945 | /** |
946 | 946 | * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer |
947 | 947 | * a simple array, rather it is an object that implements the ArrayAccess interface. |
@@ -950,33 +950,33 @@ discard block |
||
950 | 950 | * |
951 | 951 | * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/ |
952 | 952 | */ |
953 | - if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) { |
|
954 | - $callbacks = &$wp_filter[ $tag ]->callbacks; |
|
953 | + if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) { |
|
954 | + $callbacks = &$wp_filter[$tag]->callbacks; |
|
955 | 955 | } else { |
956 | - $callbacks = &$wp_filter[ $tag ]; |
|
956 | + $callbacks = &$wp_filter[$tag]; |
|
957 | 957 | } |
958 | 958 | // Exit if there aren't any callbacks for specified priority |
959 | - if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE; |
|
959 | + if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE; |
|
960 | 960 | // Loop through each filter for the specified priority, looking for our class & method |
961 | - foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) { |
|
961 | + foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) { |
|
962 | 962 | // Filter should always be an array - array( $this, 'method' ), if not goto next |
963 | - if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue; |
|
963 | + if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue; |
|
964 | 964 | // If first value in array is not an object, it can't be a class |
965 | - if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue; |
|
965 | + if ( ! is_object( $filter['function'][0] ) ) continue; |
|
966 | 966 | // Method doesn't match the one we're looking for, goto next |
967 | - if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue; |
|
967 | + if ( $filter['function'][1] !== $method_name ) continue; |
|
968 | 968 | // Method matched, now let's check the Class |
969 | - if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) { |
|
969 | + if ( get_class( $filter['function'][0] ) === $class_name ) { |
|
970 | 970 | // Now let's remove it from the array |
971 | - unset( $callbacks[ $priority ][ $filter_id ] ); |
|
971 | + unset( $callbacks[$priority][$filter_id] ); |
|
972 | 972 | // and if it was the only filter in that priority, unset that priority |
973 | - if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] ); |
|
973 | + if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] ); |
|
974 | 974 | // and if the only filter for that tag, set the tag to an empty array |
975 | 975 | if ( empty( $callbacks ) ) $callbacks = array(); |
976 | 976 | // If using WordPress older than 4.7 |
977 | - if ( ! is_object( $wp_filter[ $tag ] ) ) { |
|
977 | + if ( ! is_object( $wp_filter[$tag] ) ) { |
|
978 | 978 | // Remove this filter from merged_filters, which specifies if filters have been sorted |
979 | - unset( $GLOBALS[ 'merged_filters' ][ $tag ] ); |
|
979 | + unset( $GLOBALS['merged_filters'][$tag] ); |
|
980 | 980 | } |
981 | 981 | return TRUE; |
982 | 982 | } |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | } |
986 | 986 | } // End function exists |
987 | 987 | |
988 | -if ( ! function_exists ( 'remove_class_action' ) ) { |
|
988 | +if ( ! function_exists( 'remove_class_action' ) ) { |
|
989 | 989 | /** |
990 | 990 | * Remove Class Action Without Access to Class Object |
991 | 991 | * |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | foreach ( $translations->entries as $msgid => $entry ) { |
1058 | - $locale[ $msgid ] = $entry->translations; |
|
1058 | + $locale[$msgid] = $entry->translations; |
|
1059 | 1059 | } |
1060 | 1060 | |
1061 | 1061 | return $locale; |
@@ -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 ) ) { |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | |
36 | 36 | if ( $dashboards_disabled || ! $is_authed || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
37 | 37 | // If dashboards disabled, first settings page |
38 | - add_menu_page( __( 'Settings:', '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( __( 'Settings:', '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, __( 'Settings:', '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 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
83 | 83 | $hook = 'monsterinsights_network'; |
84 | - 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' ); |
|
84 | + 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' ); |
|
85 | 85 | |
86 | 86 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
87 | 87 | |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | * @return array $links |
117 | 117 | */ |
118 | 118 | function monsterinsights_add_action_links( $links ) { |
119 | - $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>'; |
|
119 | + $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>'; |
|
120 | 120 | array_unshift( $links, $docs ); |
121 | 121 | |
122 | 122 | // If lite, show a link where they can get pro from |
123 | 123 | if ( ! monsterinsights_is_pro_version() ) { |
124 | - $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>'; |
|
124 | + $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>'; |
|
125 | 125 | array_unshift( $links, $get_pro ); |
126 | 126 | } |
127 | 127 | |
128 | 128 | // If Lite, support goes to forum. If pro, it goes to our website |
129 | 129 | if ( monsterinsights_is_pro_version() ) { |
130 | - $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>'; |
|
130 | + $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>'; |
|
131 | 131 | array_unshift( $links, $support ); |
132 | 132 | } else { |
133 | - $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>'; |
|
133 | + $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>'; |
|
134 | 134 | array_unshift( $links, $support ); |
135 | 135 | } |
136 | 136 | |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
160 | 160 | |
161 | 161 | if ( file_exists( $dir . $template . '.php' ) ) { |
162 | - require_once( $dir . $template . '.php' ); |
|
162 | + require_once( $dir . $template . '.php' ); |
|
163 | 163 | return true; |
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
167 | 167 | |
168 | 168 | if ( file_exists( $dir . $template . '.php' ) ) { |
169 | - require_once( $dir . $template . '.php' ); |
|
169 | + require_once( $dir . $template . '.php' ); |
|
170 | 170 | return true; |
171 | 171 | } |
172 | 172 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
175 | 175 | |
176 | 176 | if ( file_exists( $dir . $template . '.php' ) ) { |
177 | - require_once( $dir . $template . '.php' ); |
|
177 | + require_once( $dir . $template . '.php' ); |
|
178 | 178 | return true; |
179 | 179 | } |
180 | 180 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | '2xlogo' => plugins_url( 'assets/css/images/[email protected]', MonsterInsights()->file ), |
212 | 212 | ) ); |
213 | 213 | } |
214 | -add_action( 'in_admin_header','monsterinsights_admin_header', 100 ); |
|
214 | +add_action( 'in_admin_header', 'monsterinsights_admin_header', 100 ); |
|
215 | 215 | |
216 | 216 | /** |
217 | 217 | * When user is on a MonsterInsights related admin page, display footer text |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | global $current_screen; |
226 | 226 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
227 | 227 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
228 | - $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>' ); |
|
228 | + $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>' ); |
|
229 | 229 | } |
230 | 230 | return $text; |
231 | 231 | } |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | // 1. Google Analytics not authenticated |
260 | 260 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
261 | 261 | $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
262 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
263 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
262 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ), '<a href="' . $page . '">', '</a>' ); |
|
263 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
264 | 264 | return; |
265 | 265 | } |
266 | 266 | |
@@ -268,17 +268,17 @@ discard block |
||
268 | 268 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
269 | 269 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
270 | 270 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
271 | - $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>' ); |
|
272 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
271 | + $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>' ); |
|
272 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
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 | - $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>' ); |
|
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() ) { |
283 | 283 | $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
284 | 284 | } else if ( MonsterInsights()->license->site_license_invalid() ) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } else if ( MonsterInsights()->license->get_network_license_key() ) { |
288 | 288 | if ( MonsterInsights()->license->network_license_expired() ) { |
289 | - $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>' ); |
|
289 | + $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>' ); |
|
290 | 290 | } else if ( MonsterInsights()->license->network_license_disabled() ) { |
291 | 291 | $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
292 | 292 | } else if ( MonsterInsights()->license->network_license_invalid() ) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | if ( ! empty( $message ) ) { |
297 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
297 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
298 | 298 | return; |
299 | 299 | } |
300 | 300 | } |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | if ( version_compare( phpversion(), '5.4', '<' ) ) { |
308 | 308 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
309 | 309 | $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>' ); |
310 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
310 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
311 | 311 | return; |
312 | 312 | } |
313 | 313 | // WordPress 3.0 - 4.5 |
314 | 314 | else if ( version_compare( $wp_version, '4.6', '<' ) ) { |
315 | 315 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
316 | 316 | $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>' ); |
317 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
317 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
318 | 318 | return; |
319 | 319 | } |
320 | 320 | // PHP 5.4/5.5 |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | // } |
359 | 359 | // } |
360 | 360 | |
361 | - $notices = get_option( 'monsterinsights_notices' ); |
|
361 | + $notices = get_option( 'monsterinsights_notices' ); |
|
362 | 362 | if ( ! is_array( $notices ) ) { |
363 | 363 | $notices = array(); |
364 | 364 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | $authed = MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed(); |
368 | 368 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
369 | 369 | |
370 | - if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
|
370 | + if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual'] ) ) { |
|
371 | 371 | echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
372 | 372 | echo '<p>'; |
373 | - 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>' ); |
|
373 | + 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>' ); |
|
374 | 374 | echo '</p>'; |
375 | 375 | echo '</div>'; |
376 | 376 | return; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | // 8. WooUpsell |
395 | 395 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
396 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
396 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
397 | 397 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
398 | 398 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
399 | 399 | echo '<p><strong>'; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | echo '<p>'; |
413 | 413 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
414 | 414 | echo '</p>'; |
415 | - 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>' ); |
|
415 | + 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>' ); |
|
416 | 416 | echo '</p>'; |
417 | 417 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
418 | 418 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | // 9. EDDUpsell |
426 | 426 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
427 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
427 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
428 | 428 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
429 | 429 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
430 | 430 | echo '<p><strong>'; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | echo '<p>'; |
444 | 444 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
445 | 445 | echo '</p>'; |
446 | - 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>' ); |
|
446 | + 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>' ); |
|
447 | 447 | echo '</p>'; |
448 | 448 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
449 | 449 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -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 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | - $site_license = array( |
|
39 | + $site_license = array( |
|
40 | 40 | 'key' => MonsterInsights()->license->get_site_license_key(), |
41 | 41 | 'type' => MonsterInsights()->license->get_site_license_type(), |
42 | 42 | 'is_disabled' => MonsterInsights()->license->site_license_disabled(), |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | // Array fields are needed even if empty. |
97 | 97 | $array_fields = array( 'view_reports', 'save_settings', 'ignore_users' ); |
98 | 98 | foreach ( $array_fields as $array_field ) { |
99 | - if ( ! isset( $options[ $array_field ] ) ) { |
|
100 | - $options[ $array_field ] = array(); |
|
99 | + if ( ! isset( $options[$array_field] ) ) { |
|
100 | + $options[$array_field] = array(); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | if ( isset( $options['custom_code'] ) ) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | if ( $empty ) { |
174 | - unset( $value[ $key ] ); |
|
174 | + unset( $value[$key] ); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | foreach ( $addons_data as $addons_type => $addons ) { |
205 | 205 | foreach ( $addons as $addon ) { |
206 | - $slug = 'monsterinsights-' . $addon->slug; |
|
206 | + $slug = 'monsterinsights-' . $addon->slug; |
|
207 | 207 | if ( 'monsterinsights-ecommerce' === $slug ) { |
208 | 208 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
209 | 209 | if ( empty( $addon->installed ) ) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } else { |
214 | 214 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
215 | 215 | } |
216 | - $parsed_addons[ $addon->slug ] = $addon; |
|
216 | + $parsed_addons[$addon->slug] = $addon; |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $installed = false; |
268 | 268 | $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
269 | 269 | |
270 | - if ( isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
270 | + if ( isset( $installed_plugins[$plugin_basename] ) ) { |
|
271 | 271 | $installed = true; |
272 | 272 | $ms_active = is_plugin_active_for_network( $plugin_basename ); |
273 | 273 | $ss_active = is_plugin_active( $plugin_basename ); |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | <?php |
51 | 51 | } |
52 | 52 | |
53 | -function monsterinsights_tools_url_builder_tab(){ |
|
53 | +function monsterinsights_tools_url_builder_tab() { |
|
54 | 54 | do_action( 'monsterinsights_tools_url_builder_tab' ); |
55 | 55 | } |
56 | 56 | |
57 | 57 | function monsterinsights_tools_settings_tab() { |
58 | - ob_start();?> |
|
58 | + ob_start(); ?> |
|
59 | 59 | <div class="monsterinsights-tools-content-area"> |
60 | - <h2><?php echo esc_html__( 'Setting Tools', 'google-analytics-for-wordpress' );?></h2> |
|
60 | + <h2><?php echo esc_html__( 'Setting Tools', 'google-analytics-for-wordpress' ); ?></h2> |
|
61 | 61 | <p><?php echo esc_html__( 'You can use the below tools to import settings from other MonsterInsights websites or export settings to import into another MonsterInsights install.', 'google-analytics-for-wordpress' ); ?> </p> |
62 | 62 | <br /> |
63 | 63 | <table class="form-table"> |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | <tr> |
66 | 66 | <th scope="row"> |
67 | 67 | <label for="monsterinsights-import-settings"> |
68 | - <?php echo esc_html__( 'Import Settings', 'google-analytics-for-wordpress' );?> |
|
68 | + <?php echo esc_html__( 'Import Settings', 'google-analytics-for-wordpress' ); ?> |
|
69 | 69 | </label> |
70 | 70 | </th> |
71 | 71 | <td> |
72 | 72 | <?php |
73 | - if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ){ |
|
74 | - echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!','google-analytics-for-wordpress'), 'success', false, array() ); |
|
73 | + if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ) { |
|
74 | + echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!', 'google-analytics-for-wordpress' ), 'success', false, array() ); |
|
75 | 75 | } |
76 | 76 | ?> |
77 | 77 | <form method="post" enctype="multipart/form-data"> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <input type="file" name="import_file"/> |
80 | 80 | <input type="hidden" name="monsterinsights_action" value="monsterinsights_import_settings" /> |
81 | 81 | </p> |
82 | - <p class="description"><?php echo esc_html__( 'Use the filepicker above to select the settings export file from another site', 'google-analytics-for-wordpress' );?></p> |
|
82 | + <p class="description"><?php echo esc_html__( 'Use the filepicker above to select the settings export file from another site', 'google-analytics-for-wordpress' ); ?></p> |
|
83 | 83 | <p> |
84 | 84 | <?php wp_nonce_field( 'monsterinsights_import_settings', 'monsterinsights_import_settings' ); ?> |
85 | 85 | </p> |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | <tr> |
93 | 93 | <th scope="row"> |
94 | 94 | <label for="monsterinsights-export-settings"> |
95 | - <?php echo esc_html__( 'Export Settings:', 'google-analytics-for-wordpress' );?> |
|
95 | + <?php echo esc_html__( 'Export Settings:', 'google-analytics-for-wordpress' ); ?> |
|
96 | 96 | </label> |
97 | 97 | </th> |
98 | 98 | <td> |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return void |
127 | 127 | */ |
128 | 128 | function monsterinsights_process_export_settings() { |
129 | - if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
129 | + if ( ! isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | return; |
135 | 135 | } |
136 | 136 | |
137 | - if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ){ |
|
137 | + if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | function monsterinsights_import_settings() { |
159 | 159 | |
160 | - if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
160 | + if ( ! isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | return; |
166 | 166 | } |
167 | 167 | |
168 | - if ( $_POST['monsterinsights_action'] !== 'monsterinsights_import_settings' ){ |
|
168 | + if ( $_POST['monsterinsights_action'] !== 'monsterinsights_import_settings' ) { |
|
169 | 169 | return; |
170 | 170 | } |
171 | 171 | |
172 | - if ( !wp_verify_nonce( $_POST['monsterinsights_import_settings'], 'monsterinsights_import_settings' ) ) { |
|
172 | + if ( ! wp_verify_nonce( $_POST['monsterinsights_import_settings'], 'monsterinsights_import_settings' ) ) { |
|
173 | 173 | return; |
174 | 174 | } |
175 | 175 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | wp_die( __( 'Please upload a file to import', 'google-analytics-for-wordpress' ) ); |
187 | 187 | } |
188 | 188 | |
189 | - $file = file_get_contents( $import_file ); |
|
189 | + $file = file_get_contents( $import_file ); |
|
190 | 190 | if ( empty( $file ) ) { |
191 | 191 | wp_die( __( 'Please upload a real settings export file to import', 'google-analytics-for-wordpress' ) ); |
192 | 192 | } |
@@ -204,20 +204,20 @@ discard block |
||
204 | 204 | ); |
205 | 205 | |
206 | 206 | foreach ( $exclude as $e ) { |
207 | - if ( ! empty( $new_settings[ $e ] ) ) { |
|
208 | - unset( $new_settings[ $e ] ); |
|
207 | + if ( ! empty( $new_settings[$e] ) ) { |
|
208 | + unset( $new_settings[$e] ); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | |
212 | 212 | if ( ! is_super_admin() ) { |
213 | - if ( ! empty( $new_settings[ 'custom_code' ] ) ) { |
|
214 | - unset( $new_settings[ 'custom_code' ] ); |
|
213 | + if ( ! empty( $new_settings['custom_code'] ) ) { |
|
214 | + unset( $new_settings['custom_code'] ); |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | 218 | foreach ( $exclude as $e ) { |
219 | - if ( ! empty( $settings[ $e ] ) ) { |
|
220 | - $new_settings = $settings[ $e ]; |
|
219 | + if ( ! empty( $settings[$e] ) ) { |
|
220 | + $new_settings = $settings[$e]; |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @since 6.0.0 |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10 , 3 ); |
|
33 | + add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10, 3 ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | - public function additional_data(){ |
|
43 | + public function additional_data() { |
|
44 | 44 | return array(); |
45 | 45 | } |
46 | 46 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function show_report( $args = array() ) { |
52 | 52 | |
53 | 53 | if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) { |
54 | - return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) ); |
|
54 | + return monsterinsights_get_message( 'error', esc_html__( 'Access denied', 'google-analytics-for-wordpress' ) ); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ( monsterinsights_is_pro_version() ){ |
|
72 | + if ( monsterinsights_is_pro_version() ) { |
|
73 | 73 | if ( ! MonsterInsights()->license->has_license() ) { |
74 | 74 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
75 | - return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' ); |
|
75 | + return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
76 | 76 | } else if ( MonsterInsights()->license->license_has_error() ) { |
77 | 77 | return monsterinsights_get_message( 'error', $this->get_license_error() ); |
78 | 78 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | return monsterinsights_get_message( 'error', $args['error'] ); |
108 | 108 | } |
109 | 109 | |
110 | - if ( empty( $args['data' ] ) || ! is_array( $args['data' ] ) ) { |
|
110 | + if ( empty( $args['data'] ) || ! is_array( $args['data'] ) ) { |
|
111 | 111 | if ( monsterinsights_is_pro_version() ) { |
112 | 112 | return ''; |
113 | 113 | } else { |
114 | 114 | // Try to get default data. |
115 | 115 | $args = $this->get_data( array( 'default' => true ) ); |
116 | - if ( empty( $args['data'] ) || is_array( $args['data' ] ) ) { |
|
116 | + if ( empty( $args['data'] ) || is_array( $args['data'] ) ) { |
|
117 | 117 | return monsterinsights_get_message( 'error', __( 'No data found', 'google-analytics-for-wordpress' ) ); |
118 | 118 | } |
119 | 119 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | $start = ! empty( $args['start'] ) && $this->is_valid_date( $args['start'] ) ? $args['start'] : ''; |
150 | - $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
150 | + $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
151 | 151 | |
152 | 152 | if ( ! MonsterInsights()->license->license_can( $this->level ) ) { |
153 | 153 | return array( |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | $data = ! $site_auth && $ms_auth ? get_site_transient( $transient ) : get_transient( $transient ); |
205 | 205 | } |
206 | 206 | |
207 | - if ( ! empty( $data ) && |
|
208 | - ! empty( $data['expires'] ) && |
|
207 | + if ( ! empty( $data ) && |
|
208 | + ! empty( $data['expires'] ) && |
|
209 | 209 | $data['expires'] >= time() && |
210 | - ! empty( $data['data'] ) && |
|
211 | - ! empty( $data['p'] ) && |
|
210 | + ! empty( $data['data'] ) && |
|
211 | + ! empty( $data['p'] ) && |
|
212 | 212 | $data['p'] === $p |
213 | 213 | ) { |
214 | 214 | return array( |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | // Nothing in cache, either not saved before, expired or mismatch. Let's grab from API |
221 | - $api_options = array( 'start' => $start, 'end' => $end); |
|
221 | + $api_options = array( 'start' => $start, 'end' => $end ); |
|
222 | 222 | if ( ! $site_auth && $ms_auth ) { |
223 | 223 | $api_options['network'] = true; |
224 | 224 | } |
225 | 225 | |
226 | - $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
226 | + $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
227 | 227 | |
228 | 228 | $additional_data = $this->additional_data(); |
229 | 229 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $api->set_additional_data( $additional_data ); |
232 | 232 | } |
233 | 233 | |
234 | - $ret = $api->request(); |
|
234 | + $ret = $api->request(); |
|
235 | 235 | |
236 | 236 | if ( is_wp_error( $ret ) ) { |
237 | 237 | return array( |
@@ -291,44 +291,44 @@ discard block |
||
291 | 291 | // Is a valid date value |
292 | 292 | public function is_valid_date( $date = '' ) { |
293 | 293 | $d = MonsterInsightsDateTime::createFromFormat( 'Y-m-d', $date ); |
294 | - return $d && $d->format('Y-m-d') === $date; |
|
294 | + return $d && $d->format( 'Y-m-d' ) === $date; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Do not use the functions below this. They are unused and are just here so people |
299 | 299 | * with out of date MonsterInsights addons won't get fatal errors. |
300 | 300 | */ |
301 | - protected function get_api_max_limit() {return 300;} |
|
302 | - protected function get_date_range() {return array();} |
|
301 | + protected function get_api_max_limit() {return 300; } |
|
302 | + protected function get_date_range() {return array(); } |
|
303 | 303 | |
304 | 304 | public function get_upsell_notice() { |
305 | 305 | $has_level = MonsterInsights()->license->get_license_type(); |
306 | 306 | $has_level = $has_level ? $has_level : 'lite'; |
307 | 307 | $message = sprintf( __( 'You currently have a %s level license, but this report requires at least a %s level license to view the %s. Please upgrade to view this report.', 'google-analytics-for-wordpress' ), $has_level, $this->level, $this->title ); |
308 | - ob_start();?> |
|
309 | - <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name;?>-bg"> |
|
308 | + ob_start(); ?> |
|
309 | + <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name; ?>-bg"> |
|
310 | 310 | <div class="monsterinsights-upsell-container"> |
311 | 311 | <div class="row justify-content-center"> |
312 | 312 | <div class="col-lg-10 col-lg-offset-1 align-self-center"> |
313 | 313 | <div class="monsterinsights-upsell-card"> |
314 | - <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/[email protected] 2x" alt=""> |
|
314 | + <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/[email protected] 2x" alt=""> |
|
315 | 315 | <div class="monsterinsights-upsell-card-card-content"> |
316 | - <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' );?></span> |
|
317 | - <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' );?></strong></p> |
|
316 | + <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' ); ?></span> |
|
317 | + <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' ); ?></strong></p> |
|
318 | 318 | <?php if ( monsterinsights_is_pro_version() ) { ?> |
319 | 319 | <p ><?php echo sprintf( esc_html__( "Hey there! It looks like you've got the %s license installed on your site. |
320 | - That's awesome! %s",'google-analytics-for-wordpress'), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
320 | + That's awesome! %s",'google-analytics-for-wordpress' ), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
321 | 321 | |
322 | - <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<strong><a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'">' . $this->level,'</a></strong>' ); ?></p> |
|
323 | - <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'"><strong>','</strong></a>', '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) .'" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
324 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
322 | + <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<strong><a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '">' . $this->level, '</a></strong>' ); ?></p> |
|
323 | + <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '"><strong>', '</strong></a>', '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) . '" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
324 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
325 | 325 | <?php } else { ?> |
326 | 326 | <p><?php echo sprintf( esc_html__( "Hey there! %s It looks like you've got the free version of MonsterInsights installed on your site. |
327 | - That's awesome!",'google-analytics-for-wordpress'), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
327 | + That's awesome!",'google-analytics-for-wordpress' ), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
328 | 328 | |
329 | - <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'">' . $this->level,'</a>' ); ?></p> |
|
330 | - <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?></p> |
|
331 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
329 | + <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '">' . $this->level, '</a>' ); ?></p> |
|
330 | + <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?></p> |
|
331 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
332 | 332 | <?php } ?> |
333 | 333 | </div> |
334 | 334 | <div class="monsterinsights-upsell-card-action"> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * @return string |
367 | 367 | */ |
368 | 368 | public function get_addons_page_link() { |
369 | - $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
369 | + $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
370 | 370 | return sprintf( '<a href="%1$s">%2$s</a>', $addons_url, esc_html__( 'Visit addons page', 'google-analytics-for-wordpress' ) ); |
371 | 371 | } |
372 | 372 |