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.
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
Refactor cron event to validate individual URLs #6520
Refactor cron event to validate individual URLs #6520
Changes from 16 commits
6feb425
2ce519a
0e8fa73
a7aeb61
d7f1659
9dcb139
dc72b8a
a67cadd
4f1630e
c085388
2a05e8f
f41681f
422d0f2
bf25b0c
e7f51ea
5f56cc1
3f803b0
fc2c727
72ffb2d
b5afb54
7371fd4
dab728c
afcbcce
ca7b70d
d1ccdaf
2e2f363
4144830
79d678f
da77a0d
5bbadea
ab2bff1
f0c7b3b
55c0ea7
042a74c
4e0dda5
42a2c35
acf93dd
2e94ba4
6d25e3c
1b1b7b1
27b18de
5820ce8
5f5fe35
fce116d
8f2985a
43899d3
331955f
8376583
284e489
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm thinking in a subsequent PR to just remove the
SavePostValidationEvent
entirely. We'll have a weekly cron to re-check the most recently-published post aside from the user-initiated site scan in #6610. If a user has dev tools turned off, this will do a periodic health check without the overhead of doing validation for every single post when that data may not ever be used. What's more is that there is currently no garbage collection of validated URLs (although there needs to be), and without this the database would just keep silently getting larger and larger with validation data.cc @delawski
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.
A change in the validated environment (and enabled post types and templates) should also trigger this, since we need to obtain a new set of URLs.
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.
Done in 55c0ea7 and ab2bff1
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.
Also relates to site scanning in general in #6610. Only the available templates should be scanned.
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.
Done in 5bbadea
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.
I just noticed this change is problematic because there is an existing daily schedule, and because of that the change to hourly is not resulting in the re-scheduling. It seems we need to do a call to
wp_get_scheduled_event()
instead of usingwp_next_scheduled()
inRecurringBackgroundTask::schedule_event()
, and then re-schedule it if theschedule
does not match.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.
Took my first stab at addressing this in 422d0f2. I'm not sure it's best, however. Namely, if there was a daily schedule that is going to happen in 23 hours, but then the schedule gets changed to hourly, then the initial timestamp remains 23 hours in the future. I guess it would be better to unschedule it enturely.
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.
There, I think this is better: bf25b0c.