Coming Soon Page & Maintenance Mode by SeedProd - Version 5.0.5

Version Description

  • Disable REST API while in coming soon and maintenance mode
Download this release

Release Info

Developer seedprod
Plugin Icon 128x128 Coming Soon Page & Maintenance Mode by SeedProd
Version 5.0.5
Comparing to
See all releases

Code changes from version 5.0.4 to 5.0.5

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: seedprod
3
  Donate link: http://www.seedprod.com
4
  Tags: maintenance mode, coming soon page, coming soon, under construction, launch page, launch, maintenance, construction, offline, unavailable, under construction page, landing page
5
  Requires at least: 3.5.1
6
- Tested up to: 4.7.0
7
- Stable tag: 5.0.4
8
  Text Domain: coming-soon
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -113,6 +113,9 @@ This is always a caching issue. Go to the caching plugin's setting page and clea
113
  4. Design Page
114
 
115
  == Changelog ==
 
 
 
116
  = 5.0.4 =
117
  * PHP 7 Compatibility
118
 
@@ -167,6 +170,9 @@ This is always a caching issue. Go to the caching plugin's setting page and clea
167
  * Initial Commit
168
 
169
  == Upgrade Notice ==
 
 
 
170
  = 5.0.4 =
171
  * PHP 7 Compatibility
172
 
3
  Donate link: http://www.seedprod.com
4
  Tags: maintenance mode, coming soon page, coming soon, under construction, launch page, launch, maintenance, construction, offline, unavailable, under construction page, landing page
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.7.1
7
+ Stable tag: 5.0.5
8
  Text Domain: coming-soon
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
113
  4. Design Page
114
 
115
  == Changelog ==
116
+ = 5.0.5 =
117
+ * Disable REST API while in coming soon and maintenance mode
118
+
119
  = 5.0.4 =
120
  * PHP 7 Compatibility
121
 
170
  * Initial Commit
171
 
172
  == Upgrade Notice ==
173
+ = 5.0.5 =
174
+ * Disable REST API while in coming soon and maintenance mode
175
+
176
  = 5.0.4 =
177
  * PHP 7 Compatibility
178
 
coming-soon.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Coming Soon Page & Maintenance Mode by SeedProd
4
  * Plugin URI: http://www.seedprod.com
5
  * Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
6
- * Version: 5.0.4
7
  * Author: SeedProd
8
  * Author URI: http://www.seedprod.com
9
  * Text Domain: coming-soon
@@ -21,7 +21,7 @@ define( 'SEED_CSP4_SHORTNAME', 'seed_csp4' ); // Used to reference namespace fun
21
  define( 'SEED_CSP4_SLUG', 'coming-soon/coming-soon.php' ); // Used for settings link.
22
  define( 'SEED_CSP4_TEXTDOMAIN', 'coming-soon' ); // Your textdomain
23
  define( 'SEED_CSP4_PLUGIN_NAME', __( 'Coming Soon Page & Maintenance Mode by SeedProd', 'coming-soon' ) ); // Plugin Name shows up on the admin settings screen.
24
- define( 'SEED_CSP4_VERSION', '5.0.4'); // Plugin Version Number. Recommend you use Semantic Versioning http://semver.org/
25
  define( 'SEED_CSP4_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seed_csp4/
26
  define( 'SEED_CSP4_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // Example output: http://localhost:8888/wordpress/wp-content/plugins/seed_csp4/
27
  define( 'SEED_CSP4_TABLENAME', 'seed_csp4_subscribers' );
3
  * Plugin Name: Coming Soon Page & Maintenance Mode by SeedProd
4
  * Plugin URI: http://www.seedprod.com
5
  * Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
6
+ * Version: 5.0.5
7
  * Author: SeedProd
8
  * Author URI: http://www.seedprod.com
9
  * Text Domain: coming-soon
21
  define( 'SEED_CSP4_SLUG', 'coming-soon/coming-soon.php' ); // Used for settings link.
22
  define( 'SEED_CSP4_TEXTDOMAIN', 'coming-soon' ); // Your textdomain
23
  define( 'SEED_CSP4_PLUGIN_NAME', __( 'Coming Soon Page & Maintenance Mode by SeedProd', 'coming-soon' ) ); // Plugin Name shows up on the admin settings screen.
24
+ define( 'SEED_CSP4_VERSION', '5.0.5'); // Plugin Version Number. Recommend you use Semantic Versioning http://semver.org/
25
  define( 'SEED_CSP4_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seed_csp4/
26
  define( 'SEED_CSP4_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // Example output: http://localhost:8888/wordpress/wp-content/plugins/seed_csp4/
27
  define( 'SEED_CSP4_TABLENAME', 'seed_csp4_subscribers' );
framework/framework.php CHANGED
@@ -186,7 +186,8 @@ class SEED_CSP4_ADMIN
186
  }
187
  echo '<a class="nav-tab seed_csp4-preview thickbox-preview" target="_blank" href="'.home_url().'?cs_preview=true&TB_iframe=true&width=640&height=632" title="'.__('&larr; Close Window','coming-soon').'"><i class="fa fa-external-link"></i> '.__('Live Preview','coming-soon').'</a>';
188
  if(defined('SEED_CSP_API_KEY') === false){
189
- echo '<a class="nav-tab seed_csp4-support" style="background-color: #444;color: #fff" href="https://www.seedprod.com/ultimate-coming-soon-page-vs-coming-soon-pro/?utm_source=coming-soon-plugin&utm_medium=banner&utm_campaign=coming-soon-link-in-plugin" target="_blank"><i class="fa fa-star"></i> '.__('Upgrade to Pro for more Professional Features','coming-soon').'</a>';
 
190
  }
191
  echo '</h2>';
192
 
@@ -344,7 +345,7 @@ class SEED_CSP4_ADMIN
344
  <ul>
345
  <li>&raquo; <a target="_blank" href="http://www.seedprod.com/features/?utm_source=coming-soon-plugin&utm_medium=banner&utm_campaign=coming-soon-link-in-plugin"><?php _e('Buy It', 'coming-soon') ?></a></li>
346
 
347
- <li>&raquo; <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/coming-soon?rate=5#postform"><?php _e('Rate It', 'coming-soon') ?></a></li>
348
  <li>&raquo; <a target="_blank" href="<?php echo "http://twitter.com/share?url=https%3A%2F%2Fwordpress.org%2Fplugins%2Fultimate-coming-soon-page%2F&text=Check out this awesome %23WordPress Plugin I'm using, Coming Soon Page and Maintenance Mode by SeedProd"; ?>"><?php _e('Tweet It', 'coming-soon') ?></a></li>
349
  </ul>
350
  </div>
186
  }
187
  echo '<a class="nav-tab seed_csp4-preview thickbox-preview" target="_blank" href="'.home_url().'?cs_preview=true&TB_iframe=true&width=640&height=632" title="'.__('&larr; Close Window','coming-soon').'"><i class="fa fa-external-link"></i> '.__('Live Preview','coming-soon').'</a>';
188
  if(defined('SEED_CSP_API_KEY') === false){
189
+ echo '<a class="nav-tab seed_csp4-support" style="background-color: #444;color: #fff" href="https://www.seedprod.com/ultimate-coming-soon-page-vs-coming-soon-pro/?utm_source=coming-soon-plugin&utm_medium=banner&utm_campaign=coming-soon-link-in-plugin" target="_blank"><i class="fa fa-star"></i> '.__('Upgrade to Pro for More Features','coming-soon').'</a>';
190
+ //echo '<a class="nav-tab seed_csp4-support" style="background-color: #444;color: #fff" href="http://testdrive.seedprod.com?utm_source=coming-soon-plugin&utm_medium=banner&utm_campaign=coming-soon-link-in-plugin" target="_blank"><i class="fa fa-bolt"></i> '.__('Try the Pro Version for Free','coming-soon').'</a>';
191
  }
192
  echo '</h2>';
193
 
345
  <ul>
346
  <li>&raquo; <a target="_blank" href="http://www.seedprod.com/features/?utm_source=coming-soon-plugin&utm_medium=banner&utm_campaign=coming-soon-link-in-plugin"><?php _e('Buy It', 'coming-soon') ?></a></li>
347
 
348
+ <li>&raquo; <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/coming-soon?rate=5#postform"><?php _e('Rate It on WordPress.org', 'coming-soon') ?></a></li>
349
  <li>&raquo; <a target="_blank" href="<?php echo "http://twitter.com/share?url=https%3A%2F%2Fwordpress.org%2Fplugins%2Fultimate-coming-soon-page%2F&text=Check out this awesome %23WordPress Plugin I'm using, Coming Soon Page and Maintenance Mode by SeedProd"; ?>"><?php _e('Tweet It', 'coming-soon') ?></a></li>
350
  </ul>
351
  </div>
inc/class-seed-csp4.php CHANGED
@@ -27,6 +27,11 @@ class SEED_CSP4{
27
  add_action( 'template_redirect', array(&$this,'render_comingsoon_page'));
28
  }
29
  add_action( 'admin_bar_menu',array( &$this, 'admin_bar_menu' ), 1000 );
 
 
 
 
 
30
  }
31
 
32
  // Add this script globally so we can view the notification across the admin area
@@ -214,4 +219,14 @@ class SEED_CSP4{
214
 
215
  }
216
 
 
 
 
 
 
 
 
 
 
 
217
  }
27
  add_action( 'template_redirect', array(&$this,'render_comingsoon_page'));
28
  }
29
  add_action( 'admin_bar_menu',array( &$this, 'admin_bar_menu' ), 1000 );
30
+ // Disable the rest api in coming soon mode
31
+ $current_WP_version = get_bloginfo('version');
32
+ if ( version_compare( $current_WP_version, '4.7', '>=' ) ) {
33
+ add_filter( 'rest_authentication_errors', array( &$this, 'only_allow_logged_in_rest_access') );
34
+ }
35
  }
36
 
37
  // Add this script globally so we can view the notification across the admin area
219
 
220
  }
221
 
222
+ function only_allow_logged_in_rest_access( $access ) {
223
+
224
+ if( ! is_user_logged_in() ) {
225
+ return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'coming-soon' ), array( 'status' => rest_authorization_required_code() ) );
226
+ }
227
+
228
+ return $access;
229
+
230
+ }
231
+
232
  }