Support » Plugin: Wordbooker » Timing Issue

  • Resolved agMedia34


    Just got the plugin and everything is great. Except … Timing on the comments is off a bit.

    I posted a test post on my site and it went to facebook.

    Then I commented on it (on the site) … and that went to facebook too.

    Then from facebook, I commented on the initial comment … and it went back to my site.

    So now my site has both comments posted, but the one I made from that site was at 5:57pm (correct), and the one from facebook is saying it was posted at 12:03 pm (NOT correct) … and causing improper ordering of the comments.

    I did check the correct time zone in my wp settings. Any ideas?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Steve


    That’s going to be the post from FB coming over with the wrong time.

    Which version of Wordbooker are you using? I could push a test version out for you to test with a TZ offset for FB comments

    Thank you. Its the latest version – just downloaded yesterday. I think its fine as it is, but if you have plans to address that, Ill just hold off for the update.

    I just think its confusing for people that interact on our site and facebook that the comments may be “shuffled”.

    So are you saying that facebook is marking the wrong time stamp? If your updated plugin automatically adjusts for the difference, what would happen then when facebook “fixes” it on their end?

    Plugin Author Steve


    The comment timestamps already have code in place to put in the appropriate time shift. I assume you are on the US Eastern Seaboard….

    US Central Time actually. Can you just explain what/where I need to edit for my particular timezone in your file?


    Plugin Author Steve


    In the wordbooker_comments.php file there is this code:

    $time = date("Y-m-d H:i:s",strtotime($single_comment->created_time));
    $current_offset = get_option('gmt_offset');
    $atime = date("Y-m-d H:i:s",strtotime($single_comment->created_time)+(3600*$current_offset));
    $data = array(
    'comment_post_ID' => $wp_post_row->wp_post_id,					'comment_author' => $single_comment->from->name,
    'comment_author_email' => $commemail,
    'comment_author_url' => ''.$single_comment->from->id,
    'comment_content' =>$single_comment->message,
    'comment_author_IP' => '',
    'comment_date' => $atime,
    'comment_date_gmt' => $time,
    'comment_parent'=> 0,
    'user_id' => 0,
    'comment_agent' => 'Wordbooker plugin '.WORDBOOKER_CODE_RELEASE,
    'comment_approved' => $comment_approve,

    so comment_date should have the comment time and comment_date_gmt should have the time offset to GMT.

    It might be worth checking to see what those two columns look like in the database – FB might be returning the wrong time.. What we’d need to see is the raw comments feed from FB to work out what it going on.

    Okay, thank you. So what do you need from me? I dont have any live comments being fed yet – I just had the couple test ones from yesterday.

    Plugin Author Steve


    It would be interesting to know the two time stamps for the two comments in your database…. also which theme are you using?

    Im using a very heavily modified version of the MADE theme.

    Ill do a couple more test comments later tonight. What database table am I looking in to find the stamps for you?

    Plugin Author Steve


    its the regular wordpress comments table – you should be able to work out which two comments you’re looking for

    It may not be with your plugin at all. I just noticed in my activity stream (buddypress) that an action I “just did” was being posted as having happened 6 hours ago.

    In my WP settings I had “chicago” selected as my time … I switched to UTC-6 (which is the same thing) and it fixed the activity times. Im hoping the same will be true with comments, but I havent gotten to testing those again yet. Will keep you posted.

    Plugin Author Steve


    But those time zones should correspond to the same thing… unless there is something screwy inside WordPress…..I’ll see if I can work out what is going on.

    Plugin Author Steve


    Chicago here returns an offset of -6 which is right…..

    Weird. UTC-6 works fine, but selecting Chicago sets everything off by 6 hours. It wasn’t your plugin at all … did it with my buddypress activity stream as well, but its all fixed now. Everything is as it should be. Just curious now on the whole Chicago thing … but that’s not you and the plugin is fantastic.

    Thanks again for your help.

    Plugin Author Steve


    Is your blog a very old one that has been upgraded? I’ve seen some reports that very old WP installs that have been upgraded seem to have some Time zone problems.

    Setting it to -6 means that you’ll have to manually adjust for DST though which is a pain. If you set it to Chicago do the two times show correctly on the page where you set the blog time zone?

    Install is only a month or 2 old, and yes, on the settings screen when I select Chicago it shows fine. Only in the bp activity and the wordbooker comments pulled from facebook.

    No worries though – as long as the UTC-6 works, Im good with that.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Timing Issue’ is closed to new replies.