Countdown, Coming Soon – Countdown & Clock - Version 1.7.7

Version Description

  • Circle time extension
  • Admin side hide coming soon menu setting
  • Admin side info metabox
  • Sticky countdown type improvements
  • WooCommerce countdown type improvements
  • Bug fixes
Download this release

Release Info

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

Code changes from version 1.7.6 to 1.7.7

assets/js/YcdGeneral.js CHANGED
@@ -50,3 +50,31 @@ YcgGeneral.prototype.countDurationSeconds = function (options) {
50
  return seconds;
51
  };
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  return seconds;
51
  };
52
 
53
+ YcgGeneral.prototype.endBehavior = function(cd, options) {
54
+ if(YCD_GENERAL_ARGS.isAdmin) {
55
+ return false;
56
+ }
57
+ if (options['ycd-countdown-end-sound']) {
58
+ var soundUrl = options['ycd-countdown-end-sound-url'];
59
+ var song = new Audio (soundUrl);
60
+ song.play();
61
+ }
62
+ var id = parseInt(options['id']);
63
+ var behavior = options['ycd-countdown-expire-behavior'];
64
+
65
+ jQuery(window).trigger('YcdExpired', {'id': id});
66
+
67
+ switch (behavior) {
68
+ case 'hideCountdown':
69
+ cd.remove();
70
+ break;
71
+ case 'redirectToURL':
72
+ cd.remove();
73
+ window.location.href = (options['ycd-expire-url']);
74
+ break;
75
+ case 'showText':
76
+ cd.replaceWith(options['ycd-expire-text']);
77
+ break;
78
+ }
79
+ };
80
+
assets/views/admin/shortcodeMetabox.php CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  <?php
2
  $postId = @$_GET['post'];
3
  if (empty($postId)) : ?>
@@ -5,4 +9,18 @@ if (empty($postId)) : ?>
5
  <?php else: ?>
6
  <div class="ycd-tooltip">
7
  <span class="ycd-tooltiptext" id="ycd-tooltip-<?php echo $postId; ?>">Copy to clipboard</span><input type="text" data-id="<?php echo $postId; ?>" onfocus="this.select();" readonly="" id="ycd-shortcode-input-<?php echo $postId; ?>" value="[ycd_countdown id=<?php echo $postId; ?>]" class="large-text code countdown-shortcode"></div>
8
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ycd-bootstrap-wrapper">
2
+ <label>
3
+ <?php _e('Shortcode', YCD_TEXT_DOMAIN); ?>
4
+ </label>
5
  <?php
6
  $postId = @$_GET['post'];
7
  if (empty($postId)) : ?>
9
  <?php else: ?>
10
  <div class="ycd-tooltip">
11
  <span class="ycd-tooltiptext" id="ycd-tooltip-<?php echo $postId; ?>">Copy to clipboard</span><input type="text" data-id="<?php echo $postId; ?>" onfocus="this.select();" readonly="" id="ycd-shortcode-input-<?php echo $postId; ?>" value="[ycd_countdown id=<?php echo $postId; ?>]" class="large-text code countdown-shortcode"></div>
12
+ <?php endif; ?>
13
+
14
+ <label>
15
+ <?php _e('Current version', YCD_TEXT_DOMAIN); ?>
16
+ </label>
17
+ <p class="current-version-text" style="color: #3474ff;"><?php echo YCD_VERSION_TEXT; ?></p>
18
+ <label>
19
+ <?php _e('Last update date', YCD_TEXT_DOMAIN); ?>
20
+ </label>
21
+ <p style="color: #11ca79;"><?php echo YCD_LAST_UPDATE; ?></p>
22
+ <label>
23
+ <?php _e('Next update date', YCD_TEXT_DOMAIN); ?>
24
+ </label>
25
+ <p style="color: #efc150;"><?php echo YCD_NEXT_UPDATE; ?></p>
26
+ </div>
assets/views/settings.php CHANGED
@@ -4,6 +4,7 @@
4
  $defaultData = AdminHelper::defaultData();
5
  $userSavedRoles = get_option('ycd-user-roles');
6
  $dontDeleteData = (get_option('ycd-delete-data') ? 'checked': '');
 
7
  ?>
8
  <div class="ycd-bootstrap-wrapper ycd-settings-wrapper">
9
  <div class="row">
@@ -28,6 +29,17 @@
28
  </label>
29
  </div>
30
  </div>
 
 
 
 
 
 
 
 
 
 
 
31
  <div class="row form-group">
32
  <div class="col-md-5">
33
  <label><?php _e('User role who can use plugin', YCD_TEXT_DOMAIN)?></label>
4
  $defaultData = AdminHelper::defaultData();
5
  $userSavedRoles = get_option('ycd-user-roles');
6
  $dontDeleteData = (get_option('ycd-delete-data') ? 'checked': '');
7
+ $hideComingSoon = (get_option('ycd-hide-coming-soon-menu') ? 'checked': '');
8
  ?>
9
  <div class="ycd-bootstrap-wrapper ycd-settings-wrapper">
10
  <div class="row">
29
  </label>
30
  </div>
31
  </div>
32
+ <div class="row form-group">
33
+ <div class="col-md-5">
34
+ <label for="ycd-hide-coming-soon-menu"><?php _e('Hide Coming soon menu', YCD_TEXT_DOMAIN)?></label>
35
+ </div>
36
+ <div class="col-md-4">
37
+ <label class="ycd-switch">
38
+ <input type="checkbox" id="ycd-hide-coming-soon-menu" name="ycd-hide-coming-soon-menu" class="ycd-accordion-checkbox" <?= $hideComingSoon ?> >
39
+ <span class="ycd-slider ycd-round"></span>
40
+ </label>
41
+ </div>
42
+ </div>
43
  <div class="row form-group">
44
  <div class="col-md-5">
45
  <label><?php _e('User role who can use plugin', YCD_TEXT_DOMAIN)?></label>
classes/Actions.php CHANGED
@@ -134,8 +134,10 @@ class Actions {
134
  }
135
 
136
  public function adminMenu() {
137
- add_menu_page(__('Coming Soon', YCD_TEXT_DOMAIN), __('Coming Soon', YCD_TEXT_DOMAIN), 'manage_options', 'ycdComingSoon', array($this, 'comingSoonMenu'), 'dashicons-clock', 11);
138
- }
 
 
139
 
140
  public function comingSoonMenu() {
141
  $comingSoonObj = new ComingSoon();
@@ -354,7 +356,7 @@ class Actions {
354
  add_meta_box('ycdUpgrade', __('Upgrade', YCD_TEXT_DOMAIN), array($this, 'upgradeToPro'), YCD_COUNTDOWN_POST_TYPE, 'side', 'high');
355
  }
356
  add_meta_box('ycdSupport', __('Support', YCD_TEXT_DOMAIN), array($this, 'support'), YCD_COUNTDOWN_POST_TYPE, 'side');
357
- add_meta_box('ycdShortcodeMetabox', __('Shortcode', YCD_TEXT_DOMAIN), array($this, 'shortcodeMetabox'), YCD_COUNTDOWN_POST_TYPE, 'side');
358
  }
359
 
360
  public function upgradeToPro() {
@@ -379,6 +381,13 @@ class Actions {
379
  else {
380
  delete_option('ycd-delete-data');
381
  }
 
 
 
 
 
 
 
382
 
383
  update_option('ycd-user-roles', $userRoles);
384
  wp_redirect(admin_url().'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_SETTINGS);
134
  }
135
 
136
  public function adminMenu() {
137
+ if (!get_option('ycd-hide-coming-soon-menu')) {
138
+ add_menu_page(__('Coming Soon', YCD_TEXT_DOMAIN), __('Coming Soon', YCD_TEXT_DOMAIN), 'manage_options', 'ycdComingSoon', array($this, 'comingSoonMenu'), 'dashicons-clock', 11);
139
+ }
140
+ }
141
 
142
  public function comingSoonMenu() {
143
  $comingSoonObj = new ComingSoon();
356
  add_meta_box('ycdUpgrade', __('Upgrade', YCD_TEXT_DOMAIN), array($this, 'upgradeToPro'), YCD_COUNTDOWN_POST_TYPE, 'side', 'high');
357
  }
358
  add_meta_box('ycdSupport', __('Support', YCD_TEXT_DOMAIN), array($this, 'support'), YCD_COUNTDOWN_POST_TYPE, 'side');
359
+ add_meta_box('ycdShortcodeMetabox', __('Info', YCD_TEXT_DOMAIN), array($this, 'shortcodeMetabox'), YCD_COUNTDOWN_POST_TYPE, 'side');
360
  }
361
 
362
  public function upgradeToPro() {
381
  else {
382
  delete_option('ycd-delete-data');
383
  }
384
+
385
+ if (isset($post['ycd-hide-coming-soon-menu'])) {
386
+ update_option('ycd-hide-coming-soon-menu', true);
387
+ }
388
+ else {
389
+ delete_option('ycd-hide-coming-soon-menu');
390
+ }
391
 
392
  update_option('ycd-user-roles', $userRoles);
393
  wp_redirect(admin_url().'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_SETTINGS);
classes/countdown/CircleCountdown.php CHANGED
@@ -200,8 +200,7 @@ class CircleCountdown extends Countdown {
200
  <?php
201
  $content .= ob_get_contents();
202
  ob_get_clean();
203
- $content .= $this->renderProgressBar();
204
- $content .= $this->renderSubscriptionForm();
205
  $content .= '<div class="ycd-circle-after-countdown" data-key="">'.$this->getOptionValue('ycd-circle-countdown-after-countdown').'</div>';
206
  $content .= '</div>';
207
 
200
  <?php
201
  $content .= ob_get_contents();
202
  ob_get_clean();
203
+ $content .= $this->additionalFunctionality();
 
204
  $content .= '<div class="ycd-circle-after-countdown" data-key="">'.$this->getOptionValue('ycd-circle-countdown-after-countdown').'</div>';
205
  $content .= '</div>';
206
 
classes/countdown/Countdown.php CHANGED
@@ -137,8 +137,9 @@ abstract class Countdown {
137
  }
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');
@@ -1105,4 +1106,11 @@ abstract class Countdown {
1105
 
1106
  return $options;
1107
  }
 
 
 
 
 
 
 
1108
  }
137
  }
138
 
139
  public function includeGeneralScripts() {
140
+ $isAdmin = is_admin();
141
  ScriptsIncluder::registerScript('YcdGeneral.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
142
+ ScriptsIncluder::localizeScript('YcdGeneral.js', 'YCD_GENERAL_ARGS', array('YCD_COUNTDOWN_RESET_COOKIE_NAME' => YCD_COUNTDOWN_RESET_COOKIE_NAME, 'isAdmin' => $isAdmin));
143
  ScriptsIncluder::enqueueScript('YcdGeneral.js');
144
  ScriptsIncluder::registerScript('moment.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL));
145
  ScriptsIncluder::enqueueScript('moment.js');
1106
 
1107
  return $options;
1108
  }
1109
+
1110
+ public function additionalFunctionality() {
1111
+ $content = $this->renderProgressBar();
1112
+ $content .= $this->renderSubscriptionForm();
1113
+
1114
+ return $content;
1115
+ }
1116
  }
config/config.php CHANGED
@@ -68,14 +68,22 @@ class YcdCountdownConfig {
68
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
69
  self::addDefine('YCD_AJAX_SUCCESS', 1);
70
  self::addDefine('YCD_TABLE_LIMIT', 15);
71
- self::addDefine('YCD_VERSION_PRO', 1.62);
72
- self::addDefine('YCD_VERSION', 1.76);
73
  self::addDefine('YCD_FREE_VERSION', 1);
74
  self::addDefine('YCD_SILVER_VERSION', 2);
75
  self::addDefine('YCD_GOLD_VERSION', 3);
76
  self::addDefine('YCD_PLATINUM_VERSION', 4);
77
  self::addDefine('YCD_EXTENSION_VERSION', 99);
78
  require_once(dirname(__FILE__).'/config-pkg.php');
 
 
 
 
 
 
 
 
79
  }
80
 
81
  public static function displaySettings() {
@@ -194,6 +202,14 @@ class YcdCountdownConfig {
194
  'videoURL' => 'https://www.youtube.com/watch?v=WwBuEGIy8po',
195
  'boxTitle' => __('Countdown Button')
196
  );
 
 
 
 
 
 
 
 
197
 
198
  return apply_filters('ycdExtensionsInfo', $extensions);
199
  }
68
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
69
  self::addDefine('YCD_AJAX_SUCCESS', 1);
70
  self::addDefine('YCD_TABLE_LIMIT', 15);
71
+ self::addDefine('YCD_VERSION_PRO', 1.63);
72
+ self::addDefine('YCD_VERSION', 1.77);
73
  self::addDefine('YCD_FREE_VERSION', 1);
74
  self::addDefine('YCD_SILVER_VERSION', 2);
75
  self::addDefine('YCD_GOLD_VERSION', 3);
76
  self::addDefine('YCD_PLATINUM_VERSION', 4);
77
  self::addDefine('YCD_EXTENSION_VERSION', 99);
78
  require_once(dirname(__FILE__).'/config-pkg.php');
79
+
80
+ $versionText = '1.7.7';
81
+ if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
82
+ $versionText = '1.6.3';
83
+ }
84
+ self::addDefine('YCD_VERSION_TEXT', $versionText);
85
+ self::addDefine('YCD_LAST_UPDATE', 'May 10');
86
+ self::addDefine('YCD_NEXT_UPDATE', 'May 24');
87
  }
88
 
89
  public static function displaySettings() {
202
  'videoURL' => 'https://www.youtube.com/watch?v=WwBuEGIy8po',
203
  'boxTitle' => __('Countdown Button')
204
  );
205
+
206
+ $extensions['circleTimer'] = array(
207
+ 'pluginKey' => 'countdown-builder-circle-timer/countdown-bilder-circle-timer.php',
208
+ 'isType' => true,
209
+ 'shortKey' => 'circleTimer',
210
+ 'videoURL' => 'https://www.youtube.com/watch?v=DZHUxHlSdcU&feature=youtu.be',
211
+ 'boxTitle' => __('Circle Timer')
212
+ );
213
 
214
  return apply_filters('ycdExtensionsInfo', $extensions);
215
  }
config/optionsConfig.php CHANGED
@@ -19,8 +19,7 @@ class YcdCountdownOptionsConfig {
19
  'woo' => YCD_GOLD_VERSION,
20
  'circlePopup' => YCD_GOLD_VERSION,
21
  'flipClock' => YCD_SILVER_VERSION,
22
- 'flipClockPopup' => YCD_GOLD_VERSION,
23
- 'circleTimer' => 'comingSoon'
24
  ));
25
 
26
  $YCD_TYPES['typePath'] = apply_filters('ycdTypePaths', array(
@@ -69,7 +68,8 @@ class YcdCountdownOptionsConfig {
69
  'flipClock' => 'https://www.youtube.com/watch?v=Zb7fIkEBcio',
70
  'flipClockPopup' => 'https://www.youtube.com/watch?v=i46qN2sFwZc',
71
  'countdownButton' => 'https://www.youtube.com/watch?v=WwBuEGIy8po',
72
- 'analytics' => 'https://www.youtube.com/watch?v=58asfPjhMS8'
 
73
  ));
74
 
75
  $YCD_TYPES['tutorialsTitles'] = apply_filters('ycdYoutubeUrlsTitles', array(
@@ -195,14 +195,6 @@ class YcdCountdownOptionsConfig {
195
  $options[] = array('name' => 'ycd-clock7-width', 'type' => 'text', 'defaultValue' => 200);
196
  $options[] = array('name' => 'ycd-clock7-alignment', 'type' => 'text', 'defaultValue' => 'center');
197
 
198
- $options[] = array('name' => 'ycd-sticky-button-text', 'type' => 'text', 'defaultValue' => __('Checkout', YCD_TEXT_DOMAIN));
199
- $options[] = array('name' => 'ycd-sticky-bg-color', 'type' => 'text', 'defaultValue' => '#000000');
200
- $options[] = array('name' => 'ycd-sticky-button-color', 'type' => 'text', 'defaultValue' => '#fff');
201
- $options[] = array('name' => 'ycd-sticky-text-color', 'type' => 'text', 'defaultValue' => '#fff');
202
- $options[] = array('name' => 'ycd-sticky-text-background-color', 'type' => 'text', 'defaultValue' => '#555');
203
- $options[] = array('name' => 'ycd-sticky-countdown-text-color', 'type' => 'text', 'defaultValue' => '#fff');
204
- $options[] = array('name' => 'ycd-sticky-all-pages', 'type' => 'checkbox', 'defaultValue' => '');
205
-
206
  if(YCD_PKG_VERSION > YCD_FREE_VERSION) {
207
  require_once dirname(__FILE__) . '/proOptionsConfig.php';
208
  }
19
  'woo' => YCD_GOLD_VERSION,
20
  'circlePopup' => YCD_GOLD_VERSION,
21
  'flipClock' => YCD_SILVER_VERSION,
22
+ 'flipClockPopup' => YCD_GOLD_VERSION
 
23
  ));
24
 
25
  $YCD_TYPES['typePath'] = apply_filters('ycdTypePaths', array(
68
  'flipClock' => 'https://www.youtube.com/watch?v=Zb7fIkEBcio',
69
  'flipClockPopup' => 'https://www.youtube.com/watch?v=i46qN2sFwZc',
70
  'countdownButton' => 'https://www.youtube.com/watch?v=WwBuEGIy8po',
71
+ 'analytics' => 'https://www.youtube.com/watch?v=58asfPjhMS8',
72
+ 'circleTimer' => 'https://www.youtube.com/watch?v=DZHUxHlSdcU&feature=youtu.be'
73
  ));
74
 
75
  $YCD_TYPES['tutorialsTitles'] = apply_filters('ycdYoutubeUrlsTitles', array(
195
  $options[] = array('name' => 'ycd-clock7-width', 'type' => 'text', 'defaultValue' => 200);
196
  $options[] = array('name' => 'ycd-clock7-alignment', 'type' => 'text', 'defaultValue' => 'center');
197
 
 
 
 
 
 
 
 
 
198
  if(YCD_PKG_VERSION > YCD_FREE_VERSION) {
199
  require_once dirname(__FILE__) . '/proOptionsConfig.php';
200
  }
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: 1.7.6
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: 1.7.7
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
helpers/ShowReviewNotice.php CHANGED
@@ -85,10 +85,17 @@ class YcdShowReviewNotice {
85
 
86
  return $days;
87
  }
 
 
 
 
 
 
88
 
89
  private function getMaxOpenDaysMessage($type) {
90
  $getUsageDays = $this->getPopupUsageDays();
91
- $firstHeader = '<h1 class="ycd-review-h1"><strong class="ycd-review-strong">Wow!</strong> You’ve been using Countdown on your site for '.$getUsageDays.' days</h1>';
 
92
  $popupContent = $this->getMaxOepnContent($firstHeader, $type);
93
 
94
  $popupContent .= $this->showReviewBlockJs();
85
 
86
  return $days;
87
  }
88
+
89
+ private function getCurrentUserDisplayName() {
90
+ $user = wp_get_current_user();
91
+
92
+ return $user->display_name;
93
+ }
94
 
95
  private function getMaxOpenDaysMessage($type) {
96
  $getUsageDays = $this->getPopupUsageDays();
97
+ $userName = $this->getCurrentUserDisplayName();
98
+ $firstHeader = '<h1 class="ycd-review-h1"><strong class="ycd-review-strong">Wow! '.$userName.'</strong> You’ve been using Countdown on your site for '.$getUsageDays.' days</h1>';
99
  $popupContent = $this->getMaxOepnContent($firstHeader, $type);
100
 
101
  $popupContent .= $this->showReviewBlockJs();
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.4
6
- Stable tag: 1.7.6
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,14 @@ 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.6 =
69
  * Countdown Clone (new)
70
  * Coming Soon Custom JS (new)
2
  Contributors: adamskaat
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
+ Tested up to: 5.4.1
6
+ Stable tag: 1.7.7
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.7 =
69
+ * Circle time extension
70
+ * Admin side hide coming soon menu setting
71
+ * Admin side info metabox
72
+ * Sticky countdown type improvements
73
+ * WooCommerce countdown type improvements
74
+ * Bug fixes
75
+
76
  = 1.7.6 =
77
  * Countdown Clone (new)
78
  * Coming Soon Custom JS (new)