Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/activate the WP Consent API plugin in the background. #8521

Closed
12 tasks
techanvil opened this issue Apr 10, 2024 · 11 comments
Closed
12 tasks

Install/activate the WP Consent API plugin in the background. #8521

techanvil opened this issue Apr 10, 2024 · 11 comments
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Apr 10, 2024

Feature Description

As discussed on Slack, we should install and/or activate the WP Consent API plugin in the background, rather than opening the WP plugins page in a new tab to facilitate the installation/activation.

This will improve both the general UX and our capability for tracking the WP Consent API activation state, which will help to further inform how to improve the feature.


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

Acceptance criteria

  • When the user clicks the install button in the Consent Mode "Install WP Consent API" panel in the Admin Settings, the WP Consent API plugin should:
    • Be installed without redirecting the user to wp-admin/update.php.
    • Be activated without redirecting the user to wp-admin/plugins.php.
  • The user should see an appropriate loading state, such as a spinner button, while backend requests are taking place in the background.
  • If the plugin installation or activation fails, the user should see an appropriate warning message from the backend and allow the user to retry it.

Implementation Brief

Test Coverage

  • No additional test coverage required.

QA Brief

  • Set up Site Kit
  • Go to Site Kit Settings. Enable Consent Mode, and then in Consent Mode settings, click the "Install" button.
    • This should activate plugin in the background and display the success checkmark that WP Consent API is detected on the website
  • Deactivate WP Consent API plugin, go back to the Consent Mode settings, verify that clicking the "Activate" CTA activates the plugin without redirection as well.
    *To test the erorr, you can use HTTP proxy addon, like Tweak, and replicate these settings:
image Then click on install button

Changelog entry

  • Allow users to install Consent Mode plugin from Site Kit Settings.
@techanvil techanvil added the Type: Enhancement Improvement of an existing feature label Apr 10, 2024
@techanvil techanvil added the P1 Medium priority label Jun 18, 2024
@benbowler benbowler removed their assignment Jun 18, 2024
@tofumatt tofumatt self-assigned this Jun 20, 2024
@binnieshah binnieshah added Next Up Issues to prioritize for definition Team S Issues for Squad 1 labels Jun 24, 2024
@tofumatt
Copy link
Collaborator

The ACs say we should enable the WP Consent API plugin, but they don't say when/under what conditions.

Enabling it automatically when it isn't enabled seems like a fine idea, but we shouldn't do it constantly, because then a user that explicitly disables it (for whatever reason) after we enabled it will return to the plugins page to see it "randomly" enabled again by us.

So we probably want to specify the conditions to enable it, and also a mechanism to only do so once.

@tofumatt tofumatt assigned benbowler and unassigned tofumatt Jun 25, 2024
@benbowler benbowler assigned tofumatt and unassigned benbowler Jun 25, 2024
@tofumatt
Copy link
Collaborator

Thanks, this makes sense 👍🏻

Moving to IB 👍🏻

@tofumatt tofumatt removed their assignment Jun 25, 2024
@benbowler benbowler self-assigned this Jun 25, 2024
@techanvil techanvil self-assigned this Jun 25, 2024
@techanvil
Copy link
Collaborator Author

Hey @benbowler, actually the AC for this needs a revision.

It's not the case that we want the WP Consent API plugin to be installed in direct response to the user enabling Consent Mode via the switch in settings.

We still want the trigger to be a click of the Install (or Activate) button, so the user is making an informed and deliberate choice to install the plugin.

image

At present when the Install/Activate button is clicked, the plugins page is navigated to, taking the user away from Site Kit. What this issue should accomplish is to install/activate the plugin in the background when the button is clicked, showing an in-progress state while doing so (i.e. a spinner in the button).

Please can you update the AC accordingly?

@techanvil techanvil removed their assignment Jun 25, 2024
@benbowler benbowler assigned techanvil and unassigned benbowler Jun 26, 2024
@binnieshah binnieshah removed the Next Up Issues to prioritize for definition label Jun 26, 2024
@techanvil
Copy link
Collaborator Author

Hi @benbowler, thanks for updating the AC.

  • It looks like the point about the como_enable event is now redundant and can be removed.
  • Also, it would be good to give some direction on how errors should be handled.

@techanvil techanvil assigned benbowler and unassigned techanvil Jun 26, 2024
@benbowler benbowler assigned techanvil and unassigned benbowler Jun 26, 2024
@techanvil
Copy link
Collaborator Author

techanvil commented Jun 26, 2024

@benbowler thanks for the update. Please note I made a small change to tweak the proposed error text and fix a couple of typos.

That said - while I like the proposed error handling, I do have some reservations; for one, handling an error with "warning" styling is a bit out of step with other errors which tend to be displayed inline using the "error" red colour.

image

Also by showing a fixed error message, the underlying error we receive from the WP API is hidden and this might contain some valuable information as to why the plugin couldn't be installed.

Lastly the proposed message doesn't handle the activation case where the more appropriate guidance would be to navigate to the plugins page on the current WP instance and try activating there.

To be honest, I think we might be better off initially taking a simple approach where we display the error received inline using the usual error styling (as seen in ErrorNotice). This is what I had imagined when writing my previous feedback, I just wanted the AC to be a bit more explicit about it.

We can then iterate on it in a subsequent issue to provide more detailed error handling along the lines of what you have specced, but looking further into the possible errors received by the WP plugin API rather than having a single fixed message.

How does that sound?

@techanvil techanvil assigned benbowler and unassigned techanvil Jun 26, 2024
@benbowler
Copy link
Collaborator

Agreed @techanvil, I've simplified the AC removing implementation detail which can code in the IB based on the comments above.

@tofumatt tofumatt removed their assignment Jul 5, 2024
@zutigrm zutigrm self-assigned this Jul 5, 2024
@zutigrm zutigrm removed their assignment Jul 9, 2024
@tofumatt tofumatt assigned tofumatt and zutigrm and unassigned tofumatt Jul 9, 2024
@zutigrm zutigrm assigned tofumatt and unassigned zutigrm Jul 11, 2024
@tofumatt tofumatt removed their assignment Jul 11, 2024
@mohitwp mohitwp self-assigned this Jul 15, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Jul 19, 2024

QA Update ❌

  • Tested on dev environment.

Issue-
I use the Tweak extension to show error but error not reproduced for me. So, I use inspect element> Network settings to create error state.

  • @zutigrm I noticed that if the internet is not available and the user clicks on the 'Install' button, the process gets stuck in a continuous loading state. This issue does not occur when the user clicks on the 'Activate' button without internet; instead, a backend error is displayed with a Retry button. Can we implement the same behavior for the 'Install' button?

Install Plugin: Gets stuck in a loading state-

image

Activate Plugin :

image

PASS CASES

  • Verified when the user clicks the install button in the Consent Mode "Install WP Consent API" panel in the Admin Settings, the WP Consent API plugin :
    -- Gets installed without redirecting the user to wp-admin/update.php.
    -- Gets activated without redirecting the user to wp-admin/plugins.php.
  • Verified the user see an appropriate loading state, such as a spinner button, while backend requests are taking place in the background.
Recording.1192.mp4

@mohitwp
Copy link
Collaborator

mohitwp commented Jul 24, 2024

QA Update ✅

  • Tested on main environment.
  • Verified continuous loading issue in offline mode is resolve now.
  • Verified when the user clicks the install button in the Consent Mode "Install WP Consent API" panel in the Admin Settings, the WP Consent API plugin gets:
    • Installed without redirecting the user to wp-admin/update.php.
    • Gets activated without redirecting the user to wp-admin/plugins.php.
  • Verified an appropriate loading state appears, such as a spinner button, while backend requests are taking place in the background.
  • Verified if the plugin installation or activation fails, the user should sees an appropriate warning message from the backend and allow the user to retry it.
Recording.1214.mp4

image

image

@mohitwp mohitwp removed their assignment Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants