-
Notifications
You must be signed in to change notification settings - Fork 337
Bug/12102 timezone fix #12303
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
Merged
Merged
Bug/12102 timezone fix #12303
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f62b80c
Pass scheduled timestamp to initiator hook.
zutigrm 0321542
Schedule initiator with timestamp arg.
zutigrm 56c00a9
Use scheduled timestamp as batch anchor.
zutigrm 474bab0
Check initiator existence by frequency.
zutigrm 7e4a157
Update initiator assertions for new args.
zutigrm 3352908
Assert initiator args include scheduled timestamp.
zutigrm bcec24f
Add timezone midnight scheduling test.
zutigrm 982fed1
Assert worker/fallback use scheduled timestamp.
zutigrm c071d39
Mock frequency-based initiator checks.
zutigrm 377df77
Merge remote-tracking branch 'origin/develop' into bug/12102-timezone…
zutigrm 2143a0a
Add BC wp_timezone fallback utility.
zutigrm 2c47c48
Use BC timezone.
zutigrm 7556872
Use scheduler helper for initiator timestamp assertions.
zutigrm bf5faf9
Make initiator test timestamp human-readable.
zutigrm eb7eca5
Fix date range mismatch - extra day excluded.
zutigrm a889481
Update tests to verify correct date ranges.
zutigrm 2eeba57
Merge remote-tracking branch 'origin/develop' into bug/12102-timezone…
zutigrm 4da1fce
Add wp_timezone_string method.
zutigrm b4dcf6a
Add tests.
zutigrm 130fa18
Consistently apply strtotime over hard coded unix timestamp.
benbowler cd6c4bc
Fix uses of wp_timezone within Frequency_PlannerTest.
benbowler 50da565
Add comment to private function usage.
tofumatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 a private function (clearly marked as such with the leading underscore) and is explicitly marked as not being for third-parties to use/rely on: https://developer.wordpress.org/reference/functions/_get_cron_array/
Using private functions like this could cause Site Kit to break unexpectedly in the future—I know we test nightly versions of WordPress right now to check on this sort of thing, but is there any way we can get this data without relying on a private API?
I'd really rather us not use APIs like this, and it wasn't mentioned in the IB.
If we do need to use this, at the absolute minimum, we should thoroughly document our reasoning for using this private API (why public APIs can't provide the data we need).
I can see we have tests for this function so that's good 😄.
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.
We are using it here because of dynamic timestamp argument, so default
wp_next_scheduledcheck won;t do as we don't have static arguments for hook to be correctly identified. The reasoning is explained in detail already in the method header doc:Similar reason we also use this internal check on uninstallation hook:
site-kit-wp/includes/Core/Util/Uninstallation.php
Lines 160 to 173 in 424e7e4