Countdown, Coming Soon – Countdown & Clock - Version 2.2.2

Version Description

  • Added Custom font family functionality
  • Fixed the progress bar color change issue
  • Fixed the progress bar percentage calculation issue
  • Fixed schedules date calculation with simple countdown type
  • Bug fixed realted to Display on option
Download this release

Release Info

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

Code changes from version 2.2.1 to 2.2.2

assets/js/Admin.js CHANGED
@@ -705,6 +705,15 @@ YcdAdmin.prototype.accordionContent = function() {
705
  accordionCheckbox.each(function () {
706
  that.doAccordion(jQuery(this), jQuery(this).is(':checked'));
707
  });
 
 
 
 
 
 
 
 
 
708
  accordionCheckbox.each(function () {
709
  jQuery(this).bind('change', function () {
710
  var attrChecked = jQuery(this).is(':checked');
705
  accordionCheckbox.each(function () {
706
  that.doAccordion(jQuery(this), jQuery(this).is(':checked'));
707
  });
708
+ var customValueAccordion = jQuery('.ycd-custom-value-accordion');
709
+ if (customValueAccordion.length) {
710
+ customValueAccordion.bind('change', function() {
711
+ var val = jQuery('option:selected', this).val() == jQuery(this).data('custom');
712
+ var currentCheckbox = jQuery(this);
713
+ that.doAccordion(currentCheckbox, val);
714
+ });
715
+ customValueAccordion.change();
716
+ }
717
  accordionCheckbox.each(function () {
718
  jQuery(this).bind('change', function () {
719
  var attrChecked = jQuery(this).is(':checked');
assets/views/cricleMainView.php CHANGED
@@ -104,7 +104,17 @@ if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
104
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('Font Family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
105
  </div>
106
  <div class="col-md-7 ycd-option-wrapper<?php echo $isPro; ?>">
107
- <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($textFontFamily), array('name' => 'ycd-text-font-family', 'class' => 'js-ycd-select js-countdown-font-family')); ?>
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
  </div>
110
  <!-- text styles end -->
@@ -151,7 +161,17 @@ if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
151
  <label for="ycd-countdown-number-font" class="ycd-label-of-select"><?php _e('Font Family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
152
  </div>
153
  <div class="col-md-7 ycd-option-wrapper<?php echo $isPro; ?>">
154
- <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($this->getOptionValue('ycd-countdown-number-font')), array('name' => 'ycd-countdown-number-font', 'class' => 'js-ycd-select js-countdown-number-font')); ?>
 
 
 
 
 
 
 
 
 
 
155
  </div>
156
  </div>
157
  <!-- Number styles end -->
104
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('Font Family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
105
  </div>
106
  <div class="col-md-7 ycd-option-wrapper<?php echo $isPro; ?>">
107
+ <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($textFontFamily), array('name' => 'ycd-text-font-family', 'class' => 'js-ycd-select js-countdown-font-family ycd-custom-value-accordion', 'data-custom' => 'customFont')); ?>
108
+ </div>
109
+ </div>
110
+ <div class="ycd-accordion-content ycd-hide-content">
111
+ <div class="row">
112
+ <div class="col-xs-5">
113
+ <label class="control-label" for="ycd-text-font-family-custom"><?php _e(' custom font family', YCD_TEXT_DOMAIN);?>:</label>
114
+ </div>
115
+ <div class="col-xs-7">
116
+ <input type="text" id="ycd-text-font-family-custom" class="form-control input-md custom-font-family" name="ycd-text-font-family-custom" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-text-font-family-custom'))?>" placeholder="Custom Font Family"><br>
117
+ </div>
118
  </div>
119
  </div>
120
  <!-- text styles end -->
161
  <label for="ycd-countdown-number-font" class="ycd-label-of-select"><?php _e('Font Family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
162
  </div>
163
  <div class="col-md-7 ycd-option-wrapper<?php echo $isPro; ?>">
164
+ <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($this->getOptionValue('ycd-countdown-number-font')), array('name' => 'ycd-countdown-number-font', 'class' => 'js-ycd-select js-countdown-number-font ycd-custom-value-accordion', 'data-custom' => 'customFont')); ?>
165
+ </div>
166
+ </div>
167
+ <div class="ycd-accordion-content ycd-hide-content">
168
+ <div class="row">
169
+ <div class="col-xs-5">
170
+ <label class="control-label" for="ycd-number-font-family-custom"><?php _e('custom font family', YCD_TEXT_DOMAIN);?>:</label>
171
+ </div>
172
+ <div class="col-xs-7">
173
+ <input type="text" id="ycd-number-font-family-custom" class="form-control input-md custom-font-family" name="ycd-number-font-family-custom" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-number-font-family-custom'))?>" placeholder="Custom Font Family"><br>
174
+ </div>
175
  </div>
176
  </div>
177
  <!-- Number styles end -->
assets/views/main/simpleMainView.php CHANGED
@@ -177,9 +177,19 @@ $defaultData = AdminHelper::defaultData();
177
  <label for="ycd-simple-numbers-font-family" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
178
  </div>
179
  <div class="col-md-6 ycd-option-wrapper<?php echo $isPro; ?>">
180
- <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($typeObj->getOptionValue('ycd-simple-numbers-font-family')), array('name' => 'ycd-simple-numbers-font-family', 'class' => 'js-ycd-select js-simple-font-family', 'data-field-type' => 'number')); ?>
181
  </div>
182
  </div>
 
 
 
 
 
 
 
 
 
 
183
  <div class="row form-group">
184
  <div class="col-md-6">
185
  <label for="ycd-simple-numbers-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
@@ -214,9 +224,19 @@ $defaultData = AdminHelper::defaultData();
214
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
215
  </div>
216
  <div class="col-md-6 ycd-option-wrapper<?php echo $isPro; ?>">
217
- <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($typeObj->getOptionValue('ycd-simple-text-font-family')), array('name' => 'ycd-simple-text-font-family', 'class' => 'js-ycd-select js-simple-font-family', 'data-field-type' => 'label')); ?>
218
  </div>
219
  </div>
 
 
 
 
 
 
 
 
 
 
220
  <div class="row form-group">
221
  <div class="col-md-6">
222
  <label for="ycd-simple-text-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
177
  <label for="ycd-simple-numbers-font-family" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
178
  </div>
179
  <div class="col-md-6 ycd-option-wrapper<?php echo $isPro; ?>">
180
+ <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($typeObj->getOptionValue('ycd-simple-numbers-font-family')), array('name' => 'ycd-simple-numbers-font-family', 'class' => 'js-ycd-select js-simple-font-family ycd-custom-value-accordion', 'data-field-type' => 'number', 'data-custom' => 'customFont')); ?>
181
  </div>
182
  </div>
183
+ <div class="ycd-accordion-content ycd-hide-content">
184
+ <div class="row">
185
+ <div class="col-xs-6">
186
+ <label class="control-label" for="ycd-simple-numbers-font-family-custom"><?php _e('custom font family', YCD_TEXT_DOMAIN);?>:</label>
187
+ </div>
188
+ <div class="col-xs-6">
189
+ <input type="text" id="ycd-simple-numbers-font-family-custom" class="form-control input-md custom-font-family" name="ycd-simple-numbers-font-family-custom" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-numbers-font-family-custom'))?>" placeholder="Custom Font Family"><br>
190
+ </div>
191
+ </div>
192
+ </div>
193
  <div class="row form-group">
194
  <div class="col-md-6">
195
  <label for="ycd-simple-numbers-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
224
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
225
  </div>
226
  <div class="col-md-6 ycd-option-wrapper<?php echo $isPro; ?>">
227
+ <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($typeObj->getOptionValue('ycd-simple-text-font-family')), array('name' => 'ycd-simple-text-font-family', 'class' => 'js-ycd-select js-simple-font-family ycd-custom-value-accordion', 'data-field-type' => 'label', 'data-custom' => 'customFont')); ?>
228
  </div>
229
  </div>
230
+ <div class="ycd-accordion-content ycd-hide-content">
231
+ <div class="row">
232
+ <div class="col-xs-6">
233
+ <label class="control-label" for="ycd-simple-text-font-family-custom"><?php _e('custom font family', YCD_TEXT_DOMAIN);?>:</label>
234
+ </div>
235
+ <div class="col-xs-6">
236
+ <input type="text" id="ycd-simple-text-font-family-custom" class="form-control input-md custom-font-family" name="ycd-simple-text-font-family-custom" value="<?php echo esc_attr($typeObj->getOptionValue('ycd-simple-text-font-family-custom'))?>" placeholder="Custom Font Family"><br>
237
+ </div>
238
+ </div>
239
+ </div>
240
  <div class="row form-group">
241
  <div class="col-md-6">
242
  <label for="ycd-simple-text-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
classes/countdown/CircleCountdown.php CHANGED
@@ -83,13 +83,13 @@ class CircleCountdown extends Countdown {
83
  $marginTop = $this->getOptionValue('ycd-text-margin-top');
84
  $fontWeight = $this->getOptionValue('ycd-countdown-font-weight');
85
  $fontStyle = $this->getOptionValue('ycd-countdown-font-style');
86
- $fontFamily = $this->getOptionValue('ycd-text-font-family');
87
  // numbers styles
88
  $fontSizeNumber = $this->getOptionValue('ycd-countdown-number-size');
89
  $marginToNumber = $this->getOptionValue('ycd-number-margin-top');
90
  $fontWeightNumber = $this->getOptionValue('ycd-countdown-number-font-weight');
91
  $fontStyleNumber = $this->getOptionValue('ycd-countdown-number-font-style');
92
- $fontFamilyNumber = $this->getOptionValue('ycd-countdown-number-font');
93
 
94
  $yearsColor = $this->getOptionValue('ycd-countdown-years-text-color');
95
  $monthsColor = $this->getOptionValue('ycd-countdown-months-text-color');
83
  $marginTop = $this->getOptionValue('ycd-text-margin-top');
84
  $fontWeight = $this->getOptionValue('ycd-countdown-font-weight');
85
  $fontStyle = $this->getOptionValue('ycd-countdown-font-style');
86
+ $fontFamily = $this->getFontFamilyByName('ycd-text-font-family');
87
  // numbers styles
88
  $fontSizeNumber = $this->getOptionValue('ycd-countdown-number-size');
89
  $marginToNumber = $this->getOptionValue('ycd-number-margin-top');
90
  $fontWeightNumber = $this->getOptionValue('ycd-countdown-number-font-weight');
91
  $fontStyleNumber = $this->getOptionValue('ycd-countdown-number-font-style');
92
+ $fontFamilyNumber = $this->getFontFamilyByName('ycd-countdown-number-font');
93
 
94
  $yearsColor = $this->getOptionValue('ycd-countdown-years-text-color');
95
  $monthsColor = $this->getOptionValue('ycd-countdown-months-text-color');
classes/countdown/Countdown.php CHANGED
@@ -652,8 +652,8 @@ abstract class Countdown {
652
  'minutes' => (int)$this->getOptionValue('ycd-countdown-duration-minutes'),
653
  'secondsSaved' => (int)$this->getOptionValue('ycd-countdown-duration-seconds')
654
  );
655
- $allSeconds = $this->gettProgressAllSeconds();
656
- $currentSeconds = $this->getProgressCurrentSeconds();
657
 
658
  $args = array(
659
  'id' => $this->getId(),
@@ -907,6 +907,7 @@ abstract class Countdown {
907
 
908
  public function renderView() {
909
  $id = $this->getId();
 
910
  $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
911
  $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
912
  $content .= $this->getViewContent();
@@ -927,12 +928,14 @@ abstract class Countdown {
927
  $explodedData = explode( '_', $position);
928
  $vertical = $explodedData[0];
929
  $horizontal = $explodedData[1];
930
-
931
- $countdownContent = $this->getViewContent();
 
932
  $allContent = $content.$countdownContent;
933
  if ($vertical == 'top') {
934
  $allContent = $countdownContent.$content;
935
  }
 
936
  $allContent .= '<style>.ycd-circle-'.$id.'-wrapper {text-align: '.$horizontal.' !important;}</style>';
937
  return $allContent;
938
  }
@@ -1124,6 +1127,15 @@ abstract class Countdown {
1124
 
1125
  return $options;
1126
  }
 
 
 
 
 
 
 
 
 
1127
 
1128
  public function additionalFunctionality() {
1129
  $content = $this->renderProgressBar();
652
  'minutes' => (int)$this->getOptionValue('ycd-countdown-duration-minutes'),
653
  'secondsSaved' => (int)$this->getOptionValue('ycd-countdown-duration-seconds')
654
  );
655
+ $currentSeconds = $this->gettProgressAllSeconds();
656
+ $allSeconds = $this->getProgressCurrentSeconds();
657
 
658
  $args = array(
659
  'id' => $this->getId(),
907
 
908
  public function renderView() {
909
  $id = $this->getId();
910
+
911
  $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
912
  $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
913
  $content .= $this->getViewContent();
928
  $explodedData = explode( '_', $position);
929
  $vertical = $explodedData[0];
930
  $horizontal = $explodedData[1];
931
+
932
+ $countdownContent = apply_filters('ycdCountdownBeforeContent', '', $this);
933
+ $countdownContent .= $this->getViewContent();
934
  $allContent = $content.$countdownContent;
935
  if ($vertical == 'top') {
936
  $allContent = $countdownContent.$content;
937
  }
938
+ $allContent .= apply_filters('ycdCountdownAfterContent', '', $this);
939
  $allContent .= '<style>.ycd-circle-'.$id.'-wrapper {text-align: '.$horizontal.' !important;}</style>';
940
  return $allContent;
941
  }
1127
 
1128
  return $options;
1129
  }
1130
+
1131
+ public function getFontFamilyByName($name) {
1132
+ $fontFamily = $this->getOptionValue($name);
1133
+ if ($fontFamily == 'customFont') {
1134
+ $fontFamily = $this->getOptionValue($name.'-custom');
1135
+ }
1136
+
1137
+ return $fontFamily;
1138
+ }
1139
 
1140
  public function additionalFunctionality() {
1141
  $content = $this->renderProgressBar();
classes/countdown/SimpleCountdown.php CHANGED
@@ -148,6 +148,8 @@ class SimpleCountdown extends Countdown
148
  if(YCD_PKG_VERSION > YCD_FREE_VERSION) {
149
  ScriptsIncluder::registerScript('ycdGoogleFonts.js');
150
  ScriptsIncluder::enqueueScript('ycdGoogleFonts.js');
 
 
151
  }
152
  $this->includeGeneralScripts();
153
  wp_enqueue_script('jquery');
148
  if(YCD_PKG_VERSION > YCD_FREE_VERSION) {
149
  ScriptsIncluder::registerScript('ycdGoogleFonts.js');
150
  ScriptsIncluder::enqueueScript('ycdGoogleFonts.js');
151
+ ScriptsIncluder::registerScript('CountdownProFunctionality.js');
152
+ ScriptsIncluder::enqueueScript('CountdownProFunctionality.js');
153
  }
154
  $this->includeGeneralScripts();
155
  wp_enqueue_script('jquery');
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.07);
79
- self::addDefine('YCD_VERSION', 2.21);
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.2.1';
88
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
89
- $versionText = '2.0.7';
90
  }
91
  self::addDefine('YCD_VERSION_TEXT', $versionText);
92
- self::addDefine('YCD_LAST_UPDATE', 'Oct 22');
93
- self::addDefine('YCD_NEXT_UPDATE', 'Nov 15');
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.08);
79
+ self::addDefine('YCD_VERSION', 2.22);
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.2.2';
88
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
89
+ $versionText = '2.0.8';
90
  }
91
  self::addDefine('YCD_VERSION_TEXT', $versionText);
92
+ self::addDefine('YCD_LAST_UPDATE', 'Nov 14');
93
+ self::addDefine('YCD_NEXT_UPDATE', 'Nov 25');
94
  }
95
 
96
  public static function displaySettings()
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.2.1
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.2.2
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
helpers/AdminHelper.php CHANGED
@@ -216,7 +216,8 @@ class AdminHelper {
216
  'Roboto Condensed' => 'Roboto Condensed',
217
  'Oswald' => 'Oswald',
218
  'PT Sans' => 'PT Sans',
219
- 'Montserrat' => 'Montserrat'
 
220
  );
221
 
222
  $data['woo-products'] = self::getAllProducts();
216
  'Roboto Condensed' => 'Roboto Condensed',
217
  'Oswald' => 'Oswald',
218
  'PT Sans' => 'PT Sans',
219
+ 'Montserrat' => 'Montserrat',
220
+ 'customFont' => 'Custom font'
221
  );
222
 
223
  $data['woo-products'] = self::getAllProducts();
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.8.1
6
- Stable tag: 2.2.1
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,12 @@ 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.2.1 =
71
  * Fixed Change countdown before text after expiration saving issue
72
  * Fixed Change countdown before text before expiration saving issue
2
  Contributors: adamskaat
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
+ Tested up to: 5.8.2
6
+ Stable tag: 2.2.2
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.2.2 =
71
+ * Added Custom font family functionality
72
+ * Fixed the progress bar color change issue
73
+ * Fixed the progress bar percentage calculation issue
74
+ * Fixed schedules date calculation with simple countdown type
75
+ * Bug fixed realted to Display on option
76
  = 2.2.1 =
77
  * Fixed Change countdown before text after expiration saving issue
78
  * Fixed Change countdown before text before expiration saving issue