Viewing 2 replies - 1 through 2 (of 2 total)
  • From the 5.3 Master List:

    Dates or times being incorrect, permalinks being off by a day, other weirdness related to “time”

    WordPress 5.3 received a significant upgrade to its date and time handling code. The previous code dated all the way back to over 10 years ago, when PHP 4 was still supported. This was a significant chunk of code scattered all through the core of WordPress, and it was very slow and a drag on performance.

    With 5.3, most of this code has been updated or replaced with saner PHP 5.6 compatible code. A lot of the legacy has been removed. However, some plugins and themes may have relied on the side effects from how this code previously operated.

    For this reason, some plugins or themes may be doing incorrect things. One such thing would be to call the date_default_timezone_set() function in PHP. WordPress works by setting the default timezone to UTC and then performing its own calculations to adjust times. Setting the default timezone incorrectly to anything else will result in these calculations being incorrect. WordPress will be overcompensating the timezone adjustments.

    For backwards compatibility, it is crucial that plugins *not* change the default PHP timezone. The default timezone must be set to UTC at all times. Any problems you find with timezones or dates shifting is likely going to be a plugin or theme which is doing-it-wrong. This may not have mattered as much in previous versions of WordPress, but now that WordPress is using these newer functions more and less reliant on the old PHP 4 compatible code, then this is far more critical.

    If you find a plugin or theme with a problem like this, please report it to their authors, or report it to the plugins team.

    Thread Starter dsbw

    (@dsbw)

    Jacob,

    Thanks. I searched for “permalinks” on what I thought was the right text but I didn’t see this.

    So, I switched to the 2020 theme, changed permalinks and changed back. But 2020 is showing the same phenomenon. The post shows as 2012-July-16 on the page, it was posted on 2012-July-16, but the link generated is for 2012/07/17.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Permalinks SOMETIMES broken’ is closed to new replies.