CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 3.7.6

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 3.7.6
Comparing to
See all releases

Code changes from version 3.7.5.1 to 3.7.6

inc/class-cmp-render_html.php CHANGED
@@ -330,11 +330,61 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
330
  * @return html
331
  **/
332
  public function cmp_wp_head() {
 
333
  // Plugin Name: Insert Headers and Footers
334
  if ( class_exists('InsertHeadersAndFooters') ) {
335
  $ihaf = new InsertHeadersAndFooters();
336
  $ihaf->frontendHeader();
337
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  }
339
 
340
  /**
330
  * @return html
331
  **/
332
  public function cmp_wp_head() {
333
+
334
  // Plugin Name: Insert Headers and Footers
335
  if ( class_exists('InsertHeadersAndFooters') ) {
336
  $ihaf = new InsertHeadersAndFooters();
337
  $ihaf->frontendHeader();
338
  }
339
+
340
+ // Plugin Name: Cookie Notice
341
+ if ( function_exists('cn_cookies_accepted') && !cn_cookies_accepted() ) {
342
+ // access cookie notice class
343
+ $cookie_notice = Cookie_Notice();
344
+
345
+ // get cookie notice options private variable
346
+ $closure_option = \Closure::bind(function (Cookie_Notice $cookie_notice) {
347
+ return $cookie_notice->options;
348
+ }, null, Cookie_Notice::class);
349
+
350
+ // get cookie notice times private variable
351
+ $closure_times = \Closure::bind(function (Cookie_Notice $cookie_notice) {
352
+ return $cookie_notice->times;
353
+ }, null, Cookie_Notice::class);
354
+
355
+ // render required cnArgs js variable
356
+ $cn_options = array(
357
+ 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
358
+ 'nonce' => wp_create_nonce( 'cn_save_cases' ),
359
+ 'hideEffect' => $closure_option($cookie_notice)['general']['hide_effect'],
360
+ 'position' => $closure_option($cookie_notice)['general']['position'],
361
+ 'onScroll' => (int) $closure_option($cookie_notice)['general']['on_scroll'],
362
+ 'onScrollOffset' => (int) $closure_option($cookie_notice)['general']['on_scroll_offset'],
363
+ 'onClick' => (int) $closure_option($cookie_notice)['general']['on_click'],
364
+ 'cookieName' => 'cookie_notice_accepted',
365
+ 'cookieTime' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time']][1],
366
+ 'cookieTimeRejected' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time_rejected']][1],
367
+ 'cookiePath' => ( defined( 'COOKIEPATH' ) ? (string) COOKIEPATH : '' ),
368
+ 'cookieDomain' => ( defined( 'COOKIE_DOMAIN' ) ? (string) COOKIE_DOMAIN : '' ),
369
+ 'redirection' => (int) $closure_option($cookie_notice)['general']['redirection'],
370
+ 'cache' => (int) ( defined( 'WP_CACHE' ) && WP_CACHE ),
371
+ 'refuse' => (int) $closure_option($cookie_notice)['general']['refuse_opt'],
372
+ 'revokeCookies' => (int) $closure_option($cookie_notice)['general']['revoke_cookies'],
373
+ 'revokeCookiesOpt' => $closure_option($cookie_notice)['general']['revoke_cookies_opt'],
374
+ 'secure' => (int) is_ssl(),
375
+ 'coronabarActive' => (int) $closure_option($cookie_notice)['general']['coronabar'],
376
+ ); ?>
377
+
378
+ <link rel='stylesheet' id='cookie-notice-front-css' href='<?php echo plugins_url();?>/cookie-notice/css/front.min.css' media='all' />
379
+
380
+ <script src='<?php echo plugins_url();?>/cookie-notice/js/front.min.js'></script>
381
+
382
+ <script>
383
+ var cnArgs = <?php echo json_encode( $cn_options );?>
384
+ </script>
385
+ <?php
386
+
387
+ }
388
  }
389
 
390
  /**
inc/cmp-update-process.php CHANGED
@@ -10,6 +10,7 @@ if ( !get_option( 'niteoCS_version' ) ) {
10
  if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
11
 
12
  $current_theme = get_option('niteoCS_theme', 'countdown');
 
13
  $premium_themes = $this->cmp_premium_themes_installed();
14
 
15
  // delete transients for theme updates, to ensure the updates for latest cmp versions runs again
@@ -236,6 +237,24 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
236
  update_option('niteoCS_translation', wp_json_encode( $translation ));
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  // bump version for next udpate check
240
  update_option( 'niteoCS_version', CMP_VERSION );
241
  }
10
  if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
11
 
12
  $current_theme = get_option('niteoCS_theme', 'countdown');
13
+
14
  $premium_themes = $this->cmp_premium_themes_installed();
15
 
16
  // delete transients for theme updates, to ensure the updates for latest cmp versions runs again
237
  update_option('niteoCS_translation', wp_json_encode( $translation ));
238
  }
239
 
240
+ // delete unzip theme from cmp-premium-dir
241
+ if ( file_exists( CMP_PREMIUM_THEMES_DIR ) ) {
242
+ $files = glob(CMP_PREMIUM_THEMES_DIR . '/*');
243
+ $premium_themes = array_column( $this->cmp_premium_themes(), 'name' );
244
+
245
+ foreach( $files as $file ) {
246
+ if ( is_file($file) ){
247
+ unlink($file);
248
+ } else {
249
+ if ( !in_array(basename($file), $premium_themes)) {
250
+ array_map('unlink', glob("$file/*.*"));
251
+ rmdir($file);
252
+ }
253
+
254
+ }
255
+ }
256
+ }
257
+
258
  // bump version for next udpate check
259
  update_option( 'niteoCS_version', CMP_VERSION );
260
  }
inc/render/custom-css.php CHANGED
@@ -20,14 +20,13 @@ if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
20
  // add CMP CSS to all themes
21
  ob_start(); ?>
22
 
23
- <style>
24
- /* wp video shortcode */
25
- .wp-video {margin: 0 auto;}
26
- .wp-video-shortcode {max-width: 100%;}
27
- /* google recaptcha badge */
28
- .grecaptcha-badge {display: none!important;}
29
- .text-logo {display: inline-block;}
30
- </style>
31
 
32
  <?php
33
 
@@ -146,7 +145,6 @@ if ( get_option('niteoCS_counter_date' ) < time() && $countdown_action === 'hide
146
  }
147
  </style>
148
  <?php
149
-
150
  }
151
 
152
 
20
  // add CMP CSS to all themes
21
  ob_start(); ?>
22
 
23
+ <style>
24
+ .wp-video {margin: 0 auto;}
25
+ .wp-video-shortcode {max-width: 100%;}
26
+ .grecaptcha-badge {display: none!important;}
27
+ .text-logo {display: inline-block;}
28
+ #gdpr-checkbox {-webkit-appearance: checkbox;-moz-appearance: checkbox;width: initial;height: initial;}
29
+ </style>
 
30
 
31
  <?php
32
 
145
  }
146
  </style>
147
  <?php
 
148
  }
149
 
150
 
inc/render/footer.php CHANGED
@@ -12,6 +12,13 @@ if ( class_exists('InsertHeadersAndFooters') ) {
12
  $ihaf->frontendFooter();
13
  }
14
 
 
 
 
 
 
 
 
15
  // Plugin Name: SimpleAnalytics
16
  if ( is_plugin_active( 'simpleanalytics/simple-analytics.php' ) ) {
17
  echo '<script src="https://cdn.simpleanalytics.io/hello.js"></script>' . PHP_EOL;
@@ -38,4 +45,4 @@ if ( get_option('niteoCS_subscribe_type', '2') === '3' && defined('MAILOPTIN_VER
38
  </script>
39
  <script type='text/javascript' src='<?php echo MAILOPTIN_ASSETS_URL;?>js/mailoptin.min.js?ver=<?php echo MAILOPTIN_VERSION_NUMBER;?>'></script>
40
  <?php
41
- }
12
  $ihaf->frontendFooter();
13
  }
14
 
15
+ // Plugin Name: Cookie Notice
16
+ if ( class_exists('Cookie_Notice') ) {
17
+ $cookie_notice = Cookie_Notice();
18
+ $cookie_notice->add_cookie_notice();
19
+
20
+ }
21
+
22
  // Plugin Name: SimpleAnalytics
23
  if ( is_plugin_active( 'simpleanalytics/simple-analytics.php' ) ) {
24
  echo '<script src="https://cdn.simpleanalytics.io/hello.js"></script>' . PHP_EOL;
45
  </script>
46
  <script type='text/javascript' src='<?php echo MAILOPTIN_ASSETS_URL;?>js/mailoptin.min.js?ver=<?php echo MAILOPTIN_VERSION_NUMBER;?>'></script>
47
  <?php
48
+ }
inc/render/head-scripts.php CHANGED
@@ -26,37 +26,40 @@ if ( !empty( $head_scripts ) ) {
26
  do_action('cmp-after-header-scripts');
27
  }
28
 
29
- switch ( get_option('niteoCS_analytics_status', 'disabled') ) {
30
- //disabled analytics
31
- case 'disabled':
32
- break;
33
- // google analytics
34
- case 'google':
35
 
36
- if ( get_option('niteoCS_analytics', '') !== '' ) { ?>
37
- <!-- Google analytics code -->
38
- <script>
39
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
40
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
41
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
42
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
43
-
44
- ga('create', '<?php echo esc_attr(get_option('niteoCS_analytics'));?>', 'auto');
45
- ga('send', 'pageview');
46
-
47
- </script>
48
- <?php
49
- }
50
-
51
- break;
52
- // other js code
53
- case 'other':
54
- if ( get_option('niteoCS_analytics_other', '') !== '' ) {
55
- $analytics_code = get_option('niteoCS_analytics_other', '');
56
- echo stripslashes( $analytics_code );
57
- }
58
-
59
- break;
60
- default:
61
- break;
 
 
 
 
 
 
 
 
 
62
  }
26
  do_action('cmp-after-header-scripts');
27
  }
28
 
 
 
 
 
 
 
29
 
30
+ if ( ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) || !function_exists('cn_cookies_accepted') ) {
31
+ switch ( get_option('niteoCS_analytics_status', 'disabled') ) {
32
+ //disabled analytics
33
+ case 'disabled':
34
+ break;
35
+ // google analytics
36
+ case 'google':
37
+
38
+ if ( get_option('niteoCS_analytics', '') !== '' ) { ?>
39
+ <!-- Google analytics code -->
40
+ <script>
41
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
42
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
43
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
44
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
45
+
46
+ ga('create', '<?php echo esc_attr(get_option('niteoCS_analytics'));?>', 'auto');
47
+ ga('send', 'pageview');
48
+
49
+ </script>
50
+ <?php
51
+ }
52
+
53
+ break;
54
+ // other js code
55
+ case 'other':
56
+ if ( get_option('niteoCS_analytics_other', '') !== '' ) {
57
+ $analytics_code = get_option('niteoCS_analytics_other', '');
58
+ echo stripslashes( $analytics_code );
59
+ }
60
+
61
+ break;
62
+ default:
63
+ break;
64
+ }
65
  }
inc/render/javascripts.php CHANGED
@@ -461,6 +461,9 @@ if ( $counter_script && get_option('niteoCS_counter', '1') == '1') {
461
  <script>
462
  document.addEventListener("DOMContentLoaded", function() {
463
  var counter = document.getElementById("counter") ? document.getElementById("counter") : document.getElementById("cmp-counter");
 
 
 
464
  if ( !counter ) {
465
  return;
466
  }
@@ -507,14 +510,35 @@ if ( $counter_script && get_option('niteoCS_counter', '1') == '1') {
507
 
508
  <?php
509
  if ( $countdown_action === 'redirect' || $countdown_action === 'disable-cmp') { ?>
510
- if ( distance < 0 ) {
511
- clearInterval(timerInt);
512
- window.location.reload();
513
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  <?php
515
  } ?>
516
 
517
  }, 1000);
 
 
518
 
519
  });
520
  </script>
461
  <script>
462
  document.addEventListener("DOMContentLoaded", function() {
463
  var counter = document.getElementById("counter") ? document.getElementById("counter") : document.getElementById("cmp-counter");
464
+ var cmp_nonce = '<?php echo wp_create_nonce( 'cmp-coming-soon-maintenance-nonce' ); ?>';
465
+ var cmp_status = '<?php echo esc_attr(get_option('niteoCS_countdown_action', 'no-action'));?>';
466
+
467
  if ( !counter ) {
468
  return;
469
  }
510
 
511
  <?php
512
  if ( $countdown_action === 'redirect' || $countdown_action === 'disable-cmp') { ?>
513
+
514
+ if ( distance < 0 ) {
515
+ fetch( '<?php echo esc_url(admin_url( 'admin-ajax.php' ));?>', {
516
+ method: 'POST',
517
+ headers: {
518
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
519
+ },
520
+ body: `action=cmp_disable_comingsoon_ajax&security=${cmp_nonce}&status=${cmp_status}`,
521
+ credentials: 'same-origin'
522
+ })
523
+ .then(response => response.json())
524
+ .then((data) => {
525
+ if ( data.message === 'success' ) {
526
+ setTimeout(() => {
527
+ window.location.reload();
528
+ }, 1500);
529
+ }
530
+ })
531
+ .catch(function(error) { console.log(error.message); });
532
+
533
+ clearInterval(timerInt);
534
+
535
+ }
536
  <?php
537
  } ?>
538
 
539
  }, 1000);
540
+
541
+
542
 
543
  });
544
  </script>
inc/render/seo.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
 
3
-
4
  ob_start();
5
 
6
  $title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
1
  <?php
2
 
 
3
  ob_start();
4
 
5
  $title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
inc/render/subscribe-form.php CHANGED
@@ -129,16 +129,27 @@ switch ($subscribe_type) {
129
  // render Subscribe form Message/GDPR
130
  if ( $niteoCS_subscribe_label != '' ) {
131
 
 
 
132
  $allowed_html = array(
133
  'a' => array(
134
  'href' => array(),
135
  'title' => array()
136
  ),
 
 
 
 
 
137
  );
138
- ?>
 
 
 
 
139
 
140
  <div class="cmp-form-notes">
141
- <?php echo wpautop(wp_kses( $niteoCS_subscribe_label, $allowed_html )); ?>
142
  </div>
143
  <?php
144
  } ?>
@@ -170,7 +181,18 @@ switch ($subscribe_type) {
170
  const resultElement = document.getElementById('subscribe-response');
171
  const emailInput = document.getElementById('email-subscribe');
172
  const firstnameInput = document.getElementById('firstname-subscribe');
173
- const lastnameInput = document.getElementById('lastname-subscribe');
 
 
 
 
 
 
 
 
 
 
 
174
 
175
  submitButton.onclick = function( e ) {
176
  e.preventDefault();
129
  // render Subscribe form Message/GDPR
130
  if ( $niteoCS_subscribe_label != '' ) {
131
 
132
+ $checkbox = '';
133
+
134
  $allowed_html = array(
135
  'a' => array(
136
  'href' => array(),
137
  'title' => array()
138
  ),
139
+ 'input' => array(
140
+ 'type' => array(),
141
+ 'checked' => array(),
142
+ 'id' => array(),
143
+ )
144
  );
145
+
146
+ if ( get_option( 'niteoCS_subscribe_gdpr_checkbox', '0' ) == '1' ) {
147
+ $checkbox = '<input type="checkbox" id="gdpr-checkbox" checked /> ';
148
+
149
+ } ?>
150
 
151
  <div class="cmp-form-notes">
152
+ <?php echo wpautop(wp_kses( $checkbox . $niteoCS_subscribe_label, $allowed_html )); ?>
153
  </div>
154
  <?php
155
  } ?>
181
  const resultElement = document.getElementById('subscribe-response');
182
  const emailInput = document.getElementById('email-subscribe');
183
  const firstnameInput = document.getElementById('firstname-subscribe');
184
+ const lastnameInput = document.getElementById('lastname-subscribe');
185
+ const gdprCheckbox = document.getElementById('gdpr-checkbox');
186
+
187
+ if ( gdprCheckbox ) {
188
+ gdprCheckbox.addEventListener('change', function() {
189
+ if (this.checked) {
190
+ submitButton.disabled = false;
191
+ } else {
192
+ submitButton.disabled = true;
193
+ }
194
+ })
195
+ }
196
 
197
  submitButton.onclick = function( e ) {
198
  e.preventDefault();
inc/settings/settings-subscribe.php CHANGED
@@ -64,6 +64,12 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
64
  } else {
65
  update_option('niteoCS_recaptcha_status', '0');
66
  }
 
 
 
 
 
 
67
  }
68
 
69
 
@@ -144,7 +150,7 @@ $recaptcha_site = get_option('niteoCS_recaptcha_site', '');
144
  <td class="subscribe-switch x1 x2">
145
  <h4 for="niteoCS_subscribe_title"><?php _e('Subcribe Form Title', 'cmp-coming-soon-maintenance');?>
146
  <input type="text" name="niteoCS_subscribe_title" id="niteoCS_subscribe_title" value="<?php echo stripslashes( esc_attr($niteoCS_subscribe_title ));?>" class="regular-text code">
147
- </label>
148
  </td>
149
  <?php endif; ?>
150
 
@@ -152,9 +158,7 @@ $recaptcha_site = get_option('niteoCS_recaptcha_site', '');
152
  <fieldset>
153
  <h4 class="subscribe" for="niteoCS_subscribe_code"><?php _e('3rd Party Plugin Shortcode', 'cmp-coming-soon-maintenance');?></h4>
154
  <input type="text" name="niteoCS_subscribe_code" id="niteoCS_subscribe_code" value="<?php echo stripslashes( esc_attr($niteoCS_subscribe_code ));?>" class="regular-text code">
155
-
156
  <p><?php _e('You can find Shortode in your Contact Form Plugin settings. Should be something similar to code below: ', 'cmp-coming-soon-maintenance');?><br><code>[contact-form-7 id="8" title='Contact form 1']</code> or <code>[mc4wp_form id='7']</code></p>
157
-
158
  <p><?php _e('If you use 3rd party shortcode for subscribe or contact form, you might need to apply custom CSS to style the form correctly.', 'cmp-coming-soon-maintenance');?></p>
159
  </fieldset>
160
  </td>
@@ -165,6 +169,7 @@ $recaptcha_site = get_option('niteoCS_recaptcha_site', '');
165
 
166
  <h4 class="subscribe" for="niteoCS_subscribe_label"><?php _e('Subscribe Form message (can be GDPR or any custom message). Supports anchor HTML tags.', 'cmp-coming-soon-maintenance');?></h4>
167
  <textarea name="niteoCS_subscribe_label" id="niteoCS_subscribe_label" class="regular-text code" placeholder="<?php _e('Leave empty to disable', 'cmp-coming-soon-maintenance');?>"><?php echo esc_attr( $niteoCS_subscribe_label );?></textarea>
 
168
  <br>
169
  <p class="cmp-hint"><?php printf( __('* Did you know you can translate Subscribe form Labels and Placeholders to your language in %s Settings?', 'cmp-coming-soon-maintenance'), '<a href="' . get_admin_url() . 'admin.php?page=cmp-translate">Translation</a>');?></p>
170
 
64
  } else {
65
  update_option('niteoCS_recaptcha_status', '0');
66
  }
67
+
68
+ if ( isset($_POST['niteoCS_subscribe_gdpr_checkbox']) ) {
69
+ update_option('niteoCS_subscribe_gdpr_checkbox', $this->sanitize_checkbox($_POST['niteoCS_subscribe_gdpr_checkbox']));
70
+ } else {
71
+ update_option('niteoCS_subscribe_gdpr_checkbox', '0');
72
+ }
73
  }
74
 
75
 
150
  <td class="subscribe-switch x1 x2">
151
  <h4 for="niteoCS_subscribe_title"><?php _e('Subcribe Form Title', 'cmp-coming-soon-maintenance');?>
152
  <input type="text" name="niteoCS_subscribe_title" id="niteoCS_subscribe_title" value="<?php echo stripslashes( esc_attr($niteoCS_subscribe_title ));?>" class="regular-text code">
153
+ </h4>
154
  </td>
155
  <?php endif; ?>
156
 
158
  <fieldset>
159
  <h4 class="subscribe" for="niteoCS_subscribe_code"><?php _e('3rd Party Plugin Shortcode', 'cmp-coming-soon-maintenance');?></h4>
160
  <input type="text" name="niteoCS_subscribe_code" id="niteoCS_subscribe_code" value="<?php echo stripslashes( esc_attr($niteoCS_subscribe_code ));?>" class="regular-text code">
 
161
  <p><?php _e('You can find Shortode in your Contact Form Plugin settings. Should be something similar to code below: ', 'cmp-coming-soon-maintenance');?><br><code>[contact-form-7 id="8" title='Contact form 1']</code> or <code>[mc4wp_form id='7']</code></p>
 
162
  <p><?php _e('If you use 3rd party shortcode for subscribe or contact form, you might need to apply custom CSS to style the form correctly.', 'cmp-coming-soon-maintenance');?></p>
163
  </fieldset>
164
  </td>
169
 
170
  <h4 class="subscribe" for="niteoCS_subscribe_label"><?php _e('Subscribe Form message (can be GDPR or any custom message). Supports anchor HTML tags.', 'cmp-coming-soon-maintenance');?></h4>
171
  <textarea name="niteoCS_subscribe_label" id="niteoCS_subscribe_label" class="regular-text code" placeholder="<?php _e('Leave empty to disable', 'cmp-coming-soon-maintenance');?>"><?php echo esc_attr( $niteoCS_subscribe_label );?></textarea>
172
+ <label><input type="checkbox" name="niteoCS_subscribe_gdpr_checkbox" value="1" <?php checked( '1', get_option( 'niteoCS_subscribe_gdpr_checkbox', '0' ) ); ?> class="regular-text code"><?php _e('Display GDPR Checkbox', 'cmp-coming-soon-maintenance');?></label>
173
  <br>
174
  <p class="cmp-hint"><?php printf( __('* Did you know you can translate Subscribe form Labels and Placeholders to your language in %s Settings?', 'cmp-coming-soon-maintenance'), '<a href="' . get_admin_url() . 'admin.php?page=cmp-translate">Translation</a>');?></p>
175
 
niteo-cmp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
- Version: 3.7.5.1
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -63,7 +63,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
63
 
64
  // define constants
65
  private function constants() {
66
- $this->define( 'CMP_VERSION', '3.7.5.1' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
@@ -81,6 +81,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
81
  */
82
  public function init() {
83
  do_action( 'cmp_plugin_loaded');
 
84
  add_action( 'plugins_loaded', array( $this, 'cmp_update_process' ), 0 );
85
  add_action( 'template_redirect', array( $this, 'cmp_displayPage' ), 1 );
86
  add_action( 'admin_init', array( $this, 'cmp_adminInit' ) ) ;
@@ -105,6 +106,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
105
  add_action( 'wp_ajax_cmp_ajax_upload_font', array( $this, 'cmp_ajax_upload_font' ) );
106
  add_action( 'wp_ajax_cmp_ajax_export_settings', array( $this, 'cmp_ajax_export_settings' ) );
107
  add_action( 'wp_ajax_cmp_ajax_import_settings', array( $this, 'cmp_ajax_import_settings' ) );
 
108
  add_action( 'admin_head', array( $this,'cmp_admin_css') );
109
  add_action( 'after_setup_theme', array( $this,'cmp_create_translation'), 10 );
110
  add_action( 'after_setup_theme', array( $this,'cmp_register_wpml_strings'), 20 );
@@ -842,14 +844,10 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
842
 
843
  }
844
 
845
- // if action set to disable cmp
846
- if ( $action == 'disable-cmp' ) {
847
- update_option('niteoCS_status', '0');
848
- }
849
 
850
  // if action set to redirect
851
  if ( $action == 'redirect' ) {
852
- $redirect_url = esc_url(get_option('niteoCS_countdown_redirect'));
853
  header('Location: '.$redirect_url);
854
  die();
855
  }
@@ -1120,6 +1118,27 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1120
  return $downloadable_themes;
1121
  }
1122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1123
  // theme updates function
1124
  public function cmp_check_update( $theme_slug ) {
1125
 
@@ -2497,7 +2516,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
2497
  }
2498
 
2499
  return $image_url;
2500
- }
 
2501
 
2502
  /**
2503
  * Purge cache for popular caching plugins
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
+ Version: 3.7.6
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
63
 
64
  // define constants
65
  private function constants() {
66
+ $this->define( 'CMP_VERSION', '3.7.6' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
81
  */
82
  public function init() {
83
  do_action( 'cmp_plugin_loaded');
84
+
85
  add_action( 'plugins_loaded', array( $this, 'cmp_update_process' ), 0 );
86
  add_action( 'template_redirect', array( $this, 'cmp_displayPage' ), 1 );
87
  add_action( 'admin_init', array( $this, 'cmp_adminInit' ) ) ;
106
  add_action( 'wp_ajax_cmp_ajax_upload_font', array( $this, 'cmp_ajax_upload_font' ) );
107
  add_action( 'wp_ajax_cmp_ajax_export_settings', array( $this, 'cmp_ajax_export_settings' ) );
108
  add_action( 'wp_ajax_cmp_ajax_import_settings', array( $this, 'cmp_ajax_import_settings' ) );
109
+ add_action( 'wp_ajax_nopriv_cmp_disable_comingsoon_ajax', array( $this, 'cmp_disable_comingsoon_ajax' ) );
110
  add_action( 'admin_head', array( $this,'cmp_admin_css') );
111
  add_action( 'after_setup_theme', array( $this,'cmp_create_translation'), 10 );
112
  add_action( 'after_setup_theme', array( $this,'cmp_register_wpml_strings'), 20 );
844
 
845
  }
846
 
 
 
 
 
847
 
848
  // if action set to redirect
849
  if ( $action == 'redirect' ) {
850
+ $redirect_url = esc_url( get_option('niteoCS_countdown_redirect') );
851
  header('Location: '.$redirect_url);
852
  die();
853
  }
1118
  return $downloadable_themes;
1119
  }
1120
 
1121
+ /**
1122
+ * Disable CMP Coming Soon Mode via AJAX
1123
+ *
1124
+ * @since 3.7.6
1125
+ * @access public
1126
+ * @return JSON
1127
+ */
1128
+ public function cmp_disable_comingsoon_ajax() {
1129
+
1130
+ check_ajax_referer( 'cmp-coming-soon-maintenance-nonce', 'security' );
1131
+
1132
+ if ( !empty( $_REQUEST['status'] ) && $_REQUEST['status'] === 'disable-cmp' ) {
1133
+ update_option('niteoCS_status', '0');
1134
+ }
1135
+
1136
+ $this->cmp_purge_cache();
1137
+
1138
+ echo json_encode( array( 'message' => 'success') );
1139
+ wp_die();
1140
+ }
1141
+
1142
  // theme updates function
1143
  public function cmp_check_update( $theme_slug ) {
1144
 
2516
  }
2517
 
2518
  return $image_url;
2519
+ }
2520
+
2521
 
2522
  /**
2523
  * Purge cache for popular caching plugins
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, coming soon page, launch page, maintenance mode, under constr
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.4
8
- Stable tag: 3.7.5.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -19,7 +19,7 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
19
  <h3>Live Preview</h3>
20
  <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?utm_source=wordpress.org&utm_medium=referral" target="_blank">Click for CMP preview>></a>
21
 
22
- <p>TIP! Change to another CMP Theme or the background by clicking on "settings icon" in the right sidebar.</p>
23
 
24
  <h3>Features</h3>
25
  <ul>
@@ -38,6 +38,7 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
38
  <li>All strings are Fully translatable.</li>
39
  <li>Display Login Icon Button on Coming soon pages.</li>
40
  <li>Compatible with custom WordPress login URL.</li>
 
41
  <li>Configurable Countdown Action - disable Coming soon / Maintenance mode, Hide counter or redirect to another website.</li>
42
  <li>Configurable SEO meta tags for search engines, editable favicon, Search Engine Visibility and No-cache Headers.</li>
43
  <li>Set response code to search engines (200 OK, 503 Maintenance).</li>
@@ -55,6 +56,7 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
55
  <li><a href="https://mailster.co/" target="_blank>Mailster – The Ultimate Newsletter Plugin for WordPress</a> fully integrated.</li>
56
  <li><a href="https://wordpress.org/plugins/mailoptin/" target="_blank>MailOptin – WordPress Popup, Optin Form, Email Newsletter Plugin</a> fully integrated.</li>
57
  <li><a href="https://wordpress.org/plugins/wps-hide-login/" target="_blank>WPS Hide Login full automatic compatibility.</li>
 
58
  <li>We are working on more plugins to be compatible with CMP - feel free to send us suggestions what plugin you might need together with CMP.</li>
59
  </ul>
60
 
@@ -152,7 +154,14 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
152
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
153
 
154
  == Changelog ==
155
- <h4>CMP 3.7.5.1 - xx- May-20</h4>
 
 
 
 
 
 
 
156
  <ul>
157
  <li>Resolved issue with Construct theme background image.</li>
158
  <li>New option to set custom Logo link URL - suggested by @ct001</li>
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.4
8
+ Stable tag: 3.7.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
19
  <h3>Live Preview</h3>
20
  <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?utm_source=wordpress.org&utm_medium=referral" target="_blank">Click for CMP preview>></a>
21
 
22
+ <p>TIP! Change to another CMP Theme, background or special effects in the right sidebar.</p>
23
 
24
  <h3>Features</h3>
25
  <ul>
38
  <li>All strings are Fully translatable.</li>
39
  <li>Display Login Icon Button on Coming soon pages.</li>
40
  <li>Compatible with custom WordPress login URL.</li>
41
+ <li>GDPR ready.</li>
42
  <li>Configurable Countdown Action - disable Coming soon / Maintenance mode, Hide counter or redirect to another website.</li>
43
  <li>Configurable SEO meta tags for search engines, editable favicon, Search Engine Visibility and No-cache Headers.</li>
44
  <li>Set response code to search engines (200 OK, 503 Maintenance).</li>
56
  <li><a href="https://mailster.co/" target="_blank>Mailster – The Ultimate Newsletter Plugin for WordPress</a> fully integrated.</li>
57
  <li><a href="https://wordpress.org/plugins/mailoptin/" target="_blank>MailOptin – WordPress Popup, Optin Form, Email Newsletter Plugin</a> fully integrated.</li>
58
  <li><a href="https://wordpress.org/plugins/wps-hide-login/" target="_blank>WPS Hide Login full automatic compatibility.</li>
59
+ <li><a href="https://wordpress.org/plugins/cookie-notice/" target="_blank>Cookie Notice for GDPR & CCPA full automatic compatibility.</li>
60
  <li>We are working on more plugins to be compatible with CMP - feel free to send us suggestions what plugin you might need together with CMP.</li>
61
  </ul>
62
 
154
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
155
 
156
  == Changelog ==
157
+ <h4>CMP 3.7.6 - 14-May-20</h4>
158
+ <ul>
159
+ <li>New option to display checkbox for Subscribe form GDPR message.</li>
160
+ <li>Compatibility added with 3rd party plugin Cookie Notice.</li>
161
+ <li>Resolved issue with clearing cache and Coming Soon mode disabling by expired counter. @leighjones123 thanks for your investigation and input!</li>
162
+ </ul>
163
+
164
+ <h4>CMP 3.7.5.1 - 11-May-20</h4>
165
  <ul>
166
  <li>Resolved issue with Construct theme background image.</li>
167
  <li>New option to set custom Logo link URL - suggested by @ct001</li>
themes/countdown/countdown-theme.php CHANGED
@@ -17,7 +17,7 @@
17
  }
18
 
19
  // render SEO
20
- $html->cmp_get_seo();
21
 
22
  $html->cmp_enqueue_styles( $themeslug, false , false, $banner_type, true, false);
23
 
17
  }
18
 
19
  // render SEO
20
+ echo $html->cmp_get_seo();
21
 
22
  $html->cmp_enqueue_styles( $themeslug, false , false, $banner_type, true, false);
23