Countdown, Coming Soon – Countdown & Clock - Version 1.2.9

Version Description

  • Newsletter (new)
  • Countdown number Font Size (new)
  • Countdown number Font Weight (new)
  • Countdown number Font Style (new)
  • Countdown number Font Family (new)
  • Video tutorial https://www.youtube.com/watch?v=efqVcdKF620
  • Bug fixed
  • Code fixes
Download this release

Release Info

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

Code changes from version 1.2.8 to 1.2.9

assets/css/Css.php CHANGED
@@ -23,6 +23,10 @@ class Css {
23
  public function getSubscribersPageKey() {
24
  return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_SUBSCRIBERS;
25
  }
 
 
 
 
26
 
27
  public function enqueueStyles($hook) {
28
 
@@ -36,10 +40,12 @@ class Css {
36
  $settingsKey = $this->getSettingsPageKey();
37
  $supportKey = $this->getSupportPageKey();
38
  $subscriberKey = $this->getSubscribersPageKey();
 
39
  $allowedPages = array(
40
  $settingsKey,
41
  $supportKey,
42
  $subscriberKey,
 
43
  'ycdcountdown_page_ycdcountdown',
44
  );
45
  if(in_array($hook, $allowedPages) || get_post_type(@$_GET['post']) == YCD_COUNTDOWN_POST_TYPE) {
23
  public function getSubscribersPageKey() {
24
  return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_SUBSCRIBERS;
25
  }
26
+
27
+ public function getNewsletterPageKey() {
28
+ return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_NEWSLETTER;
29
+ }
30
 
31
  public function enqueueStyles($hook) {
32
 
40
  $settingsKey = $this->getSettingsPageKey();
41
  $supportKey = $this->getSupportPageKey();
42
  $subscriberKey = $this->getSubscribersPageKey();
43
+ $newsletterKey = $this->getNewsletterPageKey();
44
  $allowedPages = array(
45
  $settingsKey,
46
  $supportKey,
47
  $subscriberKey,
48
+ $newsletterKey,
49
  'ycdcountdown_page_ycdcountdown',
50
  );
51
  if(in_array($hook, $allowedPages) || get_post_type(@$_GET['post']) == YCD_COUNTDOWN_POST_TYPE) {
assets/css/admin.css CHANGED
@@ -376,7 +376,6 @@ div.ycd-tabs-text-header > div.ycd-toggle-icon-open {
376
  top: -3px;
377
  text-decoration: none;
378
  border: none;
379
- border: 1px solid #ccc;
380
  border-radius: 2px;
381
  background: #f7f7f7;
382
  text-shadow: none;
@@ -401,4 +400,31 @@ div.ycd-tabs-text-header > div.ycd-toggle-icon-open {
401
 
402
  .ycd-livew-preview-content {
403
  text-align: center !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  }
376
  top: -3px;
377
  text-decoration: none;
378
  border: none;
 
379
  border-radius: 2px;
380
  background: #f7f7f7;
381
  text-shadow: none;
400
 
401
  .ycd-livew-preview-content {
402
  text-align: center !important;
403
+ }
404
+
405
+ .ycd-float-none {
406
+ float: none !important;
407
+ }
408
+
409
+ .ycd-options-content {
410
+ padding: 10px;
411
+ }
412
+
413
+ .ycd-validation-error {
414
+ color: red;
415
+ margin-bottom: 15px;
416
+ font-weight: bold;
417
+ }
418
+
419
+ .ycd-alert {
420
+ padding: 15px;
421
+ margin-bottom: 20px;
422
+ border: 1px solid transparent;
423
+ border-radius: 4px;
424
+ }
425
+
426
+ .ycd-alert-info {
427
+ color: #31708f;
428
+ background-color: #d9edf7;
429
+ border-color: #bce8f1;
430
  }
assets/js/Admin.js CHANGED
@@ -15,6 +15,81 @@ YcdAdmin.prototype.init = function() {
15
  this.support();
16
  this.livePreview();
17
  this.redirectToProWebpage();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  };
19
 
20
  YcdAdmin.prototype.redirectToProWebpage = function() {
@@ -47,7 +122,8 @@ YcdAdmin.prototype.support = function() {
47
  jQuery('#ycd-form').submit(function(e) {
48
  e.preventDefault();
49
  var isValid = true;
50
- jQuery('.ycd-validate-email-error').addClass('ycd-hide');
 
51
  jQuery('.ycd-required-fields').each(function() {
52
  var currentVal = jQuery(this).val();
53
  jQuery('.'+jQuery(this).data('error')).addClass('ycd-hide');
@@ -63,7 +139,7 @@ YcdAdmin.prototype.support = function() {
63
  }
64
 
65
  if(!validateEmail(jQuery('#ycd-email').val())) {
66
- jQuery('.ycd-validate-email-error').removeClass('ycd-hide');
67
  return false;
68
  }
69
  var data = {
@@ -203,7 +279,7 @@ YcdAdmin.prototype.switchCountdown = function() {
203
  checked: jQuery(this).is(':checked')
204
  };
205
 
206
- jQuery.post(ajaxurl, data, function(responce) {
207
 
208
  });
209
  })
15
  this.support();
16
  this.livePreview();
17
  this.redirectToProWebpage();
18
+ this.newsletter();
19
+ };
20
+
21
+ YcdAdmin.prototype.getTinymceContent = function()
22
+ {
23
+ if (jQuery('.wp-editor-wrap').hasClass('tmce-active')) {
24
+ return tinyMCE.activeEditor.getContent();
25
+ }
26
+
27
+ return jQuery('#ycd-newsletter-text').val();
28
+ };
29
+
30
+ YcdAdmin.prototype.newsletter = function() {
31
+ var sendButton = jQuery('.js-send-newsletter');
32
+
33
+ if (!sendButton.length) {
34
+ return false;
35
+ }
36
+ var that = this;
37
+
38
+ sendButton.bind('click', function(e) {
39
+ e.preventDefault();
40
+ jQuery('.ycd-validation-error').addClass('ycd-hide');
41
+ var validationStatus = true;
42
+ var fromEmail = jQuery('.ycd-newsletter-from-email').val();
43
+ var subscriptionFormId = jQuery('.js-ycd-newsletter-forms option:selected').val();
44
+ subscriptionFormId = parseInt(subscriptionFormId);
45
+ var validateEmail = fromEmail.search(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,10})+$/);
46
+ var emailsInFlow = jQuery('.ycd-emails-in-flow').val();
47
+ emailsInFlow = parseInt(emailsInFlow);
48
+
49
+ if (isNaN(subscriptionFormId)) {
50
+ jQuery('.ycd-newsletter-error').removeClass('ycd-hide');
51
+ validationStatus = false;
52
+ }
53
+
54
+ /*When the sent email isn't valid or the user hasn't selected any subscription form.*/
55
+ if (validateEmail == -1 ) {
56
+ validationStatus = false;
57
+ jQuery('.ycd-newsletter-from-email-error').removeClass('ycd-hide');
58
+ }
59
+
60
+ if (isNaN(emailsInFlow)) {
61
+ jQuery('.ycd-emails-in-flow-error').removeClass('ycd-hide');
62
+ validationStatus = false;
63
+ }
64
+
65
+ if (!validationStatus) {
66
+ return false;
67
+ }
68
+
69
+ var newsletterSubject = jQuery('.ycd-newsletter-subject').val();
70
+ var messageBody = that.getTinymceContent();
71
+
72
+ var data = {
73
+ nonce: ycd_admin_localized.nonce,
74
+ action: 'ycd_send_newsletter',
75
+ newsletterData: {
76
+ subscriptionFormId: subscriptionFormId,
77
+ beforeSend: function() {
78
+ jQuery('.ycd-js-newsletter-spinner').removeClass('ycd-hide');
79
+ jQuery('.ycd-newsletter-notice').addClass('ycd-hide');
80
+ },
81
+ fromEmail: fromEmail,
82
+ emailsInFlow: emailsInFlow,
83
+ newsletterSubject: newsletterSubject,
84
+ messageBody: messageBody
85
+ }
86
+ };
87
+
88
+ jQuery.post(ajaxurl, data, function() {
89
+ jQuery('.ycd-newsletter-notice').removeClass('ycd-hide');
90
+ jQuery('.ycd-js-newsletter-spinner').addClass('ycd-hide');
91
+ });
92
+ });
93
  };
94
 
95
  YcdAdmin.prototype.redirectToProWebpage = function() {
122
  jQuery('#ycd-form').submit(function(e) {
123
  e.preventDefault();
124
  var isValid = true;
125
+ var emailError = jQuery('.ycd-validate-email-error');
126
+ emailError.addClass('ycd-hide');
127
  jQuery('.ycd-required-fields').each(function() {
128
  var currentVal = jQuery(this).val();
129
  jQuery('.'+jQuery(this).data('error')).addClass('ycd-hide');
139
  }
140
 
141
  if(!validateEmail(jQuery('#ycd-email').val())) {
142
+ emailError.removeClass('ycd-hide');
143
  return false;
144
  }
145
  var data = {
279
  checked: jQuery(this).is(':checked')
280
  };
281
 
282
+ jQuery.post(ajaxurl, data, function() {
283
 
284
  });
285
  })
assets/js/Countdown.js CHANGED
@@ -152,6 +152,7 @@ YcdCountdown.prototype.livePreview = function() {
152
  this.changeTextColor();
153
  this.changePadding();
154
  this.changeAlignment();
 
155
  };
156
 
157
  YcdCountdown.prototype.changeAlignment = function() {
@@ -266,6 +267,35 @@ YcdCountdown.prototype.changeTextStyles = function() {
266
  })
267
  };
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  YcdCountdown.prototype.circleBgColor = function() {
270
  var countdownBgCircleColor = jQuery('.js-countdown-bg-circle-color');
271
 
152
  this.changeTextColor();
153
  this.changePadding();
154
  this.changeAlignment();
155
+ this.changeNumberStyles();
156
  };
157
 
158
  YcdCountdown.prototype.changeAlignment = function() {
267
  })
268
  };
269
 
270
+ YcdCountdown.prototype.changeNumberStyles = function() {
271
+ var changeNumberTarget = jQuery('.js-countdown-number-size,.js-countdown-number-font-weight, .js-countdown-number-font, .js-countdown-number-font-style');
272
+ var that = this;
273
+
274
+ if(!changeNumberTarget.length) {
275
+ return false;
276
+ }
277
+ changeNumberTarget.bind('change', function() {
278
+ that.setNumberStyles();
279
+ });
280
+ };
281
+
282
+ YcdCountdown.prototype.setNumberStyles = function() {
283
+ var circle = jQuery('.ycd-time-circle');
284
+ var fontSize = jQuery('.js-countdown-number-size').val()+'px';
285
+ var fontWeight = jQuery('.js-countdown-number-font-weight').val();
286
+ var fontFamily = jQuery('.js-countdown-number-font').val();
287
+ var fontStyle = jQuery('.js-countdown-number-font-style').val();
288
+
289
+ circle.find('span').each(function() {
290
+ jQuery(this).attr('style',
291
+ 'font-size: ' + fontSize+' !important;' +
292
+ 'font-weight: ' + fontWeight+' !important;' +
293
+ 'font-family:' + fontFamily + '!important;'+
294
+ 'font-style:' + fontStyle + '!important'
295
+ );
296
+ })
297
+ };
298
+
299
  YcdCountdown.prototype.circleBgColor = function() {
300
  var countdownBgCircleColor = jQuery('.js-countdown-bg-circle-color');
301
 
assets/js/Js.php CHANGED
@@ -23,6 +23,10 @@ class Js {
23
  public function getSubscribersPageKey() {
24
  return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_SUBSCRIBERS;
25
  }
 
 
 
 
26
 
27
  public function enqueueStyles($hook) {
28
  ScriptsIncluder::registerScript('Admin.js');
@@ -39,10 +43,12 @@ class Js {
39
  $settingsKey = $this->getSettingsPageKey();
40
  $supportKey = $this->getSupportPageKey();
41
  $subscriberKey = $this->getSubscribersPageKey();
 
42
  $allowedPages = array(
43
  $settingsKey,
44
  $supportKey,
45
  $subscriberKey,
 
46
  'ycdcountdown_page_ycdcountdown',
47
  );
48
 
23
  public function getSubscribersPageKey() {
24
  return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_SUBSCRIBERS;
25
  }
26
+
27
+ public function getNewsletterPageKey() {
28
+ return YCD_COUNTDOWN_POST_TYPE.'_page_'.YCD_COUNTDOWN_NEWSLETTER;
29
+ }
30
 
31
  public function enqueueStyles($hook) {
32
  ScriptsIncluder::registerScript('Admin.js');
43
  $settingsKey = $this->getSettingsPageKey();
44
  $supportKey = $this->getSupportPageKey();
45
  $subscriberKey = $this->getSubscribersPageKey();
46
+ $newsletterKey = $this->getNewsletterPageKey();
47
  $allowedPages = array(
48
  $settingsKey,
49
  $supportKey,
50
  $subscriberKey,
51
+ $newsletterKey,
52
  'ycdcountdown_page_ycdcountdown',
53
  );
54
 
assets/js/ycdTimer.js CHANGED
@@ -386,12 +386,12 @@ YcdTimer.prototype.changeTime = function() {
386
  return false;
387
  }
388
  var that = this;
389
- var seetings = that.getSettings();
390
 
391
  timeSettings.bind('change', function() {
392
  var type = jQuery(this).data('type');
393
- seetings[type] = jQuery(this).val();
394
- that.setSettings(seetings);
395
  that.resetTimer();
396
  that.this.startTimer();
397
  })
386
  return false;
387
  }
388
  var that = this;
389
+ var settings = that.getSettings();
390
 
391
  timeSettings.bind('change', function() {
392
  var type = jQuery(this).data('type');
393
+ settings[type] = jQuery(this).val();
394
+ that.setSettings(settings);
395
  that.resetTimer();
396
  that.this.startTimer();
397
  })
assets/views/advancedOptions.php CHANGED
@@ -25,7 +25,7 @@ $defaultData = AdminHelper::defaultData();
25
  </label>
26
  </div>
27
  </div>
28
- <?php if($this->isAllowOPtion('ycd-countdown-selected-countries')): ?>
29
  <div class="row">
30
  <div class="col-md-6">
31
  <label for="ycd-countdown-selected-countries" class="ycd-label-of-switch"><?php _e('Filter Countdown For Selected Countries', YCD_TEXT_DOMAIN); ?></label>
25
  </label>
26
  </div>
27
  </div>
28
+ <?php if($this->isAllowOption('ycd-countdown-selected-countries')): ?>
29
  <div class="row">
30
  <div class="col-md-6">
31
  <label for="ycd-countdown-selected-countries" class="ycd-label-of-switch"><?php _e('Filter Countdown For Selected Countries', YCD_TEXT_DOMAIN); ?></label>
assets/views/afterExpire.php CHANGED
@@ -6,7 +6,7 @@ $defaultData = AdminHelper::defaultData();
6
  ?>
7
  <div class="ycd-bootstrap-wrapper">
8
  <div class="row form-group">
9
- <label class="col-md-8 control-label sgpb-static-padding-top">
10
  <?php _e('After Countdown Expire', YCD_TEXT_DOMAIN) ?>:
11
  </label>
12
  <div class="col-md-7">
6
  ?>
7
  <div class="ycd-bootstrap-wrapper">
8
  <div class="row form-group">
9
+ <label class="col-md-8 control-label ycd-static-padding-top">
10
  <?php _e('After Countdown Expire', YCD_TEXT_DOMAIN) ?>:
11
  </label>
12
  <div class="col-md-7">
assets/views/cricleMainView.php CHANGED
@@ -56,23 +56,19 @@ if(empty($type)) {
56
  <div class="ycd-bootstrap-wrapper">
57
  <div class="row">
58
  <div class="col-md-6">
59
- <!-- -->
 
60
  <div class="row form-group">
61
- <div class="col-md-5">
62
- <label><?php _e('Countdown Format', YCD_TEXT_DOMAIN); ?></label>
63
- </div>
64
  <div class="col-md-7">
 
65
  </div>
66
  </div>
67
-
68
- <!-- Countdown formats general start -->
69
-
70
  <div class="row form-group">
71
  <div class="col-md-5">
72
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('Font Size', YCD_TEXT_DOMAIN); ?></label>
73
  </div>
74
  <div class="col-md-7">
75
- <?php echo AdminHelper::selectBox($defaultData['font-size'], esc_attr($textFontSize), array('name' => 'ycd-text-font-size', 'class' => 'js-ycd-select js-countdown-font-size')); ?>
76
  </div>
77
  </div>
78
  <div class="row form-group">
@@ -80,7 +76,7 @@ if(empty($type)) {
80
  <label for="ycd-countdown-font-weight" class="ycd-label-of-select"><?php _e('Font Weight', YCD_TEXT_DOMAIN); ?></label>
81
  </div>
82
  <div class="col-md-7">
83
- <?php echo AdminHelper::selectBox($defaultData['font-weight'], esc_attr($countdownFontWeight), array('name' => 'ycd-countdown-font-weight', 'class' => 'js-ycd-select js-countdown-font-weight')); ?>
84
  </div>
85
  </div>
86
  <div class="row form-group">
@@ -88,7 +84,7 @@ if(empty($type)) {
88
  <label for="ycd-countdown-font-style" class="ycd-label-of-select"><?php _e('Font Style', YCD_TEXT_DOMAIN); ?></label>
89
  </div>
90
  <div class="col-md-7">
91
- <?php echo AdminHelper::selectBox($defaultData['font-style'], esc_attr($countdownFontStyle), array('name' => 'ycd-countdown-font-style', 'class' => 'js-ycd-select js-countdown-font-style')); ?>
92
  </div>
93
  </div>
94
  <div class="row form-group">
@@ -99,8 +95,58 @@ if(empty($type)) {
99
  <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($textFontFamily), array('name' => 'ycd-text-font-family', 'class' => 'js-ycd-select js-countdown-font-family')); ?>
100
  </div>
101
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
- <!-- Countdown formats general end -->
104
 
105
  <!-- Countdown formats Days start -->
106
 
56
  <div class="ycd-bootstrap-wrapper">
57
  <div class="row">
58
  <div class="col-md-6">
59
+ <!-- Countdown fonts start -->
60
+ <!-- text styles start -->
61
  <div class="row form-group">
 
 
 
62
  <div class="col-md-7">
63
+ <label><?php _e('Countdown Text Styles', YCD_TEXT_DOMAIN); ?></label>
64
  </div>
65
  </div>
 
 
 
66
  <div class="row form-group">
67
  <div class="col-md-5">
68
  <label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('Font Size', YCD_TEXT_DOMAIN); ?></label>
69
  </div>
70
  <div class="col-md-7">
71
+ <?php echo AdminHelper::selectBox($defaultData['font-size'], esc_attr($textFontSize), array('name' => 'ycd-text-font-size', 'class' => 'js-ycd-select js-countdown-font-size')); ?>
72
  </div>
73
  </div>
74
  <div class="row form-group">
76
  <label for="ycd-countdown-font-weight" class="ycd-label-of-select"><?php _e('Font Weight', YCD_TEXT_DOMAIN); ?></label>
77
  </div>
78
  <div class="col-md-7">
79
+ <?php echo AdminHelper::selectBox($defaultData['font-weight'], esc_attr($countdownFontWeight), array('name' => 'ycd-countdown-font-weight', 'class' => 'js-ycd-select js-countdown-font-weight')); ?>
80
  </div>
81
  </div>
82
  <div class="row form-group">
84
  <label for="ycd-countdown-font-style" class="ycd-label-of-select"><?php _e('Font Style', YCD_TEXT_DOMAIN); ?></label>
85
  </div>
86
  <div class="col-md-7">
87
+ <?php echo AdminHelper::selectBox($defaultData['font-style'], esc_attr($countdownFontStyle), array('name' => 'ycd-countdown-font-style', 'class' => 'js-ycd-select js-countdown-font-style')); ?>
88
  </div>
89
  </div>
90
  <div class="row form-group">
95
  <?php echo AdminHelper::selectBox($defaultData['font-family'], esc_attr($textFontFamily), array('name' => 'ycd-text-font-family', 'class' => 'js-ycd-select js-countdown-font-family')); ?>
96
  </div>
97
  </div>
98
+ <!-- text styles end -->
99
+ <!-- Number styles start -->
100
+ <div class="row form-group">
101
+ <div class="col-md-7">
102
+ <label><?php _e('Countdown Number Styles', YCD_TEXT_DOMAIN); ?></label>
103
+ </div>
104
+ </div>
105
+ <div class="row form-group">
106
+ <div class="col-md-5">
107
+ <label for="ycd-countdown-number-size" class="ycd-label-of-select"><?php _e('Font Size', YCD_TEXT_DOMAIN); ?></label>
108
+ </div>
109
+ <div class="col-md-7">
110
+ <?php echo AdminHelper::selectBox($defaultData['font-size-number'], esc_attr($this->getOptionValue('ycd-countdown-number-size')), array('name' => 'ycd-countdown-number-size', 'class' => 'js-ycd-select js-countdown-number-size')); ?>
111
+ </div>
112
+ </div>
113
+ <div class="row form-group">
114
+ <div class="col-md-5">
115
+ <label for="ycd-countdown-number-font-weight" class="ycd-label-of-select"><?php _e('Font Weight', YCD_TEXT_DOMAIN); ?></label>
116
+ </div>
117
+ <div class="col-md-7">
118
+ <?php echo AdminHelper::selectBox($defaultData['font-weight'], esc_attr($this->getOptionValue('ycd-countdown-number-font-weight')), array('name' => 'ycd-countdown-number-font-weight', 'class' => 'js-ycd-select js-countdown-number-font-weight')); ?>
119
+ </div>
120
+ </div>
121
+ <div class="row form-group">
122
+ <div class="col-md-5">
123
+ <label for="ycd-countdown-number-font-style" class="ycd-label-of-select"><?php _e('Font Style', YCD_TEXT_DOMAIN); ?></label>
124
+ </div>
125
+ <div class="col-md-7">
126
+ <?php echo AdminHelper::selectBox($defaultData['font-style'], esc_attr($this->getOptionValue('ycd-countdown-number-font-style')), array('name' => 'ycd-countdown-number-font-style', 'class' => 'js-ycd-select js-countdown-number-font-style')); ?>
127
+ </div>
128
+ </div>
129
+ <div class="row form-group">
130
+ <div class="col-md-5">
131
+ <label for="ycd-countdown-number-font" class="ycd-label-of-select"><?php _e('Font Family', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
132
+ </div>
133
+ <div class="col-md-7 ycd-option-wrapper<?php echo $isPro; ?>">
134
+ <?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')); ?>
135
+ </div>
136
+ </div>
137
+ <!-- Number styles end -->
138
+ <!-- Countdown fonts end -->
139
+
140
+ <!-- -->
141
+ <div class="row form-group">
142
+ <div class="col-md-5">
143
+ <label><?php _e('Countdown Format', YCD_TEXT_DOMAIN); ?></label>
144
+ </div>
145
+ <div class="col-md-7">
146
+ </div>
147
+ </div>
148
 
149
+ <!-- Countdown formats general start -->
150
 
151
  <!-- Countdown formats Days start -->
152
 
assets/views/settings.php CHANGED
@@ -2,8 +2,7 @@
2
  use ycd\AdminHelper;
3
  use ycd\HelperFunctions;
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">
2
  use ycd\AdminHelper;
3
  use ycd\HelperFunctions;
4
  $defaultData = AdminHelper::defaultData();
5
+ $userSavedRoles = '';
 
6
  ?>
7
  <div class="ycd-bootstrap-wrapper ycd-settings-wrapper">
8
  <div class="row">
classes/Actions.php CHANGED
@@ -21,6 +21,17 @@ class Actions {
21
  add_action('media_buttons', array($this, 'ycdMediaButton'), 11);
22
  add_action('admin_post_ycdSaveSettings', array($this, 'saveSettings'), 10, 1);
23
  add_action('wp_head', array($this, 'wpHead'), 10, 1);
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  public static function wpHead() {
21
  add_action('media_buttons', array($this, 'ycdMediaButton'), 11);
22
  add_action('admin_post_ycdSaveSettings', array($this, 'saveSettings'), 10, 1);
23
  add_action('wp_head', array($this, 'wpHead'), 10, 1);
24
+ if (YCD_PKG_VERSION == YCD_FREE_VERSION) {
25
+ add_action('admin_head', array($this, 'adminHead'));
26
+ }
27
+ }
28
+
29
+ public function adminHead() {
30
+ $script = '<script>';
31
+ $script .= "jQuery(document).ready(function() {jQuery('[href*=\"ycdNewsletter\"]').attr(\"href\", '".YCD_COUNTDOWN_PRO_URL."').attr('target', '_blank')})";
32
+ $script .= '</script>';
33
+
34
+ echo $script;
35
  }
36
 
37
  public static function wpHead() {
classes/Filters.php CHANGED
@@ -12,8 +12,19 @@ class Filters {
12
  add_filter('manage_'.YCD_COUNTDOWN_POST_TYPE.'_posts_columns' , array($this, 'tableColumns'));
13
  add_filter('ycdDefaults', array($this, 'defaults'), 10, 1);
14
  add_filter('post_updated_messages' , array($this, 'updatedMessages'), 10, 1);
 
15
  }
16
 
 
 
 
 
 
 
 
 
 
 
17
  public function defaults($defaults) {
18
  if(YCD_PKG_VERSION != YCD_FREE_VERSION) {
19
  return $defaults;
12
  add_filter('manage_'.YCD_COUNTDOWN_POST_TYPE.'_posts_columns' , array($this, 'tableColumns'));
13
  add_filter('ycdDefaults', array($this, 'defaults'), 10, 1);
14
  add_filter('post_updated_messages' , array($this, 'updatedMessages'), 10, 1);
15
+ add_filter('cron_schedules', array($this, 'cronAddMinutes'), 10, 1);
16
  }
17
 
18
+ public function cronAddMinutes($schedules)
19
+ {
20
+ $schedules['ycd_newsletter_send_every_minute'] = array(
21
+ 'interval' => YCD_CRON_REPEAT_INTERVAL * 60,
22
+ 'display' => __('Once Every Minute', YCD_TEXT_DOMAIN)
23
+ );
24
+
25
+ return $schedules;
26
+ }
27
+
28
  public function defaults($defaults) {
29
  if(YCD_PKG_VERSION != YCD_FREE_VERSION) {
30
  return $defaults;
classes/RegisterPostType.php CHANGED
@@ -180,7 +180,19 @@ class RegisterPostType {
180
  }
181
 
182
  public function addSubMenu() {
183
- add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Countdown Types', YCD_TEXT_DOMAIN), __('Countdown Types', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_POST_TYPE, array($this, 'countdownTypes'));
 
 
 
 
 
 
 
 
 
 
 
 
184
  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'));
185
  if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
186
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Subscribers', YCD_TEXT_DOMAIN), __('Subscribers', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_SUBSCRIBERS, array($this, 'countdownSubscribers'));
@@ -188,6 +200,15 @@ class RegisterPostType {
188
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Settings', YCD_TEXT_DOMAIN), __('Settings', YCD_TEXT_DOMAIN), 'manage_options', YCD_COUNTDOWN_SETTINGS, array($this, 'countdownSettings'));
189
  }
190
 
 
 
 
 
 
 
 
 
 
191
  public function countdownSupport() {
192
  require_once YCD_VIEWS_PATH.'support.php';
193
  }
180
  }
181
 
182
  public function addSubMenu() {
183
+ $menuLabel = '';
184
+ if (YCD_PKG_VERSION == YCD_FREE_VERSION) {
185
+ $menuLabel = '<span style="color: red;"> '.__('Pro', YCD_TEXT_DOMAIN).'</span>';
186
+ }
187
+ add_submenu_page(
188
+ 'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE,
189
+ __('Countdown Types', YCD_TEXT_DOMAIN), // page title
190
+ __('Countdown Types', YCD_TEXT_DOMAIN), // menu title
191
+ 'ycd_manage_options',
192
+ YCD_COUNTDOWN_POST_TYPE,
193
+ array($this, 'countdownTypes')
194
+ );
195
+ 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'));
196
  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'));
197
  if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
198
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Subscribers', YCD_TEXT_DOMAIN), __('Subscribers', YCD_TEXT_DOMAIN), 'ycd_manage_options', YCD_COUNTDOWN_SUBSCRIBERS, array($this, 'countdownSubscribers'));
200
  add_submenu_page('edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE, __('Settings', YCD_TEXT_DOMAIN), __('Settings', YCD_TEXT_DOMAIN), 'manage_options', YCD_COUNTDOWN_SETTINGS, array($this, 'countdownSettings'));
201
  }
202
 
203
+ public function countdownNewsletter() {
204
+ if (YCD_PKG_VERSION == YCD_FREE_VERSION) {
205
+ wp_redirect(YCD_COUNTDOWN_PRO_URL);
206
+ }
207
+ else {
208
+ require_once YCD_VIEWS_PATH.'newsletter.php';
209
+ }
210
+ }
211
+
212
  public function countdownSupport() {
213
  require_once YCD_VIEWS_PATH.'support.php';
214
  }
classes/YcdWidget.php CHANGED
@@ -38,7 +38,7 @@ class ycd_countdown_widget extends WP_Widget {
38
 
39
  // Updating widget replacing old instances with new
40
  public function update( $new_instance, $old_instance ) {
41
-
42
  $instance = array();
43
  $instance['ycdOption'] = $new_instance['ycdOption'];
44
  return $instance;
38
 
39
  // Updating widget replacing old instances with new
40
  public function update( $new_instance, $old_instance ) {
41
+
42
  $instance = array();
43
  $instance['ycdOption'] = $new_instance['ycdOption'];
44
  return $instance;
classes/countdown/CircleCountdown.php CHANGED
@@ -106,10 +106,17 @@ class CircleCountdown extends Countdown {
106
 
107
  private function renderStyles() {
108
  $id = $this->getId();
 
109
  $fontSize = $this->getOptionValue('ycd-text-font-size');
110
  $fontWeight = $this->getOptionValue('ycd-countdown-font-weight');
111
  $fontStyle = $this->getOptionValue('ycd-countdown-font-style');
112
  $fontFamily = $this->getOptionValue('ycd-text-font-family');
 
 
 
 
 
 
113
  $daysTextColor = $this->getOptionValue('ycd-countdown-days-text-color');
114
  $hoursTextColor = $this->getOptionValue('ycd-countdown-hours-text-color');
115
  $minutesTextColor = $this->getOptionValue('ycd-countdown-minutes-text-color');
@@ -129,7 +136,13 @@ class CircleCountdown extends Countdown {
129
  font-size: <?php echo $fontSize; ?>px !important;
130
  font-weight: <?php echo $fontWeight; ?> !important;
131
  font-style: <?php echo $fontStyle; ?> !important;
132
- font-family: <?php $fontFamily; ?> !important;
 
 
 
 
 
 
133
  }
134
  #ycd-circle-<?php echo $id; ?> .textDiv_Days {
135
  color: <?php echo $daysTextColor; ?>
106
 
107
  private function renderStyles() {
108
  $id = $this->getId();
109
+ // text styles
110
  $fontSize = $this->getOptionValue('ycd-text-font-size');
111
  $fontWeight = $this->getOptionValue('ycd-countdown-font-weight');
112
  $fontStyle = $this->getOptionValue('ycd-countdown-font-style');
113
  $fontFamily = $this->getOptionValue('ycd-text-font-family');
114
+ // numbers styles
115
+ $fontSizeNumber = $this->getOptionValue('ycd-countdown-number-size');
116
+ $fontWeightNumber = $this->getOptionValue('ycd-countdown-number-font-weight');
117
+ $fontStyleNumber = $this->getOptionValue('ycd-countdown-number-font-style');
118
+ $fontFamilyNumber = $this->getOptionValue('ycd-countdown-number-font');
119
+
120
  $daysTextColor = $this->getOptionValue('ycd-countdown-days-text-color');
121
  $hoursTextColor = $this->getOptionValue('ycd-countdown-hours-text-color');
122
  $minutesTextColor = $this->getOptionValue('ycd-countdown-minutes-text-color');
136
  font-size: <?php echo $fontSize; ?>px !important;
137
  font-weight: <?php echo $fontWeight; ?> !important;
138
  font-style: <?php echo $fontStyle; ?> !important;
139
+ font-family: <?php echo $fontFamily; ?> !important;
140
+ }
141
+ #ycd-circle-<?php echo $id; ?> span {
142
+ font-size: <?php echo $fontSizeNumber; ?>px !important;
143
+ font-weight: <?php echo $fontWeightNumber; ?> !important;
144
+ font-style: <?php echo $fontStyleNumber; ?> !important;
145
+ font-family: <?php echo $fontFamilyNumber; ?> !important;
146
  }
147
  #ycd-circle-<?php echo $id; ?> .textDiv_Days {
148
  color: <?php echo $daysTextColor; ?>
classes/countdown/Countdown.php CHANGED
@@ -190,7 +190,7 @@ abstract class Countdown {
190
  return $defaultData['defaultValue'];
191
  }
192
 
193
- public function isAllowOPtion($optionName) {
194
  if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
195
  return true;
196
  }
190
  return $defaultData['defaultValue'];
191
  }
192
 
193
+ public function isAllowOption($optionName) {
194
  if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
195
  return true;
196
  }
config/config.php CHANGED
@@ -34,15 +34,18 @@ class YcdCountdownConfig {
34
  self::addDefine('YCD_COUNTDOWN_POST_TYPE', 'ycdcountdown');
35
  self::addDefine('YCD_COUNTDOWN_SETTINGS', 'ycdSettings');
36
  self::addDefine('YCD_COUNTDOWN_SUPPORT', 'supports');
 
37
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS', 'subscribers');
38
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
39
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS_TABLE', 'ycd_subscribers');
40
  self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
41
  self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
42
  self::addDefine('YCD_COUNTDOWN_PRO_URL', 'https://edmonsoft.com/countdown');
 
 
43
  self::addDefine('YCD_TABLE_LIMIT', 15);
44
- self::addDefine('YCD_VERSION', 1.28);
45
- self::addDefine('YCD_VERSION_PRO', 1.16);
46
  self::addDefine('YCD_FREE_VERSION', 1);
47
  self::addDefine('YCD_SILVER_VERSION', 2);
48
  self::addDefine('YCD_GOLD_VERSION', 3);
34
  self::addDefine('YCD_COUNTDOWN_POST_TYPE', 'ycdcountdown');
35
  self::addDefine('YCD_COUNTDOWN_SETTINGS', 'ycdSettings');
36
  self::addDefine('YCD_COUNTDOWN_SUPPORT', 'supports');
37
+ self::addDefine('YCD_COUNTDOWN_NEWSLETTER', 'ycdNewsletter');
38
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS', 'subscribers');
39
  self::addDefine('YCD_POSTS_TABLE_NAME', 'posts');
40
  self::addDefine('YCD_COUNTDOWN_SUBSCRIBERS_TABLE', 'ycd_subscribers');
41
  self::addDefine('YCD_COUNTDOWN_WIDGET', 'ycd_countdown_widget');
42
  self::addDefine('YCD_TEXT_DOMAIN', 'ycdCountdown');
43
  self::addDefine('YCD_COUNTDOWN_PRO_URL', 'https://edmonsoft.com/countdown');
44
+ self::addDefine('YCD_FILTER_REPEAT_INTERVAL', 50);
45
+ self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
46
  self::addDefine('YCD_TABLE_LIMIT', 15);
47
+ self::addDefine('YCD_VERSION', 1.3);
48
+ self::addDefine('YCD_VERSION_PRO', 1.17);
49
  self::addDefine('YCD_FREE_VERSION', 1);
50
  self::addDefine('YCD_SILVER_VERSION', 2);
51
  self::addDefine('YCD_GOLD_VERSION', 3);
config/optionsConfig.php CHANGED
@@ -74,6 +74,8 @@ class YcdCountdownOptionsConfig {
74
  $options[] = array('name' => 'ycd-bg-image-url', 'type' => 'text', 'defaultValue' => '', 'ver' => YCD_SILVER_VERSION);
75
  $options[] = array('name' => 'ycd-countdown-bg-circle-color', 'type' => 'text', 'defaultValue' => '#60686F', 'ver' => YCD_SILVER_VERSION);
76
  $options[] = array('name' => 'ycd-text-font-size', 'type' => 'text', 'defaultValue' => '9');
 
 
77
  $options[] = array('name' => 'ycd-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'normal');
78
  $options[] = array('name' => 'ycd-countdown-font-style', 'type' => 'text', 'defaultValue' => 'initial');
79
  $options[] = array('name' => 'ycd-text-font-family', 'type' => 'text', 'defaultValue' => 'Century Gothic', 'ver' => YCD_SILVER_VERSION);
74
  $options[] = array('name' => 'ycd-bg-image-url', 'type' => 'text', 'defaultValue' => '', 'ver' => YCD_SILVER_VERSION);
75
  $options[] = array('name' => 'ycd-countdown-bg-circle-color', 'type' => 'text', 'defaultValue' => '#60686F', 'ver' => YCD_SILVER_VERSION);
76
  $options[] = array('name' => 'ycd-text-font-size', 'type' => 'text', 'defaultValue' => '9');
77
+ $options[] = array('name' => 'ycd-countdown-number-size', 'type' => 'text', 'defaultValue' => '35');
78
+ $options[] = array('name' => 'ycd-countdown-number-font-weight', 'type' => 'text', 'defaultValue' => 'bold');
79
  $options[] = array('name' => 'ycd-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'normal');
80
  $options[] = array('name' => 'ycd-countdown-font-style', 'type' => 'text', 'defaultValue' => 'initial');
81
  $options[] = array('name' => 'ycd-text-font-family', 'type' => 'text', 'defaultValue' => 'Century Gothic', 'ver' => YCD_SILVER_VERSION);
countdown-builder.php CHANGED
@@ -2,9 +2,9 @@
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin
5
- * Version: 1.2.8
6
  * Author: Adam Skaat
7
- * Author URI:
8
  * License: GPLv2
9
  */
10
 
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin
5
+ * Version: 1.2.9
6
  * Author: Adam Skaat
7
+ * Author URI: https://edmonsoft.com/countdown/
8
  * License: GPLv2
9
  */
10
 
helpers/AdminHelper.php CHANGED
@@ -88,18 +88,14 @@ class AdminHelper {
88
  'repeat-y' => __('Repeat y', YCD_TEXT_DOMAIN),
89
  'no-repeat' => __('Not Repeat', YCD_TEXT_DOMAIN)
90
  );
91
-
92
- $data['font-size'] = array(
93
- '7' => __('7px', YCD_TEXT_DOMAIN),
94
- '8' => __('8px', YCD_TEXT_DOMAIN),
95
- '9' => __('9px', YCD_TEXT_DOMAIN),
96
- '10' => __('10px', YCD_TEXT_DOMAIN),
97
- '11' => __('11px', YCD_TEXT_DOMAIN),
98
- '12' => __('12px', YCD_TEXT_DOMAIN),
99
- '13' => __('13px', YCD_TEXT_DOMAIN),
100
- '14' => __('14px', YCD_TEXT_DOMAIN),
101
- '15' => __('15px', YCD_TEXT_DOMAIN)
102
- );
103
 
104
  $data['font-weight'] = array(
105
  'normal' => __('Normal', YCD_TEXT_DOMAIN),
@@ -126,6 +122,7 @@ class AdminHelper {
126
  );
127
 
128
  $data['font-family'] = array(
 
129
  'Century Gothic' => 'Century Gothic',
130
  'Diplomata SC' => 'Diplomata SC',
131
  'flavors' => 'Flavors',
88
  'repeat-y' => __('Repeat y', YCD_TEXT_DOMAIN),
89
  'no-repeat' => __('Not Repeat', YCD_TEXT_DOMAIN)
90
  );
91
+
92
+ for($i = 7; $i <= 15; $i++) {
93
+ $data['font-size'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
94
+ }
95
+
96
+ for($i = 7; $i <= 40; $i++) {
97
+ $data['font-size-number'][$i] = __($i.'px', YCD_TEXT_DOMAIN);
98
+ }
 
 
 
 
99
 
100
  $data['font-weight'] = array(
101
  'normal' => __('Normal', YCD_TEXT_DOMAIN),
122
  );
123
 
124
  $data['font-family'] = array(
125
+ 'inherit' => 'Inherit',
126
  'Century Gothic' => 'Century Gothic',
127
  'Diplomata SC' => 'Diplomata SC',
128
  'flavors' => 'Flavors',
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: 4.9.8
6
- Stable tag: 1.2.8
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -19,6 +19,10 @@ This is the best way to create beautiful <strong>Countdown</strong> for your use
19
  You can use our Countdown timer in your posts/pages via shrot code example like this
20
  [ycd_countdown id=73]
21
 
 
 
 
 
22
  == Installation ==
23
 
24
  Coming soon
@@ -29,6 +33,16 @@ Coming soon
29
 
30
  == Changelog ==
31
 
 
 
 
 
 
 
 
 
 
 
32
  = 1.2.8 =
33
  * Circle Countdown type text Font Style (new option)
34
  * Bug fixed
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 4.9.8
6
+ Stable tag: 1.2.9
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
19
  You can use our Countdown timer in your posts/pages via shrot code example like this
20
  [ycd_countdown id=73]
21
 
22
+ How to create Countdown example
23
+
24
+ https://www.youtube.com/watch?v=efqVcdKF620
25
+
26
  == Installation ==
27
 
28
  Coming soon
33
 
34
  == Changelog ==
35
 
36
+ = 1.2.9 =
37
+ * Newsletter (new)
38
+ * Countdown number Font Size (new)
39
+ * Countdown number Font Weight (new)
40
+ * Countdown number Font Style (new)
41
+ * Countdown number Font Family (new)
42
+ * Video tutorial https://www.youtube.com/watch?v=efqVcdKF620
43
+ * Bug fixed
44
+ * Code fixes
45
+
46
  = 1.2.8 =
47
  * Circle Countdown type text Font Style (new option)
48
  * Bug fixed