Daily recurring timer, day specific
-
I have been using this plugin for a log time and I’ve just realized it’s causing massive issues with my site because of the fairly complex code I am using. My use case is to display the time at which the delivery window for next day delivery of a product closes. This is in a WP block which appears on lots of product pages. The problem is that when the order window closes (at 11:00am), instead of moving on to the next period, every page that is open on any user’s desktop which includes this code starts to refresh about once a second, immediately robbing my server of resources and effectively becoming a denial of service attack. I am sure this can be resolved by better code, but I need help figuring out how to resolve this.
Here is my code:
[countdown date=2022/01/03-00:00:00//2022/01/03-11:00:00//2022/01/04-00:00:00//2022/01/04-11:00:00//2022/01/05-00:00:00//2022/01/05-11:00:00//2022/01/06-00:00:00//2022/01/06-11:00:00//2022/01/07-00:00:00//2022/01/07-11:00:00//2022/01/07-11:00:00 period=7] Orders for <b>Monday & Tuesday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Wednesday+</b>: <font color="green"><b>OPEN</b></font> (closing at <b>11:00am on Monday</b>)[after] Orders for <b>Tuesday</b>: <font color="red"><b>CLOSED</b></font>, orders for <b>Wednesday+</b>: <font color="green"><b>OPEN</b></font>, closing in <b>[dhmtimer]</b> (11:00am)[after] Orders for <b>Tuesday & Wednesday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Thursday+</b>: <font color="green"><b>OPEN</b></font> (closing at <b>11:00am tomorrow</b>)[after] Orders for <b>Wednesday</b>: <font color="red"><b>CLOSED</b></font>, orders for <b>Thursday+</b>: <font color="green"><b>OPEN</b></font>, closing in <b>[dhmtimer]</b> (11:00am)[after] Orders for <b>Wednesday & Thursday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Friday+</b>:<font color="green"><b>OPEN</b></font> (closing at <b>11:00am tomorrow</b>)[after] Orders for <b>Thursday</b>: <font color="red"><b>CLOSED</b></font>, orders for <b>Friday</b>: <font color="green"><b>OPEN</b></font>, closing in <b>[dhmtimer]</b> (11:00am)[after] Orders for <b>Thursday & Friday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Monday+</b>: <font color="green"><b>OPEN</b></font> (closing at <b>2:00pm on Friday</b>)[after] Orders for <b>Friday</b>: <font color="red"><b>CLOSED</b></font>, orders for <b>Monday+</b>: <font color="green"><b>OPEN</b></font>, closing in <b>[dhmtimer]</b> (11:00am)[after] Orders for <b>Friday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Monday+</b>: <font color="green"><b>OPEN</b></font> (closing at <b>11:00am tomorrow</b>)[after] Orders for <b>Monday+ </b>: <font color="green"><b>OPEN</b></font>, closing in <b>[dhmtimer]</b> (11:00am)<br>[after] Orders for <b>Monday</b>: <font color="red"><b>CLOSED</b></font> <br>Orders for <b>Tuesday+</b>: <font color="green"><b>OPEN</b></font> (closing closing in <b>[dhmtimer]</b> (11:00am today) [/countdown]
I have resolved this temporarily by un-ticking the “Add JavaScript code” but being able to show the minutes and seconds counting down was a useful feature.
Your assistance would be greatly appreciated.
The page I need help with: [log in to see the link]
- The topic ‘Daily recurring timer, day specific’ is closed to new replies.