• nickvw

    (@nickvandewaerdt)


    I am using this plug-in to close our website on Sunday, for religious reasons.

    Problem: Last weekend, the website was closed until noon on Monday, which was 12 hours later than it should have been closed. I cannot figure out why.

    The plug-in help document says the plug-in works off the time settings in our website, which is set to Central Time (GMT-6).

    Any ideas how to fix?

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    If you go to Settings > General, is the time set on UTC-6?

    It should look like this:
    Universal time (UTC) is 2019-04-10 19:12:44. Local time is 2019-04-10 13:12:44.

    Guido

    Thread Starter nickvw

    (@nickvandewaerdt)

    Hi Guido,

    Thanks for the reply!

    It was set on UTC-5, actually, which would be correct, since we’re observing Daylight Savings Time now.

    I changed it to Chicago now, which should be the same thing.

    It looks like this:
    Universal time (UTC) is 2019-04-12 03:01:02. Local time is 2019-04-11 22:01:02.

    I don’t see how to attached a pic, or I’d attach a screenshot…

    Plugin Author Guido

    (@guido07111975)

    Hi,

    My plugin uses the Local Time, so in your example this one: 2019-04-11 22:01:02

    So if this was a sunday the site should be offline from 2019-04-11 00:00:00 – 23:59:59

    Can you please check this upcoming sunday again? With this UTC time format.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Checking this any other day should work as well, of course..

    So you can do a quick test tomorrow, close your site for example:
    Saturday at 00:10 am
    Saturday at 12:10 pm

    The result should be that it’s closed at both times above. If not, there’s something strange going on with the time settings of your site or my plugin.

    Guido

    Thread Starter nickvw

    (@nickvandewaerdt)

    Guido,

    I’ve been checking the past few Sundays, and right now (6:21AM Central Time), it is still on Sabbath mode, both on my mobile and desktop computer. I refreshed the page several times.

    Last week it came on around 7-8am. The week before it was 11:30AM.

    Our website does not get many visitors. Is it possible it takes a few visitors for the website to “wake up” from Sabbath mode?

    Thread Starter nickvw

    (@nickvandewaerdt)

    Right now (5pm central time, Monday), the website is still in Sabbath mode. I checked it on desktop and mobile, and from other IP addresses, and they’re all the same problem.

    Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    This is very strange, the structure of my plugin is very simple and uses the time from your dashboard. That’s it. But maybe there’s a problem with certain time formats, don’t know. So is there a way you give me a temp admin login so I can take a look at it myself?

    If this is possible, how can I reach you? Via the website in your first post?

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi again,

    Did found some info about current_time( 'timestamp' ); that I use, please check this post. Maybe that’s causing this unexpected behaviour.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi,

    Are you able to make a change to my plugin file?

    Go to the editor and select my plugin and open file “vswc”.

    Look for these 2 strings:

    
    $vswc_time = current_time( 'timestamp' );
    $vswc_date = date('w', $vswc_time);
    

    Remove them and change into:

    
    $vswc_date = current_time( 'w' );
    

    I think this does the trick. Apparently the “timestamp” part doesn’t always work properly (anymore).

    Guido

    Thread Starter nickvw

    (@nickvandewaerdt)

    Guido,

    Thank you for the replies.

    I was able to modify the code of your plug-in. I found the strings, and changed them just as you described.

    To test it, I changed the “Closed” day to today (Tuesday). When I refresh the page on my laptop, it enters Website Closed mode, just as it should.

    On my mobile phone however, the website remained available (not in Closed mode), even after closing the internet browser several times, and refreshing multiple times, on multiple different phones. I restarted my phone. I also forced my phone to use the Desktop site, and also tried using 4G data instead of my home Wi-Fi. I left Closed enabled for 30 minutes while I tried these various things, and my phone still did not enter Closed mode, no matter what I did.

    All this while, the Desktop version behaved just as it should.

    Do you have any other ideas of what to try? Does the mobile version of the website/plug-in behave differently, or get it’s time stamp from somewhere else?

    Plugin Author Guido

    (@guido07111975)

    Hi Nick,

    No, my plugin is “very simple”… only few lines of code. In your case it uses 1 single string to determine the date/time:

    
    $vswc_date = current_time( 'w' );
    

    The current_time() is a native WordPress feature that gets the local time of your WP install. And the “w” is part of a native PHP feature that returns the day (in numeric format, such as 0 for Sunday, 1 for Monday, etc.).

    So there must be a conflict with your install or perhaps another plugin of your website.

    By the way, are you using a caching plugin? Perhaps that causes unexpected behaviour?

    Guido

    Thread Starter nickvw

    (@nickvandewaerdt)

    I don’t think we are using a caching plug-in. But in the process of building our website, we did install a handful of plug-ins that are not being used anymore. I’ll try to get those cleaned up.

    But for now, here’s the list of plug-ins that are active on our site. Do you see any that may cause a problem?

    Advanced Excerpt
    Advanced Post Excerpt
    Akismet Anti-Spam — plan to keep this one
    Contact Widgets
    Elementor — plan to keep this one
    Force Login — plan to keep
    GoDaddy Email Marketing
    Google Analytics for WordPress by MonsterInsights — plan to keep
    Gravity Forms
    MailChimp for WordPress — plan to keep?
    Ninja Forms
    Very Simple Website Closed ??
    WordPress Importer
    WP Subscribe
    WP101 Video Tutorials

    Plugin Author Guido

    (@guido07111975)

    Hi,

    For now I don’t notice a plugin that could cause a conflict with mine.

    My local time is 12:31pm and your website is closed over here. So that’s good.

    I have played a lot with the time-settings in dashboard, but website is always closed and open as it should be.

    You told me it’s not working properly at your phone, can you also try on a tablet, such as an iPad?

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi @nickvandewaerdt

    Any news on this?

    Guido

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Website not closed at the correct time’ is closed to new replies.