google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.22k stars 278 forks source link

Store initial setup time for Site Kit and modules as meta. #6443

Open derweili opened 1 year ago

derweili commented 1 year ago

Feature Description

This is a followup for #5853 where showing the auto-update banner is delayed after the initial plugin setup for 10 minutes. Currently there is no way to get the site kit setup time to calculate the time delta. Therefore the auto-update banner (#5853) tries to recognize the initial setup by verifying URL query params. A cacheItem with a 10 minutes lifetime is used to recognize the initial setup for the following 10 minutes.

There are many assumptions in this process, which are unrelated to the to the actual component.

Therefore it would be better, if the setup time was stored in options and available through the datastore. The same applies not only to Site Kit setup but also to the setup time of each module.


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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

tofumatt commented 1 year ago

ACs here are good, thanks for including the module setup dates as well 👍🏻

I did add a note to the ACs to use this new selector in the Auto-update logic; I don't think it warrants a new issue 😄

Moved to IB.

bethanylang commented 1 year ago

@derweili Can you please add a priority to this issue? Thanks!

techanvil commented 1 year ago

Hey @asvinb, the IB is looking good for the AC, but I have some reservations about the AC itself.

I think this might need to have the AC updated. What's your take on this?

asvinb commented 1 year ago

@techanvil

Do you want me to update the IB or curious to hear @aaemnnosttv 's thoughts about this.

techanvil commented 1 year ago

Thanks @asvinb. I think it might be worth updating the AC, as well as the IB, seeing as we've caught it at this stage. Interested to hear @aaemnnosttv's thoughts too.

aaemnnosttv commented 1 year ago

Anything user-specific which isn't critical and 1 hr or less is probably better suited as client-side cache rather than a persistent value in the DB. I wouldn't say this is critical, so if the user were to install SK via WP CLI and this doesn't get set and the user sees it right away instead, that seems fine to me.

Moving this back to AC for potential revision.

techanvil commented 1 year ago

Anything user-specific which isn't critical and 1 hr or less is probably better suited as client-side cache rather than a persistent value in the DB. I wouldn't say this is critical, so if the user were to install SK via WP CLI and this doesn't get set and the user sees it right away instead, that seems fine to me.

Moving this back to AC for potential revision.

@aaemnnosttv, while I think this is a perfectly reasonable statement, when reading the Feature Description for this one it's evident that we currently do make use of the client-side cache for this functionality, but we don't have a very good way of identifying when the site has just been setup on the client side. I think this issue is really about adding some server-side state to make this new-site status more reliable, and we might still be relying on client-side caching to determine whether we'd actually actioned the notification.

With that in mind, how do you feel about this one?

ivonac4 commented 6 months ago

@aaemnnosttv Seems like this one requires your opinion. Do you have time to take a look anytime soon?