• Resolved Ladewig

    (@ladewig)


    After Twitter Tools upgraded 31,313 tweets, everythign seemd OK until I looked at the tweets. The upgrade set the date to the date/time when the new twitter post was added and not the actual date/time of the original tweet. So now it look lsike I have 31,313 tweets in the last several hours. Not exactly what I thought it was going to do.

    https://www.ads-software.com/extend/plugins/twitter-tools/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Ladewig

    (@ladewig)

    I did some more checking and it appears that post_date_gmt is correct, but post_date is not. for example:

    post_date 2012-10-18 15:50:44
    post_date_gmt 2012-10-18 19:22:32

    post_date 2012-10-18 15:50:45
    post_date_gmt 2012-10-18 19:20:35

    post_date 2012-10-18 15:50:46
    post_date_gmt 2012-10-18 19:17:27

    I can update these via a query, but it would seem there is an issue with the upgrade process.

    Plugin Contributor alexkingorg

    (@alexkingorg)

    Hmm, that was just changed in 3.0.1 – based on my (limited) testing the post_date was working as expected when only the post_date_gmt was set.

    https://github.com/crowdfavorite/wp-twitter-tools/commit/8986ffeb99d145b5310897eeed8e7b60a9eeb755

    What version of WordPress are you using? Definitely want to fix this for a quick 3.0.2 if needed.

    Thread Starter Ladewig

    (@ladewig)

    Using WordPress 3.42.

    After i fixed the post_date values of the tweets, I noticed that Tweets were not being imported automatically. Figured I’d look into that later and just clicked the button to manually check for Tweets.

    When I looked at the values for these new tweets, post_date was incorrect for these new tweets. Same situation, post_date_gmt reflected the datetime for the original tweet. post_date showed the local time that the tweet was added to WordPress.

    Thread Starter Ladewig

    (@ladewig)

    Why wouldn’t you set both fields? If you know post_date_gmt, then you should know post_date.

    I experienced this now after manually fetching new tweets (the 15 minute cron call still isn’t working for me), when I saw most current tweets were being sorted in the wrong order. Copying post_date_gmt to post-date got them back in the right order…

    Plugin Contributor alexkingorg

    (@alexkingorg)

    Why wouldn’t you set both fields?

    It didn’t appear necessary.

    On my server it still doesn’t appear necessary (the dates all match up as you’d expect). I wonder what the difference is…

    I’m having the same issue here. Not setting the post_date explicitly means it uses the current date/time, so in the DB you end up with post_date with current date/time and post_date_gmt with the tweet date/time. Looking at WP’s code for wp_insert_post, if you don’t set the post_date it sets it to the current date/time: https://github.com/WordPress/WordPress/blob/3.4.2/wp-includes/post.php#L2546

    So, if you set only the post_date, wp_insert_post should pick it up and automatically set the correct GMT date/time. Looks like it was right before the change in 3.0.1?

    In related news, I noticed get_date_from_gmt() doesn’t respect daylight savings time and found that there’s been a patch in Trac for the past 7 months to fix it: https://core.trac.www.ads-software.com/ticket/20328

    FYI, just submitted a pull request to fix these issues:
    https://github.com/crowdfavorite/wp-twitter-tools/pull/16

    Plugin Contributor alexkingorg

    (@alexkingorg)

    Should be fixed in 3.0.2.

    Just tested an upgrade and the dates look good. Thanks!

    Thread Starter Ladewig

    (@ladewig)

    Same here. Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Twitter Tools] Upgraded tweets all show today's date’ is closed to new replies.