WP Construction Mode - Version 3.01

Version Description

  • Added a direct login link from the Construction Page so admins can easily access the login page & site backend
  • Added more filtering to avoid conflicts in template_redirect
Download this release

Release Info

Developer smartcat
Plugin Icon 128x128 WP Construction Mode
Version 3.01
Comparing to
See all releases

Code changes from version 3.0 to 3.01

admin/form.php CHANGED
@@ -54,14 +54,14 @@
54
  <tbody>
55
  <tr>
56
  <td>
57
- <?php _e("Do you like this plugin ? Please take a minute and write a review on WordPress.org", "sc-construction"); ?>
58
  </td>
59
  </tr>
60
  <tr>
61
  <td class='center'>
62
  <a href='https://wordpress.org/support/view/plugin-reviews/wp-construction-mode' target='_blank' class='button-primary'><?php _e('Leave Review', 'sc-construction'); ?></a>
63
  </td>
64
- </tr>
65
  </tbody>
66
  </table>
67
 
54
  <tbody>
55
  <tr>
56
  <td>
57
+ <b><?php _e("Do you like this plugin ? Do you have suggestions? Want to request more features? Please take a minute and write a review on WordPress.org and share your opinion", "sc-construction"); ?></b>
58
  </td>
59
  </tr>
60
  <tr>
61
  <td class='center'>
62
  <a href='https://wordpress.org/support/view/plugin-reviews/wp-construction-mode' target='_blank' class='button-primary'><?php _e('Leave Review', 'sc-construction'); ?></a>
63
  </td>
64
+ </tr>
65
  </tbody>
66
  </table>
67
 
inc/class/class.smartcat-construction.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class SmartcatConstructionPlugin {
8
 
9
- const VERSION = '2.0';
10
 
11
  private static $instance;
12
  private $options;
@@ -49,10 +49,10 @@ class SmartcatConstructionPlugin {
49
 
50
  if ( !get_option( 'smartcat_construction_options' ) ) {
51
  add_option( 'smartcat_construction_options', $options );
 
 
52
  }
53
 
54
- $options[ 'redirect' ] = true;
55
- update_option( 'smartcat_construction_options', $options );
56
  }
57
 
58
  public static function deactivate() {
@@ -60,6 +60,8 @@ class SmartcatConstructionPlugin {
60
  }
61
 
62
  private function add_hooks() {
 
 
63
  add_action( 'admin_init', array( $this, 'smartcat_construction_activation_redirect' ) );
64
  add_action( 'wp_head', array( $this, 'sc_custom_styles' ) );
65
  // add_action( 'wp_head', array( $this, 'smartcat_load_screen' ) );
@@ -67,9 +69,19 @@ class SmartcatConstructionPlugin {
67
  // add_action( 'wp_enqueue_scripts', array( $this, 'smartcat_construction_load_styles_scripts' ) );
68
  add_action( 'admin_menu', array( $this, 'under_construction_menu' ) );
69
  add_action( 'admin_bar_menu', array( $this, 'create_admin_bar_menu' ), 1000 );
70
- add_action( 'template_redirect', array( $this, 'catch_redirect') );
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
73
  private function get_options() {
74
  if ( get_option( 'smartcat_construction_options' ) ) :
75
  $this->options = get_option( 'smartcat_construction_options' );
@@ -162,7 +174,9 @@ class SmartcatConstructionPlugin {
162
 
163
  $current_user = wp_get_current_user();
164
 
165
- if( ( $this->options['mode'] && !user_can( $current_user, 'administrator' ) ) ) :
 
 
166
  if( $this->options['set_page'] == 'all' || $this->options['set_page'] == get_the_ID() ) :
167
  include_once SC_CONSTRUCTION_PATH . 'inc/template/construction.php';
168
  exit();
6
  */
7
  class SmartcatConstructionPlugin {
8
 
9
+ const VERSION = '3.01';
10
 
11
  private static $instance;
12
  private $options;
49
 
50
  if ( !get_option( 'smartcat_construction_options' ) ) {
51
  add_option( 'smartcat_construction_options', $options );
52
+ $options[ 'redirect' ] = true;
53
+ update_option( 'smartcat_construction_options', $options );
54
  }
55
 
 
 
56
  }
57
 
58
  public static function deactivate() {
60
  }
61
 
62
  private function add_hooks() {
63
+
64
+ add_action( 'init', array( $this, 'escape_catch_redirect') );
65
  add_action( 'admin_init', array( $this, 'smartcat_construction_activation_redirect' ) );
66
  add_action( 'wp_head', array( $this, 'sc_custom_styles' ) );
67
  // add_action( 'wp_head', array( $this, 'smartcat_load_screen' ) );
69
  // add_action( 'wp_enqueue_scripts', array( $this, 'smartcat_construction_load_styles_scripts' ) );
70
  add_action( 'admin_menu', array( $this, 'under_construction_menu' ) );
71
  add_action( 'admin_bar_menu', array( $this, 'create_admin_bar_menu' ), 1000 );
72
+
73
  }
74
 
75
+ public function escape_catch_redirect(){
76
+ global $pagenow;
77
+
78
+ if( 'wp-login.php' == $pagenow ) :
79
+ return;
80
+ else :
81
+ add_action( 'template_redirect', array( $this, 'catch_redirect') );
82
+ endif;
83
+ }
84
+
85
  private function get_options() {
86
  if ( get_option( 'smartcat_construction_options' ) ) :
87
  $this->options = get_option( 'smartcat_construction_options' );
174
 
175
  $current_user = wp_get_current_user();
176
 
177
+
178
+
179
+ if( ( $this->options['mode'] && !user_can( $current_user, 'administrator' ) && !isset($_GET['sc_construction_login'] ) ) ) :
180
  if( $this->options['set_page'] == 'all' || $this->options['set_page'] == get_the_ID() ) :
181
  include_once SC_CONSTRUCTION_PATH . 'inc/template/construction.php';
182
  exit();
inc/style/style.css CHANGED
@@ -9,6 +9,21 @@
9
  .center{
10
  text-align: center;
11
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  #about,
13
  #contact{
14
  display: none;
9
  .center{
10
  text-align: center;
11
  }
12
+ #admin-login{
13
+ width: 30px;
14
+ height: 30px;
15
+ line-height: 30px;
16
+ border-radius: 100%;
17
+ text-align: center;
18
+ background: #fff;
19
+ color: #fff;
20
+ display: inline-block;
21
+ z-index: 999;
22
+ cursor: pointer;
23
+ position: absolute;
24
+ bottom: 30px;
25
+ right: 30px;
26
+ }
27
  #about,
28
  #contact{
29
  display: none;
inc/template/construction.php CHANGED
@@ -63,7 +63,7 @@
63
  background: <?php echo $accent_color; ?>;
64
  color: <?php echo $font_color; ?>;
65
  }
66
- .trigger, .wuc_icons a{ background: <?php echo $accent_color; ?>;}
67
  .wuc-shortcode input[type=text]:focus, .wuc-shortcode input[type=email]:focus{
68
  box-shadow: 0 0 6px <?php echo $accent_color; ?>;
69
  -moz-box-shadow: 0 0 6px <?php echo $accent_color; ?>;
@@ -74,11 +74,14 @@
74
  </style>
75
  </head>
76
  <body>
 
 
 
77
 
78
-
79
  <div class='wuc-overlay'></div>
80
  <div id="wuc-wrapper"></div>
81
-
82
  <div class="wuc-box">
83
  <div class="wuc-logo center sc-col-sm-12">
84
  <?php if ( $logo != "" ) { ?>
63
  background: <?php echo $accent_color; ?>;
64
  color: <?php echo $font_color; ?>;
65
  }
66
+ .trigger, .wuc_icons a, #admin-login{ background: <?php echo $accent_color; ?>;}
67
  .wuc-shortcode input[type=text]:focus, .wuc-shortcode input[type=email]:focus{
68
  box-shadow: 0 0 6px <?php echo $accent_color; ?>;
69
  -moz-box-shadow: 0 0 6px <?php echo $accent_color; ?>;
74
  </style>
75
  </head>
76
  <body>
77
+ <a href="<?php echo wp_login_url(); ?>" id="admin-login" class="trigger">
78
+ <i class="fa fa-lock"></i>
79
+ </a>
80
 
81
+
82
  <div class='wuc-overlay'></div>
83
  <div id="wuc-wrapper"></div>
84
+
85
  <div class="wuc-box">
86
  <div class="wuc-logo center sc-col-sm-12">
87
  <?php if ( $logo != "" ) { ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://smartcatdesign.net/donate
4
  Tags: construction,maintenance,landing,page,admin,under construction,under maintenance,coming soon,administrator,custom message,social,facebook,twitter,google plus,gplus,email,icons,link,instagram,digg,flickr,skype,tumblr,youtube, mailchimp,newsletter,shortcode,contact,form,constant contact
5
  Requires at least: 3.2
6
  Tested up to: 4.1
7
- Stable tag: 2.1
8
  License: GPLv2 or later
9
 
10
  Display a customizable Under Construction or Coming Soon landing page for all users except the admin. Perfect for developing on a live server!
@@ -26,6 +26,7 @@ enter an About section, Contact section and many more features! See the demo!
26
  Pro version available, [Live Demo](http://smartcatdesign.net/smartcat-construction-mode-v2-pro/ "Construction Mode Pro")
27
 
28
  Available Customizations:
 
29
  * Toggle on/off
30
  * Set to entire site or specific page
31
  * Animated Progress Bar
@@ -50,8 +51,13 @@ Available Customizations:
50
  1. Construction Mode Landing Page
51
  2. Settings Page
52
  3. Pro Version, 1 of many samples
 
53
  == Changelog ==
54
 
 
 
 
 
55
  = 3.0 =
56
  * ATTENTION: The plugin has undergone a complete re-build. It now has better functionality and is more scalable for future updates
57
  * Added upload buttons for the logo and background image
@@ -64,10 +70,6 @@ Available Customizations:
64
  * New Feature: Added animation to progress bar
65
  * Moved the Under Construction notification to the admin top bar
66
 
67
- == Upgrade Notice ==
68
- = 3.0 =
69
- This version is a re-build of the plugin that gives you many new features!
70
-
71
  = 2.0 = email field fix, added shortcode support
72
  = 1.92 = responsive fix, dashboard change
73
  = 1.91 = security fix
@@ -85,6 +87,11 @@ added social icons
85
  = 1.0 =
86
  initial release
87
 
 
 
 
 
 
88
 
89
 
90
 
4
  Tags: construction,maintenance,landing,page,admin,under construction,under maintenance,coming soon,administrator,custom message,social,facebook,twitter,google plus,gplus,email,icons,link,instagram,digg,flickr,skype,tumblr,youtube, mailchimp,newsletter,shortcode,contact,form,constant contact
5
  Requires at least: 3.2
6
  Tested up to: 4.1
7
+ Stable tag: 3.0
8
  License: GPLv2 or later
9
 
10
  Display a customizable Under Construction or Coming Soon landing page for all users except the admin. Perfect for developing on a live server!
26
  Pro version available, [Live Demo](http://smartcatdesign.net/smartcat-construction-mode-v2-pro/ "Construction Mode Pro")
27
 
28
  Available Customizations:
29
+
30
  * Toggle on/off
31
  * Set to entire site or specific page
32
  * Animated Progress Bar
51
  1. Construction Mode Landing Page
52
  2. Settings Page
53
  3. Pro Version, 1 of many samples
54
+
55
  == Changelog ==
56
 
57
+ = 3.01 =
58
+ * Added a direct login link from the Construction Page so admins can easily access the login page & site backend
59
+ * Added more filtering to avoid conflicts in template_redirect
60
+
61
  = 3.0 =
62
  * ATTENTION: The plugin has undergone a complete re-build. It now has better functionality and is more scalable for future updates
63
  * Added upload buttons for the logo and background image
70
  * New Feature: Added animation to progress bar
71
  * Moved the Under Construction notification to the admin top bar
72
 
 
 
 
 
73
  = 2.0 = email field fix, added shortcode support
74
  = 1.92 = responsive fix, dashboard change
75
  = 1.91 = security fix
87
  = 1.0 =
88
  initial release
89
 
90
+ == Upgrade Notice ==
91
+ = 3.0 =
92
+ This version is a re-build of the plugin that gives you many new features!
93
+
94
+
95
 
96
 
97
 
under-construction.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Construction Mode
4
  Plugin URI: http://smartcatdesign.net/downloads/construction-mode-v2-pro/
5
  Description: Display a customizable Under Construction or Coming Soon landing page for all users except the admin. Perfect for developing a new site!
6
- Version: 3.0
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
@@ -26,6 +26,6 @@ require_once ( plugin_dir_path( __FILE__ ) . 'inc/class/class.smartcat-construct
26
 
27
  // activation and de-activation hooks
28
  register_activation_hook( __FILE__, array( 'SmartcatConstructionPlugin', 'activate' ) );
29
- register_deactivation_hook( __FILE__, 'SmartcatConstructionPlugin', 'deactivate' );
30
 
31
  SmartcatConstructionPlugin::instance();
3
  Plugin Name: WP Construction Mode
4
  Plugin URI: http://smartcatdesign.net/downloads/construction-mode-v2-pro/
5
  Description: Display a customizable Under Construction or Coming Soon landing page for all users except the admin. Perfect for developing a new site!
6
+ Version: 3.01
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
26
 
27
  // activation and de-activation hooks
28
  register_activation_hook( __FILE__, array( 'SmartcatConstructionPlugin', 'activate' ) );
29
+ register_deactivation_hook( __FILE__, array( 'SmartcatConstructionPlugin', 'deactivate') );
30
 
31
  SmartcatConstructionPlugin::instance();