Version Description
- Fixed Countdown translation warnings
- Improved Display Rules section
- Added page type Home, Posts, Search, 404, Archive
Download this release
Release Info
Developer | adamskaat |
Plugin | Countdown, Coming Soon – Countdown & Clock |
Version | 2.4.7 |
Comparing to | |
See all releases |
Code changes from version 2.4.6 to 2.4.7
- assets/views/main/simpleMainView.php +2 -2
- classes/ConditionBuilder.php +2 -1
- classes/DisplayRuleChecker.php +37 -5
- classes/IncludeManager.php +2 -1
- classes/countdown/CircleCountdown.php +1 -0
- classes/translation/AbstractTranslationManager.php +2 -2
- config/config.php +62 -11
- countdown-builder.php +1 -1
- helpers/AdminHelper.php +29 -2
- readme.txt +7 -2
assets/views/main/simpleMainView.php
CHANGED
@@ -204,7 +204,7 @@ $allowed_html = AdminHelper::getAllowedTags();
|
|
204 |
</div>
|
205 |
<div class="row form-group">
|
206 |
<div class="col-md-6">
|
207 |
-
<label for="ycd-simple-numbers-font-family" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN);?></label>
|
208 |
</div>
|
209 |
<div class="col-md-6 ycd-option-wrapper<?php echo esc_attr($isPro); ?>">
|
210 |
<?php
|
@@ -225,7 +225,7 @@ $allowed_html = AdminHelper::getAllowedTags();
|
|
225 |
</div>
|
226 |
<div class="row form-group">
|
227 |
<div class="col-md-6">
|
228 |
-
<label for="ycd-simple-numbers-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); ?></label>
|
229 |
</div>
|
230 |
<div class="col-md-6 ycd-option-wrapper<?php echo esc_attr($isPro); ?>">
|
231 |
<div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
|
204 |
</div>
|
205 |
<div class="row form-group">
|
206 |
<div class="col-md-6">
|
207 |
+
<label for="ycd-simple-numbers-font-family" class="ycd-label-of-select"><?php _e('font family', YCD_TEXT_DOMAIN); echo wp_kses($proSpan, $allowed_html);?></label>
|
208 |
</div>
|
209 |
<div class="col-md-6 ycd-option-wrapper<?php echo esc_attr($isPro); ?>">
|
210 |
<?php
|
225 |
</div>
|
226 |
<div class="row form-group">
|
227 |
<div class="col-md-6">
|
228 |
+
<label for="ycd-simple-numbers-color" class=""><?php _e('color', YCD_TEXT_DOMAIN); echo wp_kses($proSpan, $allowed_html); ?></label>
|
229 |
</div>
|
230 |
<div class="col-md-6 ycd-option-wrapper<?php echo esc_attr($isPro); ?>">
|
231 |
<div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
|
classes/ConditionBuilder.php
CHANGED
@@ -172,8 +172,9 @@ class ConditionBuilder {
|
|
172 |
$savedValue = array();
|
173 |
}
|
174 |
}
|
175 |
-
|
176 |
$fieldHtml .= AdminHelper::selectBox($currentData, $savedValue, $fieldAttributes);
|
|
|
177 |
}
|
178 |
$fieldHtml .= '</div>';
|
179 |
|
172 |
$savedValue = array();
|
173 |
}
|
174 |
}
|
175 |
+
|
176 |
$fieldHtml .= AdminHelper::selectBox($currentData, $savedValue, $fieldAttributes);
|
177 |
+
|
178 |
}
|
179 |
$fieldHtml .= '</div>';
|
180 |
|
classes/DisplayRuleChecker.php
CHANGED
@@ -52,17 +52,49 @@ class DisplayRuleChecker {
|
|
52 |
private function checkSetting($setting) {
|
53 |
global $post;
|
54 |
$post_type = get_post_type($post->ID);
|
|
|
|
|
|
|
55 |
|
56 |
-
if('selected_'.esc_attr($post_type) == $
|
57 |
|
58 |
-
if(in_array($post->ID, array_keys($
|
59 |
-
return ($
|
60 |
}
|
61 |
return '';
|
62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
if('all_'.esc_attr($post_type) == $
|
65 |
-
return ($
|
66 |
}
|
67 |
|
68 |
return '';
|
52 |
private function checkSetting($setting) {
|
53 |
global $post;
|
54 |
$post_type = get_post_type($post->ID);
|
55 |
+
$key1 = $setting['key1'];
|
56 |
+
$key2 = @$setting['key2'];
|
57 |
+
$key3 = @$setting['key3'];
|
58 |
|
59 |
+
if('selected_'.esc_attr($post_type) == $key1) {
|
60 |
|
61 |
+
if(in_array($post->ID, array_keys($key3))) {
|
62 |
+
return ($key2.'1');
|
63 |
}
|
64 |
return '';
|
65 |
}
|
66 |
+
elseif ($key1 === "type_page") {
|
67 |
+
$pageTypes = $key3;
|
68 |
+
foreach ($pageTypes as $pageType) {
|
69 |
+
|
70 |
+
if ($pageType == 'is_home_page') {
|
71 |
+
if (is_front_page() && is_home()) {
|
72 |
+
// default homepage
|
73 |
+
return ($key2.'1');
|
74 |
+
}
|
75 |
+
else if (is_front_page()) {
|
76 |
+
// static homepage
|
77 |
+
return ($key2.'1');
|
78 |
+
}
|
79 |
+
}
|
80 |
+
else if (function_exists($pageType)) {
|
81 |
+
if ($pageType == 'is_home') {
|
82 |
+
return ($key2.'1');
|
83 |
+
}
|
84 |
+
else if ($pageType == 'is_search') {
|
85 |
+
return ($key2.'1');
|
86 |
+
}
|
87 |
+
else if ($pageType == 'is_shop') {
|
88 |
+
return ($key2.'1');
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
return '';
|
93 |
+
}
|
94 |
+
}
|
95 |
|
96 |
+
if('all_'.esc_attr($post_type) == $key1) {
|
97 |
+
return ($key2.'1');
|
98 |
}
|
99 |
|
100 |
return '';
|
classes/IncludeManager.php
CHANGED
@@ -59,7 +59,7 @@ class IncludeManager {
|
|
59 |
if(empty($countdowns)) {
|
60 |
return false;
|
61 |
}
|
62 |
-
|
63 |
foreach($countdowns as $countdown) {
|
64 |
$this->includeCountdown($countdown);
|
65 |
}
|
@@ -72,6 +72,7 @@ class IncludeManager {
|
|
72 |
|
73 |
add_action('wp_head',function() use ($content) {
|
74 |
$allowed_html = AdminHelper::getAllowedTags();
|
|
|
75 |
echo wp_kses($content, $allowed_html);
|
76 |
});
|
77 |
}
|
59 |
if(empty($countdowns)) {
|
60 |
return false;
|
61 |
}
|
62 |
+
|
63 |
foreach($countdowns as $countdown) {
|
64 |
$this->includeCountdown($countdown);
|
65 |
}
|
72 |
|
73 |
add_action('wp_head',function() use ($content) {
|
74 |
$allowed_html = AdminHelper::getAllowedTags();
|
75 |
+
|
76 |
echo wp_kses($content, $allowed_html);
|
77 |
});
|
78 |
}
|
classes/countdown/CircleCountdown.php
CHANGED
@@ -172,6 +172,7 @@ class CircleCountdown extends Countdown {
|
|
172 |
}
|
173 |
|
174 |
public function addToContent() {
|
|
|
175 |
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
176 |
}
|
177 |
|
172 |
}
|
173 |
|
174 |
public function addToContent() {
|
175 |
+
|
176 |
add_filter('the_content', array($this, 'getTheContentFilter'),99999999, 1);
|
177 |
}
|
178 |
|
classes/translation/AbstractTranslationManager.php
CHANGED
@@ -53,7 +53,7 @@ abstract class AbstractTranslationManager {
|
|
53 |
<label><?php _e('Language', YCD_TEXT_DOMAIN)?></label>
|
54 |
</div>
|
55 |
<div>
|
56 |
-
<?php echo AdminHelper::selectBox($language, esc_attr(
|
57 |
</div>
|
58 |
</div>
|
59 |
</div>
|
@@ -61,7 +61,7 @@ abstract class AbstractTranslationManager {
|
|
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(
|
65 |
</div>
|
66 |
<?php endforeach; ?>
|
67 |
</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>
|
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>
|
config/config.php
CHANGED
@@ -76,8 +76,8 @@ class YcdCountdownConfig
|
|
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.
|
80 |
-
self::addDefine('YCD_VERSION', 2.
|
81 |
self::addDefine('YCD_FREE_VERSION', 1);
|
82 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
83 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
@@ -85,13 +85,13 @@ class YcdCountdownConfig
|
|
85 |
self::addDefine('YCD_EXTENSION_VERSION', 99);
|
86 |
require_once(dirname(__FILE__).'/config-pkg.php');
|
87 |
|
88 |
-
$versionText = '2.4.
|
89 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
90 |
-
$versionText = '2.2.
|
91 |
}
|
92 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
93 |
-
self::addDefine('YCD_LAST_UPDATE', '
|
94 |
-
self::addDefine('YCD_NEXT_UPDATE', 'Nov
|
95 |
}
|
96 |
|
97 |
public static function displaySettings()
|
@@ -100,10 +100,15 @@ class YcdCountdownConfig
|
|
100 |
$keys = array(
|
101 |
'select_settings' => 'Select settings',
|
102 |
'everywhere' => 'Everywhere',
|
103 |
-
'
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
107 |
);
|
108 |
|
109 |
$keys = apply_filters('ycdConditionsDisplayKeys', $keys);
|
@@ -114,7 +119,8 @@ class YcdCountdownConfig
|
|
114 |
'selected_post' => array(),
|
115 |
'all_post' => array(),
|
116 |
'selected_page' => array(),
|
117 |
-
'
|
|
|
118 |
'everywhere' => array()
|
119 |
);
|
120 |
|
@@ -157,6 +163,16 @@ class YcdCountdownConfig
|
|
157 |
'value' => ''
|
158 |
)
|
159 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
);
|
161 |
|
162 |
$values = apply_filters('ycdConditionsDisplayValues', $values);
|
@@ -221,6 +237,41 @@ class YcdCountdownConfig
|
|
221 |
|
222 |
return apply_filters('ycdExtensionsInfo', $extensions);
|
223 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
|
226 |
YcdCountdownConfig::init();
|
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.28);
|
80 |
+
self::addDefine('YCD_VERSION', 2.47);
|
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.7';
|
89 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
90 |
+
$versionText = '2.2.8';
|
91 |
}
|
92 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
93 |
+
self::addDefine('YCD_LAST_UPDATE', 'Nov 12');
|
94 |
+
self::addDefine('YCD_NEXT_UPDATE', 'Nov 20');
|
95 |
}
|
96 |
|
97 |
public static function displaySettings()
|
100 |
$keys = array(
|
101 |
'select_settings' => 'Select settings',
|
102 |
'everywhere' => 'Everywhere',
|
103 |
+
'Post' => array(
|
104 |
+
'selected_post' => 'Select posts',
|
105 |
+
'all_post' => 'All posts',
|
106 |
+
),
|
107 |
+
'Page' => array(
|
108 |
+
'selected_page' => 'Select pages',
|
109 |
+
'all_page' => 'All pages',
|
110 |
+
'type_page' => 'Page type'
|
111 |
+
)
|
112 |
);
|
113 |
|
114 |
$keys = apply_filters('ycdConditionsDisplayKeys', $keys);
|
119 |
'selected_post' => array(),
|
120 |
'all_post' => array(),
|
121 |
'selected_page' => array(),
|
122 |
+
'type_page' => self::getPageTypes(),
|
123 |
+
'page_type' => array(),
|
124 |
'everywhere' => array()
|
125 |
);
|
126 |
|
163 |
'value' => ''
|
164 |
)
|
165 |
),
|
166 |
+
'type_page' => array(
|
167 |
+
'label' => __('Select specific page types'),
|
168 |
+
'fieldType' => 'select',
|
169 |
+
'fieldAttributes' => array(
|
170 |
+
'data-post-type' => 'page',
|
171 |
+
'multiple' => 'multiple',
|
172 |
+
'class' => 'ycd-condition-select js-ycd-select',
|
173 |
+
'value' => ''
|
174 |
+
)
|
175 |
+
),
|
176 |
);
|
177 |
|
178 |
$values = apply_filters('ycdConditionsDisplayValues', $values);
|
237 |
|
238 |
return apply_filters('ycdExtensionsInfo', $extensions);
|
239 |
}
|
240 |
+
|
241 |
+
public static function getPageTypes()
|
242 |
+
{
|
243 |
+
$postTypes = array();
|
244 |
+
|
245 |
+
$postTypes['is_home_page'] = __('Home Page', YCD_TEXT_DOMAIN);
|
246 |
+
$postTypes['is_home'] = __('Posts Page', YCD_TEXT_DOMAIN);
|
247 |
+
$postTypes['is_search'] = __('Search Pages', YCD_TEXT_DOMAIN);
|
248 |
+
$postTypes['is_404'] = __('404 Pages', YCD_TEXT_DOMAIN);
|
249 |
+
if (function_exists('is_shop')) {
|
250 |
+
$postTypes['is_shop'] = __('Shop Page', YCD_TEXT_DOMAIN);
|
251 |
+
}
|
252 |
+
if (function_exists('is_archive')) {
|
253 |
+
$postTypes['is_archive'] = __('Archive Page', YCD_TEXT_DOMAIN);
|
254 |
+
}
|
255 |
+
|
256 |
+
return $postTypes;
|
257 |
+
}
|
258 |
+
|
259 |
+
public static function getPageTemplates() {
|
260 |
+
$pageTemplates = array(
|
261 |
+
'page.php' => __('Default Template', YCD_TEXT_DOMAIN)
|
262 |
+
);
|
263 |
+
|
264 |
+
$templates = wp_get_theme()->get_page_templates();
|
265 |
+
if (empty($templates)) {
|
266 |
+
return $pageTemplates;
|
267 |
+
}
|
268 |
+
|
269 |
+
foreach ($templates as $key => $value) {
|
270 |
+
$pageTemplates[$key] = $value;
|
271 |
+
}
|
272 |
+
|
273 |
+
return $pageTemplates;
|
274 |
+
}
|
275 |
}
|
276 |
|
277 |
YcdCountdownConfig::init();
|
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.7
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
helpers/AdminHelper.php
CHANGED
@@ -863,7 +863,30 @@ class AdminHelper {
|
|
863 |
$selected = 'selected';
|
864 |
}
|
865 |
|
866 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
867 |
$selected = '';
|
868 |
}
|
869 |
|
@@ -1527,8 +1550,12 @@ class AdminHelper {
|
|
1527 |
'style' => array(),
|
1528 |
'multiple' => array(),
|
1529 |
'data-select-type' => array(),
|
1530 |
-
'data-id' => array()
|
|
|
1531 |
),
|
|
|
|
|
|
|
1532 |
'option' => array(
|
1533 |
'value' => array(),
|
1534 |
'selected' => array()
|
863 |
$selected = 'selected';
|
864 |
}
|
865 |
|
866 |
+
if (is_array($label)) {
|
867 |
+
$selectBox .= '<optgroup label="'.esc_attr($value).'">';
|
868 |
+
foreach ($label as $key => $optionLabel) {
|
869 |
+
$selected = '';
|
870 |
+
if (is_array($selectedValue)) {
|
871 |
+
$isSelected = in_array($key, $selectedValue);
|
872 |
+
if ($isSelected) {
|
873 |
+
$selected = 'selected';
|
874 |
+
}
|
875 |
+
}
|
876 |
+
else if ($selectedValue == $key) {
|
877 |
+
$selected = 'selected';
|
878 |
+
}
|
879 |
+
else if (is_array($key) && in_array($selectedValue, $key)) {
|
880 |
+
$selected = 'selected';
|
881 |
+
}
|
882 |
+
|
883 |
+
$selectBox .= '<option value="'.esc_attr($key).'" '.esc_attr($selected).'>'.esc_attr($optionLabel).'</option>';
|
884 |
+
}
|
885 |
+
$selectBox .= '</optgroup>';
|
886 |
+
}
|
887 |
+
else {
|
888 |
+
$selectBox .= '<option value="'.esc_attr($value).'" '.esc_attr($selected).'>'.esc_attr($label).'</option>';
|
889 |
+
}
|
890 |
$selected = '';
|
891 |
}
|
892 |
|
1550 |
'style' => array(),
|
1551 |
'multiple' => array(),
|
1552 |
'data-select-type' => array(),
|
1553 |
+
'data-id' => array(),
|
1554 |
+
'optgroup' => array('label')
|
1555 |
),
|
1556 |
+
'optgroup' => array(
|
1557 |
+
'label' => array()
|
1558 |
+
),
|
1559 |
'option' => array(
|
1560 |
'value' => array(),
|
1561 |
'selected' => array()
|
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.
|
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,11 @@ 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.6 =
|
71 |
* Fixed coming soon mode option
|
72 |
* Fixed coming soon page render html tags issue
|
2 |
Contributors: adamskaat
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
+
Tested up to: 6.1
|
6 |
+
Stable tag: 2.4.7
|
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.7 =
|
71 |
+
* Fixed Countdown translation warnings
|
72 |
+
* Improved Display Rules section
|
73 |
+
* Added page type Home, Posts, Search, 404, Archive
|
74 |
+
|
75 |
= 2.4.6 =
|
76 |
* Fixed coming soon mode option
|
77 |
* Fixed coming soon page render html tags issue
|