• Ok, so I am testing the beta and this is what I’ve noticed so far.

    The relative timestamp after each entry in the front end page has consistent functionality now. Unfortunately it appears to be using UTC time instead of my local specified wordpress time for both the front end and the all users page.

    I looked in the database at the wp_activity table and the ‘act_date’ column is now storing dates based on UTC timezone. Before it was using the correct local date in ‘act_date’ for all ‘act_types’ except for ‘post_add’.

    Let me know if that is not clear.

    The blacklisting feature works great and now no longer displays in the frontend.

    I’ll update this if I notice anything else.

    https://www.ads-software.com/extend/plugins/wp-activity/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Dric

    (@dric1107)

    Hi,

    The dates are stored in database in UTC format (this was not always the case before 1.9, but that was a bug), so it works like it should. But it should be displayed in admin and frontend with your local timezone (and if it’s not, here is the bug !).

    I think I found where I missed something. There is two options related to timezone setting in WP, one of them is ‘gmt_offset’ (which I try to use), and the other I just discovered is ‘timezone_string’.

    I will fix that.

    Thx for the feedback !

    Thread Starter Elmoonfire

    (@elmoonfire)

    Ahh I didn’t know that was the way to properly store dates in the database. I had seen before 1.9 that some dates were stored in my timezone.

    As for the timezone setting I do know that my wordpress install is using ‘timezone_string’ instead of ‘gmt_offset’ because I had picked my actual timezone.

    Thank you for your support!

    Plugin Author Dric

    (@dric1107)

    Hi,

    I released version 1.9 beta 2, the timezone should be handled correctly now.

    Please test it at : https://downloads.www.ads-software.com/plugin/wp-activity.1.9.zip

    Thx

    Thread Starter Elmoonfire

    (@elmoonfire)

    Hmm, the front end relative dates are still not appearing properly for me. I’ve deleted all of the plugin files and uploaded with the contents of the zip file you linked and the relative dates still show “3 weeks, 6 days ago” for every action that occurs right now until 8 hours have passed then it shows the correct relative time based on UTC time. 8 hours just so happens to be my offset from UTC time.

    Plugin Author Dric

    (@dric1107)

    I think I found what was wrong !

    I updated the 1.9 version, could you download it (use the same link) and test it please ? (only wp-activity.php has changed).

    Thread Starter Elmoonfire

    (@elmoonfire)

    Ok I believe I have figured it out. You can revert that last change. The current_time() and time() functions were producing the same time.

    The problem relied on the gmdate() function. It was actually adjusting the date based on the offset from the gmt time and then compounding it with the offset we just determined in the if statement right above it. In addition the $in_seconds variable was being set before the $posted_date was being adjusted by the offset.

    The following lines need to be adjusted to the following but everything else was fine and doesn’t need changing:

    $cur_time_gmt = current_time(‘timestamp’, true);
    $posted_date = date(“Y-m-d H:i:s”, strtotime($posted_date) + ($gmt_offset * 3600));
    $in_seconds = strtotime($posted_date);

    This is working for me but probably needs testing for other timezones/environments.

    Thread Starter Elmoonfire

    (@elmoonfire)

    Just wondering if you are going to implement my fix for the timezone issue. It should be correct. I checked php.net and this description of gmdate() correlates to what I was seeing.

    Identical to the date() function except that the time returned is Greenwich Mean Time (GMT).

    I’m thinking that it takes the $posted_date (which is already UTC time) and outputs it to what it thinks UTC time would be for that given timestamp based on my offset from UTC. Which has the result of doubling my offset.

    Plugin Author Dric

    (@dric1107)

    I’m sorry, I thought your problem was solved.

    I tried the modified code you gave me on my two tests installations (one in a WAMP and my own blog), the dates are bugged with it.

    Does the 1.9.1 version mess up your relative dates ?

    Thread Starter Elmoonfire

    (@elmoonfire)

    Yes it does because it uses the same code as 1.9. What happens to your dates when you use the code from above?

    Plugin Author Dric

    (@dric1107)

    The events that just occur are displayed with more than 3 weeks instead of having a few seconds.

    Thread Starter Elmoonfire

    (@elmoonfire)

    That is exactly what has been happening to me. All it means is the posted date is being considered in the future. I will try testing on other installation with different timezones to find out whats wrong. You use the actual gmt_offset instead of the timezone_string in both of your installations right?

    Plugin Author Dric

    (@dric1107)

    When I tried your code, all my WP were set to a timezone_string. The gmt_offset are empty.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: WP-Activity] Feedback for beta’ is closed to new replies.