Index: googleanalytics.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.test,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 googleanalytics.test
--- googleanalytics.test	2 Jan 2011 15:35:59 -0000	1.2.2.2
+++ googleanalytics.test	2 Jan 2011 16:26:09 -0000
@@ -87,7 +87,7 @@
     $this->assertNoRaw($ua_code, '[testGoogleAnalyticsTracking]: Tracking code is not displayed on front page.');
 
     // Test whether tracking code is not display for anonymous.
-    $this->drupalGet('logout');
+    $this->drupalGet('user/logout');
     $this->drupalGet('');
     $this->assertNoRaw($ua_code, '[testGoogleAnalyticsTracking]: Tracking code is not displayed for anonymous.');
   }
Index: googleanalytics.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.admin.inc,v
retrieving revision 1.24.2.2
diff -u -r1.24.2.2 googleanalytics.admin.inc
--- googleanalytics.admin.inc	2 Jan 2011 15:35:59 -0000	1.24.2.2
+++ googleanalytics.admin.inc	2 Jan 2011 16:26:08 -0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_admin_settings() for configuring the module
+ * Implements hook_admin_settings() for module settings configuration.
  */
 function googleanalytics_admin_settings_form($form_state) {
   $form['account'] = array(
@@ -157,7 +157,7 @@
   $form['tracking']['search_and_adsense']['googleanalytics_site_search'] = array(
     '#type' => 'checkbox',
     '#title' => t('Track internal search'),
-    '#description' => t('If checked, internal search keywords are tracked. You must configure your Google account to use the internal query parameter <strong>search</strong>. For more information see <a href="@url">How do I set up Site Search for my profile</a>.', array('@url' => 'http://www.google.com/support/analytics/bin/answer.py?hl='. $language->language .'&answer=75817')) . $site_search_dependencies,
+    '#description' => t('If checked, internal search keywords are tracked. You must configure your Google account to use the internal query parameter <strong>search</strong>. For more information see <a href="@url">How do I set up Site Search for my profile</a>.', array('@url' => 'http://www.google.com/support/analytics/bin/answer.py?hl=' . $language->language . '&answer=75817')) . $site_search_dependencies,
     '#default_value' => variable_get('googleanalytics_site_search', FALSE),
     '#disabled' => (module_exists('search') ? FALSE : TRUE),
   );
@@ -192,7 +192,7 @@
     $form['segmentation']['googleanalytics_segmentation'] = array(
       '#type' => 'select',
       '#title' => t('Segment users based on these selected properties') . ' <span class="admin-disabled">***DEPRECATED***</span>',
-      '#description' => t("You can supplement Google Analytics' basic IP address tracking of visitors by segmenting users based on these selected properties.") . (!$profile_enabled ? ' '. t('<a href="@module_list">Enable the profile module</a> to be able to use profile fields for more granular tracking.', array('@module_list' => url('admin/build/modules'))) : '') .' '. t('Section 8.1 of the <a href="@ga_tos">Google Analytics terms of use</a> requires you to make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties\' websites) with any personally identifying information from any source as part of your use (or such third parties\' use) of the Google Analytics\' service.', array('@ga_tos' => 'http://www.google.com/analytics/en-GB/tos.html')) .' '. t('You can select multiple values.'),
+      '#description' => t("You can supplement Google Analytics' basic IP address tracking of visitors by segmenting users based on these selected properties.") . (!$profile_enabled ? ' ' . t('<a href="@module_list">Enable the profile module</a> to be able to use profile fields for more granular tracking.', array('@module_list' => url('admin/build/modules'))) : '') . ' ' . t('Section 8.1 of the <a href="@ga_tos">Google Analytics terms of use</a> requires you to make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties\' websites) with any personally identifying information from any source as part of your use (or such third parties\' use) of the Google Analytics\' service.', array('@ga_tos' => 'http://www.google.com/analytics/en-GB/tos.html')) . ' ' . t('You can select multiple values.'),
       '#default_value' => variable_get('googleanalytics_segmentation', array()),
       '#options' => $fields,
       '#size' => count($fields)>3 ? 10 : 3,
@@ -247,7 +247,7 @@
 
   $form['googleanalytics_custom_var']['googleanalytics_custom_var_description'] = array(
     '#type' => 'item',
-    '#description' => t("You can supplement Google Analytics' basic IP address tracking of visitors by segmenting users based on these selected properties.") . (!$token_enabled ? ' '. t('<a href="@module_list">Enable the token module</a> to be able to use tokens for more granular tracking.', array('@module_list' => url('admin/build/modules'))) : '') .' '. t('Section 8.1 of the <a href="@ga_tos">Google Analytics terms of use</a> requires you to make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties\' websites) with any personally identifying information from any source as part of your use (or such third parties\' use) of the Google Analytics\' service.', array('@ga_tos' => 'http://www.google.com/analytics/en-GB/tos.html')),
+    '#description' => t("You can supplement Google Analytics' basic IP address tracking of visitors by segmenting users based on these selected properties.") . (!$token_enabled ? ' ' . t('<a href="@module_list">Enable the token module</a> to be able to use tokens for more granular tracking.', array('@module_list' => url('admin/build/modules'))) : '') . ' ' . t('Section 8.1 of the <a href="@ga_tos">Google Analytics terms of use</a> requires you to make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties\' websites) with any personally identifying information from any source as part of your use (or such third parties\' use) of the Google Analytics\' service.', array('@ga_tos' => 'http://www.google.com/analytics/en-GB/tos.html')),
   );
   $form['googleanalytics_custom_var']['googleanalytics_custom_var_token_tree'] = array(
     '#access' => $token_enabled ? TRUE : FALSE,
@@ -326,6 +326,9 @@
   return system_settings_form($form);
 }
 
+/**
+ * Implements _form_validate().
+ */
 function googleanalytics_admin_settings_form_validate($form, &$form_state) {
   // Custom variables validation.
   foreach ($form_state['values']['googleanalytics_custom_var']['slots'] as $custom_var) {
Index: googleanalytics.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.install,v
retrieving revision 1.22.2.2
diff -u -r1.22.2.2 googleanalytics.install
--- googleanalytics.install	2 Jan 2011 15:35:59 -0000	1.22.2.2
+++ googleanalytics.install	2 Jan 2011 16:26:08 -0000
@@ -6,6 +6,9 @@
  * Installation file for Google Analytics module.
  */
 
+/**
+ * Implements hook_install().
+ */
 function googleanalytics_install() {
   variable_set('googleanalytics_visibility', 0);
 
@@ -29,6 +32,9 @@
   }
 }
 
+/**
+ * Implements hook_uninstall().
+ */
 function googleanalytics_uninstall() {
   variable_del('googleanalytics_account');
   variable_del('googleanalytics_custom_vars');
@@ -57,6 +63,8 @@
 }
 
 /**
+ * Implements hook_disable().
+ *
  * Remove cache directory if module is disabled (or uninstalled).
  */
 function googleanalytics_disable() {
@@ -64,7 +72,7 @@
 }
 
 /**
- * Implementation of hook_requirements().
+ * Implements hook_requirements().
  */
 function googleanalytics_requirements($phase) {
   $requirements = array();
@@ -120,7 +128,7 @@
   $roles = array();
   $messages = array();
   foreach (user_roles() as $rid => $name) {
-    if (variable_get('googleanalytics_track_'. $rid, FALSE)) {
+    if (variable_get('googleanalytics_track_' . $rid, FALSE)) {
       // Role ID is activated for user tracking.
       $roles[$rid] = $rid;
       $messages[] = t('Enabled page tracking for role: @name.', array('@name' => $name));
@@ -136,14 +144,14 @@
     variable_set('googleanalytics_custom', 1);
 
     // Load user 1 object, set appropiate value and save new user settings back.
-    $account = user_load(array('uid' => 1));
+    $account = user_load(1);
     $account = user_save($account, array('googleanalytics' => array('custom' => 0)), 'account');
     $messages[] = t('Disabled user specific page tracking for site administrator.');
   }
 
   // Delete outdated tracking settings.
   db_delete('variable')
-    ->condition('name', db_like('googleanalytics_track_') .'%', 'LIKE')
+    ->condition('name', db_like('googleanalytics_track_') . '%', 'LIKE')
     ->execute();
 
   return implode(', ', $messages);
@@ -247,7 +255,7 @@
 function googleanalytics_update_6200() {
   $path = 'public://googleanalytics';
   if (file_exists($path)) {
-    file_unmanaged_delete($path .'/urchin.js');
+    file_unmanaged_delete($path . '/urchin.js');
   }
   variable_del('googleanalytics_legacy_version');
 
Index: googleanalytics.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v
retrieving revision 1.70.2.2
diff -u -r1.70.2.2 googleanalytics.module
--- googleanalytics.module	2 Jan 2011 15:35:59 -0000	1.70.2.2
+++ googleanalytics.module	2 Jan 2011 16:26:09 -0000
@@ -12,6 +12,9 @@
 
 define('GA_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip');
 
+/**
+ * Implements hook_help().
+ */
 function googleanalytics_help($path, $arg) {
   switch ($path) {
     case 'admin/config/system/googleanalytics':
@@ -20,7 +23,7 @@
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function googleanalytics_theme() {
   return array(
@@ -30,6 +33,9 @@
   );
 }
 
+/**
+ * Implements hook_permission().
+ */
 function googleanalytics_permission() {
   return array(
     'administer google analytics' => array(
@@ -47,6 +53,9 @@
   );
 }
 
+/**
+ * Implements hook_menu().
+ */
 function googleanalytics_menu() {
   $items['admin/config/system/googleanalytics'] = array(
     'title' => 'Google Analytics',
@@ -62,7 +71,7 @@
 }
 
 /**
- * Implementation of hook_page_alter() to insert JavaScript to the appropriate scope/region of the page.
+ * Implements hook_page_alter() to insert JavaScript to the appropriate scope/region of the page.
  */
 function googleanalytics_page_alter(&$page) {
   global $user;
@@ -130,7 +139,7 @@
     // Site search tracking support.
     $url_custom = '';
     if (module_exists('search') && variable_get('googleanalytics_site_search', FALSE) && arg(0) == 'search' && $keys = googleanalytics_search_get_keys()) {
-      $url_custom = drupal_json_encode(rawurldecode(url('search/'. arg(1), array('query' => array('search' => $keys)))));
+      $url_custom = drupal_json_encode(rawurldecode(url('search/' . arg(1), array('query' => array('search' => $keys)))));
     }
 
     // If this node is a translation of another node, pass the original
@@ -142,7 +151,7 @@
       if ($node && translation_supported_type($node->type) && isset($node->tnid) && ($node->tnid != $node->nid)) {
         $source_node = node_load($node->tnid);
         $languages = language_list();
-        $url_custom = drupal_json_encode(url('node/'. $source_node->nid, array('language' => $languages[$source_node->language])));
+        $url_custom = drupal_json_encode(url('node/' . $source_node->nid, array('language' => $languages[$source_node->language])));
       }
     }
 
@@ -174,13 +183,15 @@
         }
 
         // Suppress empty custom variables.
-        if (!is_numeric($custom_var_value) && empty($custom_var_value)) { continue; }
+        if (!is_numeric($custom_var_value) && empty($custom_var_value)) {
+          continue;
+        }
 
         // The length of the string used for the 'name' and the length of the
         // string used for the 'value' must not exceed 64 bytes after url encoding.
-        $name_length = strlen(rawurlencode($custom_var_name));
+        $name_length = drupal_strlen(rawurlencode($custom_var_name));
         $tmp_value = rawurlencode($custom_var_value);
-        $value_length = strlen($tmp_value);
+        $value_length = drupal_strlen($tmp_value);
         if ($name_length + $value_length > 64) {
           // Trim value and remove fragments of url encoding.
           $tmp_value = rtrim(substr($tmp_value, 0, 63 - $name_length), '%0..9A..F');
@@ -247,7 +258,7 @@
 }
 
 /**
- * Implement hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter().
  *
  * Allow users to decide if tracking code will be added to pages or not.
  */
@@ -295,13 +306,13 @@
 }
 
 /**
- * Implementation of hook_cron().
+ * Implements hook_cron().
  */
 function googleanalytics_cron() {
   // Regenerate the tracking code file every day.
-  if (time() - variable_get('googleanalytics_last_cache', 0) >= 86400 && variable_get('googleanalytics_cache', 0)) {
+  if (REQUEST_TIME - variable_get('googleanalytics_last_cache', 0) >= 86400 && variable_get('googleanalytics_cache', 0)) {
     _googleanalytics_cache('http://www.google-analytics.com/ga.js', TRUE);
-    variable_set('googleanalytics_last_cache', time());
+    variable_set('googleanalytics_last_cache', REQUEST_TIME);
   }
 }
 
@@ -480,7 +491,7 @@
         $page_match = !($visibility xor $page_match);
       }
       else {
-        $page_match = drupal_eval($pages);
+        $page_match = php_eval($pages);
       }
     }
     else {
