Version Description
Download this release
Release Info
| Developer | adamskaat |
| Plugin | |
| Version | 2.3.9.7 |
| Comparing to | |
| See all releases | |
Code changes from version 2.3.9.6 to 2.3.9.7
- assets/views/generalOptions.php +9 -3
- assets/views/preview/circlePreview.php +4 -1
- assets/views/preview/timerPreview.php +4 -1
- assets/views/types.php +6 -5
- classes/countdown/SimpleCountdown.php +7 -5
- countdown-builder.php +1 -1
- helpers/AdminHelper.php +43 -0
- helpers/MultipleChoiceButton.php +14 -8
- readme.txt +1 -1
assets/views/generalOptions.php
CHANGED
|
@@ -21,6 +21,8 @@ if (class_exists('ycd\AdminHelperPro')) {
|
|
| 21 |
<div class="ycd-multichoice-wrapper">
|
| 22 |
<?php
|
| 23 |
$multipleChoiceButton = new MultipleChoiceButton($defaultData['countdown-date-type'], esc_attr($this->getOptionValue('ycd-countdown-date-type')));
|
|
|
|
|
|
|
| 24 |
?>
|
| 25 |
</div>
|
| 26 |
<div id="ycd-date-wooCoupon" class="ycd-countdown-show-text ycd-hide">
|
|
@@ -30,7 +32,10 @@ if (class_exists('ycd\AdminHelperPro')) {
|
|
| 30 |
</div>
|
| 31 |
<div class="col-md-6">
|
| 32 |
<div class="ycd-select-wrapper">
|
| 33 |
-
<?php
|
|
|
|
|
|
|
|
|
|
| 34 |
</div>
|
| 35 |
</div>
|
| 36 |
</div>
|
|
@@ -73,7 +78,8 @@ if (class_exists('ycd\AdminHelperPro')) {
|
|
| 73 |
</div>
|
| 74 |
<div class="col-md-6">
|
| 75 |
<div class="ycd-select-wrapper">
|
| 76 |
-
<?php AdminHelper::selectBox($defaultData['time-zone'], esc_attr($this->getOptionValue('ycd-circle-time-zone')), array('name' => 'ycd-circle-time-zone', 'class' => 'js-ycd-select js-circle-time-zone'));
|
|
|
|
| 77 |
</div>
|
| 78 |
</div>
|
| 79 |
</div>
|
|
@@ -155,7 +161,7 @@ if (class_exists('ycd\AdminHelperPro')) {
|
|
| 155 |
</div>
|
| 156 |
<div class="col-md-6">
|
| 157 |
<div class="ycd-select-wrapper">
|
| 158 |
-
<?php
|
| 159 |
</div>
|
| 160 |
</div>
|
| 161 |
</div>
|
| 21 |
<div class="ycd-multichoice-wrapper">
|
| 22 |
<?php
|
| 23 |
$multipleChoiceButton = new MultipleChoiceButton($defaultData['countdown-date-type'], esc_attr($this->getOptionValue('ycd-countdown-date-type')));
|
| 24 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 25 |
+
echo wp_kses($multipleChoiceButton, $allowed_html);
|
| 26 |
?>
|
| 27 |
</div>
|
| 28 |
<div id="ycd-date-wooCoupon" class="ycd-countdown-show-text ycd-hide">
|
| 32 |
</div>
|
| 33 |
<div class="col-md-6">
|
| 34 |
<div class="ycd-select-wrapper">
|
| 35 |
+
<?php
|
| 36 |
+
$timeZoneSelectBox = AdminHelper::selectBox($defaultData['time-zone'], esc_attr($this->getOptionValue('ycd-woo-time-zone')), array('name' => 'ycd-woo-time-zone', 'class' => 'js-ycd-select js-ycd-woo-time-zone'));
|
| 37 |
+
echo wp_kses($timeZoneSelectBox, $allowed_html);
|
| 38 |
+
?>
|
| 39 |
</div>
|
| 40 |
</div>
|
| 41 |
</div>
|
| 78 |
</div>
|
| 79 |
<div class="col-md-6">
|
| 80 |
<div class="ycd-select-wrapper">
|
| 81 |
+
<?php AdminHelper::selectBox($defaultData['time-zone'], esc_attr($this->getOptionValue('ycd-circle-time-zone')), array('name' => 'ycd-circle-time-zone', 'class' => 'js-ycd-select js-circle-time-zone'));
|
| 82 |
+
?>
|
| 83 |
</div>
|
| 84 |
</div>
|
| 85 |
</div>
|
| 161 |
</div>
|
| 162 |
<div class="col-md-6">
|
| 163 |
<div class="ycd-select-wrapper">
|
| 164 |
+
<?php AdminHelper::selectBox($defaultData['time-zone'], esc_attr($this->getOptionValue('ycd-schedule-time-zone')), array('name' => 'ycd-schedule-time-zone', 'class' => 'js-ycd-select js-ycd-schedule-time-zone')); ?>
|
| 165 |
</div>
|
| 166 |
</div>
|
| 167 |
</div>
|
assets/views/preview/circlePreview.php
CHANGED
|
@@ -1,3 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
?>
|
| 1 |
<?php
|
| 2 |
+
use ycd\AdminHelper;
|
| 3 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 4 |
+
$constnet = $typeObj->getViewContent();
|
| 5 |
+
echo __($constnet);
|
| 6 |
?>
|
assets/views/preview/timerPreview.php
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
|
|
|
|
|
|
|
|
| 1 |
<?php
|
| 2 |
+
use ycd\AdminHelper;
|
| 3 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 4 |
+
$constnet = $typeObj->getViewContent();
|
| 5 |
+
echo wp_kses($constnet, $allowed_html);
|
assets/views/types.php
CHANGED
|
@@ -5,12 +5,13 @@ use ycd\TypesNavBar;
|
|
| 5 |
$types = Countdown::getCountdownTypes();
|
| 6 |
$currentExtensions = YcdCountdownConfig::extensions();
|
| 7 |
$extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions);
|
|
|
|
| 8 |
?>
|
| 9 |
|
| 10 |
<div>
|
| 11 |
<h3 class="ycd-page-h3"><?php _e('Add New Countdown', YCD_TEXT_DOMAIN); ?></h3>
|
| 12 |
</div>
|
| 13 |
-
<?php TypesNavBar::render(); ?>
|
| 14 |
|
| 15 |
<div class="ycd-bootstrap-wrapper ycd-types-wrapper">
|
| 16 |
<div class="row ycd-mb-20">
|
|
@@ -21,12 +22,12 @@ $extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions
|
|
| 21 |
<?php if(!$type->isVisible()): ?>
|
| 22 |
<?php continue; ?>
|
| 23 |
<?php endif; ?>
|
| 24 |
-
<a class="create-countdown-link" <?php AdminHelper::buildCreateCountdownAttrs($type); ?> href="<?php AdminHelper::buildCreateCountdownUrl($type); ?>">
|
| 25 |
<div class="countdowns-div">
|
| 26 |
-
<div class="ycd-type-div <?php AdminHelper::getCountdownThumbClass($type); ?>"></div>
|
| 27 |
-
<?php AdminHelper::getCountdownThumbText($type); ?>
|
| 28 |
<div class="ycd-type-view-footer">
|
| 29 |
-
<span class="ycd-promotion-video"><?php
|
| 30 |
<?php
|
| 31 |
$videoUrl = AdminHelper::getCountdownYoutubeUrl($type);
|
| 32 |
if(!$type->isAvailable() && !empty($videoUrl)): ?>
|
| 5 |
$types = Countdown::getCountdownTypes();
|
| 6 |
$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>
|
| 14 |
+
<?php echo wp_kses(TypesNavBar::render(), $allowed_html); ?>
|
| 15 |
|
| 16 |
<div class="ycd-bootstrap-wrapper ycd-types-wrapper">
|
| 17 |
<div class="row ycd-mb-20">
|
| 22 |
<?php if(!$type->isVisible()): ?>
|
| 23 |
<?php continue; ?>
|
| 24 |
<?php endif; ?>
|
| 25 |
+
<a class="create-countdown-link" <?php echo wp_kses(AdminHelper::buildCreateCountdownAttrs($type), $allowed_html); ?> href="<?php echo esc_attr(AdminHelper::buildCreateCountdownUrl($type)); ?>">
|
| 26 |
<div class="countdowns-div">
|
| 27 |
+
<div class="ycd-type-div <?php echo wp_kses(AdminHelper::getCountdownThumbClass($type), $allowed_html); ?>"></div>
|
| 28 |
+
<?php echo wp_kses(AdminHelper::getCountdownThumbText($type), $allowed_html); ?>
|
| 29 |
<div class="ycd-type-view-footer">
|
| 30 |
+
<span class="ycd-promotion-video"><?php echo wp_kses(AdminHelper::getCountdownDisplayName($type), $allowed_html); ?></span>
|
| 31 |
<?php
|
| 32 |
$videoUrl = AdminHelper::getCountdownYoutubeUrl($type);
|
| 33 |
if(!$type->isAvailable() && !empty($videoUrl)): ?>
|
classes/countdown/SimpleCountdown.php
CHANGED
|
@@ -120,6 +120,7 @@ class SimpleCountdown extends Countdown
|
|
| 120 |
$availableUnites = array_filter($unites, function($unite) {
|
| 121 |
return $this->getOptionValue('ycd-simple-enable-'.esc_attr($unite));
|
| 122 |
});
|
|
|
|
| 123 |
$textToTop = $this->getOptionValue('ycd-text-to-top');
|
| 124 |
$this->renderScripts();
|
| 125 |
$lastUnite = end($availableUnites);
|
|
@@ -141,9 +142,9 @@ class SimpleCountdown extends Countdown
|
|
| 141 |
?>
|
| 142 |
<div class="ycd-simple-current-unite-wrapper ycd-simple-current-unite-<?php echo esc_attr($unite); ?> <?php echo esc_attr($hideUnite)?>">
|
| 143 |
<div class="ycd-simple-current-unite"><!-- -->
|
| 144 |
-
<?php ($textToTop ? $this->timeUnitText($unite): ''); ?>
|
| 145 |
-
<?php $this->timeUnitNumber($unite); ?><!--
|
| 146 |
-
--><?php (
|
| 147 |
</div>
|
| 148 |
<?php if ($unite != 'seconds'): ?>
|
| 149 |
<div class="ycd-simple-timer-dots <?php echo esc_attr($hideDotsClassName); ?>">:</div>
|
|
@@ -206,11 +207,12 @@ class SimpleCountdown extends Countdown
|
|
| 206 |
$id = $this->getId();
|
| 207 |
$options = $this->getAllOptions();
|
| 208 |
$options = json_encode($options);
|
|
|
|
| 209 |
ob_start();
|
| 210 |
?>
|
| 211 |
<div class="ycd-countdown-wrapper ycd-simple-content-wrapper ycd-simple-content-wrapper-<?php echo esc_attr($id); ?>">
|
| 212 |
-
<div class="ycd-simple-time ycd-simple-container ycd-simple-wrapper-<?php echo esc_attr($id); ?>" data-options='<?php echo
|
| 213 |
-
<?php echo
|
| 214 |
</div>
|
| 215 |
</div>
|
| 216 |
<?php
|
| 120 |
$availableUnites = array_filter($unites, function($unite) {
|
| 121 |
return $this->getOptionValue('ycd-simple-enable-'.esc_attr($unite));
|
| 122 |
});
|
| 123 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 124 |
$textToTop = $this->getOptionValue('ycd-text-to-top');
|
| 125 |
$this->renderScripts();
|
| 126 |
$lastUnite = end($availableUnites);
|
| 142 |
?>
|
| 143 |
<div class="ycd-simple-current-unite-wrapper ycd-simple-current-unite-<?php echo esc_attr($unite); ?> <?php echo esc_attr($hideUnite)?>">
|
| 144 |
<div class="ycd-simple-current-unite"><!-- -->
|
| 145 |
+
<?php echo (esc_attr($textToTop) ? wp_kses($this->timeUnitText($unite), $allowed_html): ''); ?>
|
| 146 |
+
<?php echo wp_kses($this->timeUnitNumber($unite), $allowed_html); ?><!--
|
| 147 |
+
--><?php echo (!esc_attr($textToTop) ? wp_kses($this->timeUnitText($unite), $allowed_html): ''); ?>
|
| 148 |
</div>
|
| 149 |
<?php if ($unite != 'seconds'): ?>
|
| 150 |
<div class="ycd-simple-timer-dots <?php echo esc_attr($hideDotsClassName); ?>">:</div>
|
| 207 |
$id = $this->getId();
|
| 208 |
$options = $this->getAllOptions();
|
| 209 |
$options = json_encode($options);
|
| 210 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 211 |
ob_start();
|
| 212 |
?>
|
| 213 |
<div class="ycd-countdown-wrapper ycd-simple-content-wrapper ycd-simple-content-wrapper-<?php echo esc_attr($id); ?>">
|
| 214 |
+
<div class="ycd-simple-time ycd-simple-container ycd-simple-wrapper-<?php echo esc_attr($id); ?>" data-options='<?php echo wp_kses($options, $allowed_html); ?>' data-id="<?php echo esc_attr($id); ?>">
|
| 215 |
+
<?php echo wp_kses($this->render(), $allowed_html); ?>
|
| 216 |
</div>
|
| 217 |
</div>
|
| 218 |
<?php
|
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.3.9.
|
| 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.3.9.7
|
| 6 |
* Author: Adam Skaat
|
| 7 |
* Author URI: https://edmonsoft.com/countdown
|
| 8 |
* License: GPLv2
|
helpers/AdminHelper.php
CHANGED
|
@@ -1474,4 +1474,47 @@ class AdminHelper {
|
|
| 1474 |
public static function getCreateCountdownUrl() {
|
| 1475 |
return (YCD_COUNTDOWN_ADMIN_URL.'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_POST_TYPE);
|
| 1476 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1477 |
}
|
| 1474 |
public static function getCreateCountdownUrl() {
|
| 1475 |
return (YCD_COUNTDOWN_ADMIN_URL.'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_POST_TYPE);
|
| 1476 |
}
|
| 1477 |
+
|
| 1478 |
+
public static function getAllowedTags() {
|
| 1479 |
+
$allowed_html = array(
|
| 1480 |
+
'div' => array(
|
| 1481 |
+
'type' => array(),
|
| 1482 |
+
'id' => array(),
|
| 1483 |
+
'name' => array(),
|
| 1484 |
+
'value' => array(),
|
| 1485 |
+
'class' => array(),
|
| 1486 |
+
'data-options' => array(),
|
| 1487 |
+
'data-id' => array()
|
| 1488 |
+
),
|
| 1489 |
+
'input' => array(
|
| 1490 |
+
'type' => array(),
|
| 1491 |
+
'id' => array(),
|
| 1492 |
+
'name' => array(),
|
| 1493 |
+
'value' => array(),
|
| 1494 |
+
'class' => array(),
|
| 1495 |
+
'data-attr-href' => array(),
|
| 1496 |
+
"checked" => array()
|
| 1497 |
+
),
|
| 1498 |
+
'span' => array(
|
| 1499 |
+
'class' => array()
|
| 1500 |
+
),
|
| 1501 |
+
'label' => array(
|
| 1502 |
+
'id' => array(),
|
| 1503 |
+
'class' => array()
|
| 1504 |
+
),
|
| 1505 |
+
'select' => array(
|
| 1506 |
+
'option' => array('value', 'selected'),
|
| 1507 |
+
'name' => array(),
|
| 1508 |
+
'class' => array(),
|
| 1509 |
+
'js-circle-time-zone' => array()
|
| 1510 |
+
),
|
| 1511 |
+
'canvas' => array(
|
| 1512 |
+
'width' => array(),
|
| 1513 |
+
'height' => array()
|
| 1514 |
+
),
|
| 1515 |
+
"style" => array()
|
| 1516 |
+
);
|
| 1517 |
+
|
| 1518 |
+
return $allowed_html;
|
| 1519 |
+
}
|
| 1520 |
}
|
helpers/MultipleChoiceButton.php
CHANGED
|
@@ -18,6 +18,7 @@ class MultipleChoiceButton {
|
|
| 18 |
* @param $savedValue
|
| 19 |
*/
|
| 20 |
public function __construct($buttonsData, $savedValue) {
|
|
|
|
| 21 |
$this->setButtonsData($buttonsData);
|
| 22 |
$this->setSavedValue($savedValue);
|
| 23 |
$this->prepareBuild();
|
|
@@ -110,11 +111,14 @@ class MultipleChoiceButton {
|
|
| 110 |
}
|
| 111 |
|
| 112 |
public function render() {
|
|
|
|
|
|
|
|
|
|
| 113 |
$content = '';
|
| 114 |
ob_start();
|
| 115 |
?>
|
| 116 |
<div class="ycd-buttons-wrapper">
|
| 117 |
-
<?php echo
|
| 118 |
</div>
|
| 119 |
<?php
|
| 120 |
$content = ob_get_contents();
|
|
@@ -177,11 +181,12 @@ class MultipleChoiceButton {
|
|
| 177 |
}
|
| 178 |
|
| 179 |
if($savedValue == $value) {
|
| 180 |
-
$checked =
|
| 181 |
}
|
|
|
|
| 182 |
|
| 183 |
-
$label =
|
| 184 |
-
$label .= "<input id='".
|
| 185 |
$label .= '</div>';
|
| 186 |
|
| 187 |
return $label;
|
|
@@ -210,11 +215,12 @@ class MultipleChoiceButton {
|
|
| 210 |
if (!empty($labelData['name'])) {
|
| 211 |
$labelName = $labelData['name'];
|
| 212 |
}
|
|
|
|
| 213 |
|
| 214 |
-
$label =
|
| 215 |
-
$label .= "<label for='".esc_attr($value)."'>".
|
| 216 |
$label .= '</div>';
|
| 217 |
-
|
| 218 |
return $label;
|
| 219 |
}
|
| 220 |
|
|
@@ -235,7 +241,7 @@ class MultipleChoiceButton {
|
|
| 235 |
}
|
| 236 |
|
| 237 |
foreach ($attrs as $attrKey => $attrValue) {
|
| 238 |
-
$attrStr .=
|
| 239 |
}
|
| 240 |
|
| 241 |
return $attrStr;
|
| 18 |
* @param $savedValue
|
| 19 |
*/
|
| 20 |
public function __construct($buttonsData, $savedValue) {
|
| 21 |
+
|
| 22 |
$this->setButtonsData($buttonsData);
|
| 23 |
$this->setSavedValue($savedValue);
|
| 24 |
$this->prepareBuild();
|
| 111 |
}
|
| 112 |
|
| 113 |
public function render() {
|
| 114 |
+
|
| 115 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 116 |
+
|
| 117 |
$content = '';
|
| 118 |
ob_start();
|
| 119 |
?>
|
| 120 |
<div class="ycd-buttons-wrapper">
|
| 121 |
+
<?php echo wp_kses($this->renderFields(), $allowed_html);?>
|
| 122 |
</div>
|
| 123 |
<?php
|
| 124 |
$content = ob_get_contents();
|
| 181 |
}
|
| 182 |
|
| 183 |
if($savedValue == $value) {
|
| 184 |
+
$checked = "checked";
|
| 185 |
}
|
| 186 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 187 |
|
| 188 |
+
$label = '<div '.wp_kses($parentAttrsStr, $allowed_html).'>';
|
| 189 |
+
$label .= "<input id='".wp_kses($value, $allowed_html)."' ".wp_kses($inputAttrStr, $allowed_html)." ".esc_attr($checked)." >";
|
| 190 |
$label .= '</div>';
|
| 191 |
|
| 192 |
return $label;
|
| 215 |
if (!empty($labelData['name'])) {
|
| 216 |
$labelName = $labelData['name'];
|
| 217 |
}
|
| 218 |
+
$allowed_html = AdminHelper::getAllowedTags();
|
| 219 |
|
| 220 |
+
$label = '<div '.wp_kses($parentAttrsStr, $allowed_html).'>';
|
| 221 |
+
$label .= "<label for='".esc_attr($value)."'>".wp_kses($labelName, $allowed_html)."</label>";
|
| 222 |
$label .= '</div>';
|
| 223 |
+
|
| 224 |
return $label;
|
| 225 |
}
|
| 226 |
|
| 241 |
}
|
| 242 |
|
| 243 |
foreach ($attrs as $attrKey => $attrValue) {
|
| 244 |
+
$attrStr .= $attrKey.'="'.$attrValue.'" ';
|
| 245 |
}
|
| 246 |
|
| 247 |
return $attrStr;
|
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: 5.9.3
|
| 6 |
-
Stable tag: 2.3.9.
|
| 7 |
Requires PHP: 5.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 3 |
Tags: countdown, timer, countdown timer
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 5.9.3
|
| 6 |
+
Stable tag: 2.3.9.7
|
| 7 |
Requires PHP: 5.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
