INN / Google-Analytics-Popular-Posts

A WordPress plugin that uses Google Analytics data to determine the most popular posts on your site and display a list of popular posts via the included widget.
https://wordpress.org/plugins/ga-popular-posts/
23 stars 7 forks source link

Fatal error 'invalid_grant' when configuring new site #61

Closed benlk closed 7 years ago

benlk commented 7 years ago

This was after connecting via the docs.

Fatal error: Uncaught Google_Auth_Exception: Error fetching OAuth2 access token, message: 'invalid_grant' in /srv/www/testing/htdocs/wp-content/plugins/ga-popular-posts/api/src/Google/Auth/OAuth2.php:120 Stack trace:

  1. /srv/www/testing/htdocs/wp-content/plugins/ga-popular-posts/api/src/Google/Client.php(120): Google_Auth_OAuth2->authenticate('4/zZJXgp4TsyKxR...')

  2. /srv/www/testing/htdocs/wp-content/plugins/ga-popular-posts/AnalyticBridgeGoogleClient.php(186): Google_Client->authenticate('4/zZJXgp4TsyKxR...')

  3. /srv/www/testing/htdocs/wp-content/plugins/ga-popular-posts/inc/analytic-bridge-blog-options.php(129): analytic_bridge_authenticate_google_client('4/zZJXgp4TsyKxR...')

  4. /srv/www/testing/htdocs/wp-includes/class-wp-hook.php(298): analyticbridge_option_page_html('')

  5. /srv/www/testing/htdocs/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)

  6. /srv/www/testing/htdocs/wp-includes/plugin.php(453): WP_Hook->do_action(Array)

  7. /srv/www/testing/htdocs/wp-admin/admin.php(222): do_action('settings in /srv/www/testing/htdocs/wp-content/plugins/ga-popular-posts/api/src/Google/Auth/OAuth2.php on line 120

screen shot 2017-01-09 at 4 13 35 pm
benlk commented 7 years ago

Okay, that's because I had a code set in my URL, leftover from previous testing. :|

Not sure if this is going to consistently be a bug; will mark as low-priority for now and return to #59.

benlk commented 7 years ago

This is resolved in https://github.com/INN/Google-Analytics-Popular-Posts/compare/59-error-in-signup-process and by making sure that you've deleted the existing permissions grant from your Google account settings before attempting to grant permissions to this app.