Plugin Directory

Changeset 370998


Ignore:
Timestamp:
04/09/2011 07:50:28 PM (15 years ago)
Author:
cavemonkey50
Message:

Improves profile id logic.

Location:
google-analyticator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • google-analyticator/trunk/google-analytics-summary-widget.php

    r246245 r370998  
    102102       
    103103        # Attempt to login and get the current account
    104         $this->id = $this->getAnalyticsAccount();
     104        $account = $this->getAnalyticsAccount();
    105105        $profile_id = get_option('ga_profileid');
    106         if ( trim($profile_id) != '' )
    107             $this->id = 'ga:' . $profile_id;
     106        if ( trim($profile_id) != '' ) {
     107            if ( substr($profile_id, 0, 3) == 'ga:' ) {
     108                $this->id = $profile_id;
     109            } else {
     110                $this->id = 'ga:' . $profile_id;
     111            }
     112        } else {
     113            $this->id = $account;
     114        }
     115        print_r($this->id);
    108116        $this->api->setAccount($this->id);
    109117       
    110118        # Check that we can display the widget before continuing
    111         if ( $this->id == false ) {
     119        if ( $account == false || $this->id == false ) {
    112120            # Output error message
    113121            echo '<p style="margin: 0;">' . __('No Analytics account selected. Double check you are authenticated with Google on Google Analyticator\'s settings page and make sure an account is selected.', 'google-analyticator') . '</p>';
  • google-analyticator/trunk/readme.txt

    r370994 r370998  
    5151
    5252= 6.1.3 =
    53 * Fixes a Javascript error on the WordPress login page
     53* Fixes a Javascript error on the WordPress login page.
     54* Improves profile id logic to hopefully fix dashboard errors for the people that experience them.
    5455
    5556= 6.1.2 =
Note: See TracChangeset for help on using the changeset viewer.