Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress time issue after activation #49

Closed
bradnz opened this issue Jan 24, 2017 · 17 comments

Comments

@bradnz
Copy link

commented Jan 24, 2017

13 hours added to both GMT and local time in WordPress General Settings after plugin activation, deactivate and returns to normal. Tested on two different servers (in different countries) and 3 websites.
Version 2.0.2

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2017

Have you tried to reverse the 2.0.2 changes manually to see if the error is there?

You can check the changes made in the commit bfbfd80

Since which version have you upgraded to 2.0.2?

@bradnz

This comment has been minimized.

Copy link
Author

commented Jan 25, 2017

No upgrade, just installed the plugin for the first time.
Not sure if I have the skills to undo the 2.0.2 changes. I'll give it ago.

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2017

This is version 2.0.0 (This version works perfectly) upload in ZippyShare http://www54.zippyshare.com/v/8j9399Od/file.html

Download and unzip the file and the folder inside (wp-opening-hours), replace in your plugin.

In the ..\wp-content\plugins

First disable the plugin

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2017

You can also download version 2.0.1 from here, but I have not tested it.

@bradnz

This comment has been minimized.

Copy link
Author

commented Jan 25, 2017

Disabled the plugin, copied over 2.0.0, but issue remains.

This is before activation:
Timezone Auckland
Universal time (GMT) is 2017-01-25 22:24:45. Local time is 2017-01-26 11:24:45.
This timezone is currently in daylight saving time.
Standard time begins on: April 2, 2017 3:00 am.

This is after:
Timezone Auckland
Universal time (GMT) is 2017-01-26 11:24:58. Local time is 2017-01-27 00:24:58.
This timezone is currently in daylight saving time.
Standard time begins on: April 2, 2017 3:00 am.

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2017

I changed the time zone in one of the websites where I have "Open Hours" running to the Auckland area GTM + 13 and the time shows okay.

hora_auckland_utc 13

The problem has to come from something else.

What version of WordPress are you using?

1.- It may be an incompatibility with some other plugin. Do testing by disabling plugins.

2.- Do a clean installation of WordPress locally and install only Opening Hours. Then install your plugins one by one to detect which plugin is giving the incompatibility.

@bradnz

This comment has been minimized.

Copy link
Author

commented Jan 26, 2017

New install of WordPress 4.7.1, no plugins installed except Opening Hours, problem remains.
PHP 7.1.0

Activated - Note the UTC time is 13 hours out
image
Deactivated - All normal
image

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2017

I do not know what may be happening.

Can you switch to the GTM + 1 "Madrid" time zone and then activate the Plugin?

Confirm me if that works.

@bradnz

This comment has been minimized.

Copy link
Author

commented Jan 26, 2017

Deactivated - All normal
image

Activated - Note UTC advanced 1 hour
image

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2017

You're right, I've reviewed a website with WordPress 4.7.1 and it's not working well.

It also advances me 1 hour.

We will have to see what @janizde tells us.

@misagues

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2017

I think the problem is setting the time zone.

I've been working with the Dates.php file (classes/OpeningHours/Util/Dates.php)

/** Sets up current timezone */ protected function initDateTimeZone () { $timezoneString = get_option('timezone_string'); $gmtOffset = get_option('gmt_offset'); if (!empty($gmtOffset) and empty($timezoneString)) { $offset = floatval(floor($gmtOffset)) * 3600; $timezoneString = timezone_name_from_abbr(null, $offset, 0); } if (empty($timezoneString)) $timezoneString = date_default_timezone_get(); $this->timezone = new DateTimeZone($timezoneString); date_default_timezone_set($timezoneString); }

But I can not find the solution. My knowledge of PHP is not very advanced either.

@gpenman

This comment has been minimized.

Copy link

commented Feb 6, 2017

Hey there,
I'm using the plugin, and am obviously experiencing the same issue.
Any progress or solution on this?

@janizde

This comment has been minimized.

Copy link
Owner

commented Feb 10, 2017

i will take a look asap. didn't have the time in the last couple of weeks

@gpenman

This comment has been minimized.

Copy link

commented Feb 10, 2017

Thanks mate - i appreciate your time and effort.

@janizde

This comment has been minimized.

Copy link
Owner

commented Feb 11, 2017

should be fixed in 2.0.3, just released it to the wp repositories. please check if it works now

@janizde janizde closed this Feb 11, 2017

@misagues

This comment has been minimized.

Copy link
Contributor

commented Feb 14, 2017

It works perfect.
Thank you!

@bradnz

This comment has been minimized.

Copy link
Author

commented Feb 14, 2017

Yes, can confirm, problem fixed.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.