Making WordPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 10 months ago

#3511 closed defect (bug) (fixed)

Sometimes Status_Transitions::transition_post_status() stores the date as -62169984000

Reported by: dd32's profile dd32 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

While investigating some off numbers in the stats report, i found something off in the date data we're storing.

Sometimes Status_Transitions::transition_post_status() stores the date as -62169984000 on this line:
https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php?rev=6534&marks=152,153#L121

-62169984000 is strtotime( '0000-00-00 00:00:00' ).

Change History (4)

#1 @dd32
7 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 6873:

Plugin Directory: Attempt to avoid storing invalid dates in postmeta for status changes. If the post modified date isn't available, assume now.

I'm not entirely sure post_modified_gmt is the correct field to use here, I suspect post_modified would be better, or perhaps even just using time() in all cases, but once again, I'm not sure why post_modified_gmt was used here instead.

Fixes #3511.

#2 follow-up: @ocean90
7 years ago

Probably related to [6592].

#3 in reply to: ↑ 2 @dd32
7 years ago

Replying to ocean90:

Probably related to [6592].

It looked to be related to plugins from the last 7 days, but could've easily been an operation on a plugin submitted from before that changeset that caused it.

#4 @dd32
10 months ago

In 12991:

Plugin Directory: When storing status transition timestamps, always use the current timestamp.

When a transition event occurs, the modified date might not actually be correct, as Plugin_Directory::filter_wp_insert_post_data() respects the passed timestamp, and some actions (such as approving a plugin) don't intentionally increase the modification date.

Previously: [6873]
See #3511

Note: See TracTickets for help on using tickets.