-
Notifications
You must be signed in to change notification settings - Fork 813
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
Store "Assumed site creation date" in transient #13463
Conversation
This is an automated check which relies on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, thank you for the improvement!
I'm only hesitant to directly remove a method vs deprecating it for at least a couple of versions.
Should be good after updating that. Also, left some questions for your consideration.
class.jetpack.php
Outdated
@@ -4651,7 +4652,7 @@ public static function build_authorize_url( $redirect = false, $iframe = false ) | |||
'site_lang' => get_locale(), | |||
'_ui' => $tracks_identity['_ui'], | |||
'_ut' => $tracks_identity['_ut'], | |||
'site_created' => Jetpack::get_assumed_site_creation_date(), | |||
'site_created' => $connection->get_assumed_site_creation_date(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the existing connection manager so we don't instantiate a new connection manager if there's one already?
'site_created' => $connection->get_assumed_site_creation_date(), | |
'site_created' => self::connection()->get_assumed_site_creation_date(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just left a small suggestion for fixing the deprecated notice call.
Feel free to 🚢 once it's solved 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks again 🚢
c15e290
to
0cace06
Compare
0cace06
to
9653553
Compare
Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
9653553
to
ff2d21e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased. Looks good now. Merging!
Changes proposed in this Pull Request:
This PR does two things:
Jetpack::get_assumed_site_creation_date()
in the main Jetpack class, and replaces it with the package method.This method is called on every Jetpack Admin page load, because it's used in the build_connect_url() method that is passed into the initial state. We don't even need it in most cases (like if the user is already connected) - unless I guess if the user wants to disconnect/reconnect without a page load, so it could be further improved to not pass at all in that case, but not worth the extra complication.
I'm not sure if there was a reason for not caching, but it seems like something that only needs to be checked and stored once.
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
You can check with a plugin such as Query monitor:
Proposed changelog entry for your changes: