I am having issues with a site displaying incorrect times in some places but not others — specifically this is related to the Events Calendar plugin. On the calendar page and if guests add an event to their personal offsite calendars the time is correct but on the events page itself the time is off by eight hours.
The Events Calendar plugin has a troubleshooting section and it generates a log. I believe I have found the issue.
WP Timezone: America/Toronto
WP GMT Offset -4
Default PHP Timezone PRC
When I restore the site to a version from ten days ago the Default PHP Timezone is UTC.
When I check the Default PHP Timezone on the server from SSH using date_default_timezone_get () the response is UTC.
I created a one-line php file that just echos date_default_timezone_get () and dropped it into the public_html directories of other sites on the same server and it all returns UTC.
A strange thing happens when I drop the same php file in the public_html directory of the site having the issue — it gets blocked.
The issue is .htaccess which has been configured to only allow access to a specific list of files.
When I try to edit that list to include my php file in the allowed list I seem to successfully edit the .htaccess file but if I open it for editing again the file has returned to the previous status.
Nothing I have been able to do allows me to edit .htaccess despite having root access to my server.
I don’t know what caused this nor if it is related or separate from the PHP Timezone issue.
One solution would be to restore the May 7 version. That would result in losing 10 days worth of work but if it solved the problem I would do it except I am concerned that whatever changed the PHP Timezone would happen again so I would not only lose ten days of work but also end up back in the same spot.
The backup has been restored to a different domain so while I can update all free plugins I can’t update paid plugins as the temporary domain does not match my licensing for those. This includes Event Calander and some related add-ons. This problem I believe started after an update as site was fine until at least May 7.
I have reached out to the plugin developer but I’m not confident in that process so am looking to start a parallel process.
If someone could answer any of the following questions it would be very useful to me.
1) Is it possible for a plugin to change the default PHP timezone for an instance of WordPress yet not impact the PHO timezone for the server?
2) I am helping someone and am not a WordPress user myself but is it possible for me to edit the code to just hardcode the timezone to UTC in a way that won’t get overwritten during the next WordPress or theme update?
3) Is it possible that the PHP timezone is actually UTC but the Event Calander diagnostics log is wrong? If yes how would I confirm that?
4) What could possibly be causing my inability to edit .htaccess? I have looked through the plugins installed and nothing hits me as being a hardening/security plugin. There are also other WordPress sites on the same server and they do not have this protection of .htaccess. Lastly, whatever this is has broken parts of WordPress as the allowed files exclude files that are called from the back office — in particular I noticed some stuff under tools comes back with a blocked error.
