Countdown, Coming Soon – Countdown & Clock - Version 1.7.3

Version Description

  • Countup issue fixed
  • Fixed Saved duration issue related to Days
  • Reset duration (new)
Download this release

Release Info

Developer adamskaat
Plugin Icon 128x128 Countdown, Coming Soon – Countdown & Clock
Version 1.7.3
Comparing to
See all releases

Code changes from version 1.7.2 to 1.7.3

assets/js/TimeCircles.js CHANGED
@@ -738,7 +738,7 @@
738
 
739
  this.data.attributes.ref_date = (new Date()).getTime() + (attr_data_timer * 1000);
740
  if(this.config['ycd-count-up-from-end-date'] && this.config['countdownExpired']) {
741
- this.data.attributes.ref_date = new Date(moment(this.config['ycd-date-time-picker']).tz(this.config['ycd-circle-time-zone']).format('MM/DD/YYYY H:m:s')).getTime() + (attr_data_timer * 1000);
742
  }
743
  }
744
  else {
738
 
739
  this.data.attributes.ref_date = (new Date()).getTime() + (attr_data_timer * 1000);
740
  if(this.config['ycd-count-up-from-end-date'] && this.config['countdownExpired']) {
741
+ this.data.attributes.ref_date = new Date(moment(this.config['ycd-date-time-picker']).tz(this.config['ycd-time-zone']).format('MM/DD/YYYY H:m:s')).getTime() + (attr_data_timer * 1000);
742
  }
743
  }
744
  else {
assets/js/YcdGeneral.js CHANGED
@@ -17,12 +17,8 @@ YcgGeneral.prototype.getSeconds = function (options) {
17
  var seconds = YcdCountdownProFunctionality.schedule2(options);
18
  }
19
  else {
20
- var days = parseInt(options['ycd-countdown-duration-days']);
21
- var hours = parseInt(options['ycd-countdown-duration-hours']);
22
- var minutes = parseInt(options['ycd-countdown-duration-minutes']);
23
- var secondsSaved = parseInt(options['ycd-countdown-duration-seconds']);
24
 
25
- var seconds = days*86400 + hours*60*60 + minutes*60 + secondsSaved;
26
  if (options['ycd-countdown-save-duration']) {
27
  if (options['ycd-countdown-save-duration-each-user']) {
28
  var id = options['id'];
@@ -32,7 +28,25 @@ YcgGeneral.prototype.getSeconds = function (options) {
32
  seconds = options['ycd-timer-seconds'];
33
  }
34
  }
 
 
 
 
 
 
35
  }
36
 
37
  return seconds;
38
- };
 
 
 
 
 
 
 
 
 
 
 
 
17
  var seconds = YcdCountdownProFunctionality.schedule2(options);
18
  }
19
  else {
 
 
 
 
20
 
21
+ var seconds = this.countDurationSeconds(options);
22
  if (options['ycd-countdown-save-duration']) {
23
  if (options['ycd-countdown-save-duration-each-user']) {
24
  var id = options['id'];
28
  seconds = options['ycd-timer-seconds'];
29
  }
30
  }
31
+
32
+ if (options['ycd-countdown-restart']) {
33
+ if (YcdCountdownProFunctionality.checkRestartDuration(options)) {
34
+ seconds = this.countDurationSeconds(options);
35
+ }
36
+ }
37
  }
38
 
39
  return seconds;
40
+ };
41
+
42
+ YcgGeneral.prototype.countDurationSeconds = function (options) {
43
+ var days = parseInt(options['ycd-countdown-duration-days']);
44
+ var hours = parseInt(options['ycd-countdown-duration-hours']);
45
+ var minutes = parseInt(options['ycd-countdown-duration-minutes']);
46
+ var secondsSaved = parseInt(options['ycd-countdown-duration-seconds']);
47
+
48
+ var seconds = days*86400 + hours*60*60 + minutes*60 + secondsSaved;
49
+
50
+ return seconds;
51
+ };
52
+
assets/views/generalOptions.php CHANGED
@@ -61,6 +61,30 @@ $dueDate = $this->getOptionValue('ycd-date-time-picker');
61
  </label>
62
  </div>
63
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
  <div class="row form-group">
66
  <div class="col-md-4">
61
  </label>
62
  </div>
63
  </div>
64
+ <div class="row">
65
+ <div class="col-md-6">
66
+ <label for="ycd-countdown-restart" class="ycd-label-of-switch"><?php _e('Restart', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
67
+ </div>
68
+ <div class="col-md-6 ycd-option-wrapper<?php echo $isPro; ?>">
69
+ <label class="ycd-switch">
70
+ <input type="checkbox" id="ycd-countdown-restart" class="ycd-accordion-checkbox" name="ycd-countdown-restart" <?php echo $this->getOptionValue('ycd-countdown-restart'); ?>>
71
+ <span class="ycd-slider ycd-round"></span>
72
+ </label>
73
+ </div>
74
+ </div>
75
+ <div class="ycd-accordion-content ycd-hide-content">
76
+ <div class="row form-group">
77
+ <div class="col-md-6">
78
+ <label for="ycd-countdown-save-duration-restart" class="ycd-label-of-switch"><?php _e('Every', YCD_TEXT_DOMAIN); ?></label>
79
+ </div>
80
+ <div class="col-md-2 ycd-option-wrapper">
81
+ <input type="number" class="form-control" name="ycd-countdown-restart-hour" value="<?php echo $this->getOptionValue('ycd-countdown-restart-hour'); ?>">
82
+ </div>
83
+ <div class="col-md-1">
84
+ <label><?php _e('Hour(s)', YCD_TEXT_DOMAIN); ?></label>
85
+ </div>
86
+ </div>
87
+ </div>
88
  </div>
89
  <div class="row form-group">
90
  <div class="col-md-4">
assets/views/timerMainView.php CHANGED
@@ -29,7 +29,7 @@ $textFontFamily = $this->getOptionValue('ycd-text-font-family');
29
  </div>
30
  <div class="row form-group">
31
  <div class="col-md-6">
32
- <label for="ycd-countdown-timer-milliseconds" class="ycd-label-of-switch"><?php _e('Enable Milliseconds', YCD_TEXT_DOMAIN); ?></label>
33
  </div>
34
  <div class="col-md-6">
35
  <label class="ycd-switch">
29
  </div>
30
  <div class="row form-group">
31
  <div class="col-md-6">
32
+ <label for="ycd-countdown-timer-milliseconds" class="ycd-label-of-switch"><?php _e('Enable Miliseconds', YCD_TEXT_DOMAIN); ?></label>
33
  </div>
34
  <div class="col-md-6">
35
  <label class="ycd-switch">
classes/countdown/CircleCountdown.php CHANGED
@@ -180,7 +180,6 @@ class CircleCountdown extends Countdown {
180
  $id = $this->getId();
181
 
182
  $seconds = $this->getCountdownTimerAttrSeconds();
183
-
184
  $bgImageStyleStr = $this->getBgImageStyleStr();
185
  $bgImageStyleStr .= $this->renderStyles();
186
  $allDataOptions = $this->getDataAllOptions();
180
  $id = $this->getId();
181
 
182
  $seconds = $this->getCountdownTimerAttrSeconds();
 
183
  $bgImageStyleStr = $this->getBgImageStyleStr();
184
  $bgImageStyleStr .= $this->renderStyles();
185
  $allDataOptions = $this->getDataAllOptions();
classes/countdown/Countdown.php CHANGED
@@ -125,6 +125,10 @@ abstract class Countdown {
125
  return $this->sanitizedData;
126
  }
127
 
 
 
 
 
128
  public function getMetaBoxes()
129
  {
130
  $metaboxes = $this->defaultMainMetaboxes();
@@ -134,6 +138,7 @@ abstract class Countdown {
134
 
135
  public function includeGeneralScripts() {
136
  ScriptsIncluder::registerScript('YcdGeneral.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
 
137
  ScriptsIncluder::enqueueScript('YcdGeneral.js');
138
  ScriptsIncluder::registerScript('moment.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
139
  ScriptsIncluder::enqueueScript('moment.js');
@@ -178,11 +183,12 @@ abstract class Countdown {
178
  if (!empty($options['ycd-countdown-date-type']) && $options['ycd-countdown-date-type'] == 'duration') {
179
  if (!empty($options['ycd-countdown-save-duration'])) {
180
 
 
181
  $hours = (int)$options['ycd-countdown-duration-hours'];
182
  $minutes = (int)$options['ycd-countdown-duration-minutes'];
183
  $secondsSaved = (int)$options['ycd-countdown-duration-seconds'];
184
 
185
- $seconds = $hours*60*60 + $minutes*60 + $secondsSaved;
186
 
187
  $options['ycd-countdown-duration-saved-str-time'] = strtotime('+'.$seconds.' seconds');
188
  }
@@ -734,11 +740,12 @@ abstract class Countdown {
734
  }
735
 
736
  if($countdownType == 'timer') {
 
737
  $hours = $this->getOptionValue('ycd-timer-hours');
738
  $minutes = $this->getOptionValue('ycd-timer-minutes');
739
  $secondsSaved = $this->getOptionValue('ycd-timer-seconds');
740
 
741
- $seconds = $hours*60*60 + $minutes*60 + $secondsSaved;
742
  }
743
 
744
  return $seconds;
@@ -838,11 +845,12 @@ abstract class Countdown {
838
  $seconds = $this->getExpireSeconds();
839
  }
840
  else {
 
841
  $hours = (int)$this->getOptionValue('ycd-countdown-duration-hours');
842
  $minutes = (int)$this->getOptionValue('ycd-countdown-duration-minutes');
843
  $secondsSaved = (int)$this->getOptionValue('ycd-countdown-duration-seconds');
844
 
845
- $seconds = $hours*60*60 + $minutes*60 + $secondsSaved;
846
  }
847
  $filteredObj->expireSeconds = $seconds;
848
 
@@ -879,6 +887,7 @@ abstract class Countdown {
879
  $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
880
  $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
881
  $content .= $this->getViewContent();
 
882
  do_action('ycdGeneralScripts');
883
  $content .= apply_filters('ycdCountdownAfterContent', '', $this);
884
  $content .= '</div>';
@@ -959,8 +968,12 @@ abstract class Countdown {
959
  $options['ycd-countdown-save-duration-each-user'] = $this->getOptionValue('ycd-countdown-save-duration-each-user');
960
  $options['ycd-date-time-picker'] = $this->getOptionValue('ycd-date-time-picker');
961
  $options['ycd-time-zone'] = $this->getOptionValue('ycd-circle-time-zone');
 
 
962
  $options['isExpired'] = $isExpired;
963
 
 
 
964
  return apply_filters('ycdGeneralIncludingOptions', $options, $this);
965
  }
966
 
125
  return $this->sanitizedData;
126
  }
127
 
128
+ public function setSanitizedData($sanitizedData) {
129
+ $this->sanitizedData = $sanitizedData;
130
+ }
131
+
132
  public function getMetaBoxes()
133
  {
134
  $metaboxes = $this->defaultMainMetaboxes();
138
 
139
  public function includeGeneralScripts() {
140
  ScriptsIncluder::registerScript('YcdGeneral.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
141
+ ScriptsIncluder::localizeScript('YcdGeneral.js', 'YCD_GENERAL_ARGS', array('YCD_COUNTDOWN_RESET_COOKIE_NAME' => YCD_COUNTDOWN_RESET_COOKIE_NAME));
142
  ScriptsIncluder::enqueueScript('YcdGeneral.js');
143
  ScriptsIncluder::registerScript('moment.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
144
  ScriptsIncluder::enqueueScript('moment.js');
183
  if (!empty($options['ycd-countdown-date-type']) && $options['ycd-countdown-date-type'] == 'duration') {
184
  if (!empty($options['ycd-countdown-save-duration'])) {
185
 
186
+ $days = $options['ycd-countdown-duration-days'];
187
  $hours = (int)$options['ycd-countdown-duration-hours'];
188
  $minutes = (int)$options['ycd-countdown-duration-minutes'];
189
  $secondsSaved = (int)$options['ycd-countdown-duration-seconds'];
190
 
191
+ $seconds = $days*86400 + $hours*60*60 + $minutes*60 + $secondsSaved;
192
 
193
  $options['ycd-countdown-duration-saved-str-time'] = strtotime('+'.$seconds.' seconds');
194
  }
740
  }
741
 
742
  if($countdownType == 'timer') {
743
+ $days = $this->getOptionValue('ycd-countdown-duration-days');
744
  $hours = $this->getOptionValue('ycd-timer-hours');
745
  $minutes = $this->getOptionValue('ycd-timer-minutes');
746
  $secondsSaved = $this->getOptionValue('ycd-timer-seconds');
747
 
748
+ $seconds = $days*86400 + $hours*60*60 + $minutes*60 + $secondsSaved;
749
  }
750
 
751
  return $seconds;
845
  $seconds = $this->getExpireSeconds();
846
  }
847
  else {
848
+ $days = $this->getOptionValue('ycd-countdown-duration-days');
849
  $hours = (int)$this->getOptionValue('ycd-countdown-duration-hours');
850
  $minutes = (int)$this->getOptionValue('ycd-countdown-duration-minutes');
851
  $secondsSaved = (int)$this->getOptionValue('ycd-countdown-duration-seconds');
852
 
853
+ $seconds = $days*86400 + $hours*60*60 + $minutes*60 + $secondsSaved;
854
  }
855
  $filteredObj->expireSeconds = $seconds;
856
 
887
  $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
888
  $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
889
  $content .= $this->getViewContent();
890
+
891
  do_action('ycdGeneralScripts');
892
  $content .= apply_filters('ycdCountdownAfterContent', '', $this);
893
  $content .= '</div>';
968
  $options['ycd-countdown-save-duration-each-user'] = $this->getOptionValue('ycd-countdown-save-duration-each-user');
969
  $options['ycd-date-time-picker'] = $this->getOptionValue('ycd-date-time-picker');
970
  $options['ycd-time-zone'] = $this->getOptionValue('ycd-circle-time-zone');
971
+ $options['ycd-countdown-restart'] = $this->getOptionValue('ycd-countdown-restart');
972
+ $options['ycd-countdown-restart-hour'] = $this->getOptionValue('ycd-countdown-restart-hour');
973
  $options['isExpired'] = $isExpired;
974
 
975
+ do_action('ycdIncludeGeneralOptions', $this);
976
+
977
  return apply_filters('ycdGeneralIncludingOptions', $options, $this);
978
  }
979
 
config/config.php CHANGED
@@ -50,6 +50,7 @@ class YcdCountdownConfig {
50
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
51
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS_TABLE', 'ycd_subscribers');
52
  self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
 
53
  self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
54
  self::addDefine('YCD_STORE_URL', 'https://edmonsoft.com/countdown/');
55
  self::addDefine('YCD_PRO_KEY', 'ycdProVersion');
@@ -66,8 +67,8 @@ class YcdCountdownConfig {
66
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
67
  self::addDefine('YCD_AJAX_SUCCESS', 1);
68
  self::addDefine('YCD_TABLE_LIMIT', 15);
69
- self::addDefine('YCD_VERSION_PRO', 1.58);
70
- self::addDefine('YCD_VERSION', 1.72);
71
  self::addDefine('YCD_FREE_VERSION', 1);
72
  self::addDefine('YCD_SILVER_VERSION', 2);
73
  self::addDefine('YCD_GOLD_VERSION', 3);
50
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
51
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS_TABLE', 'ycd_subscribers');
52
  self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
53
+ self::addDefine('YCD_COUNTDOWN_RESET_COOKIE_NAME', 'ycd-reset-duration-');
54
  self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
55
  self::addDefine('YCD_STORE_URL', 'https://edmonsoft.com/countdown/');
56
  self::addDefine('YCD_PRO_KEY', 'ycdProVersion');
67
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
68
  self::addDefine('YCD_AJAX_SUCCESS', 1);
69
  self::addDefine('YCD_TABLE_LIMIT', 15);
70
+ self::addDefine('YCD_VERSION_PRO', 1.59);
71
+ self::addDefine('YCD_VERSION', 1.73);
72
  self::addDefine('YCD_FREE_VERSION', 1);
73
  self::addDefine('YCD_SILVER_VERSION', 2);
74
  self::addDefine('YCD_GOLD_VERSION', 3);
config/optionsConfig.php CHANGED
@@ -165,6 +165,8 @@ class YcdCountdownOptionsConfig {
165
  // timer clock
166
  $options[] = array('name' => 'ycd-countdown-save-duration', 'type' => 'checkbox', 'defaultValue' => '');
167
  $options[] = array('name' => 'ycd-countdown-save-duration-each-user', 'type' => 'checkbox', 'defaultValue' => '');
 
 
168
  $options[] = array('name' => 'ycd-timer-hours', 'type' => 'number', 'defaultValue' => 0);
169
  $options[] = array('name' => 'ycd-timer-minutes', 'type' => 'number', 'defaultValue' => 0);
170
  $options[] = array('name' => 'ycd-timer-seconds', 'type' => 'number', 'defaultValue' => 30);
165
  // timer clock
166
  $options[] = array('name' => 'ycd-countdown-save-duration', 'type' => 'checkbox', 'defaultValue' => '');
167
  $options[] = array('name' => 'ycd-countdown-save-duration-each-user', 'type' => 'checkbox', 'defaultValue' => '');
168
+ $options[] = array('name' => 'ycd-countdown-restart', 'type' => 'checkbox', 'defaultValue' => '');
169
+ $options[] = array('name' => 'ycd-countdown-restart-hour', 'type' => 'text', 'defaultValue' => '1');
170
  $options[] = array('name' => 'ycd-timer-hours', 'type' => 'number', 'defaultValue' => 0);
171
  $options[] = array('name' => 'ycd-timer-minutes', 'type' => 'number', 'defaultValue' => 0);
172
  $options[] = array('name' => 'ycd-timer-seconds', 'type' => 'number', 'defaultValue' => 30);
countdown-builder.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin
5
- * Version: 1.7.2
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin
5
+ * Version: 1.7.3
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
helpers/ShowReviewNotice.php CHANGED
@@ -168,7 +168,7 @@ class YcdShowReviewNotice {
168
  position: absolute;
169
  top: 8px;
170
  right: 15px;
171
- font-size: 23px;
172
  font-weight: bold;
173
  color: #23282d;
174
  cursor: pointer;
168
  position: absolute;
169
  top: 8px;
170
  right: 15px;
171
+ font-size: 15px;
172
  font-weight: bold;
173
  color: #23282d;
174
  cursor: pointer;
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: adamskaat
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
- Tested up to: 5.3.2
6
- Stable tag: 1.7.2
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -65,6 +65,11 @@ Yes you can, we have Circle and Flipclock countdown popups.
65
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
66
 
67
  == Changelog ==
 
 
 
 
 
68
  = 1.7.2 =
69
  * Countdown timer milliseconds (new)
70
 
2
  Contributors: adamskaat
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
+ Tested up to: 5.4
6
+ Stable tag: 1.7.3
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
65
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
66
 
67
  == Changelog ==
68
+ = 1.7.3 =
69
+ * Countup issue fixed
70
+ * Fixed Saved duration issue related to Days
71
+ * Reset duration (new)
72
+
73
  = 1.7.2 =
74
  * Countdown timer milliseconds (new)
75