Opened 8 years ago
Closed 6 years ago
#41064 closed defect (bug) (duplicate)
Registered and last edited dates on new sites should be identical
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | needs-patch needs-unit-tests |
Focuses: | multisite | Cc: |
Description
In testing #40035, I discovered that depending on how long the creation process takes for a new site, the last updated and registered date could be different by up to several seconds. Ideally, this should always be identical when a new site is created.
Besides it potentially being confusing to a user, I have two use cases for this.
- It is impossible to write a test for #40035 without these dates being guaranteed the same.
- A good way to identify sites that were abandoned after creation would be to compare the registered and last updated dates. If these are not guaranteed to be the same this would become more difficult.
Change History (5)
This ticket was mentioned in Slack in #core-multisite by desrosj. View the logs.
8 years ago
#3
@
7 years ago
In wpmu_create_blog()
, update_blog_status()
is fired for at least the public
meta key. This in turn updates the last_updated
column for the site. That appears to be where the offset is happening.
One option could be to not store last_updated
when wp_is_installing()
. In this case, it would be 0000-00-00 00:00:00
rather than the same or a second off, but may be a more accurate indicator of whether the site has been updated after install.
Yes it will be good for the registered and last updated to be the same on creation. Maybe this could be done via the action hook wpmu_new_blog, that fires immediately after a new site is created. At this point we could change one of them to be the same as the other one.
(On related note, maybe the first default post, page, and comment, should also have the same exact time as site registered and updated on creation).