Solution for "Fatal error: Uncaught exception 'Google_AuthException'"
-
So I’m still running into the issue described here with the latest versions of the plugin and WordPress.
Jeremy Clarke had provided a fix that you couldn’t really apply, since it was inside Google’s code. I’ve added a catch block higher up in the call stack, and:
- It works
- You should be able to add it permanently
Here’s my version of GoogleAnalyticsStats->getAllProfiles():
function getAllProfiles() { $profile_array = array(); try { $profiles = $this->analytics->management_webproperties->listManagementWebproperties('~all'); } catch (Google_ServiceException $e) { print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); } catch (Google_AuthException $e) { print '<div class="error"><p>There was a Google Authentication error. Tracking and reporting are <strong>currently disabled</strong>. If you keep seeing this message, consider resetting your authentication; there\'s a link for that at the bottom of this page.</p></div>'; } if( !empty( $profiles->items ) ) { foreach( $profiles->items as $profile ) { $profile_array[ $profile->id ] = str_replace('http://','',$profile->name ); } } return $profile_array; }
Same catch block could be added everywhere it’s needed.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Solution for "Fatal error: Uncaught exception 'Google_AuthException'"’ is closed to new replies.