Version Description
- Security improvement
- Fixed onclick Countdown popup issue
Download this release
Release Info
| Developer | adamskaat |
| Plugin | |
| Version | 2.2.9 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.8 to 2.2.9
- assets/js/Countdown.js +22 -9
- assets/js/Js.php +2 -2
- assets/views/admin/shortcodeMetabox.php +1 -1
- classes/RegisterPostType.php +2 -2
- config/config.php +6 -6
- countdown-builder.php +1 -1
- helpers/AdminHelper.php +2 -2
- readme.txt +5 -1
assets/js/Countdown.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
function YcdCountdown() {
|
| 2 |
-
this.init();
|
| 3 |
this.options = {};
|
| 4 |
this.allOptions = {};
|
|
|
|
|
|
|
| 5 |
}
|
| 6 |
|
| 7 |
-
YcdCountdown.prototype =
|
| 8 |
|
| 9 |
YcdCountdown.prototype.setOptions = function(options) {
|
| 10 |
this.options = options;
|
|
@@ -797,25 +798,37 @@ YcdCountdown.prototype.addTimeToClock = function(options, countDown) {
|
|
| 797 |
};
|
| 798 |
|
| 799 |
YcdCountdown.prototype.render = function(currentCountdown) {
|
| 800 |
-
var that = this;
|
| 801 |
var options = this.getOptions();
|
| 802 |
-
var allOptions = this.getAllOptions();
|
| 803 |
|
| 804 |
-
if (
|
| 805 |
-
|
| 806 |
}
|
| 807 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 808 |
function countdownComplete(unit, value, total){
|
| 809 |
|
| 810 |
if(total <= 0){
|
| 811 |
-
that.endBehavior(
|
| 812 |
}
|
| 813 |
}
|
| 814 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 815 |
jQuery(window).resize(function() {
|
| 816 |
countdown.rebuild();
|
| 817 |
});
|
| 818 |
-
}
|
| 819 |
|
| 820 |
YcdCountdown.prototype.endBehavior = function(countdown, options) {
|
| 821 |
|
| 1 |
function YcdCountdown() {
|
|
|
|
| 2 |
this.options = {};
|
| 3 |
this.allOptions = {};
|
| 4 |
+
this.init();
|
| 5 |
+
YcgGeneral.call(this);
|
| 6 |
}
|
| 7 |
|
| 8 |
+
YcdCountdown.prototype = Object.create(YcgGeneral.prototype);
|
| 9 |
|
| 10 |
YcdCountdown.prototype.setOptions = function(options) {
|
| 11 |
this.options = options;
|
| 798 |
};
|
| 799 |
|
| 800 |
YcdCountdown.prototype.render = function(currentCountdown) {
|
|
|
|
| 801 |
var options = this.getOptions();
|
|
|
|
| 802 |
|
| 803 |
+
if (options['fromPopup'] === true) {
|
| 804 |
+
return;
|
| 805 |
}
|
| 806 |
+
|
| 807 |
+
this.runCountdown(currentCountdown)
|
| 808 |
+
};
|
| 809 |
+
|
| 810 |
+
YcdCountdown.prototype.runCountdown = function (currentCountdown) {
|
| 811 |
+
var options = this.getOptions();
|
| 812 |
+
var allOptions = this.getAllOptions();
|
| 813 |
+
|
| 814 |
function countdownComplete(unit, value, total){
|
| 815 |
|
| 816 |
if(total <= 0){
|
| 817 |
+
that.endBehavior(currentCountdown, allOptions);
|
| 818 |
}
|
| 819 |
}
|
| 820 |
|
| 821 |
+
var countdown = currentCountdown.TimeCircles(options).addListener(countdownComplete);
|
| 822 |
+
var that = this;
|
| 823 |
+
|
| 824 |
+
if (currentCountdown.data('timer') <= 0) {
|
| 825 |
+
that.endBehavior(currentCountdown, allOptions);
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
jQuery(window).resize(function() {
|
| 829 |
countdown.rebuild();
|
| 830 |
});
|
| 831 |
+
}
|
| 832 |
|
| 833 |
YcdCountdown.prototype.endBehavior = function(countdown, options) {
|
| 834 |
|
assets/js/Js.php
CHANGED
|
@@ -85,8 +85,8 @@ class Js {
|
|
| 85 |
$comingSoonMenuPage,
|
| 86 |
'ycdcountdown_page_ycdcountdown'
|
| 87 |
);
|
| 88 |
-
|
| 89 |
-
if(in_array($hook, $allowedPages) || get_post_type(
|
| 90 |
|
| 91 |
wp_enqueue_script('jquery-ui-core');
|
| 92 |
if(function_exists('wp_enqueue_code_editor')) {
|
| 85 |
$comingSoonMenuPage,
|
| 86 |
'ycdcountdown_page_ycdcountdown'
|
| 87 |
);
|
| 88 |
+
$post = (int)@$_GET['post'];
|
| 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')) {
|
assets/views/admin/shortcodeMetabox.php
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<?php _e('Shortcode', YCD_TEXT_DOMAIN); ?>
|
| 7 |
</label>
|
| 8 |
<?php
|
| 9 |
-
$postId = @$_GET['post'];
|
| 10 |
if (empty($postId)) : ?>
|
| 11 |
<p>Please do save the Countdown, to getting the shortcode.</p>
|
| 12 |
<?php else: ?>
|
| 6 |
<?php _e('Shortcode', YCD_TEXT_DOMAIN); ?>
|
| 7 |
</label>
|
| 8 |
<?php
|
| 9 |
+
$postId = (int)@$_GET['post'];
|
| 10 |
if (empty($postId)) : ?>
|
| 11 |
<p>Please do save the Countdown, to getting the shortcode.</p>
|
| 12 |
<?php else: ?>
|
classes/RegisterPostType.php
CHANGED
|
@@ -52,8 +52,8 @@ class RegisterPostType {
|
|
| 52 |
$args = $this->getPostTypeArgs();
|
| 53 |
|
| 54 |
register_post_type($postType, $args);
|
| 55 |
-
|
| 56 |
-
if(@$_GET['post_type'] || get_post_type(
|
| 57 |
$this->createCdObjFromCdType();
|
| 58 |
}
|
| 59 |
YcdCountdownOptionsConfig::optionsValues();
|
| 52 |
$args = $this->getPostTypeArgs();
|
| 53 |
|
| 54 |
register_post_type($postType, $args);
|
| 55 |
+
$post = (int)@$_GET['post'];
|
| 56 |
+
if(@$_GET['post_type'] || get_post_type($post) == YCD_COUNTDOWN_POST_TYPE) {
|
| 57 |
$this->createCdObjFromCdType();
|
| 58 |
}
|
| 59 |
YcdCountdownOptionsConfig::optionsValues();
|
config/config.php
CHANGED
|
@@ -75,8 +75,8 @@ class YcdCountdownConfig
|
|
| 75 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
| 76 |
self::addDefine('YCD_AJAX_SUCCESS', 1);
|
| 77 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
| 78 |
-
self::addDefine('YCD_VERSION_PRO', 2.
|
| 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 +84,13 @@ class YcdCountdownConfig
|
|
| 84 |
self::addDefine('YCD_EXTENSION_VERSION', 99);
|
| 85 |
require_once(dirname(__FILE__).'/config-pkg.php');
|
| 86 |
|
| 87 |
-
$versionText = '2.2.
|
| 88 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
| 89 |
-
$versionText = '2.1.
|
| 90 |
}
|
| 91 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
| 92 |
-
self::addDefine('YCD_LAST_UPDATE', '
|
| 93 |
-
self::addDefine('YCD_NEXT_UPDATE', 'Feb
|
| 94 |
}
|
| 95 |
|
| 96 |
public static function displaySettings()
|
| 75 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
| 76 |
self::addDefine('YCD_AJAX_SUCCESS', 1);
|
| 77 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
| 78 |
+
self::addDefine('YCD_VERSION_PRO', 2.15);
|
| 79 |
+
self::addDefine('YCD_VERSION', 2.29);
|
| 80 |
self::addDefine('YCD_FREE_VERSION', 1);
|
| 81 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
| 82 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
| 84 |
self::addDefine('YCD_EXTENSION_VERSION', 99);
|
| 85 |
require_once(dirname(__FILE__).'/config-pkg.php');
|
| 86 |
|
| 87 |
+
$versionText = '2.2.9';
|
| 88 |
if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
|
| 89 |
+
$versionText = '2.1.5';
|
| 90 |
}
|
| 91 |
self::addDefine('YCD_VERSION_TEXT', $versionText);
|
| 92 |
+
self::addDefine('YCD_LAST_UPDATE', 'Feb 15');
|
| 93 |
+
self::addDefine('YCD_NEXT_UPDATE', 'Feb 28');
|
| 94 |
}
|
| 95 |
|
| 96 |
public static function displaySettings()
|
countdown-builder.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
/**
|
| 3 |
* Plugin Name: Countdown builder
|
| 4 |
* Description: The best countdown plugin by Adam skaat
|
| 5 |
-
* Version: 2.2.
|
| 6 |
* Author: Adam Skaat
|
| 7 |
* Author URI: https://edmonsoft.com/countdown
|
| 8 |
* License: GPLv2
|
| 2 |
/**
|
| 3 |
* Plugin Name: Countdown builder
|
| 4 |
* Description: The best countdown plugin by Adam skaat
|
| 5 |
+
* Version: 2.2.9
|
| 6 |
* Author: Adam Skaat
|
| 7 |
* Author URI: https://edmonsoft.com/countdown
|
| 8 |
* License: GPLv2
|
helpers/AdminHelper.php
CHANGED
|
@@ -8,7 +8,7 @@ class AdminHelper {
|
|
| 8 |
$isAvailable = $type->isAvailable();
|
| 9 |
$name = $type->getName();
|
| 10 |
|
| 11 |
-
$url = YCD_COUNTDOWN_ADMIN_URL.'post-new.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&ycd_type='
|
| 12 |
|
| 13 |
if (!$isAvailable) {
|
| 14 |
$url = YCD_COUNTDOWN_PRO_URL;
|
|
@@ -1331,7 +1331,7 @@ class AdminHelper {
|
|
| 1331 |
elseif( isset( $_REQUEST['post_type'] ) )
|
| 1332 |
return sanitize_key( $_REQUEST['post_type'] );
|
| 1333 |
else if (!empty($_GET['post']))
|
| 1334 |
-
return get_post_type($_GET['post']);
|
| 1335 |
|
| 1336 |
//we do not know the post type!
|
| 1337 |
return null;
|
| 8 |
$isAvailable = $type->isAvailable();
|
| 9 |
$name = $type->getName();
|
| 10 |
|
| 11 |
+
$url = YCD_COUNTDOWN_ADMIN_URL.'post-new.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&ycd_type='.esc_attr($name);
|
| 12 |
|
| 13 |
if (!$isAvailable) {
|
| 14 |
$url = YCD_COUNTDOWN_PRO_URL;
|
| 1331 |
elseif( isset( $_REQUEST['post_type'] ) )
|
| 1332 |
return sanitize_key( $_REQUEST['post_type'] );
|
| 1333 |
else if (!empty($_GET['post']))
|
| 1334 |
+
return get_post_type((int)$_GET['post']);
|
| 1335 |
|
| 1336 |
//we do not know the post type!
|
| 1337 |
return null;
|
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
|
| 6 |
-
Stable tag: 2.2.
|
| 7 |
Requires PHP: 5.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
@@ -67,6 +67,10 @@ Yes you can, we have Circle and Flipclock countdown popups.
|
|
| 67 |
You need to select the .zip file, there is no need to extract the zip file, just upload it.
|
| 68 |
|
| 69 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
= 2.2.8 =
|
| 71 |
* Fixed Simple countdown save duration option
|
| 72 |
* Fixed Sticky countdown save duration option
|
| 3 |
Tags: countdown, timer, countdown timer
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 5.9
|
| 6 |
+
Stable tag: 2.2.9
|
| 7 |
Requires PHP: 5.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 67 |
You need to select the .zip file, there is no need to extract the zip file, just upload it.
|
| 68 |
|
| 69 |
== Changelog ==
|
| 70 |
+
= 2.2.9 =
|
| 71 |
+
* Security improvement
|
| 72 |
+
* Fixed onclick Countdown popup issue
|
| 73 |
+
|
| 74 |
= 2.2.8 =
|
| 75 |
* Fixed Simple countdown save duration option
|
| 76 |
* Fixed Sticky countdown save duration option
|
