Countdown, Coming Soon – Countdown & Clock - Version 2.4.1

Version Description

  • Added Years possibility to simple countdown
Download this release

Release Info

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

Code changes from version 2.4.0 to 2.4.1

assets/js/YcdSimpleCountdown.js CHANGED
@@ -271,7 +271,7 @@ YcdSimpleCountdown.prototype.render = function()
271
 
272
  YcdSimpleCountdown.prototype.countdown = function()
273
  {
274
- var unites = ['months', 'days', 'hours', 'minutes', 'seconds'];
275
  var that = this;
276
  var id = that.id;
277
  var options = this.options;
@@ -294,6 +294,10 @@ YcdSimpleCountdown.prototype.countdown = function()
294
  }
295
  // Time calculations for days, hours, minutes and seconds
296
  var unitesValues = {};
 
 
 
 
297
  unitesValues.months = Math.floor(distance / (2678400000));
298
  if (options['ycd-simple-enable-months']) {
299
  distance = distance % 2678400000
271
 
272
  YcdSimpleCountdown.prototype.countdown = function()
273
  {
274
+ var unites = ['years', 'months', 'days', 'hours', 'minutes', 'seconds'];
275
  var that = this;
276
  var id = that.id;
277
  var options = this.options;
294
  }
295
  // Time calculations for days, hours, minutes and seconds
296
  var unitesValues = {};
297
+ unitesValues.years = Math.floor(distance / (1000 * 60 * 60 * 24 * 365));
298
+ if (options['ycd-simple-enable-years']) {
299
+ distance = distance % (1000 * 60 * 60 * 24 * 365)
300
+ }
301
  unitesValues.months = Math.floor(distance / (2678400000));
302
  if (options['ycd-simple-enable-months']) {
303
  distance = distance % 2678400000
assets/views/main/simpleMainView.php CHANGED
@@ -20,6 +20,31 @@ $allowed_html = AdminHelper::getAllowedTags();
20
  </div>
21
  </div>
22
  <div class="row form-group">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <div class="col-md-6">
24
  <!-- Mounts section start -->
25
  <div class="row form-group">
@@ -44,56 +69,60 @@ $allowed_html = AdminHelper::getAllowedTags();
44
  </div>
45
  </div>
46
  <!-- Mounts section end -->
47
- <!-- Days section start -->
48
- <div class="row form-group">
49
- <div class="col-md-6">
50
- <label for="ycd-simple-enable-days"><?php _e('Days', YCD_TEXT_DOMAIN); ?></label>
51
- </div>
52
- <div class="col-md-6">
53
- <label class="ycd-switch">
54
- <input type="checkbox" id="ycd-simple-enable-days" data-time-type="days" name="ycd-simple-enable-days" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo esc_attr($typeObj->getOptionValue('ycd-simple-enable-days')); ?>>
55
- <span class="ycd-slider ycd-round"></span>
56
- </label>
57
- </div>
58
- </div>
59
- <div class="ycd-accordion-content ycd-hide-content">
60
- <div class="row form-group">
61
- <div class="col-md-6">
62
- <label for="ycd-simple-days-text"><?php _e('label', YCD_TEXT_DOMAIN); ?></label>
63
- </div>
64
- <div class="col-md-6">
65
- <input type="text" id="ycd-simple-days-text" class="form-control ycd-simple-text" data-time-type="days" name="ycd-simple-days-text" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-days-text')); ?>" >
66
- </div>
67
- </div>
68
- </div>
69
- <!-- Days section end -->
70
- </div>
71
- <div class="col-md-6">
72
- <!-- Hours section start -->
73
- <div class="row form-group">
74
- <div class="col-md-6">
75
- <label for="ycd-simple-enable-hours"><?php _e('Hours', YCD_TEXT_DOMAIN); ?></label>
76
- </div>
77
- <div class="col-md-6">
78
- <label class="ycd-switch">
79
- <input type="checkbox" id="ycd-simple-enable-hours" data-time-type="hours" name="ycd-simple-enable-hours" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo esc_attr($typeObj->getOptionValue('ycd-simple-enable-hours')); ?>>
80
- <span class="ycd-slider ycd-round"></span>
81
- </label>
82
- </div>
83
- </div>
84
- <div class="ycd-accordion-content ycd-hide-content">
85
- <div class="row form-group">
86
- <div class="col-md-6">
87
- <label for="ycd-simple-hours-text"><?php _e('label', YCD_TEXT_DOMAIN); ?></label>
88
- </div>
89
- <div class="col-md-6">
90
- <input type="text" id="ycd-simple-hours-text" class="form-control ycd-simple-text" data-time-type="hours" name="ycd-simple-hours-text" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-hours-text')); ?>" >
91
- </div>
92
- </div>
93
- </div>
94
- <!-- Hours section end -->
95
  </div>
96
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  <div class="row form-group">
98
  <div class="col-md-6">
99
  <!-- Minutes section start -->
20
  </div>
21
  </div>
22
  <div class="row form-group">
23
+ <div class="col-md-6">
24
+ <!-- Years section start -->
25
+ <div class="row form-group">
26
+ <div class="col-md-6">
27
+ <label for="ycd-simple-enable-years"><?php _e('Years', YCD_TEXT_DOMAIN); ?></label>
28
+ </div>
29
+ <div class="col-md-6">
30
+ <label class="ycd-switch">
31
+ <input type="checkbox" id="ycd-simple-enable-years" data-time-type="years" name="ycd-simple-enable-years" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo esc_attr($typeObj->getOptionValue('ycd-simple-enable-years')); ?>>
32
+ <span class="ycd-slider ycd-round"></span>
33
+ </label>
34
+ </div>
35
+ </div>
36
+ <div class="ycd-accordion-content ycd-hide-content">
37
+ <div class="row form-group">
38
+ <div class="col-md-6">
39
+ <label for="ycd-simple-years-text"><?php _e('label', YCD_TEXT_DOMAIN); ?></label>
40
+ </div>
41
+ <div class="col-md-6">
42
+ <input type="text" id="ycd-simple-years-text" class="form-control ycd-simple-text" data-time-type="years" name="ycd-simple-years-text" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-years-text')); ?>" >
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <!-- Years section end -->
47
+ </div>
48
  <div class="col-md-6">
49
  <!-- Mounts section start -->
50
  <div class="row form-group">
69
  </div>
70
  </div>
71
  <!-- Mounts section end -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  </div>
73
  </div>
74
+ <div class="row form-group">
75
+ <div class="col-md-6">
76
+ <!-- Days section start -->
77
+ <div class="row form-group">
78
+ <div class="col-md-6">
79
+ <label for="ycd-simple-enable-days"><?php _e('Days', YCD_TEXT_DOMAIN); ?></label>
80
+ </div>
81
+ <div class="col-md-6">
82
+ <label class="ycd-switch">
83
+ <input type="checkbox" id="ycd-simple-enable-days" data-time-type="days" name="ycd-simple-enable-days" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo esc_attr($typeObj->getOptionValue('ycd-simple-enable-days')); ?>>
84
+ <span class="ycd-slider ycd-round"></span>
85
+ </label>
86
+ </div>
87
+ </div>
88
+ <div class="ycd-accordion-content ycd-hide-content">
89
+ <div class="row form-group">
90
+ <div class="col-md-6">
91
+ <label for="ycd-simple-days-text"><?php _e('label', YCD_TEXT_DOMAIN); ?></label>
92
+ </div>
93
+ <div class="col-md-6">
94
+ <input type="text" id="ycd-simple-days-text" class="form-control ycd-simple-text" data-time-type="days" name="ycd-simple-days-text" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-days-text')); ?>" >
95
+ </div>
96
+ </div>
97
+ </div>
98
+ <!-- Days section end -->
99
+ </div>
100
+ <div class="col-md-6">
101
+ <!-- Hours section start -->
102
+ <div class="row form-group">
103
+ <div class="col-md-6">
104
+ <label for="ycd-simple-enable-hours"><?php _e('Hours', YCD_TEXT_DOMAIN); ?></label>
105
+ </div>
106
+ <div class="col-md-6">
107
+ <label class="ycd-switch">
108
+ <input type="checkbox" id="ycd-simple-enable-hours" data-time-type="hours" name="ycd-simple-enable-hours" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo esc_attr($typeObj->getOptionValue('ycd-simple-enable-hours')); ?>>
109
+ <span class="ycd-slider ycd-round"></span>
110
+ </label>
111
+ </div>
112
+ </div>
113
+ <div class="ycd-accordion-content ycd-hide-content">
114
+ <div class="row form-group">
115
+ <div class="col-md-6">
116
+ <label for="ycd-simple-hours-text"><?php _e('label', YCD_TEXT_DOMAIN); ?></label>
117
+ </div>
118
+ <div class="col-md-6">
119
+ <input type="text" id="ycd-simple-hours-text" class="form-control ycd-simple-text" data-time-type="hours" name="ycd-simple-hours-text" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-hours-text')); ?>" >
120
+ </div>
121
+ </div>
122
+ </div>
123
+ <!-- Hours section end -->
124
+ </div>
125
+ </div>
126
  <div class="row form-group">
127
  <div class="col-md-6">
128
  <!-- Minutes section start -->
classes/countdown/SimpleCountdown.php CHANGED
@@ -4,7 +4,7 @@ namespace ycd;
4
  class SimpleCountdown extends Countdown
5
  {
6
  private $mode = 'textUnderCountdown';
7
- private $timeUnites = array('months', 'days', 'hours', 'minutes', 'seconds');
8
 
9
  public function __construct()
10
  {
4
  class SimpleCountdown extends Countdown
5
  {
6
  private $mode = 'textUnderCountdown';
7
+ private $timeUnites = array('years', 'months', 'days', 'hours', 'minutes', 'seconds');
8
 
9
  public function __construct()
10
  {
config/config.php CHANGED
@@ -75,8 +75,8 @@ class YcdCountdownConfig
75
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
76
  self::addDefine('YCD_AJAX_SUCCESS', 1);
77
  self::addDefine('YCD_TABLE_LIMIT', 15);
78
- self::addDefine('YCD_VERSION_PRO', 2.19);
79
- self::addDefine('YCD_VERSION', 2.34);
80
  self::addDefine('YCD_FREE_VERSION', 1);
81
  self::addDefine('YCD_SILVER_VERSION', 2);
82
  self::addDefine('YCD_GOLD_VERSION', 3);
@@ -84,13 +84,13 @@ class YcdCountdownConfig
84
  self::addDefine('YCD_EXTENSION_VERSION', 99);
85
  require_once(dirname(__FILE__).'/config-pkg.php');
86
 
87
- $versionText = '2.3.5';
88
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
89
- $versionText = '2.1.9';
90
  }
91
  self::addDefine('YCD_VERSION_TEXT', $versionText);
92
- self::addDefine('YCD_LAST_UPDATE', 'May 9');
93
- self::addDefine('YCD_NEXT_UPDATE', 'May 16');
94
  }
95
 
96
  public static function displaySettings()
75
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
76
  self::addDefine('YCD_AJAX_SUCCESS', 1);
77
  self::addDefine('YCD_TABLE_LIMIT', 15);
78
+ self::addDefine('YCD_VERSION_PRO', 2.22);
79
+ self::addDefine('YCD_VERSION', 2.41);
80
  self::addDefine('YCD_FREE_VERSION', 1);
81
  self::addDefine('YCD_SILVER_VERSION', 2);
82
  self::addDefine('YCD_GOLD_VERSION', 3);
84
  self::addDefine('YCD_EXTENSION_VERSION', 99);
85
  require_once(dirname(__FILE__).'/config-pkg.php');
86
 
87
+ $versionText = '2.4.1';
88
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
89
+ $versionText = '2.2.2';
90
  }
91
  self::addDefine('YCD_VERSION_TEXT', $versionText);
92
+ self::addDefine('YCD_LAST_UPDATE', 'Aug 25');
93
+ self::addDefine('YCD_NEXT_UPDATE', 'Sep 10');
94
  }
95
 
96
  public static function displaySettings()
config/optionsConfig.php CHANGED
@@ -338,6 +338,8 @@ class YcdCountdownOptionsConfig
338
  $options[] = array('name' => 'ycd-sticky-close-position', 'type' => 'text', 'defaultValue' => 'top_right');
339
 
340
  // Simple countdown
 
 
341
  $options[] = array('name' => 'ycd-simple-enable-months', 'type' => 'checkbox', 'defaultValue' => '');
342
  $options[] = array('name' => 'ycd-simple-months-text', 'type' => 'text', 'defaultValue' => __('Months', YCD_TEXT_DOMAIN));
343
  $options[] = array('name' => 'ycd-simple-enable-days', 'type' => 'checkbox', 'defaultValue' => 'on');
338
  $options[] = array('name' => 'ycd-sticky-close-position', 'type' => 'text', 'defaultValue' => 'top_right');
339
 
340
  // Simple countdown
341
+ $options[] = array('name' => 'ycd-simple-enable-years', 'type' => 'checkbox', 'defaultValue' => '');
342
+ $options[] = array('name' => 'ycd-simple-years-text', 'type' => 'text', 'defaultValue' => __('Years', YCD_TEXT_DOMAIN));
343
  $options[] = array('name' => 'ycd-simple-enable-months', 'type' => 'checkbox', 'defaultValue' => '');
344
  $options[] = array('name' => 'ycd-simple-months-text', 'type' => 'text', 'defaultValue' => __('Months', YCD_TEXT_DOMAIN));
345
  $options[] = array('name' => 'ycd-simple-enable-days', 'type' => 'checkbox', 'defaultValue' => 'on');
countdown-builder.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin by Adam skaat
5
- * Version: 2.4.0
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 by Adam skaat
5
+ * Version: 2.4.1
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: adamskaat
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 6.0.1
6
- Stable tag: 2.4.0
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -67,6 +67,9 @@ Yes you can, we have Circle and Flipclock countdown popups.
67
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
68
 
69
  == Changelog ==
 
 
 
70
  = 2.4.0 =
71
  * Fixed Clock1 options
72
  * Fixed Clock2 options
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 6.0.1
6
+ Stable tag: 2.4.1
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
67
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
68
 
69
  == Changelog ==
70
+ = 2.4.1 =
71
+ * Added Years possibility to simple countdown
72
+
73
  = 2.4.0 =
74
  * Fixed Clock1 options
75
  * Fixed Clock2 options