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

Version Description

Download this release

Release Info

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

Code changes from version 2.9.2 to 2.9.3

cmp-advanced.php CHANGED
@@ -122,6 +122,9 @@ if ( isset( $_POST['niteoCS_roles_topbar'] ) ) {
122
  update_option('niteoCS_roles_topbar', '[]');
123
  }
124
 
 
 
 
125
  $niteoCS_page_filter = get_option('niteoCS_page_filter', '0');
126
 
127
  $niteoCS_page_whitelist = json_decode(get_option('niteoCS_page_whitelist', '[]'), true);
@@ -138,6 +141,8 @@ $bypass_id = get_option('niteoCS_bypass_id', md5( get_home_url() ));
138
 
139
  $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
140
 
 
 
141
  ?>
142
 
143
  <div class="wrap cmp-coming-soon-maintenance">
@@ -231,7 +236,7 @@ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
231
 
232
  <div class="table-wrapper general">
233
 
234
- <h3 class="no-icon"><?php _e('CMP User Roles Settings', 'cmp-coming-soon-maintenance');?></h3>
235
  <table class="general">
236
  <tbody>
237
  <tr>
@@ -276,45 +281,68 @@ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
276
  </td>
277
  </tr>
278
 
 
 
 
 
 
 
 
 
 
 
 
279
  <tr>
 
280
  <th>
281
  <fieldset>
282
  <legend class="screen-reader-text">
283
- <span><?php _e('Top Bar Switch Access', 'cmp-coming-soon-maintenance');?></span>
284
  </legend>
285
 
286
  <p>
287
- <h4><?php _e('Top Bar Switch Access', 'cmp-coming-soon-maintenance');?></h4>
 
 
 
 
 
 
 
 
288
  </p>
289
 
290
  </fieldset>
291
  </th>
292
 
293
  <td>
294
- <fieldset style="margin-top: 1em;">
295
- <h4><?php _e('Select User Roles which can access Top Bar CMP switch mode.', 'cmp-coming-soon-maintenance');?></h4>
296
 
297
- <select name="niteoCS_roles_topbar[]" class="cmp-user_roles" multiple="multiple">
 
298
 
299
- <?php
300
- $roles = get_editable_roles();
301
 
302
- foreach ( $roles as $role => $details ) {
 
303
 
304
- if ( $role != 'administrator') { ?>
305
- <option value="<?php echo esc_attr($role);?>" <?php echo in_array( $role, $niteoCS_roles_topbar ) ? 'selected' : '';?>><?php echo esc_attr( $details['name'] );?></option>
306
- <?php
307
- }
308
- } ?>
309
 
310
- </select>
 
311
 
312
- <p style="margin-top:0"><?php _e('Administrator role can always access Top Bar Switch.', 'cmp-coming-soon-maintenance');?></p>
 
 
313
 
314
  </fieldset>
315
 
 
 
316
  </td>
317
  </tr>
 
318
  <?php echo $this->render_settings->submit(); ?>
319
 
320
  </tbody>
@@ -323,26 +351,27 @@ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
323
  </div>
324
 
325
  <div class="table-wrapper general">
326
- <h3 class="no-icon"><?php _e('CMP Bypass URL', 'cmp-coming-soon-maintenance');?></h3>
 
327
  <table class="general">
328
  <tbody>
329
- <tr>
330
 
 
331
  <th>
332
  <fieldset>
333
  <legend class="screen-reader-text">
334
- <span><?php _e('Whitelist Settings', 'cmp-coming-soon-maintenance');?></span>
335
  </legend>
336
 
337
  <p>
338
- <label title="Page Whitelist">
339
- <input type="radio" class="cmp-bypass" name="niteoCS_bypass" value="1" <?php checked('1', $bypass);?>><?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
340
  </label>
341
  </p>
342
 
343
  <p>
344
  <label title="Disabled">
345
- <input type="radio" class="cmp-bypass" name="niteoCS_bypass" value="0" <?php checked('0', $bypass);?>><?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
346
  </label>
347
  </p>
348
 
@@ -350,33 +379,36 @@ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
350
  </th>
351
 
352
  <td>
353
-
354
- <fieldset class="cmp-bypass-switch x1" style="margin-top: 1em;">
355
 
356
- <h4 style="margin-bottom:0.5em"><?php _e('Bypass URL', 'cmp-coming-soon-maintenance');?></h4>
357
- <code><?php echo get_home_url().'/?cmp_bypass=' . $bypass_id;?></code>
358
-
359
- <p><?php _e('You can use this URL to bypass CMP maintenance page. Once you access your website with this URL, CMP Cookie will be set with default expiration of 2 days. If the cookie expires, you need to access your website again with this URL.', 'cmp-coming-soon-maintenance');?></p>
360
 
361
- <h4><?php _e('Set Bypass Passphrase', 'cmp-coming-soon-maintenance');?></h4>
362
- <input type="text" name="niteoCS_bypass_id" value="<?php echo esc_attr( $bypass_id ); ?>" class="regular-text code"><br>
363
 
364
- <p style="margin-top:0"><?php _e('You can use passphrase which contains letters, numbers, underscores or dashes only.', 'cmp-coming-soon-maintenance');?></p>
365
 
366
- <h4><?php _e('Set bypass cookie Expiration Time in seconds', 'cmp-coming-soon-maintenance');?></h4>
367
- <input type="text" name="niteoCS_bypass_expire" value="<?php echo esc_attr( $bypass_expire ); ?>" class="regular-text code"><br>
 
 
 
368
 
369
- <p style="margin-top:0"><?php _e('You can set custom Bypass CMP Cookie expiration time in seconds (1hour = 3600). Default expiration time is 2 days (172800).', 'cmp-coming-soon-maintenance');?></p>
370
 
371
- <p><?php _e('Please note this solution is using browser cookies which might not work correctly if you are using caching plugins.', 'cmp-coming-soon-maintenance');?></p>
372
 
373
  </fieldset>
374
-
375
- <p class="cmp-bypass-switch x0"><?php _e('You can Enable CMP Bypass where you can set custom URL parameter to bypass CMP page. You can send this URL to anyone who would like to sneak peak into your Website while it is under development or maintanence.', 'cmp-coming-soon-maintenance');?></p>
 
 
 
 
376
 
377
  </td>
378
  </tr>
379
-
380
  <?php echo $this->render_settings->submit(); ?>
381
 
382
  </tbody>
@@ -402,6 +434,7 @@ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
402
  jQuery(document).ready(function($){
403
  toggle_settings('page-whitelist');
404
  toggle_settings('cmp-bypass');
 
405
 
406
  function toggle_settings ( classname ) {
407
  // Logo type inputs
122
  update_option('niteoCS_roles_topbar', '[]');
123
  }
124
 
125
+
126
+
127
+
128
  $niteoCS_page_filter = get_option('niteoCS_page_filter', '0');
129
 
130
  $niteoCS_page_whitelist = json_decode(get_option('niteoCS_page_whitelist', '[]'), true);
141
 
142
  $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
143
 
144
+ $topbar_icon = get_option('niteoCS_topbar_icon', '1');
145
+
146
  ?>
147
 
148
  <div class="wrap cmp-coming-soon-maintenance">
236
 
237
  <div class="table-wrapper general">
238
 
239
+ <h3 class="no-icon"><?php _e('CMP Bypass by User Roles', 'cmp-coming-soon-maintenance');?></h3>
240
  <table class="general">
241
  <tbody>
242
  <tr>
281
  </td>
282
  </tr>
283
 
284
+ <?php echo $this->render_settings->submit(); ?>
285
+
286
+ </tbody>
287
+ </table>
288
+
289
+ </div>
290
+
291
+ <div class="table-wrapper general">
292
+ <h3 class="no-icon"><?php _e('CMP Bypass URL', 'cmp-coming-soon-maintenance');?></h3>
293
+ <table class="general">
294
+ <tbody>
295
  <tr>
296
+
297
  <th>
298
  <fieldset>
299
  <legend class="screen-reader-text">
300
+ <span><?php _e('Whitelist Settings', 'cmp-coming-soon-maintenance');?></span>
301
  </legend>
302
 
303
  <p>
304
+ <label title="Page Whitelist">
305
+ <input type="radio" class="cmp-bypass" name="niteoCS_bypass" value="1" <?php checked('1', $bypass);?>><?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
306
+ </label>
307
+ </p>
308
+
309
+ <p>
310
+ <label title="Disabled">
311
+ <input type="radio" class="cmp-bypass" name="niteoCS_bypass" value="0" <?php checked('0', $bypass);?>><?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
312
+ </label>
313
  </p>
314
 
315
  </fieldset>
316
  </th>
317
 
318
  <td>
319
+
320
+ <fieldset class="cmp-bypass-switch x1" style="margin-top: 1em;">
321
 
322
+ <h4 style="margin-bottom:0.5em"><?php _e('Bypass URL', 'cmp-coming-soon-maintenance');?></h4>
323
+ <code><?php echo get_home_url().'/?cmp_bypass=' . $bypass_id;?></code>
324
 
325
+ <p><?php _e('You can use this URL to bypass CMP maintenance page. Once you access your website with this URL, CMP Cookie will be set with default expiration of 2 days. If the cookie expires, you need to access your website again with this URL.', 'cmp-coming-soon-maintenance');?></p>
 
326
 
327
+ <h4><?php _e('Set Bypass Passphrase', 'cmp-coming-soon-maintenance');?></h4>
328
+ <input type="text" name="niteoCS_bypass_id" value="<?php echo esc_attr( $bypass_id ); ?>" class="regular-text code"><br>
329
 
330
+ <p style="margin-top:0"><?php _e('You can use passphrase which contains letters, numbers, underscores or dashes only.', 'cmp-coming-soon-maintenance');?></p>
 
 
 
 
331
 
332
+ <h4><?php _e('Set bypass cookie Expiration Time in seconds', 'cmp-coming-soon-maintenance');?></h4>
333
+ <input type="text" name="niteoCS_bypass_expire" value="<?php echo esc_attr( $bypass_expire ); ?>" class="regular-text code"><br>
334
 
335
+ <p style="margin-top:0"><?php _e('You can set custom Bypass CMP Cookie expiration time in seconds (1hour = 3600). Default expiration time is 2 days (172800).', 'cmp-coming-soon-maintenance');?></p>
336
+
337
+ <p><?php _e('Please note this solution is using browser cookies which might not work correctly if you are using caching plugins.', 'cmp-coming-soon-maintenance');?></p>
338
 
339
  </fieldset>
340
 
341
+ <p class="cmp-bypass-switch x0"><?php _e('You can Enable CMP Bypass where you can set custom URL parameter to bypass CMP page. You can send this URL to anyone who would like to sneak peak into your Website while it is under development or maintanence.', 'cmp-coming-soon-maintenance');?></p>
342
+
343
  </td>
344
  </tr>
345
+
346
  <?php echo $this->render_settings->submit(); ?>
347
 
348
  </tbody>
351
  </div>
352
 
353
  <div class="table-wrapper general">
354
+
355
+ <h3 class="no-icon"><?php _e('CMP Top Bar Icon', 'cmp-coming-soon-maintenance');?></h3>
356
  <table class="general">
357
  <tbody>
 
358
 
359
+ <tr>
360
  <th>
361
  <fieldset>
362
  <legend class="screen-reader-text">
363
+ <span><?php _e('CMP Top Bar Icon', 'cmp-coming-soon-maintenance');?></span>
364
  </legend>
365
 
366
  <p>
367
+ <label title="Enabled">
368
+ <input type="radio" class="cmp-topbar-icon" name="niteoCS_topbar_icon" value="1" <?php checked('1', $topbar_icon);?>><?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
369
  </label>
370
  </p>
371
 
372
  <p>
373
  <label title="Disabled">
374
+ <input type="radio" class="cmp-topbar-icon" name="niteoCS_topbar_icon" value="0" <?php checked('0', $topbar_icon);?>><?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
375
  </label>
376
  </p>
377
 
379
  </th>
380
 
381
  <td>
382
+ <fieldset class="cmp-topbar-icon-switch x1" style="margin-top: 1em;">
383
+ <h4><?php _e('You can specify which roles have access to CMP Top Bar icon.', 'cmp-coming-soon-maintenance');?></h4>
384
 
385
+ <select name="niteoCS_roles_topbar[]" class="cmp-user_roles" multiple="multiple">
 
 
 
386
 
387
+ <?php
388
+ $roles = get_editable_roles();
389
 
390
+ foreach ( $roles as $role => $details ) {
391
 
392
+ if ( $role != 'administrator') { ?>
393
+ <option value="<?php echo esc_attr($role);?>" <?php echo in_array( $role, $niteoCS_roles_topbar ) ? 'selected' : '';?>><?php echo esc_attr( $details['name'] );?></option>
394
+ <?php
395
+ }
396
+ } ?>
397
 
398
+ </select>
399
 
400
+ <p style="margin-top:0"><?php _e('Administrator role can always access Top Bar Icon', 'cmp-coming-soon-maintenance');?></p>
401
 
402
  </fieldset>
403
+
404
+ <div class="cmp-topbar-icon-switch x0">
405
+ <p><?php _e('CMP Top Bar Icon is disabled.', 'cmp-coming-soon-maintenance');?></p>
406
+ <img src="<?php echo plugins_url('/img/topbar.png', __FILE__);?>" alt="CMP Top Bar Icon">
407
+ <p><?php _e(' If you enable it again, you can quickly enable or disable Coming Soon Mode or check out CMP Preview without visiting CMP Settings Plugin page.', 'cmp-coming-soon-maintenance');?></p>
408
+ </div>
409
 
410
  </td>
411
  </tr>
 
412
  <?php echo $this->render_settings->submit(); ?>
413
 
414
  </tbody>
434
  jQuery(document).ready(function($){
435
  toggle_settings('page-whitelist');
436
  toggle_settings('cmp-bypass');
437
+ toggle_settings('cmp-topbar-icon');
438
 
439
  function toggle_settings ( classname ) {
440
  // Logo type inputs
cmp-settings.php CHANGED
@@ -5,6 +5,8 @@ $themeslug = $this->cmp_selectedTheme();
5
  $downloadable_themes = $this->cmp_downloadable_themes();
6
  $ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
7
 
 
 
8
  // check onces and wordpress rights, else DIE
9
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
10
 
@@ -29,16 +31,16 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
29
  update_option('niteoCS_theme', sanitize_text_field($_POST['niteoCS_select_theme']));
30
  }
31
 
32
- if (isset($_POST['niteoCS_logo_id_'.$themeslug]) && ( is_numeric($_POST['niteoCS_logo_id_'.$themeslug]) || empty($_POST['niteoCS_logo_id_'.$themeslug]))) {
33
- update_option('niteoCS_logo_id['.$themeslug.']', sanitize_text_field($_POST['niteoCS_logo_id_'.$themeslug]));
34
- }
35
-
36
- if (isset($_POST['niteoCS_logo_type_'.$themeslug])) {
37
- update_option('niteoCS_logo_type['.$themeslug.']', sanitize_text_field($_POST['niteoCS_logo_type_'.$themeslug]));
38
  }
39
 
40
- if (isset($_POST['niteoCS_text_logo_'.$themeslug])) {
41
- update_option('niteoCS_text_logo['.$themeslug.']', sanitize_text_field($_POST['niteoCS_text_logo_'.$themeslug]));
 
 
 
 
42
  }
43
 
44
  if (isset($_POST['niteoCS_font_headings_'.$themeslug])) {
@@ -344,9 +346,10 @@ $seo_nocache = get_option('niteoCS_seo_nocache', '0');
344
  $niteoCS_custom_css = stripslashes(get_option('niteoCS_custom_css', ''));
345
 
346
  //get theme specific settings
347
- $niteoCS_logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
348
- $niteoCS_logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
349
- $niteoCS_text_logo = stripslashes(get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' )));
 
350
  $niteoCS_heading_animation = get_option('niteoCS_heading_animation['.$themeslug.']', 'fadeInDown');
351
  $niteoCS_content_animation = get_option('niteoCS_content_animation['.$themeslug.']', 'fadeInUp');
352
 
@@ -496,9 +499,9 @@ add_thickbox();
496
  <h2 class="nav-tab-wrapper">
497
  <a class="nav-tab nav-tab-active general" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
498
 
499
- <a class="nav-tab content" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="content"><i class="fa fa-pencil-square-o" aria-hidden="true"></i><?php _e('Global Content', 'cmp-coming-soon-maintenance');?></a>
500
 
501
- <a class="nav-tab theme-setup" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="theme-setup"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Theme Setup', 'cmp-coming-soon-maintenance');?></a>
502
 
503
  <a class="nav-tab seo" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="seo"><i class="fa fa-line-chart" aria-hidden="true"></i><?php _e('SEO & Analytics', 'cmp-coming-soon-maintenance');?></a>
504
 
@@ -693,10 +696,25 @@ add_thickbox();
693
  </div>
694
 
695
  <?php
696
- } // if !empty($premium_themes ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
 
698
  <div class="table-wrapper content">
699
- <h3><?php _e('Content', 'cmp-coming-soon-maintenance');?></h3>
700
  <table class="content">
701
  <tbody>
702
  <tr class="body-title">
@@ -712,7 +730,12 @@ add_thickbox();
712
  <th><?php _e('Message', 'cmp-coming-soon-maintenance');?></th>
713
  <td>
714
  <?php wp_editor( $this->niteo_sanitize_html( $niteoCS_body ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
 
 
715
  </td>
 
 
 
716
  </tr>
717
 
718
  <?php echo $this->render_settings->submit(); ?>
@@ -902,19 +925,6 @@ add_thickbox();
902
  }
903
 
904
  }
905
-
906
- // get logo settings
907
- if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
908
- if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-logo.php' ) ) {
909
- require ( dirname(__FILE__) . '/inc/settings/settings-logo.php' );
910
- }
911
-
912
- } else {
913
- if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-logo-disabled.php' ) ) {
914
- require ( dirname(__FILE__) . '/inc/settings/settings-logo-disabled.php' );
915
- }
916
-
917
- }
918
 
919
  // get background settings
920
  if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-background.php' ) ) {
5
  $downloadable_themes = $this->cmp_downloadable_themes();
6
  $ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
7
 
8
+ $logo_type = get_option('niteoCS_logo_type[test');
9
+
10
  // check onces and wordpress rights, else DIE
11
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
12
 
31
  update_option('niteoCS_theme', sanitize_text_field($_POST['niteoCS_select_theme']));
32
  }
33
 
34
+ if (isset($_POST['niteoCS_logo_type'])) {
35
+ update_option('niteoCS_logo_type', sanitize_text_field($_POST['niteoCS_logo_type']));
 
 
 
 
36
  }
37
 
38
+ if (isset($_POST['niteoCS_logo_id']) && ( is_numeric($_POST['niteoCS_logo_id']) || empty($_POST['niteoCS_logo_id']))) {
39
+ update_option('niteoCS_logo_id', sanitize_text_field($_POST['niteoCS_logo_id']));
40
+ }
41
+
42
+ if (isset($_POST['niteoCS_text_logo'])) {
43
+ update_option('niteoCS_text_logo', sanitize_text_field($_POST['niteoCS_text_logo']));
44
  }
45
 
46
  if (isset($_POST['niteoCS_font_headings_'.$themeslug])) {
346
  $niteoCS_custom_css = stripslashes(get_option('niteoCS_custom_css', ''));
347
 
348
  //get theme specific settings
349
+ $niteoCS_logo_type = get_option('niteoCS_logo_type', 'text');
350
+ $niteoCS_logo_id = get_option('niteoCS_logo_id');
351
+ $niteoCS_text_logo = stripslashes(get_option('niteoCS_text_logo', get_bloginfo( 'name', 'display' )));
352
+
353
  $niteoCS_heading_animation = get_option('niteoCS_heading_animation['.$themeslug.']', 'fadeInDown');
354
  $niteoCS_content_animation = get_option('niteoCS_content_animation['.$themeslug.']', 'fadeInUp');
355
 
499
  <h2 class="nav-tab-wrapper">
500
  <a class="nav-tab nav-tab-active general" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp-coming-soon-maintenance');?></a>
501
 
502
+ <a class="nav-tab content" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="content"><i class="fa fa-pencil-square-o" aria-hidden="true"></i><?php _e('Content', 'cmp-coming-soon-maintenance');?></a>
503
 
504
+ <a class="nav-tab theme-setup" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="theme-setup"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Customize', 'cmp-coming-soon-maintenance');?></a>
505
 
506
  <a class="nav-tab seo" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings" data-tab="seo"><i class="fa fa-line-chart" aria-hidden="true"></i><?php _e('SEO & Analytics', 'cmp-coming-soon-maintenance');?></a>
507
 
696
  </div>
697
 
698
  <?php
699
+ } // if !empty($premium_themes
700
+
701
+
702
+ // get logo settings
703
+ if ( isset( $theme_supports['logo'] ) && $theme_supports['logo'] ) {
704
+ if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-logo.php' ) ) {
705
+ require ( dirname(__FILE__) . '/inc/settings/settings-logo.php' );
706
+ }
707
+
708
+ } else {
709
+ if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-logo-disabled.php' ) ) {
710
+ require ( dirname(__FILE__) . '/inc/settings/settings-logo-disabled.php' );
711
+ }
712
+
713
+ } ?>
714
+
715
 
716
  <div class="table-wrapper content">
717
+ <h3><?php _e('Text Content', 'cmp-coming-soon-maintenance');?></h3>
718
  <table class="content">
719
  <tbody>
720
  <tr class="body-title">
730
  <th><?php _e('Message', 'cmp-coming-soon-maintenance');?></th>
731
  <td>
732
  <?php wp_editor( $this->niteo_sanitize_html( $niteoCS_body ), 'niteoCS_body', $settings = array('textarea_name'=>'niteoCS_body', 'editor_height'=>'300') ); ?>
733
+
734
+ <span class="cmp-hint">* <?php _e('WordPress embeds are fully supported. You can also add any custom HTML. No 3rd party shortcodes are currently supported.', 'cmp-coming-soon-maintenance');?></span>
735
  </td>
736
+
737
+
738
+
739
  </tr>
740
 
741
  <?php echo $this->render_settings->submit(); ?>
925
  }
926
 
927
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
928
 
929
  // get background settings
930
  if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-background.php' ) ) {
img/topbar.png ADDED
Binary file
inc/class-cmp-render_html.php CHANGED
@@ -22,6 +22,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
22
  case 'frame':
23
  case 'eclipse':
24
  case 'element':
 
25
  // default image
26
  $niteoCS_banner = '2';
27
  break;
@@ -518,18 +519,44 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
518
 
519
  // Render Logo
520
  public function cmp_logo( $themeslug, $class = '' ) {
521
- $logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
522
- $size = $this->isMobile() ? 'large' : 'full';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  $html = '';
524
  $class = ( $class != '' ) ? ' ' . $class : $class;
525
 
526
  switch ( $logo_type ) {
527
  case 'graphic':
528
  // get logo id
529
- $logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
530
  // get logo
531
  if ( $logo_id != '' ) {
532
- $logo_url = wp_get_attachment_image_src( $logo_id, $size );
533
  }
534
 
535
  if ( isset($logo_url[0]) ) {
@@ -538,7 +565,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
538
  break;
539
 
540
  case 'text':
541
- $text_logo = stripslashes(get_option('niteoCS_text_logo['.$themeslug.']', get_bloginfo( 'name', 'display' )));
542
  $html = '<div class="logo-wrapper text text-logo-wrapper' . esc_attr( $class ) . '"><h1 class="text-logo">'.esc_html( $text_logo ).'</h1></div>';
543
  break;
544
 
@@ -888,6 +915,10 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
888
  case 'element':
889
  $title = 'Coming Soon';
890
  break;
 
 
 
 
891
 
892
  default:
893
  break;
@@ -1467,6 +1498,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1467
 
1468
  // check if content includes iframe, and if yes, include full-width video resize script
1469
  $content = $this->cmp_get_body();
 
1470
  if ( strpos( $content, 'iframe' ) !== false ) { ?>
1471
  <!-- Script for full-width size of embedded UT and VIMEO Iframes -->
1472
  <script>
22
  case 'frame':
23
  case 'eclipse':
24
  case 'element':
25
+ case 'vega':
26
  // default image
27
  $niteoCS_banner = '2';
28
  break;
519
 
520
  // Render Logo
521
  public function cmp_logo( $themeslug, $class = '' ) {
522
+ $logo_type = get_option('niteoCS_logo_type', 'text');
523
+
524
+ if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
525
+ $theme = esc_attr( $_GET['theme'] );
526
+ switch ( $theme ) {
527
+ case 'construct':
528
+ case 'hardwork':
529
+ case 'eclipse':
530
+ case 'frame':
531
+ case 'postery':
532
+ $logo_type = 'text';
533
+ break;
534
+
535
+ case 'stylo':
536
+ case 'hardwork_premium':
537
+ case 'fifty':
538
+ case 'element':
539
+ case 'apollo':
540
+ case 'countdown':
541
+ $logo_type = 'graphic';
542
+ break;
543
+
544
+ default:
545
+ $logo_type = 'disabled';
546
+ break;
547
+ }
548
+ }
549
+
550
  $html = '';
551
  $class = ( $class != '' ) ? ' ' . $class : $class;
552
 
553
  switch ( $logo_type ) {
554
  case 'graphic':
555
  // get logo id
556
+ $logo_id = get_option('niteoCS_logo_id');
557
  // get logo
558
  if ( $logo_id != '' ) {
559
+ $logo_url = wp_get_attachment_image_src( $logo_id, 'full' );
560
  }
561
 
562
  if ( isset($logo_url[0]) ) {
565
  break;
566
 
567
  case 'text':
568
+ $text_logo = stripslashes(get_option('niteoCS_text_logo', get_bloginfo( 'name', 'display' )));
569
  $html = '<div class="logo-wrapper text text-logo-wrapper' . esc_attr( $class ) . '"><h1 class="text-logo">'.esc_html( $text_logo ).'</h1></div>';
570
  break;
571
 
915
  case 'element':
916
  $title = 'Coming Soon';
917
  break;
918
+
919
+ case 'vega':
920
+ $title = 'NITEOTHEMES IS *COMING SOON!*';
921
+ break;
922
 
923
  default:
924
  break;
1498
 
1499
  // check if content includes iframe, and if yes, include full-width video resize script
1500
  $content = $this->cmp_get_body();
1501
+
1502
  if ( strpos( $content, 'iframe' ) !== false ) { ?>
1503
  <!-- Script for full-width size of embedded UT and VIMEO Iframes -->
1504
  <script>
inc/cmp-update-process.php CHANGED
@@ -9,6 +9,14 @@ if ( !get_option( 'niteoCS_version' ) ) {
9
 
10
  if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
11
 
 
 
 
 
 
 
 
 
12
  // add translation string
13
  if ( get_option('niteoCS_translation') ) {
14
  $translation = json_decode( get_option('niteoCS_translation') );
@@ -97,29 +105,6 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
97
  }
98
  }
99
 
100
- // migrate overlay color and opacity settings after update 2.8
101
-
102
- $current_theme = get_option('niteoCS_theme');
103
-
104
- if ( $current_theme ) {
105
- $overlay_color = get_option('niteoCS_overlay_color['.$current_theme.']');
106
- $overlay_opacity = get_option('niteoCS_overlay_opacity['.$current_theme.']');
107
-
108
- if ( $overlay_color ) {
109
- update_option( 'niteoCS_overlay['.$current_theme.']', 'solid-color' );
110
- update_option( 'niteoCS_overlay['.$current_theme.'][color]', $overlay_color );
111
- }
112
-
113
- if ( $overlay_opacity ) {
114
- update_option( 'niteoCS_overlay['.$current_theme.'][opacity]', $overlay_opacity );
115
- }
116
-
117
- delete_option('niteoCS_overlay_color['.$current_theme.']');
118
- delete_option('niteoCS_overlay_opacity['.$current_theme.']');
119
-
120
- }
121
-
122
-
123
  // check for < 1.8 version where subscriber ID was not set
124
  if ( get_option('niteoCS_subscribers_list') ) {
125
  $subscribe_list = get_option('niteoCS_subscribers_list');
@@ -139,31 +124,39 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
139
  }
140
  }
141
 
142
- // delete transients for theme updates, to ensure the updates for latest cmp versions runs again
143
- foreach ( $this->cmp_premium_themes_installed() as $theme_slug ) {
144
- delete_transient( $theme_slug.'_updatecheck' );
145
- }
146
-
147
  // migrate overlay color and opacity settings after update 2.8
 
 
 
 
 
 
 
 
148
 
149
- $current_theme = get_option('niteoCS_theme');
 
 
 
150
 
151
- if ( $current_theme ) {
152
- $overlay_color = get_option('niteoCS_overlay_color['.$current_theme.']');
153
- $overlay_opacity = get_option('niteoCS_overlay_opacity['.$current_theme.']');
 
154
 
155
- if ( $overlay_color ) {
156
- update_option( 'niteoCS_overlay['.$current_theme.']', 'color' );
157
- update_option( 'niteoCS_overlay['.$current_theme.'][color]', $overlay_color );
158
- }
159
 
160
- if ( $overlay_opacity ) {
161
- update_option( 'niteoCS_overlay['.$current_theme.'][opacity]', $overlay_opacity );
162
- }
163
-
164
- delete_option('niteoCS_overlay_color['.$current_theme.']');
165
- delete_option('niteoCS_overlay_opacity['.$current_theme.']');
166
 
 
 
 
167
  }
168
 
169
  // bump version for next udpate check
9
 
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
16
+ foreach ( $premium_themes as $theme_slug ) {
17
+ delete_transient( $theme_slug.'_updatecheck' );
18
+ }
19
+
20
  // add translation string
21
  if ( get_option('niteoCS_translation') ) {
22
  $translation = json_decode( get_option('niteoCS_translation') );
105
  }
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  // check for < 1.8 version where subscriber ID was not set
109
  if ( get_option('niteoCS_subscribers_list') ) {
110
  $subscribe_list = get_option('niteoCS_subscribers_list');
124
  }
125
  }
126
 
 
 
 
 
 
127
  // migrate overlay color and opacity settings after update 2.8
128
+ $overlay_color = get_option('niteoCS_overlay_color['.$current_theme.']');
129
+ $overlay_opacity = get_option('niteoCS_overlay_opacity['.$current_theme.']');
130
+
131
+ if ( $overlay_color ) {
132
+ update_option( 'niteoCS_overlay['.$current_theme.']', 'color' );
133
+ update_option( 'niteoCS_overlay['.$current_theme.'][color]', $overlay_color );
134
+ delete_option('niteoCS_overlay_color['.$current_theme.']');
135
+ }
136
 
137
+ if ( $overlay_opacity ) {
138
+ update_option( 'niteoCS_overlay['.$current_theme.'][opacity]', $overlay_opacity );
139
+ delete_option('niteoCS_overlay_opacity['.$current_theme.']');
140
+ }
141
 
142
+ // 2.9.3 version - migrate logo per theme settings to only one settings for all themes
143
+ $logo_type = get_option('niteoCS_logo_type['.$current_theme.']');
144
+ $niteoCS_logo_id = get_option('niteoCS_logo_id['.$current_theme.']');
145
+ $niteoCS_text_logo = get_option('niteoCS_text_logo['.$current_theme.']');
146
 
147
+ if ( $logo_type ) {
148
+ update_option( 'niteoCS_logo_type', $logo_type );
149
+ delete_option('niteoCS_logo_type['.$current_theme.']');
150
+ }
151
 
152
+ if ( $niteoCS_logo_id ) {
153
+ update_option( 'niteoCS_logo_id', $niteoCS_logo_id );
154
+ delete_option('niteoCS_logo_id['.$current_theme.']');
155
+ }
 
 
156
 
157
+ if ( $niteoCS_text_logo ) {
158
+ update_option( 'niteoCS_text_logo', $niteoCS_text_logo );
159
+ delete_option('niteoCS_text_logo['.$current_theme.']');
160
  }
161
 
162
  // bump version for next udpate check
inc/settings/settings-counter.php CHANGED
@@ -1,12 +1,16 @@
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
 
4
- if (isset($_POST['niteoCS_counter']) && is_numeric( $_POST['niteoCS_counter'] )) {
5
  update_option('niteoCS_counter', sanitize_text_field( $_POST['niteoCS_counter'] ));
6
  }
7
 
8
- if (isset($_POST['niteoCS_counter_date'])) {
9
  update_option('niteoCS_counter_date', sanitize_text_field( $_POST['niteoCS_counter_date'] ));
 
 
 
 
10
  }
11
 
12
  if (isset($_POST['niteoCS_countdown_action'])) {
@@ -94,6 +98,8 @@ $niteoCS_counter_heading = get_option('niteoCS_counter_heading', 'STAY TUNED, W
94
 
95
  </select>
96
 
 
 
97
  <label for="niteoCS_countdown_redirect" class="counter-action redirect" style="padding-top:1em"><?php _e('Enter redirect URL', 'cmp-coming-soon-maintenance');?>
98
  <input type="text" id="niteoCS_countdown_redirect" name="niteoCS_countdown_redirect" value="<?php echo esc_url( $niteoCS_countdown_redirect ); ?>" class="regular-text code"><br>
99
  </label>
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
 
4
+ if ( isset($_POST['niteoCS_counter']) && is_numeric( $_POST['niteoCS_counter'] )) {
5
  update_option('niteoCS_counter', sanitize_text_field( $_POST['niteoCS_counter'] ));
6
  }
7
 
8
+ if ( isset($_POST['niteoCS_counter_date']) ) {
9
  update_option('niteoCS_counter_date', sanitize_text_field( $_POST['niteoCS_counter_date'] ));
10
+
11
+ if ( $_POST['niteoCS_counter_date'] > time() ) {
12
+ delete_transient( 'cmp_counter_email' );
13
+ }
14
  }
15
 
16
  if (isset($_POST['niteoCS_countdown_action'])) {
98
 
99
  </select>
100
 
101
+ <span class="cmp-hint">* <?php echo sprintf(__('Notification Email will be sent to Administrator email %s once Counter expires.', 'cmp-coming-soon-maintenance'), '('. get_option( 'admin_email' ) . ')');?></span>
102
+
103
  <label for="niteoCS_countdown_redirect" class="counter-action redirect" style="padding-top:1em"><?php _e('Enter redirect URL', 'cmp-coming-soon-maintenance');?>
104
  <input type="text" id="niteoCS_countdown_redirect" name="niteoCS_countdown_redirect" value="<?php echo esc_url( $niteoCS_countdown_redirect ); ?>" class="regular-text code"><br>
105
  </label>
inc/settings/settings-logo.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
 
3
  ?>
4
- <div class="table-wrapper theme-setup">
5
  <h3><?php _e('Logo Setup', 'cmp-coming-soon-maintenance');?></h3>
6
  <table class="theme-setup">
7
  <tbody>
@@ -14,19 +15,19 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
14
 
15
  <p>
16
  <label title="<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>">
17
- <input type="radio" class="cmp-logo" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="text"<?php if ( $niteoCS_logo_type == 'text') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>
18
  </label>
19
  </p>
20
 
21
  <p>
22
  <label title="<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>">
23
- <input type="radio" class="cmp-logo" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="graphic"<?php if ( $niteoCS_logo_type == 'graphic') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>
24
  </label>
25
  </p>
26
 
27
  <p>
28
  <label title="<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>">
29
- <input type="radio" class="cmp-logo" name="niteoCS_logo_type_<?php echo esc_attr($themeslug);?>" value="disabled"<?php if ( $niteoCS_logo_type == 'disabled') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
30
  </label>
31
  </p>
32
 
@@ -36,13 +37,13 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
36
  <td>
37
  <fieldset class="cmp-logo-switch text">
38
  <p>
39
- <input type="text" class="widefat" id="niteoCS-text-logo" name="niteoCS_text_logo_<?php echo esc_attr($themeslug);?>" placeholder="<?php _e('Click to set..', 'cmp-coming-soon-maintenance');?>" value="<?php echo esc_attr($niteoCS_text_logo); ?>" />
40
  </p>
41
  </fieldset>
42
 
43
  <fieldset class="cmp-logo-switch graphic">
44
 
45
- <input type="hidden" class="widefat" id="niteoCS-logo-id" name="niteoCS_logo_id_<?php echo esc_attr($themeslug);?>" value="<?php echo esc_attr( $niteoCS_logo_id ); ?>" />
46
  <input id="add-logo" type="button" class="button" value="Select Logo" />
47
 
48
  <div class="logo-wrapper">
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+
4
  ?>
5
+ <div class="table-wrapper content">
6
  <h3><?php _e('Logo Setup', 'cmp-coming-soon-maintenance');?></h3>
7
  <table class="theme-setup">
8
  <tbody>
15
 
16
  <p>
17
  <label title="<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>">
18
+ <input type="radio" class="cmp-logo" name="niteoCS_logo_type" value="text"<?php if ( $niteoCS_logo_type == 'text') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Text Logo', 'cmp-coming-soon-maintenance');?>
19
  </label>
20
  </p>
21
 
22
  <p>
23
  <label title="<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>">
24
+ <input type="radio" class="cmp-logo" name="niteoCS_logo_type" value="graphic"<?php if ( $niteoCS_logo_type == 'graphic') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Graphic Logo', 'cmp-coming-soon-maintenance');?>
25
  </label>
26
  </p>
27
 
28
  <p>
29
  <label title="<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>">
30
+ <input type="radio" class="cmp-logo" name="niteoCS_logo_type" value="disabled"<?php if ( $niteoCS_logo_type == 'disabled') { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
31
  </label>
32
  </p>
33
 
37
  <td>
38
  <fieldset class="cmp-logo-switch text">
39
  <p>
40
+ <input type="text" class="widefat" id="niteoCS-text-logo" name="niteoCS_text_logo" placeholder="<?php _e('Click to set..', 'cmp-coming-soon-maintenance');?>" value="<?php echo esc_attr($niteoCS_text_logo); ?>" />
41
  </p>
42
  </fieldset>
43
 
44
  <fieldset class="cmp-logo-switch graphic">
45
 
46
+ <input type="hidden" class="widefat" id="niteoCS-logo-id" name="niteoCS_logo_id" value="<?php echo esc_attr( $niteoCS_logo_id ); ?>" />
47
  <input id="add-logo" type="button" class="button" value="Select Logo" />
48
 
49
  <div class="logo-wrapper">
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: 2.9.2
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -66,7 +66,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
66
  private function constants() {
67
 
68
  // define constants
69
- $this->define( 'CMP_VERSION', '2.9.2' );
70
  $this->define( 'CMP_DEBUG', FALSE );
71
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
72
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
@@ -183,7 +183,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
183
  * @return array
184
  */
185
  public function cmp_countdown_themes() {
186
- return array( 'frame', 'countdown', 'postery', 'countdown2', 'stylo', 'element', 'apollo', 'vega' );
187
  }
188
 
189
  /**
@@ -193,7 +193,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
193
  * @return array
194
  */
195
  public function cmp_font_animation_themes() {
196
- return array( 'hardwork_premium', 'fifty', 'orbit', 'stylo', 'apollo', 'vega' );
197
  }
198
 
199
  /**
@@ -228,10 +228,20 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
228
  */
229
  public function cmp_add_admin_style() {
230
 
 
231
  if ( !is_user_logged_in() ) {
232
  return;
233
  }
234
 
 
 
 
 
 
 
 
 
 
235
  $roles_topbar = json_decode( get_option('niteoCS_roles_topbar', '[]'), true );
236
 
237
  // push WP administrator to roles array, since it is default
@@ -245,8 +255,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
245
  // enqueue topbar script and style only, if current user is allowed to display topbar, or is admin
246
  foreach ( $current_user->roles as $role ) {
247
  if ( in_array( $role, $roles_topbar ) ) {
248
- wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__), '', CMP_VERSION);
249
- wp_enqueue_style( 'cmp_admin_style' );
250
  wp_register_script( 'cmp_admin_script', plugins_url('/js/cmp-admin-head.js', __FILE__), array('jquery'), CMP_VERSION);
251
  wp_enqueue_script( 'cmp_admin_script' );
252
  wp_localize_script( 'cmp_admin_script', 'cmp_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
@@ -256,8 +264,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
256
 
257
  // this one is for broken wp admin, where current user does not have any roles
258
  } else {
259
- wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__), '', CMP_VERSION);
260
- wp_enqueue_style( 'cmp_admin_style' );
261
  wp_register_script( 'cmp_admin_script', plugins_url('/js/cmp-admin-head.js', __FILE__), array('jquery'), CMP_VERSION);
262
  wp_enqueue_script( 'cmp_admin_script' );
263
  }
@@ -447,8 +453,10 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
447
  }
448
  }
449
 
 
 
450
  // bypass CMP and set cookie for user defined period of time, if bypass is enabled, bypass ID is set, and match CMP bypass settings
451
- if ( isset($_GET['cmp_bypass']) && $_GET['cmp_bypass'] == get_option('niteoCS_bypass_id', md5( get_home_url() )) && get_option('niteoCS_bypass', '0') == '1' ) {
452
  nocache_headers();
453
  header('Cache-Control: max-age=0; private');
454
  setcookie('cmp_bypass', get_option('niteoCS_bypass_id', md5( get_home_url() ) ), time() + get_option('niteoCS_bypass_expire', '172800'));
@@ -470,23 +478,60 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
470
 
471
  // if themes with countdown timer
472
  if ( in_array($this->cmp_selectedTheme(), $this->cmp_countdown_themes()) ){
473
- // if counter is enabled
 
474
  if ( get_option('niteoCS_counter', '1') == '1' ) {
475
- // if countdown date is set
 
476
  if ( get_option('niteoCS_counter_date' ) && get_option('niteoCS_counter_date' ) != '' ) {
477
- // if timer < timestamp do set action
 
478
  if ( get_option('niteoCS_counter_date' ) < time() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  // if action set to disable cmp
480
- if ( get_option('niteoCS_countdown_action') == 'disable-cmp' ) {
481
  update_option('niteoCS_activation', '0');
482
  }
483
 
484
  // if action set to redirect
485
- if ( get_option('niteoCS_countdown_action') == 'redirect' ) {
486
  $redirect_url = esc_url(get_option('niteoCS_countdown_redirect'));
487
  header('Location: '.$redirect_url);
488
  die();
489
  }
 
490
  }
491
  }
492
  }
@@ -609,12 +654,21 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
609
  // display admin topbar notice
610
  public function cmp_admin_bar() {
611
 
 
 
 
 
 
 
 
 
 
612
  if ( !$this->cmp_user_can_admin_bar_activation() ) {
613
  return false;
614
  }
615
 
616
  // CMP PLUGIN ACTIVATION AND STATUS CHANGE SETTINGS!
617
- if ( $_SERVER['REQUEST_METHOD'] == 'POST' && ( function_exists('get_current_screen') && get_current_screen() && get_current_screen()->id == 'toplevel_page_cmp-settings' ) ) {
618
 
619
  // verify nonce and user rights
620
  if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
@@ -622,13 +676,12 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
622
  }
623
 
624
  if ( isset($_POST['activate']) && is_numeric($_POST['activate']) ) {
625
- update_option('niteoCS_activation', sanitize_text_field($_POST['activate']));
626
  }
627
 
628
  if ( isset($_POST['cmp_status']) ) {
629
- update_option('niteoCS_status', $this->sanitize_checkbox($_POST['cmp_status']) );
630
  } else {
631
-
632
  update_option('niteoCS_status', false);
633
  }
634
  }
@@ -727,6 +780,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
727
  }
728
 
729
  $this->cmp_purge_cache();
 
 
730
  }
731
 
732
  // returns list of premium themes => manually defined
@@ -734,6 +789,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
734
 
735
  $premium_themes = array();
736
 
 
 
737
  array_push( $premium_themes, array('name' => 'vega', 'url' => 'https://niteothemes.com/?filter=cmp-plugin-themes&utm_source=cmp&utm_medium=referral&utm_campaign=vega', 'vega' => '10') );
738
 
739
  array_push( $premium_themes, array('name' => 'apollo', 'url' => 'https://niteothemes.com/?filter=cmp-plugin-themes&utm_source=cmp&utm_medium=referral&utm_campaign=apollo', 'apollo' => '10') );
@@ -1653,7 +1710,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1653
  case '2':
1654
  $page_list = json_decode( get_option('niteoCS_page_blacklist', '[]'), true );
1655
 
1656
- if ( empty( $page_list ) || in_array( $page_id, $page_list ) ){
1657
  return false;
1658
 
1659
  } else {
@@ -1700,7 +1757,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1700
  // returns version of selected CMP theme
1701
  public function cmp_theme_version( $theme_slug ) {
1702
  // if premium theme style.css exists get its version
1703
-
1704
  if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
1705
  if ( file_exists( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css' ) ) {
1706
  $version = get_file_data( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css', array('Version'), '' );
@@ -1970,6 +2026,11 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1970
  * @return boolean
1971
  */
1972
  public function cmp_user_can_admin_bar_activation() {
 
 
 
 
 
1973
 
1974
  require_once(ABSPATH . 'wp-admin/includes/screen.php');
1975
 
@@ -1982,7 +2043,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1982
  // get current user
1983
  $current_user = wp_get_current_user();
1984
 
1985
- // if current user cannot access topbar, return
1986
  foreach ( $current_user->roles as $role ) {
1987
  if ( in_array( $role, $roles_topbar ) ) {
1988
  return true;
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: 2.9.3
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
66
  private function constants() {
67
 
68
  // define constants
69
+ $this->define( 'CMP_VERSION', '2.9.3' );
70
  $this->define( 'CMP_DEBUG', FALSE );
71
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
72
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
183
  * @return array
184
  */
185
  public function cmp_countdown_themes() {
186
+ return array( 'frame', 'countdown', 'postery', 'countdown2', 'stylo', 'element', 'apollo', 'vega', 'agency' );
187
  }
188
 
189
  /**
193
  * @return array
194
  */
195
  public function cmp_font_animation_themes() {
196
+ return array( 'hardwork_premium', 'fifty', 'orbit', 'stylo', 'apollo', 'vega', 'agency' );
197
  }
198
 
199
  /**
228
  */
229
  public function cmp_add_admin_style() {
230
 
231
+ // return of user is not logged in
232
  if ( !is_user_logged_in() ) {
233
  return;
234
  }
235
 
236
+ // enqueue cmp admin style - required for topbar and menu icon
237
+ wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__), '', CMP_VERSION);
238
+ wp_enqueue_style( 'cmp_admin_style' );
239
+
240
+ // return if Top Bar Icon is disabled
241
+ if ( get_option('niteoCS_topbar_icon', '1') == '0' ) {
242
+ return;
243
+ }
244
+
245
  $roles_topbar = json_decode( get_option('niteoCS_roles_topbar', '[]'), true );
246
 
247
  // push WP administrator to roles array, since it is default
255
  // enqueue topbar script and style only, if current user is allowed to display topbar, or is admin
256
  foreach ( $current_user->roles as $role ) {
257
  if ( in_array( $role, $roles_topbar ) ) {
 
 
258
  wp_register_script( 'cmp_admin_script', plugins_url('/js/cmp-admin-head.js', __FILE__), array('jquery'), CMP_VERSION);
259
  wp_enqueue_script( 'cmp_admin_script' );
260
  wp_localize_script( 'cmp_admin_script', 'cmp_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
264
 
265
  // this one is for broken wp admin, where current user does not have any roles
266
  } else {
 
 
267
  wp_register_script( 'cmp_admin_script', plugins_url('/js/cmp-admin-head.js', __FILE__), array('jquery'), CMP_VERSION);
268
  wp_enqueue_script( 'cmp_admin_script' );
269
  }
453
  }
454
  }
455
 
456
+
457
+
458
  // bypass CMP and set cookie for user defined period of time, if bypass is enabled, bypass ID is set, and match CMP bypass settings
459
+ if ( isset( $_GET['cmp_bypass'] ) && $_GET['cmp_bypass'] == get_option('niteoCS_bypass_id', md5( get_home_url() )) && get_option('niteoCS_bypass', '0') == '1' ) {
460
  nocache_headers();
461
  header('Cache-Control: max-age=0; private');
462
  setcookie('cmp_bypass', get_option('niteoCS_bypass_id', md5( get_home_url() ) ), time() + get_option('niteoCS_bypass_expire', '172800'));
478
 
479
  // if themes with countdown timer
480
  if ( in_array($this->cmp_selectedTheme(), $this->cmp_countdown_themes()) ){
481
+
482
+ // if counter is enabled - default yes
483
  if ( get_option('niteoCS_counter', '1') == '1' ) {
484
+
485
+ // if countdown date is set - default 24 hours
486
  if ( get_option('niteoCS_counter_date' ) && get_option('niteoCS_counter_date' ) != '' ) {
487
+
488
+ // if timer < timestamp do pre-set action
489
  if ( get_option('niteoCS_counter_date' ) < time() ) {
490
+
491
+ $action = get_option('niteoCS_countdown_action', 'no-action');
492
+
493
+ // end notification email if email transient is not set
494
+ if ( get_transient('cmp_counter_email') != true ) {
495
+ switch ( $action ) {
496
+ case 'no-action':
497
+ $message = __('Counter expired but it is set to make no action - you should login to your Wordpress Admin and adjust the expired timer or disable Coming Soon / Maintenance Mode.', 'cmp-coming-soon-maintenance');
498
+ break;
499
+
500
+ case 'disable-cmp':
501
+ $message = __('Counter expired and Coming soon / Maintanance mode was disabled.', 'cmp-coming-soon-maintenance');
502
+ break;
503
+
504
+ case 'redirect':
505
+ $message = __('Counter expired and your Website is redirected to external URL per settings.', 'cmp-coming-soon-maintenance');
506
+ break;
507
+
508
+ default:
509
+ break;
510
+ }
511
+
512
+ // send notification email to admin, if not already done
513
+ $to = get_option( 'admin_email' );
514
+ $subject = 'Countdown timer just expired on your Coming Soon Page - ' . get_site_url();
515
+ $body = $message . ' This is auto generated message from CMP - Coming Soon & Maintenance Plugin. ';
516
+ $headers = array('Content-Type: text/plain; charset=UTF-8');
517
+ // send email
518
+ wp_mail( $to, $subject, $body, $headers );
519
+ // set email transient
520
+ set_transient( 'cmp_counter_email', true, 0 );
521
+ }
522
+
523
  // if action set to disable cmp
524
+ if ( $action == 'disable-cmp' ) {
525
  update_option('niteoCS_activation', '0');
526
  }
527
 
528
  // if action set to redirect
529
+ if ( $action == 'redirect' ) {
530
  $redirect_url = esc_url(get_option('niteoCS_countdown_redirect'));
531
  header('Location: '.$redirect_url);
532
  die();
533
  }
534
+
535
  }
536
  }
537
  }
654
  // display admin topbar notice
655
  public function cmp_admin_bar() {
656
 
657
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
658
+ if ( wp_verify_nonce( $_POST['save_options_field'], 'save_options' ) && current_user_can('publish_pages') && function_exists('get_current_screen') && get_current_screen()->id == 'cmp-settings_page_cmp-advanced') {
659
+ // check POST if user wants to enable or disable the topbar from settings
660
+ if ( isset( $_POST['niteoCS_topbar_icon'] ) && is_numeric( $_POST['niteoCS_topbar_icon'] ) ) {
661
+ update_option('niteoCS_topbar_icon', sanitize_text_field( $_POST['niteoCS_topbar_icon'] ));
662
+ }
663
+ }
664
+ }
665
+
666
  if ( !$this->cmp_user_can_admin_bar_activation() ) {
667
  return false;
668
  }
669
 
670
  // CMP PLUGIN ACTIVATION AND STATUS CHANGE SETTINGS!
671
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' && ( function_exists('get_current_screen') && get_current_screen()->id == 'toplevel_page_cmp-settings' ) ) {
672
 
673
  // verify nonce and user rights
674
  if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
676
  }
677
 
678
  if ( isset($_POST['activate']) && is_numeric($_POST['activate']) ) {
679
+ update_option('niteoCS_activation', sanitize_text_field($_POST['activate']));
680
  }
681
 
682
  if ( isset($_POST['cmp_status']) ) {
683
+ update_option('niteoCS_status', $this->sanitize_checkbox($_POST['cmp_status']));
684
  } else {
 
685
  update_option('niteoCS_status', false);
686
  }
687
  }
780
  }
781
 
782
  $this->cmp_purge_cache();
783
+
784
+ delete_transient( 'cmp_counter_email' );
785
  }
786
 
787
  // returns list of premium themes => manually defined
789
 
790
  $premium_themes = array();
791
 
792
+ // array_push( $premium_themes, array('name' => 'agency', 'url' => 'https://niteothemes.com/?filter=cmp-plugin-themes&utm_source=cmp&utm_medium=referral&utm_campaign=agency', 'agency' => '20') );
793
+
794
  array_push( $premium_themes, array('name' => 'vega', 'url' => 'https://niteothemes.com/?filter=cmp-plugin-themes&utm_source=cmp&utm_medium=referral&utm_campaign=vega', 'vega' => '10') );
795
 
796
  array_push( $premium_themes, array('name' => 'apollo', 'url' => 'https://niteothemes.com/?filter=cmp-plugin-themes&utm_source=cmp&utm_medium=referral&utm_campaign=apollo', 'apollo' => '10') );
1710
  case '2':
1711
  $page_list = json_decode( get_option('niteoCS_page_blacklist', '[]'), true );
1712
 
1713
+ if ( in_array( $page_id, $page_list ) ){
1714
  return false;
1715
 
1716
  } else {
1757
  // returns version of selected CMP theme
1758
  public function cmp_theme_version( $theme_slug ) {
1759
  // if premium theme style.css exists get its version
 
1760
  if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
1761
  if ( file_exists( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css' ) ) {
1762
  $version = get_file_data( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css', array('Version'), '' );
2026
  * @return boolean
2027
  */
2028
  public function cmp_user_can_admin_bar_activation() {
2029
+
2030
+ // return if Top Bar Icon is disabled
2031
+ if ( get_option('niteoCS_topbar_icon', '1') == '0' ) {
2032
+ return false;
2033
+ }
2034
 
2035
  require_once(ABSPATH . 'wp-admin/includes/screen.php');
2036
 
2043
  // get current user
2044
  $current_user = wp_get_current_user();
2045
 
2046
+ // if current user can access topbar, return true
2047
  foreach ( $current_user->roles as $role ) {
2048
  if ( in_array( $role, $roles_topbar ) ) {
2049
  return true;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JF
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Tested up to: 5.0
7
- Stable tag: 2.9.2
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -115,6 +115,14 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
115
  <p>Everyone loves supports and great feedback! If you find our plugin helpful, you can go to wordpress.org and rate it! alternatively you can click on Donate button :)</p>
116
 
117
  == Changelog ==
 
 
 
 
 
 
 
 
118
  <h4>CMP 2.9.2 - 09-Nov-18 - small bug fixes</h4>
119
  <ul>
120
  <li>Resolved issue with deleting subscribers automatically after refreshing browser window if you deleted a subscriber manually. - thanks @samstoffer1</li>
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Tested up to: 5.0
7
+ Stable tag: 2.9.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
115
  <p>Everyone loves supports and great feedback! If you find our plugin helpful, you can go to wordpress.org and rate it! alternatively you can click on Donate button :)</p>
116
 
117
  == Changelog ==
118
+ <h4>CMP 2.9.3 - xx-Nov-18 - New features update</h4>
119
+ <ul>
120
+ <li>New feature: Notification Email will be send to the Website Administrator once the set Counter time expires.</li>
121
+ <li>New feature: Possibility to enable or disable CMP Icon in Admin Bar.</li>
122
+ <li>UI Changes: Logo moved to Global Content Settings and is no longer Theme depenendent.</li>
123
+ <li>Change: Graphic logo will always use full size even on mobile devices. - requested by @elektra3</li>
124
+ </ul>
125
+
126
  <h4>CMP 2.9.2 - 09-Nov-18 - small bug fixes</h4>
127
  <ul>
128
  <li>Resolved issue with deleting subscribers automatically after refreshing browser window if you deleted a subscriber manually. - thanks @samstoffer1</li>