dshanske / simple-location

Adds Basic Location Support to Wordpress
https://wordpress.org/plugins/simple-location
Other
29 stars 14 forks source link

Small post date bug when activating this plugin #189

Closed outer-outer-space closed 2 years ago

outer-outer-space commented 4 years ago

Hi David, this is such a small, weird bug, but essentially here's what happens:

  1. I activate the Simple Location plugin
  2. Doing so automatically changes the post dates on the homepage for the first two posts on http://log.sarah-hibner.com/
    • My first two posts were made on July 9, but after activating the Simple Location plugin, the two July 9th posts are changed to July 10th.
    • Even if I deactivate and delete the plugin, that date error still persists on the homepage, but not on the individual post page
    • This doesn't seem to affect any of the later posts on http://log.sarah-hibner.com/
  3. The only thing I've tried so far that fixes the incorrect homepage dates after deactivating/deleting the Simple Location plugin is a PHP update (in my case I rolled back the PHP version of my WP site and then re-updated it just to see if that would fix the issue)
dshanske commented 4 years ago

What version of PHP?

dshanske commented 4 years ago

Also, is there any caching installed?

dshanske commented 4 years ago

Finally, what time zone is your site set to in the admin settings?

outer-outer-space commented 4 years ago
  1. I'm currently on version 7.4, but I was on 7.3 before that and was able to reproduce the issue with both versions
  2. Looks like I have Endurance Cache running at 'Normal (Level 2)'
  3. My time zone is set to UTC-7
dshanske commented 4 years ago

The caching may be why you saw it even after disabling. Did you change the time zone on any of these posts using the extra post setting I added in the plugin?

outer-outer-space commented 4 years ago

Caching makes sense, I might play around with it more since it looks like that caching plugin is one that's installed by my web host, so it's kind of opaque. Also I'm pretty sure I didn't change the time zone individually for either of those posts, and if I did update the time zone it was in the admin settings.

dshanske commented 4 years ago

Looking into this. The default timezone is saved regardless of whether it is the same as the site timezone. So it is always overriding defaults. I've added code to check and not store the timezone override if it is the same as the site's timezone offset. It was previously comparing timezone strings, which is more fragile.

dshanske commented 3 years ago

Closing this as likely resolved, reopen if needed