Countdown, Coming Soon – Countdown & Clock - Version 1.6.0

Version Description

  • Due date bug fixed
  • New Video tutorials section
  • Countdown Number Styles Font Size option improvement
Download this release

Release Info

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

Code changes from version 1.5.9 to 1.6.0

assets/js/Countdown.js CHANGED
@@ -714,7 +714,17 @@ YcdCountdown.prototype.startTimeCircle = function() {
714
  if(new Date(endDate) - Date.now() <= 0) {
715
  that.endBehavior(jQuery(this), allOptions)
716
  }
 
 
 
 
 
 
 
717
  that.addTimeToClock(options, jQuery(this));
 
 
 
718
  that.setOptions(options);
719
  that.setAllOptions(allOptions);
720
  that.render(jQuery(this));
@@ -740,6 +750,10 @@ YcdCountdown.prototype.addTimeToClock = function(options, countDown) {
740
 
741
  var seconds = hours*60*60 + minutes*60 + secondsSaved;
742
  }
 
 
 
 
743
 
744
  countDown.data('timer', seconds);
745
 
714
  if(new Date(endDate) - Date.now() <= 0) {
715
  that.endBehavior(jQuery(this), allOptions)
716
  }
717
+
718
+ if (options['ycd-countdown-date-type'] == 'dueDate') {
719
+ var val = options['ycd-date-time-picker']+':00';
720
+ var selectedTimezone = options['ycd-circle-time-zone'];
721
+ var seconds = that.setCounterTime(val, selectedTimezone);
722
+ jQuery(this).data('timer', seconds);
723
+ }
724
  that.addTimeToClock(options, jQuery(this));
725
+ if (jQuery(this).data('expired')) {
726
+ allOptions['countdownExpired'] = true;
727
+ }
728
  that.setOptions(options);
729
  that.setAllOptions(allOptions);
730
  that.render(jQuery(this));
750
 
751
  var seconds = hours*60*60 + minutes*60 + secondsSaved;
752
  }
753
+ countDown.data('expired', false);
754
+ if (seconds == 0) {
755
+ countDown.data('expired', true);
756
+ }
757
 
758
  countDown.data('timer', seconds);
759
 
assets/js/TimeCircles.js CHANGED
@@ -728,7 +728,7 @@
728
  this.data.timer = attr_data_timer;
729
 
730
  this.data.attributes.ref_date = (new Date()).getTime() + (attr_data_timer * 1000);
731
- if(this.config['ycd-count-up-from-end-date']) {
732
  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);
733
  }
734
  }
728
  this.data.timer = attr_data_timer;
729
 
730
  this.data.attributes.ref_date = (new Date()).getTime() + (attr_data_timer * 1000);
731
+ if(this.config['ycd-count-up-from-end-date'] && this.config['countdownExpired']) {
732
  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);
733
  }
734
  }
assets/views/admin/tutorials.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use ycd\AdminHelper;
3
+ global $YCD_TYPES;
4
+ $tutorialsTitles = $YCD_TYPES['tutorialsTitles'];
5
+
6
+ foreach ($YCD_TYPES['youtubeUrls'] as $videoKey => $url) {
7
+ $title = 'Video Tutorial';
8
+
9
+ if (!empty($tutorialsTitles[$videoKey])) {
10
+ $title = $tutorialsTitles[$videoKey];
11
+ }
12
+ $embedUrl = AdminHelper::getYoutubeEmbedUrl($url);
13
+ ?>
14
+ <div class="current-video-section">
15
+ <h3 style=" margin: 40px 0px 20px;"><?php echo $title; ?></h3>
16
+ <iframe class="current-iframe" src="<?php echo $embedUrl;?>" style="width: 80%; height: 300px;"></iframe>
17
+ </div>
18
+ <?php
19
+ }
classes/RegisterPostType.php CHANGED
@@ -200,6 +200,7 @@ class RegisterPostType {
200
  );
201
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Newsletter', YCD_TEXT_DOMAIN), __('Newsletter', YCD_TEXT_DOMAIN).$menuLabel, 'ycd_manage_options', YCD_COUNTDOWN_NEWSLETTER, array($this, 'countdownNewsletter'));
202
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Support', YCD_TEXT_DOMAIN), __('Support', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_SUPPORT, array($this, 'countdownSupport'));
 
203
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('More ideas?', YCD_TEXT_DOMAIN), __('More ideas?', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_IDEAS, array($this, 'countdownIdeas'));
204
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Subscribers', YCD_TEXT_DOMAIN), __('Subscribers', YCD_TEXT_DOMAIN).$menuLabel, 'ycd_manage_options', YCD_COUNTDOWN_SUBSCRIBERS, array($this, 'countdownSubscribers'));
205
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('More Plugins', YCD_TEXT_DOMAIN), __('More Plugins', YCD_TEXT_DOMAIN), 'manage_options', YCD_COUNTDOWN_MORE_PLUGINS, array($this, 'morePlugins'));
@@ -223,6 +224,10 @@ class RegisterPostType {
223
 
224
  }
225
 
 
 
 
 
226
  public function morePlugins() {
227
  require_once YCD_VIEWS_PATH.'morePlugins.php';
228
  }
200
  );
201
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Newsletter', YCD_TEXT_DOMAIN), __('Newsletter', YCD_TEXT_DOMAIN).$menuLabel, 'ycd_manage_options', YCD_COUNTDOWN_NEWSLETTER, array($this, 'countdownNewsletter'));
202
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Support', YCD_TEXT_DOMAIN), __('Support', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_SUPPORT, array($this, 'countdownSupport'));
203
+ add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Tutorials', YCD_TEXT_DOMAIN), __('Tutorials', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_TUTORIALS, array($this, 'countdownTutorials'));
204
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('More ideas?', YCD_TEXT_DOMAIN), __('More ideas?', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_IDEAS, array($this, 'countdownIdeas'));
205
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Subscribers', YCD_TEXT_DOMAIN), __('Subscribers', YCD_TEXT_DOMAIN).$menuLabel, 'ycd_manage_options', YCD_COUNTDOWN_SUBSCRIBERS, array($this, 'countdownSubscribers'));
206
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('More Plugins', YCD_TEXT_DOMAIN), __('More Plugins', YCD_TEXT_DOMAIN), 'manage_options', YCD_COUNTDOWN_MORE_PLUGINS, array($this, 'morePlugins'));
224
 
225
  }
226
 
227
+ public function countdownTutorials() {
228
+ require_once YCD_ADMIN_VIEWS_PATH.'tutorials.php';
229
+ }
230
+
231
  public function morePlugins() {
232
  require_once YCD_VIEWS_PATH.'morePlugins.php';
233
  }
config/config.php CHANGED
@@ -30,6 +30,7 @@ class YcdCountdownConfig {
30
  self::addDefine('YCD_ASSETS_PATH', YCD_COUNTDOWN_PATH.'/assets/');
31
  self::addDefine('YCD_VIEWS_PATH', YCD_ASSETS_PATH.'views/');
32
  self::addDefine('YCD_VIEWS_MAIN_PATH', YCD_VIEWS_PATH.'main/');
 
33
  self::addDefine('YCD_PREVIEW_VIEWS_PATH', YCD_VIEWS_PATH.'preview/');
34
  self::addDefine('YCD_CSS_PATH', YCD_ASSETS_PATH.'css/');
35
  self::addDefine('YCD_JS_PATH', YCD_ASSETS_PATH.'js/');
@@ -40,6 +41,7 @@ class YcdCountdownConfig {
40
  self::addDefine('YCD_COUNTDOWN_MORE_PLUGINS', 'ycdPlugins');
41
  self::addDefine('YCD_COUNTDOWN_SUPPORT', 'supports');
42
  self::addDefine('YCD_COUNTDOWN_IDEAS', 'ycdIdeas');
 
43
  self::addDefine('YCD_COUNTDOWN_NEWSLETTER', 'ycdNewsletter');
44
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS', 'ycdSubscribers');
45
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
@@ -59,8 +61,8 @@ class YcdCountdownConfig {
59
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
60
  self::addDefine('YCD_AJAX_SUCCESS', 1);
61
  self::addDefine('YCD_TABLE_LIMIT', 15);
62
- self::addDefine('YCD_VERSION_PRO', 1.44);
63
- self::addDefine('YCD_VERSION', 1.59);
64
  self::addDefine('YCD_FREE_VERSION', 1);
65
  self::addDefine('YCD_SILVER_VERSION', 2);
66
  self::addDefine('YCD_GOLD_VERSION', 3);
30
  self::addDefine('YCD_ASSETS_PATH', YCD_COUNTDOWN_PATH.'/assets/');
31
  self::addDefine('YCD_VIEWS_PATH', YCD_ASSETS_PATH.'views/');
32
  self::addDefine('YCD_VIEWS_MAIN_PATH', YCD_VIEWS_PATH.'main/');
33
+ self::addDefine('YCD_ADMIN_VIEWS_PATH', YCD_VIEWS_PATH.'admin/');
34
  self::addDefine('YCD_PREVIEW_VIEWS_PATH', YCD_VIEWS_PATH.'preview/');
35
  self::addDefine('YCD_CSS_PATH', YCD_ASSETS_PATH.'css/');
36
  self::addDefine('YCD_JS_PATH', YCD_ASSETS_PATH.'js/');
41
  self::addDefine('YCD_COUNTDOWN_MORE_PLUGINS', 'ycdPlugins');
42
  self::addDefine('YCD_COUNTDOWN_SUPPORT', 'supports');
43
  self::addDefine('YCD_COUNTDOWN_IDEAS', 'ycdIdeas');
44
+ self::addDefine('YCD_COUNTDOWN_TUTORIALS', 'ycdTutorials');
45
  self::addDefine('YCD_COUNTDOWN_NEWSLETTER', 'ycdNewsletter');
46
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS', 'ycdSubscribers');
47
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
61
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
62
  self::addDefine('YCD_AJAX_SUCCESS', 1);
63
  self::addDefine('YCD_TABLE_LIMIT', 15);
64
+ self::addDefine('YCD_VERSION_PRO', 1.45);
65
+ self::addDefine('YCD_VERSION', 1.6);
66
  self::addDefine('YCD_FREE_VERSION', 1);
67
  self::addDefine('YCD_SILVER_VERSION', 2);
68
  self::addDefine('YCD_GOLD_VERSION', 3);
config/optionsConfig.php CHANGED
@@ -57,6 +57,7 @@ class YcdCountdownOptionsConfig {
57
  ));
58
 
59
  $YCD_TYPES['youtubeUrls'] = apply_filters('ycdYoutubeUrls', array(
 
60
  'clock5' => 'https://www.youtube.com/watch?v=NbP4aKPrWfM&',
61
  'clock6' => 'https://www.youtube.com/watch?v=rsWijVfKQzk',
62
  'clock7' => 'https://www.youtube.com/watch?v=WqsbNipqyCM',
@@ -64,8 +65,26 @@ class YcdCountdownOptionsConfig {
64
  'woo' => 'https://www.youtube.com/watch?v=ObLMBFp69ro',
65
  'circlePopup' => 'https://www.youtube.com/watch?v=KUEvK0FuErw',
66
  'flipClock' => 'https://www.youtube.com/watch?v=Zb7fIkEBcio',
67
- 'flipClockPopup' => 'https://www.youtube.com/watch?v=i46qN2sFwZc'
 
 
68
  ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
 
71
  public static function optionsValues() {
57
  ));
58
 
59
  $YCD_TYPES['youtubeUrls'] = apply_filters('ycdYoutubeUrls', array(
60
+ 'countdownCreate' => 'https://www.youtube.com/watch?v=efqVcdKF620',
61
  'clock5' => 'https://www.youtube.com/watch?v=NbP4aKPrWfM&',
62
  'clock6' => 'https://www.youtube.com/watch?v=rsWijVfKQzk',
63
  'clock7' => 'https://www.youtube.com/watch?v=WqsbNipqyCM',
65
  'woo' => 'https://www.youtube.com/watch?v=ObLMBFp69ro',
66
  'circlePopup' => 'https://www.youtube.com/watch?v=KUEvK0FuErw',
67
  'flipClock' => 'https://www.youtube.com/watch?v=Zb7fIkEBcio',
68
+ 'flipClockPopup' => 'https://www.youtube.com/watch?v=i46qN2sFwZc',
69
+ 'countdownButton' => 'https://www.youtube.com/watch?v=WwBuEGIy8po',
70
+ 'analytics' => 'https://www.youtube.com/watch?v=58asfPjhMS8'
71
  ));
72
+
73
+ $YCD_TYPES['tutorialsTitles'] = apply_filters('ycdYoutubeUrlsTitles', array(
74
+ 'countdownCreate' => __('How to create Countdown', YCD_TEXT_DOMAIN),
75
+ 'clock5' => __('How to create Clock 5', YCD_TEXT_DOMAIN),
76
+ 'clock6' => __('How to create Clock 6', YCD_TEXT_DOMAIN),
77
+ 'clock7' => __('How to create Clock 7', YCD_TEXT_DOMAIN),
78
+ 'sticky' => __('How to create Sticky Countdown', YCD_TEXT_DOMAIN),
79
+ 'woo' => __('How to create WooCommerce Countdown', YCD_TEXT_DOMAIN),
80
+ 'circlePopup' => __('How to create Circle Countdown Popup', YCD_TEXT_DOMAIN),
81
+ 'flipClock' => __('How to create FlipClock Countdown', YCD_TEXT_DOMAIN),
82
+ 'flipClockPopup' => __('How to create FlipClock Popup Countdown', YCD_TEXT_DOMAIN),
83
+ 'countdownButton' => __('Countdown Button Extension', YCD_TEXT_DOMAIN),
84
+ 'analytics' => __('Countdown Analytic Extension', YCD_TEXT_DOMAIN)
85
+ ));
86
+
87
+
88
  }
89
 
90
  public static function optionsValues() {
countdown-builder.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin
5
- * Version: 1.5.9
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.6.0
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
helpers/AdminHelper.php CHANGED
@@ -130,7 +130,7 @@ class AdminHelper {
130
  $data['font-size'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
131
  }
132
 
133
- for($i = 7; $i <= 40; $i++) {
134
  $data['font-size-number'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
135
  }
136
 
@@ -1168,4 +1168,18 @@ class AdminHelper {
1168
 
1169
  return $contactFormUrl;
1170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1171
  }
130
  $data['font-size'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
131
  }
132
 
133
+ for($i = 7; $i <= 100; $i++) {
134
  $data['font-size-number'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
135
  }
136
 
1168
 
1169
  return $contactFormUrl;
1170
  }
1171
+
1172
+ public static function getYoutubeEmbedUrl($url) {
1173
+ $shortUrlRegex = '/youtu.be\/([a-zA-Z0-9_-]+)\??/i';
1174
+ $longUrlRegex = '/youtube.com\/((?:embed)|(?:watch))((?:\?v\=)|(?:\/))([a-zA-Z0-9_-]+)/i';
1175
+
1176
+ if (preg_match($longUrlRegex, $url, $matches)) {
1177
+ $youtube_id = $matches[count($matches) - 1];
1178
+ }
1179
+
1180
+ if (preg_match($shortUrlRegex, $url, $matches)) {
1181
+ $youtube_id = $matches[count($matches) - 1];
1182
+ }
1183
+ return 'https://www.youtube.com/embed/' . $youtube_id ;
1184
+ }
1185
  }
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: 5.3
6
- Stable tag: 1.5.9
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -63,6 +63,12 @@ Yes you can, we have Circle and Flipclock countdown popups.
63
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
64
 
65
  == Changelog ==
 
 
 
 
 
 
66
  = 1.5.9 =
67
  * Countdowns table copy shortcode
68
  * New Ideas sub menu
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 5.3
6
+ Stable tag: 1.6.0
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
63
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
64
 
65
  == Changelog ==
66
+ = 1.6.0 =
67
+ * Due date bug fixed
68
+ * New Video tutorials section
69
+ * Countdown Number Styles Font Size option improvement
70
+
71
+
72
  = 1.5.9 =
73
  * Countdowns table copy shortcode
74
  * New Ideas sub menu