Version Description
- Added Display Rules new section
- Added possibility to from settings include (Timer Countdown, Clock 1, Clock 2, Clock 3, Clock 4, Clock 5, Clock 6, Clock 7) types
- Added New feature suggestion request section
- Fixed some warnings
Download this release
Release Info
Developer | adamskaat |
Plugin | Countdown, Coming Soon – Countdown & Clock |
Version | 2.4.5 |
Comparing to | |
See all releases |
Code changes from version 2.4.2 to 2.4.5
- assets/css/Css.php +3 -1
- assets/css/admin.css +24 -0
- assets/css/translation.css +36 -0
- assets/js/Js.php +3 -0
- assets/js/Translation.js +107 -0
- assets/views/admin/moreIdeas.php +10 -0
- assets/views/cricleMainView.php +10 -0
- assets/views/generalOptions.php +0 -14
- assets/views/metaboxes/displayRules.php +16 -0
- assets/views/metaboxes/displaySettings.php +24 -0
- assets/views/translations/circleTranslation.php +11 -0
- assets/views/types.php +3 -1
- classes/Actions.php +10 -4
- classes/countdown/CircleCountdown.php +29 -0
- classes/countdown/Clock1Countdown.php +4 -0
- classes/countdown/Clock2Countdown.php +4 -0
- classes/countdown/Clock3Countdown.php +4 -0
- classes/countdown/Countdown.php +5 -0
- classes/countdown/TimerCountdown.php +5 -1
- classes/translation/AbstractTranslationManager.php +105 -0
- classes/translation/TranslationManager.php +36 -0
- config/config.php +7 -6
- config/optionsConfig.php +2 -1
- countdown-builder.php +1 -1
- helpers/AdminHelper.php +30 -3
- helpers/ShowReviewNotice.php +12 -7
- readme.txt +14 -2
assets/css/Css.php
CHANGED
@@ -53,6 +53,7 @@ class Css {
|
|
53 |
ScriptsIncluder::registerStyle('ion.rangeSlider.skinFlat.css');
|
54 |
ScriptsIncluder::registerStyle('select2.css');
|
55 |
ScriptsIncluder::registerStyle('jquery.dateTimePicker.min.css');
|
|
|
56 |
$settingsKey = $this->getSettingsPageKey();
|
57 |
$supportKey = $this->getSupportPageKey();
|
58 |
$subscriberKey = $this->getSubscribersPageKey();
|
@@ -80,7 +81,8 @@ class Css {
|
|
80 |
ScriptsIncluder::enqueueStyle('ion.rangeSlider.skinFlat.css');
|
81 |
ScriptsIncluder::enqueueStyle('select2.css');
|
82 |
ScriptsIncluder::enqueueStyle('jquery.dateTimePicker.min.css');
|
83 |
-
|
|
|
84 |
if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
85 |
Subscription::renderStyles();
|
86 |
}
|
53 |
ScriptsIncluder::registerStyle('ion.rangeSlider.skinFlat.css');
|
54 |
ScriptsIncluder::registerStyle('select2.css');
|
55 |
ScriptsIncluder::registerStyle('jquery.dateTimePicker.min.css');
|
56 |
+
ScriptsIncluder::registerStyle('translation.css');
|
57 |
$settingsKey = $this->getSettingsPageKey();
|
58 |
$supportKey = $this->getSupportPageKey();
|
59 |
$subscriberKey = $this->getSubscribersPageKey();
|
81 |
ScriptsIncluder::enqueueStyle('ion.rangeSlider.skinFlat.css');
|
82 |
ScriptsIncluder::enqueueStyle('select2.css');
|
83 |
ScriptsIncluder::enqueueStyle('jquery.dateTimePicker.min.css');
|
84 |
+
ScriptsIncluder::enqueueStyle('translation.css');
|
85 |
+
|
86 |
if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
87 |
Subscription::renderStyles();
|
88 |
}
|
assets/css/admin.css
CHANGED
@@ -413,6 +413,30 @@ input:checked + .ycd-slider:before {
|
|
413 |
border: 1px solid #d10303 !important;
|
414 |
}
|
415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
.ycd-upgrade-button-red .h2 {
|
417 |
font-size: 22px !important;
|
418 |
margin: 0 0 5px 0 !important;
|
413 |
border: 1px solid #d10303 !important;
|
414 |
}
|
415 |
|
416 |
+
.ycd-action-button {
|
417 |
+
padding: 7px;
|
418 |
+
color: #fff !important;
|
419 |
+
font-size: 16px;
|
420 |
+
border-radius: 3px;
|
421 |
+
cursor: pointer;
|
422 |
+
align-items: flex-start;
|
423 |
+
text-align: center !important;
|
424 |
+
}
|
425 |
+
|
426 |
+
.ycd-action-color-primary {
|
427 |
+
background: #ff7964;
|
428 |
+
border: 1px solid #ff7964;
|
429 |
+
color: #FFFFFF;
|
430 |
+
}
|
431 |
+
|
432 |
+
.ycd-action-color-primary:hover {
|
433 |
+
background: #fff;
|
434 |
+
color: #ff7964 !important;
|
435 |
+
border: 1px solid #ff7964 !important;
|
436 |
+
}
|
437 |
+
|
438 |
+
|
439 |
+
|
440 |
.ycd-upgrade-button-red .h2 {
|
441 |
font-size: 22px !important;
|
442 |
margin: 0 0 5px 0 !important;
|
assets/css/translation.css
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ycd-container-wrapper .ycd-translation-wrapper {
|
2 |
+
margin-bottom: 20px;
|
3 |
+
}
|
4 |
+
#template-wrapper {
|
5 |
+
width: 1px;
|
6 |
+
height: 1px;
|
7 |
+
position: absolute;
|
8 |
+
left: -90000px;
|
9 |
+
}
|
10 |
+
.ycd-translation-header {
|
11 |
+
background: #fff;
|
12 |
+
border: 1px solid #ccc;
|
13 |
+
border-radius: 4px;
|
14 |
+
color: #888;
|
15 |
+
padding: 15px 20px;
|
16 |
+
position: relative
|
17 |
+
}
|
18 |
+
|
19 |
+
.delete-item {
|
20 |
+
position: absolute;
|
21 |
+
right: 20px;
|
22 |
+
cursor: pointer;
|
23 |
+
}
|
24 |
+
|
25 |
+
.ycd-translation-body {
|
26 |
+
background: #fff;
|
27 |
+
border: 1px solid #ccc;
|
28 |
+
border-radius: 4px;
|
29 |
+
color: #888;
|
30 |
+
padding: 15px 20px;
|
31 |
+
position: relative;
|
32 |
+
}
|
33 |
+
|
34 |
+
.ycd-hide {
|
35 |
+
display: none;
|
36 |
+
}
|
assets/js/Js.php
CHANGED
@@ -54,6 +54,7 @@ class Js {
|
|
54 |
ScriptsIncluder::localizeScript('WpCountdownBlockMin.js', 'YCD_GUTENBERG_PARAMS', esc_attr($blockSettings));
|
55 |
ScriptsIncluder::enqueueScript('WpCountdownBlockMin.js');
|
56 |
|
|
|
57 |
ScriptsIncluder::registerScript('Admin.js');
|
58 |
ScriptsIncluder::localizeScript('Admin.js', 'ycd_admin_localized', array(
|
59 |
'nonce' => wp_create_nonce('ycd_ajax_nonce'),
|
@@ -89,10 +90,12 @@ class Js {
|
|
89 |
if(in_array($hook, $allowedPages) || get_post_type($post) == YCD_COUNTDOWN_POST_TYPE || @$_GET['post_type'] == YCD_COUNTDOWN_POST_TYPE) {
|
90 |
|
91 |
wp_enqueue_script('jquery-ui-core');
|
|
|
92 |
if(function_exists('wp_enqueue_code_editor')) {
|
93 |
wp_enqueue_code_editor(array( 'type' => 'text/html'));
|
94 |
}
|
95 |
ScriptsIncluder::enqueueScript('Admin.js');
|
|
|
96 |
if(YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
97 |
ScriptsIncluder::registerScript('AdminPro.js');
|
98 |
ScriptsIncluder::enqueueScript('AdminPro.js');
|
54 |
ScriptsIncluder::localizeScript('WpCountdownBlockMin.js', 'YCD_GUTENBERG_PARAMS', esc_attr($blockSettings));
|
55 |
ScriptsIncluder::enqueueScript('WpCountdownBlockMin.js');
|
56 |
|
57 |
+
ScriptsIncluder::registerScript('Translation.js');
|
58 |
ScriptsIncluder::registerScript('Admin.js');
|
59 |
ScriptsIncluder::localizeScript('Admin.js', 'ycd_admin_localized', array(
|
60 |
'nonce' => wp_create_nonce('ycd_ajax_nonce'),
|
90 |
if(in_array($hook, $allowedPages) || get_post_type($post) == YCD_COUNTDOWN_POST_TYPE || @$_GET['post_type'] == YCD_COUNTDOWN_POST_TYPE) {
|
91 |
|
92 |
wp_enqueue_script('jquery-ui-core');
|
93 |
+
wp_enqueue_script( 'jquery-ui-droppable' );
|
94 |
if(function_exists('wp_enqueue_code_editor')) {
|
95 |
wp_enqueue_code_editor(array( 'type' => 'text/html'));
|
96 |
}
|
97 |
ScriptsIncluder::enqueueScript('Admin.js');
|
98 |
+
ScriptsIncluder::enqueueScript('Translation.js');
|
99 |
if(YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
100 |
ScriptsIncluder::registerScript('AdminPro.js');
|
101 |
ScriptsIncluder::enqueueScript('AdminPro.js');
|
assets/js/Translation.js
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function YcdTranslation() {
|
2 |
+
this.init();
|
3 |
+
}
|
4 |
+
|
5 |
+
YcdTranslation.prototype.init = function () {
|
6 |
+
this.addTranslation();
|
7 |
+
this.action();
|
8 |
+
};
|
9 |
+
|
10 |
+
YcdTranslation.prototype.action = function () {
|
11 |
+
this.toggle();
|
12 |
+
this.select2();
|
13 |
+
this.changeLanguage();
|
14 |
+
this.deleteItem();
|
15 |
+
};
|
16 |
+
|
17 |
+
YcdTranslation.prototype.select2 = function () {
|
18 |
+
var select2 = jQuery(".ycd-container-wrapper .ycd-select2");
|
19 |
+
|
20 |
+
if(!select2.length) {
|
21 |
+
return false;
|
22 |
+
}
|
23 |
+
|
24 |
+
select2.select2({
|
25 |
+
width: "200px"
|
26 |
+
});
|
27 |
+
}
|
28 |
+
|
29 |
+
YcdTranslation.prototype.changeLanguage = function () {
|
30 |
+
jQuery('.ycd-tr-language').bind('change', function () {
|
31 |
+
var id = jQuery(this).data('id');
|
32 |
+
var text = jQuery("option:selected", this).text();
|
33 |
+
|
34 |
+
jQuery('.ycd-translation-wrapper-'+id+' .tab-language-tab').text(text);
|
35 |
+
})
|
36 |
+
}
|
37 |
+
|
38 |
+
YcdTranslation.prototype.deleteItem = function () {
|
39 |
+
jQuery('.delete-item').bind('click', function (e) {
|
40 |
+
e.preventDefault();
|
41 |
+
if (confirm("Are you sure?")) {
|
42 |
+
var id = jQuery(this).data('id');
|
43 |
+
jQuery('.ycd-translation-wrapper-'+id).remove();
|
44 |
+
return ;
|
45 |
+
}
|
46 |
+
})
|
47 |
+
}
|
48 |
+
|
49 |
+
YcdTranslation.prototype.toggle = function () {
|
50 |
+
jQuery('.ycd-translation-header').unbind('click').bind('click', function (e) {
|
51 |
+
e.preventDefault();
|
52 |
+
var hiddenClass = 'ycd-hide';
|
53 |
+
|
54 |
+
var body = jQuery(this).next('.ycd-translation-body');
|
55 |
+
if (body.hasClass(hiddenClass)) {
|
56 |
+
body.removeClass(hiddenClass)
|
57 |
+
}
|
58 |
+
else {
|
59 |
+
body.addClass(hiddenClass);
|
60 |
+
}
|
61 |
+
})
|
62 |
+
}
|
63 |
+
|
64 |
+
YcdTranslation.getMaxIndex = function () {
|
65 |
+
var idsList = [];
|
66 |
+
jQuery('.ycd-container-wrapper .ycd-translation-wrapper').each(function(current) {
|
67 |
+
let id = jQuery(this).data('id');
|
68 |
+
console.log(id);
|
69 |
+
idsList.push(id);
|
70 |
+
});
|
71 |
+
let max = Math.max.apply(null, idsList);
|
72 |
+
if (max === -Infinity) {
|
73 |
+
max = 1;
|
74 |
+
} else {
|
75 |
+
max += 1;
|
76 |
+
}
|
77 |
+
|
78 |
+
return max;
|
79 |
+
};
|
80 |
+
|
81 |
+
YcdTranslation.prototype.addTranslation = function () {
|
82 |
+
var button = jQuery('.ycd-add-translation');
|
83 |
+
|
84 |
+
if (!button.length) {
|
85 |
+
return ;
|
86 |
+
}
|
87 |
+
var that = this;
|
88 |
+
|
89 |
+
button.bind('click', function (e) {
|
90 |
+
e.preventDefault();
|
91 |
+
var template = jQuery('#template-wrapper').html();
|
92 |
+
var index = YcdTranslation.getMaxIndex();
|
93 |
+
template = template.replaceAll('{translationId}', index);
|
94 |
+
var langKey = jQuery('[name="ycd-tr[{translationId}][language]"] option:selected').text();
|
95 |
+
template = template.replaceAll('{isoCode}', langKey);
|
96 |
+
if (jQuery('.ycd-container-wrapper .ycd-translation-wrapper').length === 0) {
|
97 |
+
jQuery('.ycd-container-wrapper p').remove();
|
98 |
+
}
|
99 |
+
jQuery('.ycd-container-wrapper').append(template);
|
100 |
+
that.action();
|
101 |
+
})
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
jQuery(document).ready(function () {
|
106 |
+
new YcdTranslation();
|
107 |
+
})
|
assets/views/admin/moreIdeas.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="ycd-bootstrap-wrapper">
|
2 |
+
<h3>Do you need some new Features?</h3>
|
3 |
+
<p>Do you need to some new features, or do you have suggestion?</p>
|
4 |
+
<p>Feel free let us know and we will be happy to implement it</p>
|
5 |
+
<a href="https://wordpress.org/support/plugin/countdown-builder/" target="_blank">
|
6 |
+
<button class="ycd-action-button ycd-action-color-primary ycd-upgrade-metabox-button-red" onclick="window.open('https://wordpress.org/support/plugin/countdown-builder/')">
|
7 |
+
<b class="h2">Feature Request</b>
|
8 |
+
</button>
|
9 |
+
</a>
|
10 |
+
</div>
|
assets/views/cricleMainView.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
use ycd\AdminHelper;
|
|
|
3 |
$proSpan = '';
|
4 |
$isPro = '';
|
5 |
if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
|
@@ -57,6 +58,7 @@ if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
|
57 |
die();
|
58 |
}
|
59 |
}
|
|
|
60 |
?>
|
61 |
<div class="ycd-bootstrap-wrapper">
|
62 |
<div class="row">
|
@@ -910,6 +912,14 @@ if (YCD_PKG_VERSION > YCD_FREE_VERSION) {
|
|
910 |
</div>
|
911 |
</div>
|
912 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
913 |
</div>
|
914 |
<?php
|
915 |
require_once YCD_VIEWS_PATH.'preview.php';
|
1 |
<?php
|
2 |
use ycd\AdminHelper;
|
3 |
+
use ycd\TranslationManager;
|
4 |
$proSpan = '';
|
5 |
$isPro = '';
|
6 |
if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
|
58 |
die();
|
59 |
}
|
60 |
}
|
61 |
+
|
62 |
?>
|
63 |
<div class="ycd-bootstrap-wrapper">
|
64 |
<div class="row">
|
912 |
</div>
|
913 |
</div>
|
914 |
</div>
|
915 |
+
<div class="row">
|
916 |
+
<div class="col-md-12">
|
917 |
+
<h5><?php _e('Translations(Synchronized with the browser language)', YCD_TEXT_DOMAIN)?></h5>
|
918 |
+
<?php
|
919 |
+
require_once (dirname(__FILE__).'/translations/circleTranslation.php');
|
920 |
+
?>
|
921 |
+
</div>
|
922 |
+
</div>
|
923 |
</div>
|
924 |
<?php
|
925 |
require_once YCD_VIEWS_PATH.'preview.php';
|
assets/views/generalOptions.php
CHANGED
@@ -384,20 +384,6 @@ if (class_exists('ycd\AdminHelperPro')) {
|
|
384 |
</div>
|
385 |
</div>
|
386 |
</div>
|
387 |
-
<div class="row">
|
388 |
-
<div class="col-md-6">
|
389 |
-
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Display On', YCD_TEXT_DOMAIN); ?></label>
|
390 |
-
</div>
|
391 |
-
<div class="col-md-6">
|
392 |
-
<label class="ycd-switch">
|
393 |
-
<input type="checkbox" id="ycd-countdown-display-on" name="ycd-countdown-display-on" class="ycd-accordion-checkbox" <?php echo esc_attr($this->getOptionValue('ycd-countdown-display-on')); ?>>
|
394 |
-
<span class="ycd-slider ycd-round"></span>
|
395 |
-
</label>
|
396 |
-
</div>
|
397 |
-
</div>
|
398 |
-
<div class="ycd-accordion-content ycd-hide-content">
|
399 |
-
<?php require_once dirname(__FILE__).'/displaySettings.php'; ?>
|
400 |
-
</div>
|
401 |
<div class="row">
|
402 |
<div class="col-md-6">
|
403 |
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Timer End Sound', YCD_TEXT_DOMAIN); ?></label>
|
384 |
</div>
|
385 |
</div>
|
386 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
<div class="row">
|
388 |
<div class="col-md-6">
|
389 |
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Timer End Sound', YCD_TEXT_DOMAIN); ?></label>
|
assets/views/metaboxes/displayRules.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="ycd-bootstrap-wrapper">
|
2 |
+
<div class="row">
|
3 |
+
<div class="col-md-6">
|
4 |
+
<label for="ycd-countdown-end-sound" class="ycd-label-of-switch"><?php _e('Display On', YCD_TEXT_DOMAIN); ?></label>
|
5 |
+
</div>
|
6 |
+
<div class="col-md-6">
|
7 |
+
<label class="ycd-switch">
|
8 |
+
<input type="checkbox" id="ycd-countdown-display-on" name="ycd-countdown-display-on" class="ycd-accordion-checkbox" <?php echo esc_attr($this->getOptionValue('ycd-countdown-display-on')); ?>>
|
9 |
+
<span class="ycd-slider ycd-round"></span>
|
10 |
+
</label>
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<div class="ycd-accordion-content ycd-hide-content">
|
14 |
+
<?php require_once dirname(__FILE__).'/displaySettings.php'; ?>
|
15 |
+
</div>
|
16 |
+
</div>
|
assets/views/metaboxes/displaySettings.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
use ycd\DisplayConditionBuilder;
|
3 |
+
use ycd\AdminHelper;
|
4 |
+
|
5 |
+
$defaultData = AdminHelper::defaultData();
|
6 |
+
$savedData = $this->getOptionValue('ycd-display-settings');
|
7 |
+
$obj = new DisplayConditionBuilder();
|
8 |
+
$obj->setSavedData($savedData);
|
9 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
10 |
+
?>
|
11 |
+
<div class="ystp-bootstrap-wrapper">
|
12 |
+
<div class="row form-group">
|
13 |
+
<div class="col-md-5">
|
14 |
+
<label for="ycd-countdown-text-size" class="ycd-label-of-select"><?php _e('Position Of Countdown', YCD_TEXT_DOMAIN); ?></label>
|
15 |
+
</div>
|
16 |
+
<div class="col-md-7">
|
17 |
+
<?php
|
18 |
+
$postionCountdown = AdminHelper::selectBox($defaultData['position-countdown'], esc_attr($this->getOptionValue('ycd-position-countdown')), array('name' => 'ycd-position-countdown', 'class' => 'js-ycd-select'));
|
19 |
+
echo wp_kses($postionCountdown, $allowed_html);
|
20 |
+
?>
|
21 |
+
</div>
|
22 |
+
</div>
|
23 |
+
<?php echo wp_kses($obj->render(), $allowed_html); ?>
|
24 |
+
</div>
|
assets/views/translations/circleTranslation.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
use ycd\TranslationManager;
|
3 |
+
use ycd\AdminHelper;
|
4 |
+
require_once (YCD_CLASSES_PATH.'/translation/TranslationManager.php');
|
5 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
6 |
+
$translation = TranslationManager::init();
|
7 |
+
$translation->setTranslations($this->getOptionValue('ycd-tr'));
|
8 |
+
|
9 |
+
echo wp_kses($translation->translationTemplate(), $allowed_html);
|
10 |
+
echo wp_kses($translation->render(), $allowed_html);
|
11 |
+
|
assets/views/types.php
CHANGED
@@ -7,7 +7,9 @@ $currentExtensions = YcdCountdownConfig::extensions();
|
|
7 |
$extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions);
|
8 |
$allowed_html = AdminHelper::getAllowedTags();
|
9 |
?>
|
10 |
-
|
|
|
|
|
11 |
<div>
|
12 |
<h3 class="ycd-page-h3"><?php _e('Add New Countdown', YCD_TEXT_DOMAIN); ?></h3>
|
13 |
</div>
|
7 |
$extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions);
|
8 |
$allowed_html = AdminHelper::getAllowedTags();
|
9 |
?>
|
10 |
+
<?php
|
11 |
+
require_once(YCD_ADMIN_VIEWS_PATH."moreIdeas.php");
|
12 |
+
?>
|
13 |
<div>
|
14 |
<h3 class="ycd-page-h3"><?php _e('Add New Countdown', YCD_TEXT_DOMAIN); ?></h3>
|
15 |
</div>
|
classes/Actions.php
CHANGED
@@ -240,13 +240,14 @@ class Actions {
|
|
240 |
}
|
241 |
|
242 |
private function revieNotice() {
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
}
|
247 |
|
248 |
public function showReviewNotice() {
|
249 |
-
|
|
|
250 |
}
|
251 |
|
252 |
public function addSubMenu() {
|
@@ -364,6 +365,7 @@ class Actions {
|
|
364 |
}
|
365 |
|
366 |
public function generalOptions() {
|
|
|
367 |
if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
|
368 |
add_meta_box('ycdUpgrade', __('Upgrade', YCD_TEXT_DOMAIN), array($this, 'upgradeToPro'), YCD_COUNTDOWN_POST_TYPE, 'side', 'high');
|
369 |
}
|
@@ -371,6 +373,10 @@ class Actions {
|
|
371 |
add_meta_box('ycdShortcodeMetabox', __('Info', YCD_TEXT_DOMAIN), array($this, 'shortcodeMetabox'), YCD_COUNTDOWN_POST_TYPE, 'side');
|
372 |
}
|
373 |
|
|
|
|
|
|
|
|
|
374 |
public function upgradeToPro() {
|
375 |
require_once(YCD_VIEWS_PATH.'upgrade.php');
|
376 |
}
|
240 |
}
|
241 |
|
242 |
private function revieNotice() {
|
243 |
+
add_action('admin_notices', array($this, 'showReviewNotice'));
|
244 |
+
add_action('network_admin_notices', array($this, 'showReviewNotice'));
|
245 |
+
add_action('user_admin_notices', array($this, 'showReviewNotice'));
|
246 |
}
|
247 |
|
248 |
public function showReviewNotice() {
|
249 |
+
$allowedTags = AdminHelper::getAllowedTags();
|
250 |
+
echo wp_kses(new YcdShowReviewNotice(), $allowedTags);
|
251 |
}
|
252 |
|
253 |
public function addSubMenu() {
|
365 |
}
|
366 |
|
367 |
public function generalOptions() {
|
368 |
+
add_meta_box('ycdFeatureRequest', __('Feature Request', YCD_TEXT_DOMAIN), array($this, 'ycdFeatureRequest'), YCD_COUNTDOWN_POST_TYPE, 'side', 'high');
|
369 |
if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
|
370 |
add_meta_box('ycdUpgrade', __('Upgrade', YCD_TEXT_DOMAIN), array($this, 'upgradeToPro'), YCD_COUNTDOWN_POST_TYPE, 'side', 'high');
|
371 |
}
|
373 |
add_meta_box('ycdShortcodeMetabox', __('Info', YCD_TEXT_DOMAIN), array($this, 'shortcodeMetabox'), YCD_COUNTDOWN_POST_TYPE, 'side');
|
374 |
}
|
375 |
|
376 |
+
public function ycdFeatureRequest() {
|
377 |
+
require_once(YCD_ADMIN_VIEWS_PATH."moreIdeas.php");
|
378 |
+
}
|
379 |
+
|
380 |
public function upgradeToPro() {
|
381 |
require_once(YCD_VIEWS_PATH.'upgrade.php');
|
382 |
}
|
classes/countdown/CircleCountdown.php
CHANGED
@@ -174,6 +174,33 @@ class CircleCountdown extends Countdown {
|
|
174 |
public function addToContent() {
|
175 |
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
176 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
public function getViewContent() {
|
179 |
$this->includeStyles();
|
@@ -185,6 +212,8 @@ class CircleCountdown extends Countdown {
|
|
185 |
$allDataOptions = $this->getDataAllOptions();
|
186 |
$allDataOptions = json_encode($allDataOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT);
|
187 |
$prepareOptions = $this->getCircleOptionsData();
|
|
|
|
|
188 |
$prepareOptions = json_encode($prepareOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT);
|
189 |
$width = (int)$this->getOptionValue('ycd-countdown-width');
|
190 |
$widthMeasure = $this->getOptionValue('ycd-dimension-measure');
|
174 |
public function addToContent() {
|
175 |
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
176 |
}
|
177 |
+
|
178 |
+
private function filterTranslations($prepareOptions) {
|
179 |
+
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
180 |
+
$translations = $this->getOptionValue('ycd-tr');
|
181 |
+
$currentTranslation = null;
|
182 |
+
if (empty($translations)) {
|
183 |
+
return $prepareOptions;
|
184 |
+
}
|
185 |
+
foreach ($translations as $translation) {
|
186 |
+
$isCode = substr($translation['language'], 0, 2);
|
187 |
+
if ($lang === $isCode) {
|
188 |
+
$currentTranslation = $translation;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
if ($currentTranslation) {
|
192 |
+
|
193 |
+
unset($currentTranslation['language']);
|
194 |
+
foreach ($currentTranslation as $unite => $value) {
|
195 |
+
if (empty($value)) {
|
196 |
+
continue;
|
197 |
+
}
|
198 |
+
$prepareOptions['time'][$unite]['text'] = $value;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
return $prepareOptions;
|
203 |
+
}
|
204 |
|
205 |
public function getViewContent() {
|
206 |
$this->includeStyles();
|
212 |
$allDataOptions = $this->getDataAllOptions();
|
213 |
$allDataOptions = json_encode($allDataOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT);
|
214 |
$prepareOptions = $this->getCircleOptionsData();
|
215 |
+
$prepareOptions = $this->filterTranslations($prepareOptions);
|
216 |
+
|
217 |
$prepareOptions = json_encode($prepareOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT);
|
218 |
$width = (int)$this->getOptionValue('ycd-countdown-width');
|
219 |
$widthMeasure = $this->getOptionValue('ycd-dimension-measure');
|
classes/countdown/Clock1Countdown.php
CHANGED
@@ -21,6 +21,10 @@ class Clock1Countdown extends Countdown {
|
|
21 |
|
22 |
return $options;
|
23 |
}
|
|
|
|
|
|
|
|
|
24 |
|
25 |
public function includeStyles() {
|
26 |
$this->includeGeneralScripts();
|
21 |
|
22 |
return $options;
|
23 |
}
|
24 |
+
|
25 |
+
public function addToContent() {
|
26 |
+
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
27 |
+
}
|
28 |
|
29 |
public function includeStyles() {
|
30 |
$this->includeGeneralScripts();
|
classes/countdown/Clock2Countdown.php
CHANGED
@@ -21,6 +21,10 @@ class Clock2Countdown extends Countdown {
|
|
21 |
|
22 |
return $options;
|
23 |
}
|
|
|
|
|
|
|
|
|
24 |
|
25 |
public function includeStyles() {
|
26 |
$this->includeGeneralScripts();
|
21 |
|
22 |
return $options;
|
23 |
}
|
24 |
+
|
25 |
+
public function addToContent() {
|
26 |
+
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
27 |
+
}
|
28 |
|
29 |
public function includeStyles() {
|
30 |
$this->includeGeneralScripts();
|
classes/countdown/Clock3Countdown.php
CHANGED
@@ -21,6 +21,10 @@ class Clock3Countdown extends Countdown {
|
|
21 |
|
22 |
return $options;
|
23 |
}
|
|
|
|
|
|
|
|
|
24 |
|
25 |
public function includeStyles() {
|
26 |
$this->includeGeneralScripts();
|
21 |
|
22 |
return $options;
|
23 |
}
|
24 |
+
|
25 |
+
public function addToContent() {
|
26 |
+
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
27 |
+
}
|
28 |
|
29 |
public function includeStyles() {
|
30 |
$this->includeGeneralScripts();
|
classes/countdown/Countdown.php
CHANGED
@@ -490,6 +490,7 @@ abstract class Countdown {
|
|
490 |
$metaboxes = array();
|
491 |
|
492 |
$metaboxes['advancedOptions'] = array('title' => 'Advanced Options', 'position' => 'normal', 'prioritet' => 'high');
|
|
|
493 |
$metaboxes['generalOptions'] = array('title' => 'General Options', 'position' => 'normal', 'prioritet' => 'high');
|
494 |
$metaboxes['subscription'] = array('title' => 'Subscription Section', 'position' => 'normal', 'prioritet' => 'high');
|
495 |
$metaboxes['afterCountdownExpire'] = array('title' => 'After Expire', 'position' => 'normal', 'prioritet' => 'high');
|
@@ -528,6 +529,10 @@ abstract class Countdown {
|
|
528 |
require_once YCD_VIEWS_PATH.'advancedOptions.php';
|
529 |
}
|
530 |
|
|
|
|
|
|
|
|
|
531 |
public function generalOptions() {
|
532 |
require_once YCD_VIEWS_PATH.'generalOptions.php';
|
533 |
}
|
490 |
$metaboxes = array();
|
491 |
|
492 |
$metaboxes['advancedOptions'] = array('title' => 'Advanced Options', 'position' => 'normal', 'prioritet' => 'high');
|
493 |
+
$metaboxes['displayRules'] = array('title' => 'Display Rules', 'position' => 'normal', 'prioritet' => 'high');
|
494 |
$metaboxes['generalOptions'] = array('title' => 'General Options', 'position' => 'normal', 'prioritet' => 'high');
|
495 |
$metaboxes['subscription'] = array('title' => 'Subscription Section', 'position' => 'normal', 'prioritet' => 'high');
|
496 |
$metaboxes['afterCountdownExpire'] = array('title' => 'After Expire', 'position' => 'normal', 'prioritet' => 'high');
|
529 |
require_once YCD_VIEWS_PATH.'advancedOptions.php';
|
530 |
}
|
531 |
|
532 |
+
public function displayRules() {
|
533 |
+
require_once YCD_VIEWS_METABOXES_PATH.'displayRules.php';
|
534 |
+
}
|
535 |
+
|
536 |
public function generalOptions() {
|
537 |
require_once YCD_VIEWS_PATH.'generalOptions.php';
|
538 |
}
|
classes/countdown/TimerCountdown.php
CHANGED
@@ -29,6 +29,10 @@ class TimerCountdown extends Countdown {
|
|
29 |
|
30 |
return $defaultOptions;
|
31 |
}
|
|
|
|
|
|
|
|
|
32 |
|
33 |
public function metaboxes($metaboxes) {
|
34 |
unset($metaboxes['generalOptions']);
|
@@ -183,7 +187,7 @@ class TimerCountdown extends Countdown {
|
|
183 |
<div class="timer-time-set ycd-timer-box ycd-timer-box-next" id="nextTime" style="opacity: 0;">
|
184 |
<span id="ycdDaysNext" class="ycd-days-next-value-<?php echo esc_attr($id); ?> ycd-timer-number">00</span><!--
|
185 |
--><span class="ycd-dots">:</span><!--
|
186 |
-
--><span id="ycdHoursNext"class="ycd-hours-next-value-<?php echo esc_attr($id); ?>">00</span><!--
|
187 |
--><span>:</span><!--
|
188 |
--><span id="ycdMinutesNext" class="ycd-minutes-next-value-<?php echo esc_attr($id); ?>">00</span><!--
|
189 |
--><span>:</span><!--
|
29 |
|
30 |
return $defaultOptions;
|
31 |
}
|
32 |
+
|
33 |
+
public function addToContent() {
|
34 |
+
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
35 |
+
}
|
36 |
|
37 |
public function metaboxes($metaboxes) {
|
38 |
unset($metaboxes['generalOptions']);
|
187 |
<div class="timer-time-set ycd-timer-box ycd-timer-box-next" id="nextTime" style="opacity: 0;">
|
188 |
<span id="ycdDaysNext" class="ycd-days-next-value-<?php echo esc_attr($id); ?> ycd-timer-number">00</span><!--
|
189 |
--><span class="ycd-dots">:</span><!--
|
190 |
+
--><span id="ycdHoursNext" class="ycd-hours-next-value-<?php echo esc_attr($id); ?>">00</span><!--
|
191 |
--><span>:</span><!--
|
192 |
--><span id="ycdMinutesNext" class="ycd-minutes-next-value-<?php echo esc_attr($id); ?>">00</span><!--
|
193 |
--><span>:</span><!--
|
classes/translation/AbstractTranslationManager.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace ycd;
|
3 |
+
|
4 |
+
abstract class AbstractTranslationManager {
|
5 |
+
abstract function render();
|
6 |
+
private $prefix = '';
|
7 |
+
protected $translations = [];
|
8 |
+
|
9 |
+
public function __construct($optionsPrefix) {
|
10 |
+
$this->prefix = $optionsPrefix;
|
11 |
+
|
12 |
+
}
|
13 |
+
|
14 |
+
public function setTranslations($translations) {
|
15 |
+
if (!empty($translations['{translationId}'])) {
|
16 |
+
unset($translations['{translationId}']);
|
17 |
+
}
|
18 |
+
if (!empty($translations)) {
|
19 |
+
$this->translations = $translations;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public static function init($optionsPrefix = 'ycd-tr') {
|
24 |
+
return new static($optionsPrefix );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function translationRow($translation) {
|
28 |
+
$labelName = array(
|
29 |
+
'Years' => 'Years',
|
30 |
+
'Months' => 'Months',
|
31 |
+
'Days' => 'Days',
|
32 |
+
'Hours' => 'Hours',
|
33 |
+
'Minutes' => 'Minutes',
|
34 |
+
'Seconds' => 'Seconds'
|
35 |
+
);
|
36 |
+
$language = AdminHelper::getLanguageIsoCodeList();
|
37 |
+
$id = '{translationId}';
|
38 |
+
if (!empty($translation['id'])) {
|
39 |
+
$id = $translation['id'];
|
40 |
+
}
|
41 |
+
$isoCode = '{isoCode}';
|
42 |
+
if (!empty($translation['language'])) {
|
43 |
+
$isoCode = $language[$translation['language']];
|
44 |
+
}
|
45 |
+
ob_start();
|
46 |
+
?>
|
47 |
+
<div class="ycd-translation-wrapper ycd-translation-wrapper-<?php echo esc_attr($id); ?>" data-id="<?php echo esc_attr($id); ?>">
|
48 |
+
<div class="ycd-translation-header">Language <span class="tab-language-tab"><?php echo esc_attr($isoCode); ?></span><span class="delete-item" data-id="<?php echo esc_attr($id); ?>">X</span></div>
|
49 |
+
<div class="ycd-translation-body ycd-hide">
|
50 |
+
<div class="row">
|
51 |
+
<div class="col-md-12">
|
52 |
+
<div>
|
53 |
+
<label><?php _e('Language', YCD_TEXT_DOMAIN)?></label>
|
54 |
+
</div>
|
55 |
+
<div>
|
56 |
+
<?php echo AdminHelper::selectBox($language, esc_attr($translation['language']), array('name' => "$this->prefix[$id][language]", 'class' => 'ycd-select2 ycd-tr-language', 'data-id' => $id))?>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<div class="row">
|
61 |
+
<?php foreach ($labelName as $label => $name): ?>
|
62 |
+
<div class="col-md-2">
|
63 |
+
<label for="<?php echo "$this->prefix[$id][$name]"; ?>"><?php _e($label, YCD_TEXT_DOMAIN)?></label>
|
64 |
+
<input name="<?php echo "$this->prefix[$id][$name]"?>" id="<?php echo "$this->prefix[$id][$name]"; ?>" class="form-control" value="<?php echo esc_attr($translation[$name]); ?>">
|
65 |
+
</div>
|
66 |
+
<?php endforeach; ?>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
<?php
|
71 |
+
$content = ob_get_contents();
|
72 |
+
ob_end_clean();
|
73 |
+
|
74 |
+
return $content;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function translationTemplate($translation = array()) {
|
78 |
+
|
79 |
+
ob_start();
|
80 |
+
?>
|
81 |
+
<div id="template-wrapper">
|
82 |
+
<?php echo $this->translationRow($translation); ?>
|
83 |
+
</div>
|
84 |
+
<?php
|
85 |
+
$content = ob_get_contents();
|
86 |
+
ob_end_clean();
|
87 |
+
|
88 |
+
return $content;
|
89 |
+
}
|
90 |
+
|
91 |
+
protected function addTranslationButton() {
|
92 |
+
ob_start();
|
93 |
+
?>
|
94 |
+
<div class="row">
|
95 |
+
<div class="col-md-12">
|
96 |
+
<button class="btn btn-primary ycd-add-translation">Add Translation</button>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<?php
|
100 |
+
$content = ob_get_contents();
|
101 |
+
ob_end_clean();
|
102 |
+
|
103 |
+
return $content;
|
104 |
+
}
|
105 |
+
}
|
classes/translation/TranslationManager.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace ycd;
|
3 |
+
require_once (dirname(__FILE__).'/AbstractTranslationManager.php');
|
4 |
+
|
5 |
+
class TranslationManager extends AbstractTranslationManager {
|
6 |
+
public function renderTranslations() {
|
7 |
+
|
8 |
+
if (!$this->translations) {
|
9 |
+
return '<p>'.esc_attr(__('There is not translations', YCD_TEXT_DOMAIN)).'</p>';
|
10 |
+
}
|
11 |
+
$data = '';
|
12 |
+
foreach ($this->translations as $key => $translation) {
|
13 |
+
$translation['id'] = $key;
|
14 |
+
$data .= $this->translationRow($translation);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $data;
|
18 |
+
}
|
19 |
+
public function render() {
|
20 |
+
ob_start();
|
21 |
+
?>
|
22 |
+
<div class="row">
|
23 |
+
<div class="col-md-12 ycd-container-wrapper">
|
24 |
+
<?php echo $this->renderTranslations(); ?>
|
25 |
+
</div>
|
26 |
+
<div class="col-md-12">
|
27 |
+
<?php echo $this->addTranslationButton(); ?>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<?php
|
31 |
+
$content = ob_get_contents();
|
32 |
+
ob_end_clean();
|
33 |
+
|
34 |
+
return $content;
|
35 |
+
}
|
36 |
+
}
|
config/config.php
CHANGED
@@ -33,6 +33,7 @@ class YcdCountdownConfig
|
|
33 |
self::addDefine('YCD_CONFIG_PATH', YCD_COUNTDOWN_PATH.'config/');
|
34 |
self::addDefine('YCD_ASSETS_PATH', YCD_COUNTDOWN_PATH.'/assets/');
|
35 |
self::addDefine('YCD_VIEWS_PATH', YCD_ASSETS_PATH.'views/');
|
|
|
36 |
self::addDefine('YCD_VIEWS_MAIN_PATH', YCD_VIEWS_PATH.'main/');
|
37 |
self::addDefine('YCD_ADMIN_VIEWS_PATH', YCD_VIEWS_PATH.'admin/');
|
38 |
self::addDefine('YCD_ADMIN_COMING_VIEWS_PATH', YCD_ADMIN_VIEWS_PATH.'comingSoon/');
|
@@ -75,8 +76,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.
|
79 |
-
self::addDefine('YCD_VERSION', 2.
|
80 |
self::addDefine('YCD_FREE_VERSION', 1);
|
81 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
82 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
@@ -84,13 +85,13 @@ class YcdCountdownConfig
|
|
84 |
self::addDefine('YCD_EXTENSION_VERSION', 99);
|
85 |
require_once(dirname(__FILE__).'/config-pkg.php');
|
86 |
|
87 |
-
$versionText = '2.4.
|
88 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
89 |
-
$versionText = '2.2.
|
90 |
}
|
91 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
92 |
-
self::addDefine('YCD_LAST_UPDATE', '
|
93 |
-
self::addDefine('YCD_NEXT_UPDATE', 'Hoc
|
94 |
}
|
95 |
|
96 |
public static function displaySettings()
|
33 |
self::addDefine('YCD_CONFIG_PATH', YCD_COUNTDOWN_PATH.'config/');
|
34 |
self::addDefine('YCD_ASSETS_PATH', YCD_COUNTDOWN_PATH.'/assets/');
|
35 |
self::addDefine('YCD_VIEWS_PATH', YCD_ASSETS_PATH.'views/');
|
36 |
+
self::addDefine('YCD_VIEWS_METABOXES_PATH', YCD_VIEWS_PATH.'metaboxes/');
|
37 |
self::addDefine('YCD_VIEWS_MAIN_PATH', YCD_VIEWS_PATH.'main/');
|
38 |
self::addDefine('YCD_ADMIN_VIEWS_PATH', YCD_VIEWS_PATH.'admin/');
|
39 |
self::addDefine('YCD_ADMIN_COMING_VIEWS_PATH', YCD_ADMIN_VIEWS_PATH.'comingSoon/');
|
76 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
77 |
self::addDefine('YCD_AJAX_SUCCESS', 1);
|
78 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
79 |
+
self::addDefine('YCD_VERSION_PRO', 2.26);
|
80 |
+
self::addDefine('YCD_VERSION', 2.45);
|
81 |
self::addDefine('YCD_FREE_VERSION', 1);
|
82 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
83 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
85 |
self::addDefine('YCD_EXTENSION_VERSION', 99);
|
86 |
require_once(dirname(__FILE__).'/config-pkg.php');
|
87 |
|
88 |
+
$versionText = '2.4.5';
|
89 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
90 |
+
$versionText = '2.2.6';
|
91 |
}
|
92 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
93 |
+
self::addDefine('YCD_LAST_UPDATE', 'Hoc 2');
|
94 |
+
self::addDefine('YCD_NEXT_UPDATE', 'Hoc 12');
|
95 |
}
|
96 |
|
97 |
public static function displaySettings()
|
config/optionsConfig.php
CHANGED
@@ -269,7 +269,7 @@ class YcdCountdownOptionsConfig
|
|
269 |
$options[] = array('name' => 'ycd-circle-box-spread-radius', 'type' => 'text', 'defaultValue' => 1);
|
270 |
$options[] = array('name' => 'ycd-circle-box-shadow-color', 'type' => 'text', 'defaultValue' => '#ffffff');
|
271 |
$options[] = array('name' => 'ycd-display-settings', 'type' => 'ycd', 'defaultValue' => array(array('key1' => 'select_settings')));
|
272 |
-
$options[] = array('name' => 'ycd-countdown-display-on', 'type' => 'checkbox', 'defaultValue' => '');
|
273 |
$options[] = array('name' => 'ycd-countdown-enable-start-date', 'type' => 'checkbox', 'defaultValue' => '');
|
274 |
$options[] = array('name' => 'ycd-countdown-start-date', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i'));
|
275 |
$options[] = array('name' => 'ycd-countdown-start-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
@@ -365,6 +365,7 @@ class YcdCountdownOptionsConfig
|
|
365 |
$options[] = array('name' => 'ycd-simple-text-margin-right', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
366 |
$options[] = array('name' => 'ycd-simple-text-margin-bottom', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
367 |
$options[] = array('name' => 'ycd-simple-text-margin-left', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
|
|
368 |
|
369 |
$YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
|
370 |
}
|
269 |
$options[] = array('name' => 'ycd-circle-box-spread-radius', 'type' => 'text', 'defaultValue' => 1);
|
270 |
$options[] = array('name' => 'ycd-circle-box-shadow-color', 'type' => 'text', 'defaultValue' => '#ffffff');
|
271 |
$options[] = array('name' => 'ycd-display-settings', 'type' => 'ycd', 'defaultValue' => array(array('key1' => 'select_settings')));
|
272 |
+
$options[] = array('name' => 'ycd-countdown-display-on', 'type' => 'checkbox', 'defaultValue' => 'on');
|
273 |
$options[] = array('name' => 'ycd-countdown-enable-start-date', 'type' => 'checkbox', 'defaultValue' => '');
|
274 |
$options[] = array('name' => 'ycd-countdown-start-date', 'type' => 'text', 'defaultValue' => date('Y-m-d H:i'));
|
275 |
$options[] = array('name' => 'ycd-countdown-start-time-zone', 'type' => 'text', 'defaultValue' => self::getDefaultTimezone());
|
365 |
$options[] = array('name' => 'ycd-simple-text-margin-right', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
366 |
$options[] = array('name' => 'ycd-simple-text-margin-bottom', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
367 |
$options[] = array('name' => 'ycd-simple-text-margin-left', 'type' => 'text', 'defaultValue' => __('0px', YCD_TEXT_DOMAIN));
|
368 |
+
$options[] = array('name' => 'ycd-tr', 'type' => 'array', 'defaultValue' => '');
|
369 |
|
370 |
$YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
|
371 |
}
|
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.
|
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.5
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
helpers/AdminHelper.php
CHANGED
@@ -1487,7 +1487,9 @@ class AdminHelper {
|
|
1487 |
'data-condition-id' => array(),
|
1488 |
'data-child-class' => array(),
|
1489 |
'data-id' => array(),
|
1490 |
-
'style' => array()
|
|
|
|
|
1491 |
);
|
1492 |
|
1493 |
$allowed_html = array(
|
@@ -1495,6 +1497,9 @@ class AdminHelper {
|
|
1495 |
'p' => $generalArray,
|
1496 |
'ul' => $generalArray,
|
1497 |
'li' => $generalArray,
|
|
|
|
|
|
|
1498 |
'input' => array(
|
1499 |
'type' => array(),
|
1500 |
'id' => array(),
|
@@ -1509,7 +1514,8 @@ class AdminHelper {
|
|
1509 |
'label' => array(
|
1510 |
'id' => array(),
|
1511 |
'class' => array(),
|
1512 |
-
'style' => array()
|
|
|
1513 |
),
|
1514 |
'select' => array(
|
1515 |
'option' => array('value', 'selected'),
|
@@ -1518,7 +1524,8 @@ class AdminHelper {
|
|
1518 |
'js-circle-time-zone' => array(),
|
1519 |
'style' => array(),
|
1520 |
'multiple' => array(),
|
1521 |
-
'data-select-type' => array()
|
|
|
1522 |
),
|
1523 |
'option' => array(
|
1524 |
'value' => array(),
|
@@ -1532,6 +1539,7 @@ class AdminHelper {
|
|
1532 |
"style" => array(),
|
1533 |
'a' => array(
|
1534 |
'href' => array(),
|
|
|
1535 |
'class' => array(),
|
1536 |
'style' => array(),
|
1537 |
|
@@ -1540,4 +1548,23 @@ class AdminHelper {
|
|
1540 |
|
1541 |
return $allowed_html;
|
1542 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1543 |
}
|
1487 |
'data-condition-id' => array(),
|
1488 |
'data-child-class' => array(),
|
1489 |
'data-id' => array(),
|
1490 |
+
'style' => array(),
|
1491 |
+
'data-ajaxnonce' => array(),
|
1492 |
+
'onclick' => array()
|
1493 |
);
|
1494 |
|
1495 |
$allowed_html = array(
|
1497 |
'p' => $generalArray,
|
1498 |
'ul' => $generalArray,
|
1499 |
'li' => $generalArray,
|
1500 |
+
'button' => $generalArray,
|
1501 |
+
'style' => $generalArray,
|
1502 |
+
'script' => $generalArray,
|
1503 |
'input' => array(
|
1504 |
'type' => array(),
|
1505 |
'id' => array(),
|
1514 |
'label' => array(
|
1515 |
'id' => array(),
|
1516 |
'class' => array(),
|
1517 |
+
'style' => array(),
|
1518 |
+
'for' => array()
|
1519 |
),
|
1520 |
'select' => array(
|
1521 |
'option' => array('value', 'selected'),
|
1524 |
'js-circle-time-zone' => array(),
|
1525 |
'style' => array(),
|
1526 |
'multiple' => array(),
|
1527 |
+
'data-select-type' => array(),
|
1528 |
+
'data-id' => array()
|
1529 |
),
|
1530 |
'option' => array(
|
1531 |
'value' => array(),
|
1539 |
"style" => array(),
|
1540 |
'a' => array(
|
1541 |
'href' => array(),
|
1542 |
+
'target' => array(),
|
1543 |
'class' => array(),
|
1544 |
'style' => array(),
|
1545 |
|
1548 |
|
1549 |
return $allowed_html;
|
1550 |
}
|
1551 |
+
|
1552 |
+
public static function getLanguageIsoCodeList() {
|
1553 |
+
$translations = [];
|
1554 |
+
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
|
1555 |
+
if (function_exists('wp_get_available_translations')) {
|
1556 |
+
$translations = wp_get_available_translations();
|
1557 |
+
}
|
1558 |
+
|
1559 |
+
$list = array();
|
1560 |
+
if (!$translations) {
|
1561 |
+
return $list;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
foreach ($translations as $translation) {
|
1565 |
+
$list[$translation['language']] = $translation['english_name'];
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
return $list;
|
1569 |
+
}
|
1570 |
}
|
helpers/ShowReviewNotice.php
CHANGED
@@ -28,7 +28,6 @@ class YcdShowReviewNotice {
|
|
28 |
// When period next time does not exits it means the user is old
|
29 |
if(!$periodNextTime) {
|
30 |
YcdShowReviewNotice::setInitialDates();
|
31 |
-
|
32 |
return !$shouldOpen;
|
33 |
}
|
34 |
$currentData = new DateTime('now');
|
@@ -40,11 +39,12 @@ class YcdShowReviewNotice {
|
|
40 |
|
41 |
private function getReviewContent($type) {
|
42 |
$content = $this->getMaxOpenDaysMessage($type);
|
|
|
43 |
ob_start();
|
44 |
?>
|
45 |
<div id="welcome-panel" class="welcome-panel ycd-review-block">
|
46 |
<div class="welcome-panel-content">
|
47 |
-
<?php echo
|
48 |
</div>
|
49 |
</div>
|
50 |
<?php
|
@@ -93,9 +93,10 @@ class YcdShowReviewNotice {
|
|
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! '.esc_attr($userName).'</strong> You’ve been using Countdown on your site for '.
|
99 |
$popupContent = $this->getMaxOepnContent($firstHeader, $type);
|
100 |
|
101 |
$popupContent .= $this->showReviewBlockJs();
|
@@ -105,7 +106,7 @@ class YcdShowReviewNotice {
|
|
105 |
|
106 |
private function getMaxOepnContent($firstHeader, $type) {
|
107 |
$ajaxNonce = wp_create_nonce('ycdReviewNotice');
|
108 |
-
|
109 |
ob_start();
|
110 |
?>
|
111 |
<style>
|
@@ -170,6 +171,11 @@ class YcdShowReviewNotice {
|
|
170 |
.welcome-panel.ycd-review-block {
|
171 |
padding-top: 0px;
|
172 |
margin-right: 20px;
|
|
|
|
|
|
|
|
|
|
|
173 |
}
|
174 |
.ycd-banner-close {
|
175 |
position: absolute;
|
@@ -184,7 +190,7 @@ class YcdShowReviewNotice {
|
|
184 |
<div class="ycd-review-wrapper">
|
185 |
<span class="ycd-banner-close ycd-already-did-review" data-ajaxnonce="<?php echo esc_attr($ajaxNonce); ?>" data-message-type="<?php echo esc_attr($type); ?>">X</span>
|
186 |
<div class="ycd-review-description">
|
187 |
-
<?php echo
|
188 |
<h2 class="ycd-review-h2">This is really great for your website score.</h2>
|
189 |
<p class="ycd-review-mt20">Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!</p>
|
190 |
</div>
|
@@ -208,7 +214,6 @@ class YcdShowReviewNotice {
|
|
208 |
jQuery('.ycd-already-did-review').each(function () {
|
209 |
jQuery(this).on('click', function () {
|
210 |
var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
|
211 |
-
|
212 |
var data = {
|
213 |
action: 'ycd_dont_show_review_notice',
|
214 |
ajaxNonce: ajaxNonce
|
@@ -245,7 +250,7 @@ class YcdShowReviewNotice {
|
|
245 |
}
|
246 |
|
247 |
public static function setInitialDates() {
|
248 |
-
$usageDays = get_option('YcdUsageDays');
|
249 |
if(!$usageDays) {
|
250 |
update_option('YcdUsageDays', 0);
|
251 |
|
28 |
// When period next time does not exits it means the user is old
|
29 |
if(!$periodNextTime) {
|
30 |
YcdShowReviewNotice::setInitialDates();
|
|
|
31 |
return !$shouldOpen;
|
32 |
}
|
33 |
$currentData = new DateTime('now');
|
39 |
|
40 |
private function getReviewContent($type) {
|
41 |
$content = $this->getMaxOpenDaysMessage($type);
|
42 |
+
$allowed_html = \ycd\AdminHelper::getAllowedTags();
|
43 |
ob_start();
|
44 |
?>
|
45 |
<div id="welcome-panel" class="welcome-panel ycd-review-block">
|
46 |
<div class="welcome-panel-content">
|
47 |
+
<?php echo wp_kses($content, $allowed_html); ?>
|
48 |
</div>
|
49 |
</div>
|
50 |
<?php
|
93 |
}
|
94 |
|
95 |
private function getMaxOpenDaysMessage($type) {
|
96 |
+
$allowedTags = \ycd\AdminHelper::getAllowedTags();
|
97 |
$getUsageDays = $this->getPopupUsageDays();
|
98 |
$userName = $this->getCurrentUserDisplayName();
|
99 |
+
$firstHeader = '<h1 class="ycd-review-h1"><strong class="ycd-review-strong">Wow! '.esc_attr($userName).'</strong> You’ve been using <a href="https://wordpress.org/plugins/countdown-builder/" target="_blank">Countdown</a> on your site for '.wp_kses($getUsageDays, $allowedTags).' days</h1>';
|
100 |
$popupContent = $this->getMaxOepnContent($firstHeader, $type);
|
101 |
|
102 |
$popupContent .= $this->showReviewBlockJs();
|
106 |
|
107 |
private function getMaxOepnContent($firstHeader, $type) {
|
108 |
$ajaxNonce = wp_create_nonce('ycdReviewNotice');
|
109 |
+
$allowedTags = \ycd\AdminHelper::getAllowedTags();
|
110 |
ob_start();
|
111 |
?>
|
112 |
<style>
|
171 |
.welcome-panel.ycd-review-block {
|
172 |
padding-top: 0px;
|
173 |
margin-right: 20px;
|
174 |
+
height: auto !important;
|
175 |
+
min-height: inherit !important;
|
176 |
+
}
|
177 |
+
.ycd-review-block .welcome-panel-content {
|
178 |
+
min-height: auto !important;
|
179 |
}
|
180 |
.ycd-banner-close {
|
181 |
position: absolute;
|
190 |
<div class="ycd-review-wrapper">
|
191 |
<span class="ycd-banner-close ycd-already-did-review" data-ajaxnonce="<?php echo esc_attr($ajaxNonce); ?>" data-message-type="<?php echo esc_attr($type); ?>">X</span>
|
192 |
<div class="ycd-review-description">
|
193 |
+
<?php echo wp_kses($firstHeader, $allowedTags); ?>
|
194 |
<h2 class="ycd-review-h2">This is really great for your website score.</h2>
|
195 |
<p class="ycd-review-mt20">Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!</p>
|
196 |
</div>
|
214 |
jQuery('.ycd-already-did-review').each(function () {
|
215 |
jQuery(this).on('click', function () {
|
216 |
var ajaxNonce = jQuery(this).attr('data-ajaxnonce');
|
|
|
217 |
var data = {
|
218 |
action: 'ycd_dont_show_review_notice',
|
219 |
ajaxNonce: ajaxNonce
|
250 |
}
|
251 |
|
252 |
public static function setInitialDates() {
|
253 |
+
$usageDays = (int)get_option('YcdUsageDays');
|
254 |
if(!$usageDays) {
|
255 |
update_option('YcdUsageDays', 0);
|
256 |
|
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: 6.0.
|
6 |
-
Stable tag: 2.4.
|
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,18 @@ 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.2 =
|
71 |
* Sticky Countdown Double Digits option
|
72 |
|
2 |
Contributors: adamskaat
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 6.0.2
|
6 |
+
Stable tag: 2.4.5
|
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.5 =
|
71 |
+
* Added Display Rules new section
|
72 |
+
* Added possibility to from settings include (Timer Countdown, Clock 1, Clock 2, Clock 3, Clock 4, Clock 5, Clock 6, Clock 7) types
|
73 |
+
* Added New feature suggestion request section
|
74 |
+
* Fixed some warnings
|
75 |
+
|
76 |
+
= 2.4.4 =
|
77 |
+
* Countdown Admin panel fixes
|
78 |
+
|
79 |
+
= 2.4.3 =
|
80 |
+
* Added possibility to translate the circle countdown texts related to browser language.
|
81 |
+
|
82 |
= 2.4.2 =
|
83 |
* Sticky Countdown Double Digits option
|
84 |
|