Google Analytics - Version 2.1.3

Version Description

Download this release

Release Info

Developer ShareThis
Plugin Icon wp plugin Google Analytics
Version 2.1.3
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.3

class/Ga_Admin.php CHANGED
@@ -288,10 +288,10 @@ class Ga_Admin {
288
 
289
  if ( Ga_Helper::is_authorized() ) {
290
  $data[ 'ga_accounts_selector' ] = self::get_accounts_selector();
291
- $data[ 'auth_button' ] = self::get_auth_button( 'Re-authenticate with Google' );
292
  } else {
293
  $data[ 'popup_url' ] = self::get_auth_popup_url();
294
- $data[ 'auth_button' ] = self::get_auth_button( 'Authenticate with Google' );
295
  }
296
  $data['debug_modal'] = self::get_debug_modal();
297
  if ( !empty( $_GET[ 'err' ] ) ) {
@@ -299,6 +299,9 @@ class Ga_Admin {
299
  case 1:
300
  $data[ 'error_message' ] = Ga_Helper::ga_oauth_notice( 'There was a problem with Google Oauth2 authentication process.' );
301
  break;
 
 
 
302
  }
303
  }
304
  Ga_View_Core::load( 'page', array(
@@ -343,7 +346,7 @@ class Ga_Admin {
343
  public static function enqueue_ga_scripts() {
344
  wp_register_script( GA_NAME . '-page-js', Ga_Helper::get_plugin_url_with_correct_protocol() . '/js/' . GA_NAME . '_page.js', array(
345
  'jquery'
346
- ) );
347
  wp_enqueue_script( GA_NAME . '-page-js' );
348
  }
349
 
@@ -548,6 +551,14 @@ class Ga_Admin {
548
  $param = '';
549
  if ( !self::save_access_token( $response ) ) {
550
  $param = '&err=1';
 
 
 
 
 
 
 
 
551
  } else {
552
  self::api_client()->set_access_token( $response->getData() );
553
  // Get accounts data
@@ -690,10 +701,11 @@ class Ga_Admin {
690
  *
691
  * @return string
692
  */
693
- public static function get_auth_button( $label ) {
694
 
695
  return Ga_View_Core::load( 'ga_auth_button', array(
696
- 'label' => $label,
 
697
  'url' => self::get_auth_popup_url(),
698
  'manually_id' => get_option( self::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME )
699
  ), true );
288
 
289
  if ( Ga_Helper::is_authorized() ) {
290
  $data[ 'ga_accounts_selector' ] = self::get_accounts_selector();
291
+ $data[ 'auth_button' ] = self::get_auth_button( 'reauth' );
292
  } else {
293
  $data[ 'popup_url' ] = self::get_auth_popup_url();
294
+ $data[ 'auth_button' ] = self::get_auth_button( 'auth' );
295
  }
296
  $data['debug_modal'] = self::get_debug_modal();
297
  if ( !empty( $_GET[ 'err' ] ) ) {
299
  case 1:
300
  $data[ 'error_message' ] = Ga_Helper::ga_oauth_notice( 'There was a problem with Google Oauth2 authentication process.' );
301
  break;
302
+ case 2:
303
+ $data[ 'error_message' ] = Ga_Helper::ga_wp_notice( 'Authentication code is incorrect.', 'error', true );
304
+ break;
305
  }
306
  }
307
  Ga_View_Core::load( 'page', array(
346
  public static function enqueue_ga_scripts() {
347
  wp_register_script( GA_NAME . '-page-js', Ga_Helper::get_plugin_url_with_correct_protocol() . '/js/' . GA_NAME . '_page.js', array(
348
  'jquery'
349
+ ), GOOGLEANALYTICS_VERSION );
350
  wp_enqueue_script( GA_NAME . '-page-js' );
351
  }
352
 
551
  $param = '';
552
  if ( !self::save_access_token( $response ) ) {
553
  $param = '&err=1';
554
+ $errors = self::api_client()->get_errors();
555
+ if ( !empty( $errors ) ){
556
+ foreach ( $errors as $error ) {
557
+ if ( $error[ 'message' ] == 'invalid_grant' ){
558
+ $param = '&err=2';
559
+ }
560
+ }
561
+ }
562
  } else {
563
  self::api_client()->set_access_token( $response->getData() );
564
  // Get accounts data
701
  *
702
  * @return string
703
  */
704
+ public static function get_auth_button( $type ) {
705
 
706
  return Ga_View_Core::load( 'ga_auth_button', array(
707
+ 'label' => ( $type == 'auth' ) ? 'Authenticate with Google' : 'Re-authenticate with Google',
708
+ 'type' => $type,
709
  'url' => self::get_auth_popup_url(),
710
  'manually_id' => get_option( self::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME )
711
  ), true );
class/Ga_Helper.php CHANGED
@@ -594,4 +594,15 @@ class Ga_Helper {
594
  $url = parse_url( GA_PLUGIN_URL );
595
  return ( ( is_ssl() ) ? 'https://' : 'http://' ) . $url['host'] . $url['path'];
596
  }
 
 
 
 
 
 
 
 
 
 
 
597
  }
594
  $url = parse_url( GA_PLUGIN_URL );
595
  return ( ( is_ssl() ) ? 'https://' : 'http://' ) . $url['host'] . $url['path'];
596
  }
597
+
598
+ public static function get_code_manually_label_classes() {
599
+ $classes = '';
600
+ if ( ! self::are_features_enabled() ){
601
+ $classes = 'label-grey ga-tooltip';
602
+ }
603
+ else if( self::is_account_selected() ) {
604
+ $classes = 'label-grey';
605
+ }
606
+ return $classes;
607
+ }
608
  }
class/Ga_Notice.php CHANGED
@@ -15,6 +15,8 @@ class Ga_Notice {
15
 
16
  if ( Ga_Helper::GA_DEBUG_MODE ) {
17
  $message = Ga_Helper::ga_wp_notice( (!empty( $error[ 'class' ] ) ? _( '[' . $error[ 'class' ] . ']' ) : '' ) . ' ' . $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
 
 
18
  } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_InvalidDomain_Exception' ) {
19
  $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
20
  } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_Invite_Exception' ) {
15
 
16
  if ( Ga_Helper::GA_DEBUG_MODE ) {
17
  $message = Ga_Helper::ga_wp_notice( (!empty( $error[ 'class' ] ) ? _( '[' . $error[ 'class' ] . ']' ) : '' ) . ' ' . $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
18
+ } elseif ( $error[ 'class' ] == 'Ga_Lib_Google_Api_Client_AuthCode_Exception' ) {
19
+ $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
20
  } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_InvalidDomain_Exception' ) {
21
  $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
22
  } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_Invite_Exception' ) {
class/Ga_Sharethis.php CHANGED
@@ -22,8 +22,9 @@ class Ga_Sharethis {
22
  */
23
  public static function create_sharethis_options( $api_client ) {
24
  $data = array();
 
25
  if ( Ga_Helper::should_create_sharethis_property() ) {
26
- $domain = parse_url( get_site_url(), PHP_URL_HOST );
27
  $query_params = array( 'domain' => $domain );
28
  $response = $api_client->call( 'ga_api_create_sharethis_property', array(
29
  $query_params
22
  */
23
  public static function create_sharethis_options( $api_client ) {
24
  $data = array();
25
+ $parsed_url = parse_url( get_option( 'siteurl' ) );
26
  if ( Ga_Helper::should_create_sharethis_property() ) {
27
+ $domain = $parsed_url['host'] . ( !empty( $parsed_url['path'] ) ? $parsed_url['path'] : '' );
28
  $query_params = array( 'domain' => $domain );
29
  $response = $api_client->call( 'ga_api_create_sharethis_property', array(
30
  $query_params
class/Ga_View.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
-
3
- class Ga_View {
4
-
5
- /**
6
- * Name of the view folder.
7
- */
8
- const PATH = 'view';
9
-
10
- /**
11
- * Loads given view file and it's data.
12
- * Displays view or returns HTML code.
13
- *
14
- * @param string $view Filename
15
- * @param array $data Data array
16
- * @param bool $html Whether to display or return HTML code.
17
- *
18
- * @return string
19
- */
20
- public static function load( $view, $data_array = array(), $html = false ) {
21
- if ( ! empty( $view ) ) {
22
- foreach ( $data_array as $k => $v ) {
23
- $$k = $v;
24
- }
25
- ob_start();
26
- include GA_PLUGIN_DIR . "/" . self::PATH . "/" . $view . ".php";
27
- if ( $html ) {
28
- return ob_get_clean();
29
- } else {
30
- echo ob_get_clean();
31
- }
32
- }
33
- }
34
-
35
- // private static function buffer($buffer) {
36
- // $data = $data_array;
37
- // return $buffer;
38
- // }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
googleanalytics.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Google Analytics
5
  * Plugin URI: http://wordpress.org/extend/plugins/googleanalytics/
6
  * Description: Use Google Analytics on your Wordpress site without touching any code, and view visitor reports right in your Wordpress admin dashboard!
7
- * Version: 2.1.2
8
  * Author: ShareThis
9
  * Author URI: http://sharethis.com
10
  */
@@ -46,7 +46,7 @@ if ( !preg_match( '/(\/|\\\)' . GA_NAME . '(\/|\\\)/', realpath( __FILE__ ), $te
46
  die();
47
  }
48
 
49
- define( 'GOOGLEANALYTICS_VERSION', '2.1.2' );
50
  include_once GA_PLUGIN_DIR . '/overwrite/ga_overwrite.php';
51
  include_once GA_PLUGIN_DIR . '/class/Ga_Autoloader.php';
52
  include_once GA_PLUGIN_DIR . '/tools/class-support-logging.php';
4
  * Plugin Name: Google Analytics
5
  * Plugin URI: http://wordpress.org/extend/plugins/googleanalytics/
6
  * Description: Use Google Analytics on your Wordpress site without touching any code, and view visitor reports right in your Wordpress admin dashboard!
7
+ * Version: 2.1.3
8
  * Author: ShareThis
9
  * Author URI: http://sharethis.com
10
  */
46
  die();
47
  }
48
 
49
+ define( 'GOOGLEANALYTICS_VERSION', '2.1.3' );
50
  include_once GA_PLUGIN_DIR . '/overwrite/ga_overwrite.php';
51
  include_once GA_PLUGIN_DIR . '/class/Ga_Autoloader.php';
52
  include_once GA_PLUGIN_DIR . '/tools/class-support-logging.php';
js/googleanalytics_page.js CHANGED
@@ -10,6 +10,7 @@ const GA_MODAL_CLOSE_ID = 'ga_close';
10
  const GA_MODAL_BTN_CLOSE_ID = 'ga_btn_close';
11
  const GA_GOOGLE_AUTH_BTN_ID = 'ga_authorize_with_google_button';
12
  const GA_SAVE_ACCESS_CODE_BTN_ID = 'ga_save_access_code';
 
13
 
14
  (function ($) {
15
 
@@ -34,10 +35,24 @@ const GA_SAVE_ACCESS_CODE_BTN_ID = 'ga_save_access_code';
34
  e.target.disabled = 'disabled';
35
  ga_loader.show();
36
  const ac_tmp = $('#' + GA_ACCESS_CODE_TMP_ID).val();
37
- if (ac_tmp) {
38
  $('#' + GA_ACCESS_CODE_ID).val(ac_tmp);
39
  $('#' + GA_FORM_ID).submit();
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
  };
43
 
@@ -55,25 +70,30 @@ const GA_SAVE_ACCESS_CODE_BTN_ID = 'ga_save_access_code';
55
  click: function (selector, callback) {
56
  $(selector).live('click', callback);
57
  },
58
- codeManuallyCallback: function (terms_accepted) {
59
- const button_disabled = $('#ga_authorize_with_google_button').attr('disabled');
60
- const selector_disabled = $('#ga_account_selector').attr('disabled');
61
- if (terms_accepted) {
62
- if (button_disabled) {
63
- $('#ga_authorize_with_google_button').removeAttr('disabled').next().hide();
64
- } else {
65
- $('#ga_authorize_with_google_button').attr('disabled',
66
- 'disabled').next().show();
67
- }
68
 
69
- if (selector_disabled) {
70
- $('#ga_account_selector').removeAttr('disabled');
71
- } else {
72
- $('#ga_account_selector').attr('disabled', 'disabled');
 
 
 
 
 
 
 
73
  }
74
  }
75
-
76
- $('#ga_manually_wrapper').toggle();
77
  },
78
  initModalEvents: function () {
79
  $('#' + GA_GOOGLE_AUTH_BTN_ID).on('click', function () {
10
  const GA_MODAL_BTN_CLOSE_ID = 'ga_btn_close';
11
  const GA_GOOGLE_AUTH_BTN_ID = 'ga_authorize_with_google_button';
12
  const GA_SAVE_ACCESS_CODE_BTN_ID = 'ga_save_access_code';
13
+ const GA_AUTHENTICATION_CODE_ERROR = 'That looks like your Google Analytics Tracking ID. Please enter the authentication token in this space. See here for <a href="https://cl.ly/1y1N1A3h0s1t" target="_blank">a walkthrough</a> of how to do it.';
14
 
15
  (function ($) {
16
 
35
  e.target.disabled = 'disabled';
36
  ga_loader.show();
37
  const ac_tmp = $('#' + GA_ACCESS_CODE_TMP_ID).val();
38
+ if (ga_popup.validateCode(e, ac_tmp)) {
39
  $('#' + GA_ACCESS_CODE_ID).val(ac_tmp);
40
  $('#' + GA_FORM_ID).submit();
41
  }
42
+ },
43
+ validateCode: function (e, code) {
44
+ if (!code){
45
+ ga_loader.hide();
46
+ $('#' + GA_SAVE_ACCESS_CODE_BTN_ID).removeAttr('disabled');
47
+ return false;
48
+ }
49
+ else if (code.substring(0, 2) == 'UA'){
50
+ $('#ga_code_error').show().html(GA_AUTHENTICATION_CODE_ERROR);
51
+ ga_loader.hide();
52
+ $('#' + GA_SAVE_ACCESS_CODE_BTN_ID).removeAttr('disabled');
53
+ return false;
54
+ }
55
+ return true;
56
  }
57
  };
58
 
70
  click: function (selector, callback) {
71
  $(selector).live('click', callback);
72
  },
73
+ codeManuallyCallback: function (features_enabled) {
74
+ var checkbox = $('#ga_enter_code_manually');
75
+ if ( features_enabled ) {
76
+ if ( checkbox.is(':checked') ) {
77
+ if (confirm('Warning: If you enter your Tracking ID manually, Analytics statistics will not be shown.')) {
78
+ setTimeout(function () {
79
+ $('#ga_authorize_with_google_button').attr('disabled','disabled').next().show();
80
+ $('#ga_account_selector').attr('disabled', 'disabled');
81
+ $('#ga_manually_wrapper').show();
82
+ }, 350);
83
 
84
+ } else {
85
+ setTimeout(function () {
86
+ checkbox.removeProp('checked');
87
+ }, 350);
88
+ }
89
+ } else { // disable
90
+ setTimeout(function () {
91
+ $('#ga_authorize_with_google_button').removeAttr('disabled').next().hide();
92
+ $('#ga_account_selector').removeAttr('disabled');
93
+ $('#ga_manually_wrapper').hide();
94
+ }, 350);
95
  }
96
  }
 
 
97
  },
98
  initModalEvents: function () {
99
  $('#' + GA_GOOGLE_AUTH_BTN_ID).on('click', function () {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: ShareThis
3
  Tags: analytics, dashboard, google, google analytics, google analytics plugin, javascript, marketing, pageviews, statistics, stats, tracking, visits, web stats, widget, analytics dashboard, google analytics dashboard, google analytics widget, google analytics dashboard
4
  Requires at least: 3.8
5
- Tested up to: 4.7.2
6
- Stable tag: 2.1.2
7
 
8
  Use Google Analytics on your Wordpress site without touching any code, and view visitor reports right in your Wordpress admin dashboard!
9
 
2
  Contributors: ShareThis
3
  Tags: analytics, dashboard, google, google analytics, google analytics plugin, javascript, marketing, pageviews, statistics, stats, tracking, visits, web stats, widget, analytics dashboard, google analytics dashboard, google analytics widget, google analytics dashboard
4
  Requires at least: 3.8
5
+ Tested up to: 4.7.3
6
+ Stable tag: 2.1.3
7
 
8
  Use Google Analytics on your Wordpress site without touching any code, and view visitor reports right in your Wordpress admin dashboard!
9
 
tools/class-support-logging.php CHANGED
@@ -91,7 +91,7 @@ class Ga_SupportLogger {
91
  private function get_mail_link() {
92
 
93
  $body = 'DESCRIBE ISSUE HERE:' . str_repeat( '%0A', 10 );
94
- $body .= 'Debug Info:%0A%0A';
95
  $body .= implode( $this->get_debug_info(), '%0A' );
96
  $body .= '%0A%0AError Log:%0A%0A';
97
  $body .= str_replace( "\n", '%0A', $this->get_formatted_log() );
@@ -115,15 +115,20 @@ class Ga_SupportLogger {
115
  'Plugin Version' => GOOGLEANALYTICS_VERSION,
116
  'WordPress Version' => get_bloginfo( 'version' ),
117
  'PHP Version' => phpversion(),
 
118
  'Site URL' => get_bloginfo( 'wpurl' ),
119
  'Theme Name' => $theme->get( 'Name' ),
120
  'Theme URL' => $theme->get( 'ThemeURI' ),
121
  'Theme Version' => $theme->get( 'Version' ),
122
  'Active Plugins' => implode( $plugins, ', ' ),
123
- 'Operating System' => php_uname(),
124
  'Web Server' => $_SERVER['SERVER_SOFTWARE'],
125
  'Current Time' => current_time( 'r' ),
126
- 'Browser' => $_SERVER['HTTP_USER_AGENT'],
 
 
 
 
127
  );
128
  $formatted = array();
129
  foreach ( $data as $text => $value ) {
@@ -135,6 +140,26 @@ class Ga_SupportLogger {
135
  return $formatted;
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  /**
140
  * Gets a string of formatted error log entries.
91
  private function get_mail_link() {
92
 
93
  $body = 'DESCRIBE ISSUE HERE:' . str_repeat( '%0A', 10 );
94
+ $body .= 'Debug Info:%0A%0A';
95
  $body .= implode( $this->get_debug_info(), '%0A' );
96
  $body .= '%0A%0AError Log:%0A%0A';
97
  $body .= str_replace( "\n", '%0A', $this->get_formatted_log() );
115
  'Plugin Version' => GOOGLEANALYTICS_VERSION,
116
  'WordPress Version' => get_bloginfo( 'version' ),
117
  'PHP Version' => phpversion(),
118
+ 'CURL Version' => $this->get_curl_version(),
119
  'Site URL' => get_bloginfo( 'wpurl' ),
120
  'Theme Name' => $theme->get( 'Name' ),
121
  'Theme URL' => $theme->get( 'ThemeURI' ),
122
  'Theme Version' => $theme->get( 'Version' ),
123
  'Active Plugins' => implode( $plugins, ', ' ),
124
+ 'Operating System' => $this->get_operating_system(),
125
  'Web Server' => $_SERVER['SERVER_SOFTWARE'],
126
  'Current Time' => current_time( 'r' ),
127
+ 'Browser' => !empty( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
128
+ 'Excluded roles' => get_option( 'googleanalytics_exclude_roles' ),
129
+ 'Manually Tracking ID enabled' => get_option( 'googleanalytics_web_property_id_manually' ),
130
+ 'Manually typed Tracking ID' => get_option( 'googleanalytics_web_property_id_manually_value' ),
131
+ 'Tracking ID' => get_option( 'googleanalytics_web_property_id' ),
132
  );
133
  $formatted = array();
134
  foreach ( $data as $text => $value ) {
140
  return $formatted;
141
  }
142
 
143
+ /**
144
+ * Gets CURL version
145
+ * @return string
146
+ */
147
+ private function get_curl_version(){
148
+ $curl_version = curl_version();
149
+ return !empty( $curl_version['version'] ) ? $curl_version['version'] : '';
150
+ }
151
+
152
+ /**
153
+ * Gets operating system
154
+ * @return string
155
+ */
156
+ private function get_operating_system(){
157
+ if ( function_exists( 'ini_get' ) ) {
158
+ $disabled = explode( ',', ini_get( 'disable_functions' ) );
159
+ return !in_array( 'php_uname', $disabled ) ? php_uname() : PHP_OS;
160
+ }
161
+ return PHP_OS;
162
+ }
163
 
164
  /**
165
  * Gets a string of formatted error log entries.
view/ga_auth_button.php CHANGED
@@ -1,4 +1,4 @@
1
- <button id="ga_authorize_with_google_button" class="button-primary"
2
  <?php if ( Ga_Helper::are_features_enabled() ) : ?>
3
  onclick="ga_popup.authorize( event, '<?php echo esc_attr( $url ); ?>' )"
4
  <?php endif; ?>
1
+ <button id="ga_authorize_with_google_button" class="<?php echo ( $type == 'auth' ) ? 'button-primary' : 'button-secondary' ?>"
2
  <?php if ( Ga_Helper::are_features_enabled() ) : ?>
3
  onclick="ga_popup.authorize( event, '<?php echo esc_attr( $url ); ?>' )"
4
  <?php endif; ?>
view/page.php CHANGED
@@ -6,6 +6,7 @@
6
  <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4>
7
  </div>
8
  <div class="ga-modal-body">
 
9
  <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label>
10
  &nbsp;<input id="ga_access_code_tmp" type="text"
11
  placeholder="<?php _e( 'Paste your access code here' ) ?>"/>
@@ -55,8 +56,8 @@
55
 
56
  <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
57
  <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th>
58
- <td><?php echo $data['ga_accounts_selector']; ?>
59
- <div class="wrap"><?php echo $data[ 'auth_button' ] ?></div>
60
  </td>
61
  <?php endif; ?>
62
 
@@ -66,7 +67,7 @@
66
 
67
  <th scope="row">
68
  <div class="checkbox">
69
- <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>"
70
  for="ga_enter_code_manually"> <input
71
  <?php if ( Ga_Helper::are_features_enabled() ) : ?>
72
  onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_features_enabled() ? 1 : 0; ?> ) )"
@@ -145,7 +146,12 @@
145
  <td colspan="2">
146
  <p>If you experience an issue with this plugin, we are here to help! You can visit our <a href="https://googleanalytics.zendesk.com/hc/en-us">support portal</a> to find answers to the most frequently asked questions and to submit a support request. We aim to respond to everyone within one business day.</p>
147
  <p>If your issue is difficult to debug, click the button below to automatically send us your error logs and debugging info.</p>
148
- <p><button id="ga_debug_button" class="button button-secondary" onclick="ga_debug.open_modal( event )" >Send Debugging Info</button></p>
 
 
 
 
 
149
  </td>
150
  </tr>
151
  <tr valign="top">
6
  <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4>
7
  </div>
8
  <div class="ga-modal-body">
9
+ <div id="ga_code_error" class="ga-alert ga-alert-danger" style="display: none;"></div>
10
  <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label>
11
  &nbsp;<input id="ga_access_code_tmp" type="text"
12
  placeholder="<?php _e( 'Paste your access code here' ) ?>"/>
56
 
57
  <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
58
  <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th>
59
+ <td>
60
+ <?php echo $data['ga_accounts_selector']; ?>
61
  </td>
62
  <?php endif; ?>
63
 
67
 
68
  <th scope="row">
69
  <div class="checkbox">
70
+ <label class="ga_checkbox_label <?php echo Ga_Helper::get_code_manually_label_classes() ?>"
71
  for="ga_enter_code_manually"> <input
72
  <?php if ( Ga_Helper::are_features_enabled() ) : ?>
73
  onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_features_enabled() ? 1 : 0; ?> ) )"
146
  <td colspan="2">
147
  <p>If you experience an issue with this plugin, we are here to help! You can visit our <a href="https://googleanalytics.zendesk.com/hc/en-us">support portal</a> to find answers to the most frequently asked questions and to submit a support request. We aim to respond to everyone within one business day.</p>
148
  <p>If your issue is difficult to debug, click the button below to automatically send us your error logs and debugging info.</p>
149
+ <p>
150
+ <button id="ga_debug_button" class="button button-secondary" onclick="ga_debug.open_modal( event )" >Send Debugging Info</button>
151
+ <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
152
+ <?php echo $data[ 'auth_button' ] ?>
153
+ <?php endif; ?>
154
+ </p>
155
  </td>
156
  </tr>
157
  <tr valign="top">