• Resolved Emberstrife

    (@emberstrife)


    Good time of day,

    I couldn’t find a bug tracker for the plugin, so I’ll post this here.

    Google Analyticator sets the PHP timezone to UTC if ini_get(‘date.timezone’) fails (line 29 of google-api-php-client/src/Google_Client.php). And ini_get isn’t very reliable (for example, if you run hhvm).

    This can cause issues if the end user has a plugin that sets a custom PHP timezone (to work around issues with date.timezone in hhvm or for whatever other reason).

    WordPress already sets the default timezone to UTC on init (in wp-settings.php), so unless a user plugin deliberately overrides it, you can expect it to be UTC. If the user deliberately overrides the timezone in a plugin, I think it’s safe to expect that to be the server’s timezone, too.

    At the moment we have to patch the timezone override out of Google Analyticator after every upgrade, which is a bit tedious. Any chance the plugin could be updated to fix this?

    https://wordpress.org/plugins/google-analyticator/

Viewing 1 replies (of 1 total)
  • Hi,

    This was put in place a long time ago, and I believe the original reason was so that the google API server timezone to matches with the google server. However this might not be the case anymore.

    We will investigate if this is necessary, but as you can imagine it will involve a lot of testing, so I don’t think the change will be in the next update.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin should not change the PHP timezone’ is closed to new replies.