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

Version Description

Download this release

Release Info

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

Code changes from version 3.4.4 to 3.4.5

Files changed (3) hide show
  1. cmp-advanced.php +45 -20
  2. niteo-cmp.php +26 -8
  3. readme.txt +16 -7
cmp-advanced.php CHANGED
@@ -64,14 +64,14 @@ if ( isset( $_POST['niteoCS_page-whitelist'] ) ) {
64
  if ( isset( $_POST['niteoCS-whitelist-custom'] ) ) {
65
  $url_list = explode("\r\n", $_POST['niteoCS-whitelist-custom']);
66
 
67
- if ( !empty($url_list) && $url_list[0] !== '' ) {
68
- foreach ($url_list as $url ) {
69
  if ( !empty($url) ) {
70
- $sanitized_list[] = esc_url_raw( trailingslashit($url) );
71
  }
72
  }
73
 
74
- update_option('niteoCS_page_whitelist_custom', json_encode(array_filter($sanitized_list)));
75
 
76
  } else {
77
  update_option('niteoCS_page_whitelist_custom', '[]');
@@ -102,6 +102,23 @@ if ( isset( $_POST['niteoCS_page-blacklist'] ) ) {
102
  update_option('niteoCS_page_blacklist', '[]');
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  // update cmp bypass roles if set
106
  if ( isset( $_POST['niteoCS_roles'] ) ) {
107
 
@@ -167,18 +184,19 @@ if ( isset( $_POST['niteoCS_footer_scripts'] ) ) {
167
  update_option('niteoCS_footer_scripts', '[]');
168
  }
169
 
170
- $niteoCS_page_filter = get_option('niteoCS_page_filter', '0');
171
- $niteoCS_page_whitelist = json_decode(get_option('niteoCS_page_whitelist', '[]'), true);
172
  $niteoCS_page_whitelist_custom = json_decode(get_option('niteoCS_page_whitelist_custom', '[]'), true);
173
- $niteoCS_page_blacklist = json_decode(get_option('niteoCS_page_blacklist', '[]'), true);
174
- $niteoCS_roles = json_decode(get_option('niteoCS_roles', '[]'), true);
175
- $niteoCS_roles_topbar = json_decode(get_option('niteoCS_roles_topbar', '[]'), true);
176
- $head_scripts = json_decode(get_option('niteoCS_head_scripts', '[]'), true);
177
- $footer_scripts = json_decode(get_option('niteoCS_footer_scripts', '[]'), true);
178
- $bypass = get_option('niteoCS_bypass', '0');
179
- $bypass_id = get_option('niteoCS_bypass_id', md5( get_home_url() ));
180
- $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
181
- $topbar_icon = get_option('niteoCS_topbar_icon', '1');
 
182
 
183
  ?>
184
 
@@ -242,15 +260,13 @@ $topbar_icon = get_option('niteoCS_topbar_icon', '1');
242
 
243
  <p class="cmp-hint" style="margin-top:0"><?php _e('By default CMP is enabled on all pages. Leave this field empty to use default settings.', 'cmp-coming-soon-maintenance');?></p>
244
 
245
- <h4><?php _e('Or you can also insert manually the Page URLs.', 'cmp-coming-soon-maintenance');?></h4>
246
  <textarea name="niteoCS-whitelist-custom" cols="40" rows="5"><?php
247
  if ( !empty($niteoCS_page_whitelist_custom) ) {
248
- foreach ($niteoCS_page_whitelist_custom as $url) {
249
- echo esc_url($url) . PHP_EOL;
250
  }
251
  } ?></textarea>
252
- <p class="cmp-hint" style="margin-top:0"><?php _e('Insert separate URL at each line. Please make sure your Permalinks work correctly!', 'cmp-coming-soon-maintenance');?></p>
253
-
254
  </fieldset>
255
 
256
  <fieldset class="page-whitelist-switch x2" style="margin-top: 1em;">
@@ -266,8 +282,17 @@ $topbar_icon = get_option('niteoCS_topbar_icon', '1');
266
 
267
  <p class="cmp-hint" style="margin-top:0"><?php _e('If you want to exclude some pages from CMP you can select them here.', 'cmp-coming-soon-maintenance');?></p>
268
 
 
 
 
 
 
 
 
269
  </fieldset>
270
 
 
 
271
  <p class="page-whitelist-switch x0"><?php _e('CMP landing page is displayed on all pages by default. You can enable Page Whitelist to display CMP only on specific page(s) or Page Blacklist to exclude CMP landing page on specific page(s) by enabling Page Whitelist or Page Blacklist here.', 'cmp-coming-soon-maintenance');?></p>
272
 
273
  </td>
64
  if ( isset( $_POST['niteoCS-whitelist-custom'] ) ) {
65
  $url_list = explode("\r\n", $_POST['niteoCS-whitelist-custom']);
66
 
67
+ if ( !empty( $url_list) && $url_list[0] !== '' ) {
68
+ foreach ( $url_list as $url ) {
69
  if ( !empty($url) ) {
70
+ $sanitized_whitelist[] = esc_url_raw( trailingslashit($url) );
71
  }
72
  }
73
 
74
+ update_option('niteoCS_page_whitelist_custom', json_encode( array_filter($sanitized_whitelist) ));
75
 
76
  } else {
77
  update_option('niteoCS_page_whitelist_custom', '[]');
102
  update_option('niteoCS_page_blacklist', '[]');
103
  }
104
 
105
+ if ( isset( $_POST['niteoCS-blacklist-custom'] ) ) {
106
+ $url_blacklist = explode("\r\n", $_POST['niteoCS-blacklist-custom']);
107
+
108
+ if ( !empty( $url_blacklist) && $url_blacklist[0] !== '' ) {
109
+ foreach ( $url_blacklist as $bl_url ) {
110
+ if ( !empty($bl_url) ) {
111
+ $sanitized_blacklist[] = esc_url_raw( trailingslashit($bl_url) );
112
+ }
113
+ }
114
+
115
+ update_option('niteoCS_page_blacklist_custom', json_encode( array_filter($sanitized_blacklist) ));
116
+
117
+ } else {
118
+ update_option('niteoCS_page_blacklist_custom', '[]');
119
+ }
120
+ }
121
+
122
  // update cmp bypass roles if set
123
  if ( isset( $_POST['niteoCS_roles'] ) ) {
124
 
184
  update_option('niteoCS_footer_scripts', '[]');
185
  }
186
 
187
+ $niteoCS_page_filter = get_option('niteoCS_page_filter', '0');
188
+ $niteoCS_page_whitelist = json_decode(get_option('niteoCS_page_whitelist', '[]'), true);
189
  $niteoCS_page_whitelist_custom = json_decode(get_option('niteoCS_page_whitelist_custom', '[]'), true);
190
+ $niteoCS_page_blacklist = json_decode(get_option('niteoCS_page_blacklist', '[]'), true);
191
+ $niteoCS_page_blacklist_custom = json_decode(get_option('niteoCS_page_blacklist_custom', '[]'), true);
192
+ $niteoCS_roles = json_decode(get_option('niteoCS_roles', '[]'), true);
193
+ $niteoCS_roles_topbar = json_decode(get_option('niteoCS_roles_topbar', '[]'), true);
194
+ $head_scripts = json_decode(get_option('niteoCS_head_scripts', '[]'), true);
195
+ $footer_scripts = json_decode(get_option('niteoCS_footer_scripts', '[]'), true);
196
+ $bypass = get_option('niteoCS_bypass', '0');
197
+ $bypass_id = get_option('niteoCS_bypass_id', md5( get_home_url() ));
198
+ $bypass_expire = get_option('niteoCS_bypass_expire', '172800');
199
+ $topbar_icon = get_option('niteoCS_topbar_icon', '1');
200
 
201
  ?>
202
 
260
 
261
  <p class="cmp-hint" style="margin-top:0"><?php _e('By default CMP is enabled on all pages. Leave this field empty to use default settings.', 'cmp-coming-soon-maintenance');?></p>
262
 
263
+ <h4><?php _e('You can also add the Page URLs manually.', 'cmp-coming-soon-maintenance');?></h4>
264
  <textarea name="niteoCS-whitelist-custom" cols="40" rows="5"><?php
265
  if ( !empty($niteoCS_page_whitelist_custom) ) {
266
+ foreach ($niteoCS_page_whitelist_custom as $wl_url) {
267
+ echo esc_url($wl_url) . PHP_EOL;
268
  }
269
  } ?></textarea>
 
 
270
  </fieldset>
271
 
272
  <fieldset class="page-whitelist-switch x2" style="margin-top: 1em;">
282
 
283
  <p class="cmp-hint" style="margin-top:0"><?php _e('If you want to exclude some pages from CMP you can select them here.', 'cmp-coming-soon-maintenance');?></p>
284
 
285
+ <h4><?php _e('You can also add the Page URLs manually.', 'cmp-coming-soon-maintenance');?></h4>
286
+ <textarea name="niteoCS-blacklist-custom" cols="40" rows="5"><?php
287
+ if ( !empty($niteoCS_page_blacklist_custom) ) {
288
+ foreach ($niteoCS_page_blacklist_custom as $bl_url) {
289
+ echo esc_url($bl_url) . PHP_EOL;
290
+ }
291
+ } ?></textarea>
292
  </fieldset>
293
 
294
+ <p class="cmp-hint page-whitelist-switch x1 x2" style="margin-top:0"><?php _e('Insert separate URL at each line. Please make sure your Permalinks work correctly!<br> You can also use asterisk (*) as a wildcard to match any string.', 'cmp-coming-soon-maintenance');?></p>
295
+
296
  <p class="page-whitelist-switch x0"><?php _e('CMP landing page is displayed on all pages by default. You can enable Page Whitelist to display CMP only on specific page(s) or Page Blacklist to exclude CMP landing page on specific page(s) by enabling Page Whitelist or Page Blacklist here.', 'cmp-coming-soon-maintenance');?></p>
297
 
298
  </td>
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.4.4
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -65,7 +65,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
65
 
66
  private function constants() {
67
  // define constants
68
- $this->define( 'CMP_VERSION', '3.4.4' );
69
  $this->define( 'CMP_DEBUG', FALSE );
70
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
71
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
@@ -1799,16 +1799,20 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1799
 
1800
  // whitelist
1801
  case '1':
1802
- $page_list = json_decode( get_option('niteoCS_page_whitelist', '[]'), true );
1803
 
1804
- if ( !empty( $page_list ) && in_array( $page_id, $page_list ) ) {
1805
  return true;
1806
  }
1807
 
1808
  $page_wl_custom = json_decode(get_option('niteoCS_page_whitelist_custom', '[]'), true);
1809
 
1810
- if ( !empty( $page_wl_custom ) && in_array( $current_url, $page_wl_custom ) ) {
1811
- return true;
 
 
 
 
1812
  }
1813
 
1814
  return false;
@@ -1816,8 +1820,22 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
1816
 
1817
  // blacklist
1818
  case '2':
1819
- $page_list = json_decode( get_option('niteoCS_page_blacklist', '[]'), true );
1820
- return ( in_array( $page_id, $page_list ) ) ? false : true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1821
  break;
1822
 
1823
  default:
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.4.5
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
65
 
66
  private function constants() {
67
  // define constants
68
+ $this->define( 'CMP_VERSION', '3.4.5' );
69
  $this->define( 'CMP_DEBUG', FALSE );
70
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
71
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
1799
 
1800
  // whitelist
1801
  case '1':
1802
+ $whitelist = json_decode( get_option('niteoCS_page_whitelist', '[]'), true );
1803
 
1804
+ if ( !empty( $whitelist ) && in_array( $page_id, $whitelist ) ) {
1805
  return true;
1806
  }
1807
 
1808
  $page_wl_custom = json_decode(get_option('niteoCS_page_whitelist_custom', '[]'), true);
1809
 
1810
+ if ( !empty( $page_wl_custom ) ) {
1811
+ foreach ($page_wl_custom as $url ) {
1812
+ if ( fnmatch( $url, $current_url ) ) {
1813
+ return true;
1814
+ }
1815
+ }
1816
  }
1817
 
1818
  return false;
1820
 
1821
  // blacklist
1822
  case '2':
1823
+ $blacklist = json_decode( get_option('niteoCS_page_blacklist', '[]'), true );
1824
+ if ( !empty( $blacklist ) && in_array( $page_id, $blacklist ) ) {
1825
+ return false;
1826
+ }
1827
+
1828
+ $page_bl_custom = json_decode(get_option('niteoCS_page_blacklist_custom', '[]'), true);
1829
+
1830
+ if ( !empty( $page_bl_custom ) ) {
1831
+ foreach ($page_bl_custom as $url ) {
1832
+ if ( fnmatch( $url, $current_url ) ) {
1833
+ return false;
1834
+ }
1835
+ }
1836
+ }
1837
+
1838
+ return true;
1839
  break;
1840
 
1841
  default:
readme.txt CHANGED
@@ -3,8 +3,9 @@ Contributors: niteo
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
 
6
  Tested up to: 5.1
7
- Stable tag: 3.4.4
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,6 +66,8 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
65
  20. CMP - Pluto Theme
66
  21. CMP - Juno Theme
67
 
 
 
68
 
69
  == Installation ==
70
 
@@ -97,17 +100,17 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
97
 
98
 
99
  == Frequently Asked Questions ==
100
- <h4>I can't see the landing page I've just activated!</h4>
101
- <p>As long as you're logged in as admin, you cannot see it. That`s the purpose of our plugin - it displays Maintenance or Coming Soon page only to guest visitors of your page. Meanwhile you can work on your real website and display CMP Landing Page to your visitors. You can preview the page by clicking on "preview" tab, logout from Wordpress or access your website from a different browser.</p>
102
 
103
- <h4>I can still see the landing page I've just deactivated!</h4>
104
- <p>Please make sure to delete cache from your caching plugin, hosting provider and browser as well. Then check your website again. We did our best to cooperate with all most used caching plugins, but sometimes it just does not work as expected and you still need to delete it manually in caching plugin option.</p>
105
 
106
  <h4>I love the landing page so much, can I use it forever?</h4>
107
  <p>Yes of course! You can use CMP landing pages as your main splash page! Just make sure to set CMP plugin to "Coming Soon & Landing Page" mode which returns correct response codes to web search engines.</p>
108
 
109
  <h4>How can I translate text on buttons, countdown text and others?</h4>
110
- <p>Simply check out CMP Settings > CMP Translation sub-menu where you can translate or modify all these texts!</p>
111
 
112
  <h4>What are 503 or 200 HTTP codes, huh?</h4>
113
  <p>OK, it`s easy - if you want to display Coming Soon page you usually wants to search engines (like Google) to be able to index your website. In that case you want the response code set to 200 HTTP "OK" - set Coming Soon mode or Landing Page.</p>
@@ -124,9 +127,15 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
124
  <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>
125
 
126
  == Changelog ==
 
 
 
 
 
 
127
  <h4>CMP 3.4.4 - 05-April-19</h4>
128
  <ul>
129
- <liNew CMP Theme: Juno! Enjoy as usual :) </li>
130
  </ul>
131
 
132
  <h4>CMP 3.4.3 - 25-Mar-19</h4>
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
+ Requires PHP: 5.3
7
  Tested up to: 5.1
8
+ Stable tag: 3.4.5
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
66
  20. CMP - Pluto Theme
67
  21. CMP - Juno Theme
68
 
69
+ <h3>Administration page overview</h3>
70
+ [youtube https://www.youtube.com/watch?v=uxuJfHzwdtE]
71
 
72
  == Installation ==
73
 
100
 
101
 
102
  == Frequently Asked Questions ==
103
+ <h4>I can't see the CMP landing page I've just activated!</h4>
104
+ <p>As long as you're logged in as admin, you cannot see it. That`s the purpose of our plugin - it displays Maintenance or Coming Soon page only to guest visitors of your page while you can work on your real website. You can preview the page by clicking on "preview" tab, by logging out from Wordpress or accessing your website from a different browser (or anonymous tab)</p>
105
 
106
+ <h4>I can still see the landing page I've just deactivated! I even deleted the plugin but it is still there!</h4>
107
+ <p>This is 100% caching issue! Please make sure to delete cache from your caching plugins, hosting provider cache and browser as well. CMP plugin supports all most popular caching plugins, but sometimes it just does not work as expected and you still need to delete it manually in caching plugin option.</p>
108
 
109
  <h4>I love the landing page so much, can I use it forever?</h4>
110
  <p>Yes of course! You can use CMP landing pages as your main splash page! Just make sure to set CMP plugin to "Coming Soon & Landing Page" mode which returns correct response codes to web search engines.</p>
111
 
112
  <h4>How can I translate text on buttons, countdown text and others?</h4>
113
+ <p>Go to CMP Settings > CMP Translation sub-menu where you can translate or modify every string used!</p>
114
 
115
  <h4>What are 503 or 200 HTTP codes, huh?</h4>
116
  <p>OK, it`s easy - if you want to display Coming Soon page you usually wants to search engines (like Google) to be able to index your website. In that case you want the response code set to 200 HTTP "OK" - set Coming Soon mode or Landing Page.</p>
127
  <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>
128
 
129
  == Changelog ==
130
+ <h4>CMP 3.4.5 - 10-April-19</h4>
131
+ <ul>
132
+ <li>You can use custom URLs for CMP Blacklist as well now + added wildcard support for the URLs.</li>
133
+ </ul>
134
+
135
+
136
  <h4>CMP 3.4.4 - 05-April-19</h4>
137
  <ul>
138
+ <li>New CMP Theme: Juno! Enjoy as usual :) </li>
139
  </ul>
140
 
141
  <h4>CMP 3.4.3 - 25-Mar-19</h4>