[tsm] manual review

Created on 11 November 2013, about 11 years ago
Updated 10 July 2023, over 1 year ago
  1. Your readme could use improvement, see guidelines for in-project documentation.
  2. You can remove the hook_install().
  3.   $authenticated = FALSE;
      // It's a weak test but better than none.
      if (variable_get('google_analytics_counter_profile_id') <> '') {
        $authenticated = TRUE;
      }
    

    can be simplified to just $authenticated = !empty(variable_get('google_analytics_counter_profile_id')).

  4. Do you always need to include your .inc files? Drupal will load those on every page request - can those be moved to where they are actually used? For example, google_analytics_counter_settings.inc could be easily included in your hook_menu() with 'file' => 'google_analytics_counter_admin.inc'.
  5. There are a bunch of dpm's and other commented out code - could that be removed or moved into a separate debug branch?
  6. If google_analytics_counter_display() is already accounting for count = 0, I don't think you need it again in google_analytics_counter_block_view().
  7. In google_analytics_counter_display(), I think request_path() can handle getting the full path with language prefix instead of that parse_url() call.
  8. Try to keep html out of strings for t(). For example, t('<p><h3>More information relevant to Google Analytics statistics for this site:</h3>'); is a lot easier to translate as '<p><h3>' . t('More information relevant to Google Analytics statistics for this site:') . '</h3>';.
  9. Also, <font> tag is deprecated! You can use a style tag like <span style="color: red"> or use CSS.
  10. Instead of google_analytics_counter_sec2hms() can you use format_interval() instead?
  11. In google_analytics_counter_auth_admin_submit(), why are you creating a new GAFeed object directly instead of calling google_analytics_counter_new_gafeed()?
  12.   $times = array();
      $intervals = array(1, 3, 5, 10, 20, 30, 60, 180, 360, 720, 1440);
      foreach ($intervals as $interval) {
        $times[] = $interval;
      }
    

    can be simplified to $times = array(1, 3, 5, 10, 20, 30, 60, 180, 360, 720, 1440);

  13. In google_analytics_counter_update_path_counts(), microtime() is more accurate than time() for measuring processing times.
  14. google_analytics_counter_get_sum_per_path() is super long, can this be broken down some? There seems to be a lot of code related to checking for a language prefix or lack thereof. I think there's a variable you can check to see if the site is set to use language prefixes, that might be easier.
πŸ“Œ Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kscheirer Vallejo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡°Slovakia kaszarobert

    Because of the Universal Analytics shutdown, version 7.x-3.x is no longer supported.
    As Drupal 7 EOL is close, please consider upgrading to the latest Drupal and latest version of this module with Google Analytics 4 support.
    If you are still here and experiencing problems with the latest version using GA4, then please open an issue about it.

Production build 0.71.5 2024