Maintenance - Version 1.2.2

Version Description

// 12.07.2013

  • Re-directed user to the root of the doman (not to subdirectory).
  • Bugfix, Notice in dasboard with debug mode.
Download this release

Release Info

Developer fruitfulcode
Plugin Icon 128x128 Maintenance
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.2

Files changed (5) hide show
  1. functions.php +1 -2
  2. index.php +1 -1
  3. lib/index.php +19 -10
  4. page-options.php +2 -2
  5. readme.txt +6 -1
functions.php CHANGED
@@ -60,13 +60,12 @@
60
  function mt_handle_template($option)
61
  {
62
  $dir = get_template_directory().'/';
63
-
64
  if (!is_user_logged_in()) {
65
  switch ( $option['state'] ) {
66
  case 'maintenance':
67
  {
68
  /* load selected theme */
69
- if ( $option['expiry_date'] ) {
70
  list( $date,$time ) = explode( '|', $option['expiry_date'] );
71
  list( $month, $day, $year ) = explode( '.', $date );
72
  list( $hour, $minute, $second ) = explode ( ':', $time );
60
  function mt_handle_template($option)
61
  {
62
  $dir = get_template_directory().'/';
 
63
  if (!is_user_logged_in()) {
64
  switch ( $option['state'] ) {
65
  case 'maintenance':
66
  {
67
  /* load selected theme */
68
+ if ( isset($option['expiry_date']) ) {
69
  list( $date,$time ) = explode( '|', $option['expiry_date'] );
70
  list( $month, $day, $year ) = explode( '.', $date );
71
  list( $hour, $minute, $second ) = explode ( ':', $time );
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Maintenance
4
  Plugin URI: http://wordpress.org/extend/plugins/maintenance/
5
  Description: Take your site down from public view with a click of a button hiding the site when you need to change a few things or run an upgrade, making it only accessible by login and password. There is also an area to add a custom message which will be shown to the users while your site is down. Users stay on the same page when they input wrong initials.
6
- Version: 1.2.1
7
  Author: fruitfulcode
8
  Author URI: http://fruitfulcode.com
9
  License: GPL2
3
  Plugin Name: Maintenance
4
  Plugin URI: http://wordpress.org/extend/plugins/maintenance/
5
  Description: Take your site down from public view with a click of a button hiding the site when you need to change a few things or run an upgrade, making it only accessible by login and password. There is also an area to add a custom message which will be shown to the users while your site is down. Users stay on the same page when they input wrong initials.
6
+ Version: 1.2.2
7
  Author: fruitfulcode
8
  Author URI: http://fruitfulcode.com
9
  License: GPL2
lib/index.php CHANGED
@@ -1,10 +1,19 @@
1
  <?php
2
- global $wpdb, $error, $wp_query, $current_theme_locale_name, $mt_lib;
 
 
 
 
3
 
4
  if (!is_array($wp_query->query_vars))
5
- $wp_query->query_vars = array();
6
 
7
- $action = $_REQUEST['action'];
 
 
 
 
 
8
  $info = $error = '';
9
  nocache_headers();
10
  $class_login = "user-icon";
@@ -18,11 +27,11 @@
18
  $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
19
 
20
  $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
21
- if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
22
  update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
23
  }
24
 
25
- switch($_REQUEST["action"])
26
  {
27
  case 'login' :
28
  default:
@@ -31,7 +40,7 @@
31
  $using_cookie = false;
32
 
33
  if ( !isset( $_REQUEST['redirect_to'] ) ) {
34
- $redirect_to = get_settings('siteurl');
35
  } else {
36
  $redirect_to = $_REQUEST['redirect_to'];
37
  }
@@ -51,8 +60,8 @@
51
  $user = wp_signon( $access, false);
52
 
53
  if ( is_wp_error($user) ) {
54
- $info = 'You entered your login and password are incorrect!';
55
- $class_login = 'error-login';
56
  $class_password = 'error-password';
57
  }
58
 
@@ -91,7 +100,7 @@
91
  exit;
92
  } else {
93
  if ( $using_cookie )
94
- $error = __('Your session has expired.',$current_theme_locale_name);
95
  }
96
  }
97
  ?>
@@ -106,7 +115,7 @@
106
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
107
 
108
  <?php
109
- if ( $mt_lib['expiry_date'] ):
110
  list( $date,$time ) = explode( '|', $mt_lib['expiry_date'] );
111
  list( $month, $day, $year ) = explode( '.', $date );
112
  list( $hours, $minutes, $seconds ) = explode ( ':', $time );
1
  <?php
2
+ global $wpdb,
3
+ $error,
4
+ $wp_query,
5
+ $current_theme_locale_name,
6
+ $mt_lib;
7
 
8
  if (!is_array($wp_query->query_vars))
9
+ $wp_query->query_vars = array();
10
 
11
+ if (count($_REQUEST) > 0) {
12
+ $action = $_REQUEST['action'];
13
+ } else {
14
+ $action = null;
15
+ }
16
+
17
  $info = $error = '';
18
  nocache_headers();
19
  $class_login = "user-icon";
27
  $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
28
 
29
  $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
30
+ if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_bloginfo('url') )
31
  update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
32
  }
33
 
34
+ switch($action)
35
  {
36
  case 'login' :
37
  default:
40
  $using_cookie = false;
41
 
42
  if ( !isset( $_REQUEST['redirect_to'] ) ) {
43
+ $redirect_to = get_bloginfo('url');
44
  } else {
45
  $redirect_to = $_REQUEST['redirect_to'];
46
  }
60
  $user = wp_signon( $access, false);
61
 
62
  if ( is_wp_error($user) ) {
63
+ $info = __('The login and password you entered are incorrect!', $current_theme_locale_name);
64
+ $class_login = 'error-login';
65
  $class_password = 'error-password';
66
  }
67
 
100
  exit;
101
  } else {
102
  if ( $using_cookie )
103
+ $error = __('Your session has expired.', $current_theme_locale_name);
104
  }
105
  }
106
  ?>
115
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
116
 
117
  <?php
118
+ if (isset($mt_lib['expiry_date']) ):
119
  list( $date,$time ) = explode( '|', $mt_lib['expiry_date'] );
120
  list( $month, $day, $year ) = explode( '.', $date );
121
  list( $hours, $minutes, $seconds ) = explode ( ':', $time );
page-options.php CHANGED
@@ -51,8 +51,8 @@
51
  <a href="mailto:support@fruitfulcode.com" title="<?php _e('Contact Support', 'maintenance');?>" target="_blank">
52
  <?php _e('Contact Support', 'maintenance');?>
53
  </a><br>
54
- <a href="http://codecanyon.net/item/maintenance-wordpress-plugin/2781350?ref=fruitfulcode" title="<?php _e('Premium version', 'maintenance');?>" target="_blank">
55
- <?php _e('PURCHASE EXTENDED VERSION', 'maintenance');?>
56
  </a><br>
57
  </div>
58
  <!-- End Contact Support-->
51
  <a href="mailto:support@fruitfulcode.com" title="<?php _e('Contact Support', 'maintenance');?>" target="_blank">
52
  <?php _e('Contact Support', 'maintenance');?>
53
  </a><br>
54
+ <a href="http://codecanyon.net/item/maintenance-wordpress-plugin/2781350" title="<?php _e('Premium version', 'maintenance');?>" target="_blank">
55
+ <?php _e('Check out our extended version of plugin with new features', 'maintenance');?>
56
  </a><br>
57
  </div>
58
  <!-- End Contact Support-->
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://fruitfulcode.com/
4
  Tags: maintenance, login, under-construction, administration, offline, unavailable, landing page
5
  Requires at least: 3.0
6
  Tested up to: 3.5.1
7
- Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -48,6 +48,11 @@ No, it will be display error on current maintenance page, without redirect to wp
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
51
  = 1.2.1 =
52
  * Admin bar bug fix
53
  * Css fix
4
  Tags: maintenance, login, under-construction, administration, offline, unavailable, landing page
5
  Requires at least: 3.0
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.2.2 = // 12.07.2013
52
+
53
+ * Re-directed user to the root of the doman (not to subdirectory).
54
+ * Bugfix, Notice in dasboard with debug mode.
55
+
56
  = 1.2.1 =
57
  * Admin bar bug fix
58
  * Css fix