Countdown, Coming Soon – Countdown & Clock - Version 1.8.7

Version Description

  • Create default countdown after the first activation
  • Bug fixes
Download this release

Release Info

Developer adamskaat
Plugin Icon 128x128 Countdown, Coming Soon – Countdown & Clock
Version 1.8.7
Comparing to
See all releases

Code changes from version 1.8.6 to 1.8.7

classes/Installer.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  namespace ycd;
3
  use \YcdShowReviewNotice;
 
4
 
5
  class Installer {
6
 
@@ -46,6 +47,7 @@ class Installer {
46
  }
47
  wp_delete_post($countdown->ID, true);
48
  }
 
49
  }
50
 
51
  public static function install() {
@@ -75,8 +77,39 @@ class Installer {
75
  }
76
  }
77
  }
 
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  public static function createTables($blogId = '') {
81
  global $wpdb;
82
  $createTableHeader = 'CREATE TABLE IF NOT EXISTS '.$wpdb->prefix.$blogId;
1
  <?php
2
  namespace ycd;
3
  use \YcdShowReviewNotice;
4
+ use \YcdCountdownOptionsConfig;
5
 
6
  class Installer {
7
 
47
  }
48
  wp_delete_post($countdown->ID, true);
49
  }
50
+ delete_option('YcdInserted');
51
  }
52
 
53
  public static function install() {
77
  }
78
  }
79
  }
80
+ self::insertDefaultData();
81
  }
82
 
83
+ private static function insertDefaultData() {
84
+ $isInserted = get_option('YcdInserted');
85
+
86
+ if ($isInserted) {
87
+ return false;
88
+ }
89
+
90
+ $defaultPost = array(
91
+ 'post_title' => __('Default', YCD_TEXT_DOMAIN),
92
+ 'post_content' => '',
93
+ 'post_status' => 'publish',
94
+ 'post_author' => 1,
95
+ 'post_type'=> YCD_COUNTDOWN_POST_TYPE,
96
+ 'post_category' => array()
97
+ );
98
+
99
+ // Insert the post into the database
100
+ wp_insert_post($defaultPost);
101
+ global $wpdb;
102
+ $lastid = $wpdb->insert_id;
103
+
104
+ $options = YcdCountdownOptionsConfig::getDefaultValuesData();
105
+ $options['ycd-type'] = 'circle';
106
+ $options['ycd-post-id'] = $lastid;
107
+ update_post_meta($lastid, 'ycd_options', $options);
108
+ update_option('YcdInserted', 1);
109
+
110
+ return false;
111
+ }
112
+
113
  public static function createTables($blogId = '') {
114
  global $wpdb;
115
  $createTableHeader = 'CREATE TABLE IF NOT EXISTS '.$wpdb->prefix.$blogId;
config/config.php CHANGED
@@ -68,8 +68,8 @@ class YcdCountdownConfig {
68
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
69
  self::addDefine('YCD_AJAX_SUCCESS', 1);
70
  self::addDefine('YCD_TABLE_LIMIT', 15);
71
- self::addDefine('YCD_VERSION_PRO', 1.71);
72
- self::addDefine('YCD_VERSION', 1.85);
73
  self::addDefine('YCD_FREE_VERSION', 1);
74
  self::addDefine('YCD_SILVER_VERSION', 2);
75
  self::addDefine('YCD_GOLD_VERSION', 3);
@@ -77,13 +77,13 @@ class YcdCountdownConfig {
77
  self::addDefine('YCD_EXTENSION_VERSION', 99);
78
  require_once(dirname(__FILE__).'/config-pkg.php');
79
 
80
- $versionText = '1.8.6';
81
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
82
- $versionText = '1.7.2';
83
  }
84
  self::addDefine('YCD_VERSION_TEXT', $versionText);
85
- self::addDefine('YCD_LAST_UPDATE', 'August 14');
86
- self::addDefine('YCD_NEXT_UPDATE', 'August 25');
87
  }
88
 
89
  public static function displaySettings() {
68
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
69
  self::addDefine('YCD_AJAX_SUCCESS', 1);
70
  self::addDefine('YCD_TABLE_LIMIT', 15);
71
+ self::addDefine('YCD_VERSION_PRO', 1.73);
72
+ self::addDefine('YCD_VERSION', 1.87);
73
  self::addDefine('YCD_FREE_VERSION', 1);
74
  self::addDefine('YCD_SILVER_VERSION', 2);
75
  self::addDefine('YCD_GOLD_VERSION', 3);
77
  self::addDefine('YCD_EXTENSION_VERSION', 99);
78
  require_once(dirname(__FILE__).'/config-pkg.php');
79
 
80
+ $versionText = '1.8.7';
81
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
82
+ $versionText = '1.7.3';
83
  }
84
  self::addDefine('YCD_VERSION_TEXT', $versionText);
85
+ self::addDefine('YCD_LAST_UPDATE', 'August 30');
86
+ self::addDefine('YCD_NEXT_UPDATE', 'Sep 21');
87
  }
88
 
89
  public static function displaySettings() {
config/optionsConfig.php CHANGED
@@ -294,6 +294,17 @@ class YcdCountdownOptionsConfig {
294
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
295
  }
296
 
 
 
 
 
 
 
 
 
 
 
 
297
  public static function getDefaultTimezone() {
298
  $timezone = get_option('timezone_string');
299
  if (!$timezone) {
294
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
295
  }
296
 
297
+ public static function getDefaultValuesData() {
298
+ self::optionsValues();
299
+ global $YCD_OPTIONS;
300
+ $currentKeyVal = array();
301
+ foreach ($YCD_OPTIONS as $option) {
302
+ $currentKeyVal[$option['name']] = $option['defaultValue'];
303
+ }
304
+
305
+ return $currentKeyVal;
306
+ }
307
+
308
  public static function getDefaultTimezone() {
309
  $timezone = get_option('timezone_string');
310
  if (!$timezone) {
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: 1.8.6
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: 1.8.7
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
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.5
6
- Stable tag: 1.8.6
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -66,6 +66,10 @@ Yes you can, we have Circle and Flipclock countdown popups.
66
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
67
 
68
  == Changelog ==
 
 
 
 
69
  = 1.8.6 =
70
  * Timer Before HTML
71
  * Timer After HTML
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 5.5
6
+ Stable tag: 1.8.7
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
66
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
67
 
68
  == Changelog ==
69
+ = 1.8.7 =
70
+ * Create default countdown after the first activation
71
+ * Bug fixes
72
+
73
  = 1.8.6 =
74
  * Timer Before HTML
75
  * Timer After HTML