Site Offline or Coming Soon - Version 1.6.2

Version Description

  • Plugin now sends the correct header status when a website is in maintenance mode
Download this release

Release Info

Developer wpecommerce
Plugin Icon 128x128 Site Offline or Coming Soon
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

Files changed (3) hide show
  1. main.php +14 -7
  2. readme.txt +6 -3
  3. site-offline-options.php +1 -1
main.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Site Offline or Coming Soon
4
- Version: 1.6.1
5
  Plugin URI: http://wp-ecommerce.net/
6
  Author: wpecommerce
7
  Author URI: http://wp-ecommerce.net/
@@ -44,12 +44,19 @@ function cp_siteoffline_options_page_content()
44
  }
45
  function cp_siteoffline_message()
46
  {
47
- $options = get_option('sp_siteoffline_options');
48
- if ( $options['enabled'] === false ) return;
49
- if ( !current_user_can('edit_posts') ){
50
- echo $options['content'];
51
- exit();
52
- }
 
 
 
 
 
 
 
53
  }
54
 
55
  /* The most effective would be init hook but then if the user logout, user may need to disable or
1
  <?php
2
  /*
3
  Plugin Name: Site Offline or Coming Soon
4
+ Version: 1.6.2
5
  Plugin URI: http://wp-ecommerce.net/
6
  Author: wpecommerce
7
  Author URI: http://wp-ecommerce.net/
44
  }
45
  function cp_siteoffline_message()
46
  {
47
+ $options = get_option('sp_siteoffline_options');
48
+ if ( $options['enabled'] === false ) return;
49
+ if ( !current_user_can('edit_posts') )
50
+ {
51
+ $protocol = "HTTP/1.0";
52
+ if("HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"]){
53
+ $protocol = "HTTP/1.1";
54
+ }
55
+ header("$protocol 503 Service Unavailable", true, 503);
56
+ header("Retry-After: 3600");
57
+ echo $options['content'];
58
+ exit();
59
+ }
60
  }
61
 
62
  /* The most effective would be init hook but then if the user logout, user may need to disable or
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpecommerce
3
  Donate link: http://wp-ecommerce.net/
4
  Tags: coming soon,site is down,maintenance,teaser,offline,google,premium,post,page,google,admin,aweber,opt-in,form,mail chimp,administration, construction,mode,unavailable
5
  Requires at least: 3.0
6
- Tested up to: 3.7
7
- Stable tag: 1.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -28,7 +28,7 @@ Once you have installed the plugin you can enable "offline/maintenance mode" in
28
 
29
  This section contains a textarea which allows you to customize the page that your visitors will see when your site is offline. You can customize the message as well as the look and feel of the page.
30
 
31
- For more advanced features be sure to check out our premium version of the plugin, <a href="http://muneeb.me/wordpress-coming-soon/">WordPress Site offline/Coming Soon Plugin</a>
32
 
33
  == Installation ==
34
 
@@ -49,6 +49,9 @@ Yes.
49
 
50
  == Changelog ==
51
 
 
 
 
52
  = 1.6.1 =
53
  * Plugin is now compatible with WordPress 3.7
54
 
3
  Donate link: http://wp-ecommerce.net/
4
  Tags: coming soon,site is down,maintenance,teaser,offline,google,premium,post,page,google,admin,aweber,opt-in,form,mail chimp,administration, construction,mode,unavailable
5
  Requires at least: 3.0
6
+ Tested up to: 3.8
7
+ Stable tag: 1.6.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
28
 
29
  This section contains a textarea which allows you to customize the page that your visitors will see when your site is offline. You can customize the message as well as the look and feel of the page.
30
 
31
+ For more advanced features be sure to check out our premium version of the plugin, <a href="http://wp-ecommerce.net/wp-coming-soon-plugin-easily-create-a-coming-soon-page-for-your-wordpress-blog-2328">WordPress Site offline/Coming Soon Plugin</a>
32
 
33
  == Installation ==
34
 
49
 
50
  == Changelog ==
51
 
52
+ = 1.6.2 =
53
+ * Plugin now sends the correct header status when a website is in maintenance mode
54
+
55
  = 1.6.1 =
56
  * Plugin is now compatible with WordPress 3.7
57
 
site-offline-options.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  <div class="wrap">
4
  <div>
5
- <h3 style="margin:5px;"><a href="http://muneeb.me/wordpress-coming-soon/">Premium Version: WordPress Site offline/Coming Soon Plus Plugin</a></h3>
6
  </div>
7
  <div id="icon-options-general" class="icon32"><br /></div>
8
 
2
 
3
  <div class="wrap">
4
  <div>
5
+ <h3 style="margin:5px;"><a href="http://wp-ecommerce.net/wp-coming-soon-plugin-easily-create-a-coming-soon-page-for-your-wordpress-blog-2328" target="_blank">Premium Version: WordPress Site offline/Coming Soon Plus Plugin</a></h3>
6
  </div>
7
  <div id="icon-options-general" class="icon32"><br /></div>
8