WP Construction Mode - Version 3.10

Version Description

Download this release

Release Info

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

Code changes from version 3.01 to 3.10

admin/form.php CHANGED
@@ -48,40 +48,49 @@
48
  <table class="widefat">
49
  <thead>
50
  <tr>
51
- <th><?php _e("Support this plugin", "sc-construction") ?></th>
52
  </tr>
53
  </thead>
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
 
68
  <table class="widefat">
69
  <thead>
70
  <tr>
71
- <th><?php _e("Free WordPress Theme", "sc-construction") ?></th>
72
  </tr>
73
  </thead>
74
  <tbody>
75
  <tr>
76
- <td>
77
- <?php _e("Building a new site? Try one of our free themes", "sc-construction"); ?>
 
 
78
  </td>
79
- </tr>
 
 
 
 
 
 
 
 
 
 
80
  <tr>
81
  <td class='center'>
82
 
83
- <img src="<?php echo SC_CONSTRUCTION_URL . '/inc/img/byblos.jpg' ?>" style="width: 100%;"/>
84
- <a href='https://wordpress.org/themes/byblos' target='_blank' class='button-primary'><?php _e('Download Theme', 'sc-construction'); ?></a>
85
  </td>
86
  </tr>
87
  </tbody>
@@ -91,6 +100,7 @@
91
  </div>
92
 
93
  <div class="width70 left">
 
94
  <form name="post_form" method="post" action="" enctype="multipart/form-data">
95
 
96
  <table class="widefat sc-construction-menu">
@@ -107,6 +117,10 @@
107
 
108
  </table>
109
 
 
 
 
 
110
  <table class="widefat" id="general">
111
  <thead>
112
  <tr>
@@ -177,6 +191,16 @@
177
  </tr>
178
  </thead>
179
  <tbody>
 
 
 
 
 
 
 
 
 
 
180
  <tr>
181
  <td><?php _e('Logo') ?></td>
182
  <td>
@@ -392,8 +416,10 @@
392
  </tr>
393
  </thead>
394
  </table>
395
-
396
- <input type="submit" name="smartcat_construction_save" value="Update" class="button button-primary" />
 
 
397
  <!--<input type="hidden" name="act" value="save" />-->
398
  </form>
399
 
48
  <table class="widefat">
49
  <thead>
50
  <tr>
51
+ <th><?php _e("Default Template", "sc-construction") ?></th>
52
  </tr>
53
  </thead>
54
  <tbody>
 
 
 
 
 
55
  <tr>
56
  <td class='center'>
57
+
58
+ <img src="<?php echo SC_CONSTRUCTION_URL . '/inc/img/Capture5.JPG' ?>" style="width: 100%;"/>
59
+
60
  </td>
61
+ </tr>
62
  </tbody>
63
  </table>
64
 
65
  <table class="widefat">
66
  <thead>
67
  <tr>
68
+ <th><?php _e("One Page", "sc-construction") ?></th>
69
  </tr>
70
  </thead>
71
  <tbody>
72
  <tr>
73
+ <td class='center'>
74
+
75
+ <img src="<?php echo SC_CONSTRUCTION_URL . '/inc/img/Capture4.JPG' ?>" style="width: 100%;"/>
76
+
77
  </td>
78
+ </tr>
79
+ </tbody>
80
+ </table>
81
+
82
+ <table class="widefat">
83
+ <thead>
84
+ <tr>
85
+ <th><?php _e("Moving Background", "sc-construction") ?></th>
86
+ </tr>
87
+ </thead>
88
+ <tbody>
89
  <tr>
90
  <td class='center'>
91
 
92
+ <img src="<?php echo SC_CONSTRUCTION_URL . '/inc/img/Capture3.JPG' ?>" style="width: 100%;"/>
93
+
94
  </td>
95
  </tr>
96
  </tbody>
100
  </div>
101
 
102
  <div class="width70 left">
103
+
104
  <form name="post_form" method="post" action="" enctype="multipart/form-data">
105
 
106
  <table class="widefat sc-construction-menu">
117
 
118
  </table>
119
 
120
+ <p>
121
+ WP Construction Mode allows the site Admin & Editor profiles to continue seeing the normal website, while everyone else sees the Construction Mode page.
122
+ </p>
123
+
124
  <table class="widefat" id="general">
125
  <thead>
126
  <tr>
191
  </tr>
192
  </thead>
193
  <tbody>
194
+ <tr>
195
+ <td><?php _e('Select Template') ?></td>
196
+ <td>
197
+ <select name ="smartcat_construction_options[display_template]" id="smartcat_construction_select_template">
198
+ <option value="template1">Default</option>
199
+ <option disabled="disabled">One Page - Pro Version</option>
200
+ <option disabled="disabled">Moving Background - Pro Version</option>
201
+ </select>
202
+ </td>
203
+ </tr>
204
  <tr>
205
  <td><?php _e('Logo') ?></td>
206
  <td>
416
  </tr>
417
  </thead>
418
  </table>
419
+ <div style="text-align: right">
420
+ <a target="_blank" href="<?php echo home_url('/'); ?>?smartcat_construction=preview" class="button button-default" style="padding: 17px 22px; line-height: 0">Preview</a>
421
+ <input type="submit" name="smartcat_construction_save" value="Update" class="button button-primary" style="padding: 17px 22px; line-height: 0"/>
422
+ </div>
423
  <!--<input type="hidden" name="act" value="save" />-->
424
  </form>
425
 
inc/class/class.smartcat-construction.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class SmartcatConstructionPlugin {
8
 
9
- const VERSION = '3.01';
10
 
11
  private static $instance;
12
  private $options;
@@ -64,9 +64,7 @@ class SmartcatConstructionPlugin {
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' ) );
68
  add_action( 'admin_enqueue_scripts', array( $this, 'smartcat_construction_load_admin_styles_scripts' ) );
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
 
@@ -99,7 +97,7 @@ class SmartcatConstructionPlugin {
99
  }
100
 
101
  public function under_construction_menu() {
102
- add_menu_page( 'Construction Mode', 'Construction Mode', 'manage_options', 'under_construction', array( $this, 'show_under_construction_menu' ) );
103
  }
104
 
105
  public function show_under_construction_menu() {
@@ -142,11 +140,11 @@ class SmartcatConstructionPlugin {
142
  wp_enqueue_script( 'jquery-ui-tooltip' );
143
  wp_enqueue_style( 'thickbox' );
144
  wp_enqueue_script( 'media-upload' );
145
- wp_enqueue_script( 'thickbox' );
146
 
147
- wp_enqueue_style( 'smartcat_construction_admin_style', SC_CONSTRUCTION_URL . 'inc/style/style_admin.css' );
148
-
149
- wp_enqueue_script( 'smartcat_construction_script', SC_CONSTRUCTION_URL . 'inc/script/script_admin.js', array( 'jquery', 'wp-color-picker', 'media-upload', 'thickbox', 'jquery-ui-tooltip' ) );
 
150
  }
151
 
152
  function smartcat_construction_load_styles_scripts() {
@@ -174,9 +172,14 @@ class SmartcatConstructionPlugin {
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();
6
  */
7
  class SmartcatConstructionPlugin {
8
 
9
+ const VERSION = '3.10';
10
 
11
  private static $instance;
12
  private $options;
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( 'admin_enqueue_scripts', array( $this, 'smartcat_construction_load_admin_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
 
97
  }
98
 
99
  public function under_construction_menu() {
100
+ add_menu_page( 'Construction Mode', 'Construction Mode', 'manage_options', 'under_construction', array($this, 'show_under_construction_menu'), 'dashicons-hammer');
101
  }
102
 
103
  public function show_under_construction_menu() {
140
  wp_enqueue_script( 'jquery-ui-tooltip' );
141
  wp_enqueue_style( 'thickbox' );
142
  wp_enqueue_script( 'media-upload' );
 
143
 
144
+ if ($hook == 'toplevel_page_under_construction') :
145
+ wp_enqueue_style( 'smartcat_construction_admin_style', SC_CONSTRUCTION_URL . 'inc/style/style_admin.css' );
146
+ wp_enqueue_script( 'smartcat_construction_script', SC_CONSTRUCTION_URL . 'inc/script/script_admin.js', array( 'jquery', 'wp-color-picker', 'media-upload', 'thickbox', 'jquery-ui-tooltip' ) );
147
+ endif;
148
  }
149
 
150
  function smartcat_construction_load_styles_scripts() {
172
 
173
  $current_user = wp_get_current_user();
174
 
175
+ if ( isset( $_GET['smartcat_construction'] ) && $_GET['smartcat_construction'] == 'preview') :
176
 
177
+ include_once SC_CONSTRUCTION_PATH . 'inc/template/construction.php';
178
+ exit();
179
+ endif;
180
+
181
 
182
+ if (( $this->options['mode'] && !user_can($current_user, 'administrator') && !user_can($current_user, 'editor'))) :
183
  if( $this->options['set_page'] == 'all' || $this->options['set_page'] == get_the_ID() ) :
184
  include_once SC_CONSTRUCTION_PATH . 'inc/template/construction.php';
185
  exit();
inc/img/Capture3.JPG ADDED
Binary file
inc/img/Capture4.JPG ADDED
Binary file
inc/img/Capture5.JPG ADDED
Binary file
inc/script/upload.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery ( document ).ready( function( $ ) {
2
+ var formfield;
3
+
4
+ /* user clicks button on custom field, runs below code that opens new window */
5
+ jQuery('.onetarek-upload-button').click(function() {
6
+ formfield = jQuery(this).prev('input'); //The input field that will hold the uploaded file url
7
+ tb_show('','media-upload.php?TB_iframe=true');
8
+
9
+ return false;
10
+
11
+ });
12
+ /*
13
+ Please keep these line to use this code snipet in your project
14
+ Developed by oneTarek http://onetarek.com
15
+ */
16
+ //adding my custom function with Thick box close function tb_close() .
17
+ window.old_tb_remove = window.tb_remove;
18
+ window.tb_remove = function() {
19
+ window.old_tb_remove(); // calls the tb_remove() of the Thickbox plugin
20
+ formfield=null;
21
+ };
22
+
23
+ // user inserts file into post. only run custom if user started process using the above process
24
+ // window.send_to_editor(html) is how wp would normally handle the received data
25
+
26
+ window.original_send_to_editor = window.send_to_editor;
27
+ window.send_to_editor = function(html){
28
+ if (formfield) {
29
+ fileurl = jQuery('img',html).attr('src');
30
+ jQuery(formfield).val(fileurl);
31
+ tb_remove();
32
+ } else {
33
+ window.original_send_to_editor(html);
34
+ }
35
+ };
36
+ });
inc/template/construction.php CHANGED
@@ -90,10 +90,10 @@
90
  </div>
91
 
92
  <h2 class="title sc-col-sm-12">
93
- <?php echo $title; ?>
94
  </h2>
95
  <h3 class="subtitle sc-col-sm-12">
96
- <?php echo $sub_title; ?>
97
  </h3>
98
  <?php if ( $template == 'progress' ) { ?>
99
  <div class="wuc-progress sc-col-sm-12">
90
  </div>
91
 
92
  <h2 class="title sc-col-sm-12">
93
+ <?php echo stripslashes( $title ); ?>
94
  </h2>
95
  <h3 class="subtitle sc-col-sm-12">
96
+ <?php echo stripslashes( $sub_title ); ?>
97
  </h3>
98
  <?php if ( $template == 'progress' ) { ?>
99
  <div class="wuc-progress sc-col-sm-12">
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: 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!
@@ -20,6 +20,8 @@ to see the Coming Soon page.
20
  From this settings page you can upload your own logo, upload a different background, Enter the text you want visitors to see, set the colors of your preference, and enter an optional
21
  shortcode for a form. The shortcode could be for a contact form or a newsletter. You can put any shortcode that you got from another plugin, and the form will show up on the landing page.
22
 
 
 
23
  The Pro vesion provides you with a sleek circular countdown timer. Set the target date & time, excite your visitors with a count down till launch! It also allows you to
24
  enter an About section, Contact section and many more features! See the demo!
25
 
@@ -91,6 +93,13 @@ initial release
91
  = 3.0 =
92
  This version is a re-build of the plugin that gives you many new features!
93
 
 
 
 
 
 
 
 
94
 
95
 
96
 
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.01
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!
20
  From this settings page you can upload your own logo, upload a different background, Enter the text you want visitors to see, set the colors of your preference, and enter an optional
21
  shortcode for a form. The shortcode could be for a contact form or a newsletter. You can put any shortcode that you got from another plugin, and the form will show up on the landing page.
22
 
23
+ https://www.youtube.com/watch?v=iXvpQqv3yG8
24
+
25
  The Pro vesion provides you with a sleek circular countdown timer. Set the target date & time, excite your visitors with a count down till launch! It also allows you to
26
  enter an About section, Contact section and many more features! See the demo!
27
 
93
  = 3.0 =
94
  This version is a re-build of the plugin that gives you many new features!
95
 
96
+ = 3.1 =
97
+ fix for slashes in title and subtitle
98
+ added 2 new templates for the pro version
99
+ added new animations for the pro version
100
+ JS fixes for upload button & lightbox
101
+
102
+
103
 
104
 
105
 
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.01
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
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.10
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2