Uji Countdown - Version 2.1.1

Version Description

  • Fixed missing Styles when upgrading from Version 2.0.x to version 2.1
  • Fixed Block issue when switch timer type
  • Subscription add-on fixed
  • Recurring time issue fixed
Download this release

Release Info

Developer ujimoto
Plugin Icon 128x128 Uji Countdown
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1 to 2.1.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.wpmanage.com/uji-countdown
4
  Tags: countdown timer, countdown, counter, js countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer, recurring timer
5
  Requires at least: 3.0
6
  Tested up to: 5.4
7
- Stable tag: 2.1
8
 
9
  Uji Countdown - Customizable Countdown Timer
10
 
@@ -51,6 +51,12 @@ Please feel free to visit our [demo site](http://wpmanage.com/project/ujicountdo
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
54
  = 2.1 =
55
  * Support Block editor - Gutenberg
56
  * Added support for extensions
4
  Tags: countdown timer, countdown, counter, js countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer, recurring timer
5
  Requires at least: 3.0
6
  Tested up to: 5.4
7
+ Stable tag: 2.1.1
8
 
9
  Uji Countdown - Customizable Countdown Timer
10
 
51
 
52
  == Changelog ==
53
 
54
+ = 2.1.1 =
55
+ * Fixed missing Styles when upgrading from Version 2.0.x to version 2.1
56
+ * Fixed Block issue when switch timer type
57
+ * Subscription add-on fixed
58
+ * Recurring time issue fixed
59
+
60
  = 2.1 =
61
  * Support Block editor - Gutenberg
62
  * Added support for extensions
classes/class-uji-countdown-front.php CHANGED
@@ -85,17 +85,18 @@ class UjiCountdown extends Uji_Countdown {
85
  $unx_time = strtotime( $expire . ":00" );
86
  $now_time = (int) current_time( 'timestamp' );
87
 
 
 
88
  //Reccuring time
89
- if( $rectype && $recurring && is_numeric( $recurring ) ){
90
  //add multiple hour -> hours
91
  $rectype = intval($recurring) > 1 ? $rectype.'s' : $rectype;
92
 
93
  //Repeats
94
  if( $repeats && intval($repeats) > 0 ){
95
-
96
  //add time
97
  for( $t=1; $t<=intval($repeats); $t++){
98
- $ujictime = strtotime( '+' . ($recurring*$t) . ' ' . $rectype, $unx_time );
99
  if( $now_time < $ujictime){
100
  $rectime = true;
101
  break;
85
  $unx_time = strtotime( $expire . ":00" );
86
  $now_time = (int) current_time( 'timestamp' );
87
 
88
+ $expired = ($now_time > $unx_time) ? true : false;
89
+
90
  //Reccuring time
91
+ if( $expired && $rectype && $recurring && is_numeric( $recurring ) ) {
92
  //add multiple hour -> hours
93
  $rectype = intval($recurring) > 1 ? $rectype.'s' : $rectype;
94
 
95
  //Repeats
96
  if( $repeats && intval($repeats) > 0 ){
 
97
  //add time
98
  for( $t=1; $t<=intval($repeats); $t++){
99
+ $ujictime = strtotime( '+' . $t . ' ' . $rectype, $unx_time );
100
  if( $now_time < $ujictime){
101
  $rectime = true;
102
  break;
classes/class-uji-countdown.php CHANGED
@@ -137,7 +137,7 @@ class Uji_Countdown extends Uji_Countdown_Admin
137
  * @since 2.0.3
138
  */
139
 
140
- protected static function getPluginSavedVersion()
141
  {
142
  return get_option('uji-countdown-version', null);
143
  }
@@ -146,6 +146,22 @@ class Uji_Countdown extends Uji_Countdown_Admin
146
  {
147
  return update_option('uji-countdown-version', UJIC_ORIG);
148
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
  /**
151
  * Counter Options.
@@ -456,6 +472,11 @@ class Uji_Countdown extends Uji_Countdown_Admin
456
  public function activate( $network_wide ) {
457
  //Upgrade DB
458
  $this->upgrade_db();
 
 
 
 
 
459
  self::savePluginVersion();
460
  }
461
 
137
  * @since 2.0.3
138
  */
139
 
140
+ public static function getPluginSavedVersion()
141
  {
142
  return get_option('uji-countdown-version', null);
143
  }
146
  {
147
  return update_option('uji-countdown-version', UJIC_ORIG);
148
  }
149
+
150
+ protected static function upgradeVerFix ($ver){
151
+ if ( version_compare($ver, '2.1.2' ) ) {
152
+ global $wpdb;
153
+ $table_name = $wpdb->prefix . "uji_counter";
154
+ $ujic_datas = $wpdb->get_results( "SELECT * FROM $table_name ORDER BY `time` DESC" );
155
+ if ( !empty( $ujic_datas ) ) {
156
+ foreach ( $ujic_datas as $ujic ) {
157
+ if( $ujic->link == '' && $ujic->title != '' ){
158
+ $title = sanitize_title( $ujic->title );
159
+ $wpdb->query( "UPDATE $table_name SET `link` = '{$title}' WHERE (`id` = {$ujic->id})" );
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
 
166
  /**
167
  * Counter Options.
472
  public function activate( $network_wide ) {
473
  //Upgrade DB
474
  $this->upgrade_db();
475
+
476
+ $ver = get_option('uji-countdown-version', null);
477
+
478
+ self::upgradeVerFix($ver);
479
+
480
  self::savePluginVersion();
481
  }
482
 
dist/blocks.build.js CHANGED
@@ -206,7 +206,7 @@ module.exports = wp.blockEditor;
206
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
207
 
208
  "use strict";
209
- eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(/*! @wordpress/element */ 0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__);\n/**\n * WordPress dependencies\n */\n\n\n\nvar save = function save(_ref) {\n\tvar attributes = _ref.attributes;\n\tvar countStyles = attributes.countStyles,\n\t datetime = attributes.datetime,\n\t thour = attributes.thour,\n\t tmin = attributes.tmin,\n\t tsec = attributes.tsec,\n\t hide = attributes.hide,\n\t url = attributes.url,\n\t unitNum = attributes.unitNum,\n\t unitTime = attributes.unitTime,\n\t repeats = attributes.repeats;\n\n\n\tvar isHide = hide ? 'true' : 'false';\n\n\tvar tim = thour && tmin && tsec ? true : false;\n\tvar exp = datetime ? datetime.replace(/\\//g, '-') : '';\n\tvar expTime = exp && !tim ? 'expire=\"' + exp + '\"' : '';\n\tvar timerTime = tim ? 'timer=\"' + thour + ':' + tmin + ':' + tsec + '\"' : '';\n\n\tvar rectype = unitNum && repeats ? unitTime : '';\n\n\t// [ujicountdown id=\"test\" expire=\"2020/04/30 06:04\" hide=\"true\" url=\"\" subscr=\"undefined\" recurring=\"\" rectype=\"second\" repeats=\"\"]\n\tvar myShortcode = '[ujicountdown id=\"' + countStyles + '\" ' + expTime + ' ' + timerTime + ' hide=\"' + isHide + '\" url=\"' + url + '\" subscr=\"undefined\" recurring=\"' + repeats + '\" rectype=\"' + rectype + '\" repeats=\"' + unitNum + '\"]';\n\n\treturn wp.element.createElement(\n\t\t__WEBPACK_IMPORTED_MODULE_0__wordpress_element__[\"RawHTML\"],\n\t\tnull,\n\t\tmyShortcode\n\t);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (save);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYmxvY2svc2F2ZS5qcz9jNGQ0Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogV29yZFByZXNzIGRlcGVuZGVuY2llc1xuICovXG5cbmltcG9ydCB7IFJhd0hUTUwgfSBmcm9tICdAd29yZHByZXNzL2VsZW1lbnQnO1xuXG52YXIgc2F2ZSA9IGZ1bmN0aW9uIHNhdmUoX3JlZikge1xuXHR2YXIgYXR0cmlidXRlcyA9IF9yZWYuYXR0cmlidXRlcztcblx0dmFyIGNvdW50U3R5bGVzID0gYXR0cmlidXRlcy5jb3VudFN0eWxlcyxcblx0ICAgIGRhdGV0aW1lID0gYXR0cmlidXRlcy5kYXRldGltZSxcblx0ICAgIHRob3VyID0gYXR0cmlidXRlcy50aG91cixcblx0ICAgIHRtaW4gPSBhdHRyaWJ1dGVzLnRtaW4sXG5cdCAgICB0c2VjID0gYXR0cmlidXRlcy50c2VjLFxuXHQgICAgaGlkZSA9IGF0dHJpYnV0ZXMuaGlkZSxcblx0ICAgIHVybCA9IGF0dHJpYnV0ZXMudX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CIgcmVjdHlwZT1cIicgKyByZWN0eXBlICsgJ1wiIHJlcGVhdHM9XCInICsgdW5pdE51bSArICdcIl0nO1xuXG5cdHJldHVybiB3cC5lbGVtZW50LmNyZWF0ZUVsZW1lbnQoXG5cdFx0UmF3SFRNTCxcblx0XHRudWxsLFxuXHRcdG15U2hvcnRjb2RlXG5cdCk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBzYXZlO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vc3JjL2Jsb2NrL3NhdmUuanNcbi8vIG1vZHVsZSBpZCA9IDEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///12\n");
210
 
211
  /***/ })
212
  /******/ ]);
206
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
207
 
208
  "use strict";
209
+ eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(/*! @wordpress/element */ 0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__);\n/**\n * WordPress dependencies\n */\n\n\n\nvar save = function save(_ref) {\n\tvar attributes = _ref.attributes;\n\tvar countStyles = attributes.countStyles,\n\t timerType = attributes.timerType,\n\t datetime = attributes.datetime,\n\t thour = attributes.thour,\n\t tmin = attributes.tmin,\n\t tsec = attributes.tsec,\n\t hide = attributes.hide,\n\t url = attributes.url,\n\t unitNum = attributes.unitNum,\n\t unitTime = attributes.unitTime,\n\t repeats = attributes.repeats,\n\t news = attributes.news;\n\n\n\tvar isHide = hide ? 'true' : 'false';\n\n\tvar tim = timerType === 'repeat' && thour && tmin && tsec ? true : false;\n\tvar exp = datetime ? datetime.replace(/\\//g, '-') : '';\n\tvar expTime = timerType === 'onetime' && exp && !tim ? 'expire=\"' + exp + '\"' : '';\n\tvar timerTime = tim ? 'timer=\"' + thour + ':' + tmin + ':' + tsec + '\"' : '';\n\tvar isNews = news ? ' subscr=\"' + news : ' subscr=\"undefined\"';\n\n\tvar rectype = unitNum && repeats ? unitTime : '';\n\n\t// [ujicountdown id=\"test\" expire=\"2020/04/30 06:04\" hide=\"true\" url=\"\" subscr=\"undefined\" recurring=\"\" rectype=\"second\" repeats=\"\"]\n\tvar myShortcode = '[ujicountdown id=\"' + countStyles + '\" ' + expTime + ' ' + timerTime + ' hide=\"' + isHide + '\" url=\"' + url + '\"' + isNews + '\" recurring=\"' + repeats + '\" rectype=\"' + rectype + '\" repeats=\"' + repeats + '\"]';\n\n\treturn wp.element.createElement(\n\t\t__WEBPACK_IMPORTED_MODULE_0__wordpress_element__[\"RawHTML\"],\n\t\tnull,\n\t\tmyShortcode\n\t);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (save);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYmxvY2svc2F2ZS5qcz9jNGQ0Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogV29yZFByZXNzIGRlcGVuZGVuY2llc1xuICovXG5cbmltcG9ydCB7IFJhd0hUTUwgfSBmcm9tICdAd29yZHByZXNzL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FwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///12\n");
210
 
211
  /***/ })
212
  /******/ ]);
src/block/save.js CHANGED
@@ -7,6 +7,7 @@ import { RawHTML } from '@wordpress/element';
7
  const save = ( { attributes } ) => {
8
  const {
9
  countStyles,
 
10
  datetime,
11
  thour,
12
  tmin,
@@ -16,19 +17,21 @@ const save = ( { attributes } ) => {
16
  unitNum,
17
  unitTime,
18
  repeats,
 
19
  } = attributes;
20
 
21
  const isHide = hide ? 'true' : 'false';
22
 
23
- const tim = ( thour && tmin && tsec ) ? true : false;
24
  const exp = datetime ? datetime.replace(/\//g, '-') : '';
25
- const expTime = ( exp && ! tim ) ? 'expire="' + exp + '"' : '';
26
  const timerTime = tim ? 'timer="' + thour + ':' + tmin + ':' + tsec + '"' : '';
 
27
 
28
  const rectype = ( unitNum && repeats ) ? unitTime : '';
29
 
30
  // [ujicountdown id="test" expire="2020/04/30 06:04" hide="true" url="" subscr="undefined" recurring="" rectype="second" repeats=""]
31
- const myShortcode = '[ujicountdown id="'+countStyles+'" '+expTime+' '+timerTime+' hide="'+isHide+'" url="'+url+'" subscr="undefined" recurring="'+repeats+'" rectype="'+rectype+'" repeats="'+unitNum+'"]';
32
 
33
  return (
34
  <RawHTML>{ myShortcode }</RawHTML>
7
  const save = ( { attributes } ) => {
8
  const {
9
  countStyles,
10
+ timerType,
11
  datetime,
12
  thour,
13
  tmin,
17
  unitNum,
18
  unitTime,
19
  repeats,
20
+ news
21
  } = attributes;
22
 
23
  const isHide = hide ? 'true' : 'false';
24
 
25
+ const tim = ( timerType === 'repeat' && thour && tmin && tsec ) ? true : false;
26
  const exp = datetime ? datetime.replace(/\//g, '-') : '';
27
+ const expTime = ( timerType === 'onetime' && exp && ! tim ) ? 'expire="' + exp + '"' : '';
28
  const timerTime = tim ? 'timer="' + thour + ':' + tmin + ':' + tsec + '"' : '';
29
+ const isNews = ( news ) ? ' subscr="' + news : ' subscr="undefined"';
30
 
31
  const rectype = ( unitNum && repeats ) ? unitTime : '';
32
 
33
  // [ujicountdown id="test" expire="2020/04/30 06:04" hide="true" url="" subscr="undefined" recurring="" rectype="second" repeats=""]
34
+ const myShortcode = '[ujicountdown id="'+countStyles+'" '+expTime+' '+timerTime+' hide="'+isHide+'" url="'+url+'"'+ isNews +'" recurring="'+repeats+'" rectype="'+rectype+'" repeats="'+repeats+'"]';
35
 
36
  return (
37
  <RawHTML>{ myShortcode }</RawHTML>
ujicountdown.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Uji Countdown
4
  Plugin URI: http://www.wpmanage.com/uji-countdown
5
  Description: HTML5 Customizable Countdown.
6
- Version: 2.1
7
  Text Domain: ujicountdown
8
  Domain Path: /lang
9
  Author: Wpmanage.com
10
  Author URI: http://wpmanage.com
11
  License: GPLv2
12
- Copyright 2019 WPmanage (email : info@wpmanage.com)
13
  */
14
 
15
  // Exit if accessed directly.
3
  Plugin Name: Uji Countdown
4
  Plugin URI: http://www.wpmanage.com/uji-countdown
5
  Description: HTML5 Customizable Countdown.
6
+ Version: 2.1.1
7
  Text Domain: ujicountdown
8
  Domain Path: /lang
9
  Author: Wpmanage.com
10
  Author URI: http://wpmanage.com
11
  License: GPLv2
12
+ Copyright 2020 WPmanage (email : info@wpmanage.com)
13
  */
14
 
15
  // Exit if accessed directly.