question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve User Experience when Site Kit Access is not authorised

See original GitHub issue

Bug Description

Not a bug, but would be good to improve the user experience. When you set up Site Kit (or add a new module) the Google oAuth page appears.

Previously, the access options were checked by default (see screenshot). This meant that when the user clicked continue, they automatically gave authorisation.

image.png

With a recent change, the access options are no longer checked by default and it’s easy to continue without noticing. When you click continue you are redirected back to the WordPress dashboard with a vague message.

image.png

It would be good for the user to be sent back to the Site Kit dashboard for them to re-authorise, but with a more user-friendly message.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The copy for the access_denied error code should be updated as follows:
    • Instead of The Site Kit setup was interrupted because you did not grant the necessary permissions. To fix this, redo the plugin setup.
    • it should be The Site Kit setup was interrupted because you did not grant the necessary permissions. To use Site Kit, you’ll need to redo the plugin setup – make sure to approve all permissions at the authentication stage.

Implementation Brief

In get_authentication_oauth_error_notice method of Google\Site_Kit\Core\Authentication\Authentication class,

  • Deduplicate the message concatenation logic inside $this->credentials->using_proxy() and its else block by doing the following:
    • Create a new setup_url variable outside the condition block.
    • Conditionally assign either proxy url or splash url to it using the current conditional blocks.
    • Move out message concatenation logic from the if-else block.
  • If $error_code is access_denied, concat message with the correct wording from the AC.
  • Otherwise, keep the current message - To fix this, <a href="%s">redo the plugin setup</a>..
  • In both case, use the setup_url as the hyperlink.

Test Coverage

  • N/A

Visual Regression Changes

  • N/A

QA Brief

!THIS NEEDS TO BE QA’D ON main BRANCH!

  • Connect to sitekit using a fresh google account.
  • While in the auth flow, don’t give all the required permission (make sure some of the permissions are unchecked).
  • Continue with the auth flow.
  • You should get the new error message from the AC.

Changelog entry

  • Update handling of OAuth error with clarified language and the URL used for retry.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
felixarntzcommented, Sep 9, 2021

@marrrmarrr @aaemnnosttv I’ve added ACs with wording here that is entirely based on the other more accurate message we already have when similar errors happen in the Site Kit dashboard. Please review - if it’s good to go we can move to IB.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing common issues with Site Kit - Google
You can check your approval status in Site Kit by going to Settings > Connected Services > AdSense and clicking “Check your site...
Read more >
You don't have permissions to authenticate with Site Kit.
Hi,. I have a self-hosted WordPress installation and try to enable Google Site Kit in replacement of the “Google AdSense Plugin”.
Read more >
How to Fix "Sorry, You Are Not Allowed to Access This Page"
Learn how to troubleshoot and fix the "Sorry you are not allowed to access this page" message in WordPress. Here are eleven possible ......
Read more >
Fix "Sorry, You Are Not Allowed to Access This Page" in ...
In this tutorial, you will learn 10 ways to fix the "Sorry, You Are Not Allowed to Access This Page" error in WordPress....
Read more >
Google Site Kit Plugin for WordPress: All-in-One Guide
With Site Kit installed, WordPress users can access unified insights ... As a result, webmasters will experience better and faster access to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found