WP Construction Mode - Version 1.9

Version Description

Download this release

Release Info

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

Code changes from version 1.8 to 1.9

Files changed (3) hide show
  1. avenue.jpg +0 -0
  2. form.php +25 -0
  3. under-construction.php +78 -54
avenue.jpg ADDED
Binary file
form.php CHANGED
@@ -125,6 +125,31 @@
125
  </tr>
126
  </thead>
127
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  </div>
129
  <div class="width70 left">
130
  <form name="post_form" method="post" action="" enctype="multipart/form-data">
125
  </tr>
126
  </thead>
127
  </table>
128
+ <table class="widefat">
129
+ <thead>
130
+ <tr>
131
+ <th><?php _e("Free WordPress Theme!") ?> <span class='proversion'></span></th>
132
+ </tr>
133
+
134
+ <tr>
135
+ <td>
136
+ A unique and modern lightweight responsive WordPress theme that is ready out of the box to make your website appealing while being easy to use. Avenue comes loaded with over 600 icons with cool animationm a light weight custom slider and 2 color skins as well as 5 widget placeholders.
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <td>
141
+ <a href='https://wordpress.org/themes/avenue' target='_blank'>
142
+ <img src="<?php echo SC_WUC_PATH; ?>/avenue.jpg" style="width: 100%;"/>
143
+ </a>
144
+ </td>
145
+ </tr>
146
+ <tr>
147
+ <td class='center'>
148
+ <a href='https://wordpress.org/themes/avenue' target='_blank' class='button-primary'>Download</a>
149
+ </td>
150
+ </tr>
151
+ </thead>
152
+ </table>
153
  </div>
154
  <div class="width70 left">
155
  <form name="post_form" method="post" action="" enctype="multipart/form-data">
under-construction.php CHANGED
@@ -3,11 +3,15 @@
3
  Plugin Name: WP Construction Mode
4
  Plugin URI: http://smartcatdesign.net/under-construction-maintenance-mode-free-wordpress-plugin/
5
  Description: Display a customizable Under Construction or Coming Soon page for all users who are not logged in. Perfect for developing on a live server!
6
- Version: 1.8
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
10
  */
 
 
 
 
11
  register_activation_hook(__FILE__, 'under_construction_install');
12
 
13
  function under_construction_install() {
@@ -16,9 +20,20 @@ function under_construction_install() {
16
  deactivate_plugins(basename(__FILE__));
17
  wp_die("This plugin requires WordPress version 3.2.1 or higher.");
18
  }
 
19
  set_under_construction();
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
22
  add_action('admin_menu', 'under_construction_menu');
23
  add_action('admin_head', 'admin_action');
24
 
@@ -40,7 +55,7 @@ function under_construction_action() {
40
  switch ($_REQUEST['act']) {
41
  case "save":
42
  set_under_construction();
43
- echo '<div class="updated below-h2" id="message" style="position:relative; clear:both;"><p>Under Construction: ' . $_REQUEST['set_opt'] . '</p></div>';
44
  break;
45
  default:
46
  }
@@ -64,110 +79,113 @@ function under_construction_action() {
64
  }
65
 
66
  function set_under_construction() {
 
 
 
67
  $option_name1 = 'set_opt';
68
  $option_name2 = 'set_msg';
69
  $option_name3 = 'set_page';
70
 
71
- $new_value1 = ($_REQUEST['set_opt'] == "") ? 'No' : $_REQUEST['set_opt'];
72
  if (get_option($option_name1) !== false) {
73
  update_option($option_name1, $new_value1);
74
  } else {
75
- $deprecated = null;
76
- $autoload = 'no';
77
- add_option($option_name1, $new_value1, $deprecated, $autoload);
78
  }
79
 
80
 
81
- $new_value2 = ($_REQUEST['set_msg'] == "") ? 'Page is currently under construction. ' : $_REQUEST['set_msg'];
82
  if (get_option($option_name2) !== false) {
83
  update_option($option_name2, $new_value2);
84
  } else {
85
- $deprecated = null;
86
- $autoload = 'no';
87
- add_option($option_name2, $new_value2, $deprecated, $autoload);
88
  }
89
 
90
- $new_value3 = ($_REQUEST['set_page'] == "") ? 'Website is Under Construction' : $_REQUEST['set_page'];
91
  if (get_option($option_name3) !== false) {
92
  update_option($option_name3, $new_value3);
93
  } else {
94
- $deprecated = null;
95
- $autoload = 'no';
96
- add_option($option_name3, $new_value3, $deprecated, $autoload);
97
  }
98
 
99
- $new_value4 = ($_REQUEST['set_caption'] == "") ? 'We will be back soon!' : $_REQUEST['set_caption'];
100
  if (get_option('set_caption') !== false) {
101
  update_option('set_caption', $new_value4);
102
  } else {
103
- $deprecated = null;
104
- $autoload = 'no';
105
- add_option('set_caption', $new_value4, $deprecated, $autoload);
106
  }
107
 
108
- $new_value5 = ($_REQUEST['wuc_logo'] == "") ? '' : $_REQUEST['wuc_logo'];
109
  if (get_option('wuc_logo') !== false) {
110
  update_option('wuc_logo', $new_value5);
111
  } else {
112
- $deprecated = null;
113
- $autoload = 'no';
114
- add_option('wuc_logo', $new_value5, $deprecated, $autoload);
115
  }
116
- $new_value6 = ($_REQUEST['wuc_facebook'] == "") ? '' : $_REQUEST['wuc_facebook'];
117
  if (get_option('wuc_facebook') !== false) {
118
  update_option('wuc_facebook', $new_value6);
119
  } else {
120
- $deprecated = null;
121
- $autoload = 'no';
122
- add_option('wuc_facebook', 'http://smartcatdesign.net', $deprecated, $autoload);
123
  }
124
- $new_value7 = ($_REQUEST['wuc_gplus'] == "") ? '' : $_REQUEST['wuc_gplus'];
125
  if (get_option('wuc_gplus') !== false) {
126
  update_option('wuc_gplus', $new_value7);
127
  } else {
128
- $deprecated = null;
129
- $autoload = 'no';
130
- add_option('wuc_gplus', 'http://smartcatdesign.net', $deprecated, $autoload);
131
  }
132
- $new_value8 = ($_REQUEST['wuc_twitter'] == "") ? '' : $_REQUEST['wuc_twitter'];
133
  if (get_option('wuc_twitter') !== false) {
134
  update_option('wuc_twitter', $new_value8);
135
  } else {
136
- $deprecated = null;
137
- $autoload = 'no';
138
- add_option('wuc_twitter', 'http://smartcatdesign.net', $deprecated, $autoload);
139
  }
140
- $new_value9 = ($_REQUEST['wuc_email'] == "") ? '' : $_REQUEST['wuc_email'];
141
  if (get_option('wuc_email') !== false) {
142
  update_option('wuc_email', $new_value9);
143
  } else {
144
- $deprecated = null;
145
- $autoload = 'no';
146
- add_option('wuc_email', 'http://smartcatdesign.net', $deprecated, $autoload);
147
  }
148
- $new_value10 = ($_REQUEST['wuc_background'] == "") ? '' : $_REQUEST['wuc_background'];
149
  if (get_option('wuc_background') !== false) {
150
  update_option('wuc_background', $new_value10);
151
  } else {
152
- $deprecated = null;
153
- $autoload = 'no';
154
- add_option('wuc_background', '', $deprecated, $autoload);
155
  }
156
- $new_value19 = ($_REQUEST['wuc_loading'] == "") ? '' : $_REQUEST['wuc_loading'];
157
  if (get_option('wuc_loading') !== false) {
158
  update_option('wuc_loading', $new_value19);
159
  } else {
160
- $deprecated = null;
161
- $autoload = 'no';
162
- add_option('wuc_loading', 'timer', $deprecated, $autoload);
163
  }
164
- $new_value20 = ($_REQUEST['wuc_progress'] == "") ? '' : $_REQUEST['wuc_progress'];
165
  if (get_option('wuc_progress') !== false) {
166
  update_option('wuc_progress', $new_value20);
167
  } else {
168
- $deprecated = null;
169
- $autoload = 'no';
170
- add_option('wuc_progress', '10', $deprecated, $autoload);
171
  }
172
  }
173
 
@@ -205,10 +223,16 @@ function show_uc() {
205
  }
206
  }
207
  }
208
- wp_register_style( 'wuc_style', plugins_url() . '/wp-construction-mode/style/style.css', false, '1.8' );
209
- wp_register_style( 'wuc_font', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400,600', false);
210
 
211
- wp_enqueue_style( 'wuc_font' );
212
- wp_enqueue_style( 'wuc_style' );
213
  add_action('wp_head', 'show_uc');
 
 
 
 
 
 
 
 
 
 
214
  ?>
3
  Plugin Name: WP Construction Mode
4
  Plugin URI: http://smartcatdesign.net/under-construction-maintenance-mode-free-wordpress-plugin/
5
  Description: Display a customizable Under Construction or Coming Soon page for all users who are not logged in. Perfect for developing on a live server!
6
+ Version: 1.9
7
  Author: SmartCat
8
  Author URI: http://smartcatdesign.net
9
  License: GPL v2
10
  */
11
+
12
+ if(!defined('SC_WUC_PATH'))
13
+ define('SC_WUC_PATH', plugin_dir_url(__FILE__));
14
+
15
  register_activation_hook(__FILE__, 'under_construction_install');
16
 
17
  function under_construction_install() {
20
  deactivate_plugins(basename(__FILE__));
21
  wp_die("This plugin requires WordPress version 3.2.1 or higher.");
22
  }
23
+ add_option('wuc_activation_redirect', true);
24
  set_under_construction();
25
  }
26
 
27
+ add_action('admin_init', 'wuc_activation_redirect');
28
+
29
+ function wuc_activation_redirect() {
30
+ if (get_option('wuc_activation_redirect', false)) {
31
+ delete_option('wuc_activation_redirect');
32
+ wp_redirect(admin_url('/admin.php?page=under-construction.php'));
33
+ }
34
+ }
35
+
36
+
37
  add_action('admin_menu', 'under_construction_menu');
38
  add_action('admin_head', 'admin_action');
39
 
55
  switch ($_REQUEST['act']) {
56
  case "save":
57
  set_under_construction();
58
+ echo '<div class="updated below-h2" id="message" style="position:relative; clear:both;"><p>Under Construction: ' . sanitize_text_field($_REQUEST['set_opt']) . '</p></div>';
59
  break;
60
  default:
61
  }
79
  }
80
 
81
  function set_under_construction() {
82
+
83
+
84
+
85
  $option_name1 = 'set_opt';
86
  $option_name2 = 'set_msg';
87
  $option_name3 = 'set_page';
88
 
89
+ $new_value1 = (sanitize_text_field($_REQUEST['set_opt']) == "") ? 'No' : sanitize_text_field($_REQUEST['set_opt']);
90
  if (get_option($option_name1) !== false) {
91
  update_option($option_name1, $new_value1);
92
  } else {
93
+
94
+
95
+ add_option($option_name1, $new_value1);
96
  }
97
 
98
 
99
+ $new_value2 = (sanitize_text_field($_REQUEST['set_msg']) == "") ? 'Page is currently under construction. ' : sanitize_text_field($_REQUEST['set_msg']);
100
  if (get_option($option_name2) !== false) {
101
  update_option($option_name2, $new_value2);
102
  } else {
103
+
104
+
105
+ add_option($option_name2, $new_value2);
106
  }
107
 
108
+ $new_value3 = (sanitize_text_field($_REQUEST['set_page']) == "") ? 'Website is Under Construction' : sanitize_text_field($_REQUEST['set_page']);
109
  if (get_option($option_name3) !== false) {
110
  update_option($option_name3, $new_value3);
111
  } else {
112
+
113
+
114
+ add_option($option_name3, $new_value3);
115
  }
116
 
117
+ $new_value4 = (sanitize_text_field($_REQUEST['set_caption']) == "") ? 'We will be back soon!' : sanitize_text_field($_REQUEST['set_caption']);
118
  if (get_option('set_caption') !== false) {
119
  update_option('set_caption', $new_value4);
120
  } else {
121
+
122
+
123
+ add_option('set_caption', $new_value4);
124
  }
125
 
126
+ $new_value5 = (sanitize_text_field($_REQUEST['wuc_logo']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_logo']);
127
  if (get_option('wuc_logo') !== false) {
128
  update_option('wuc_logo', $new_value5);
129
  } else {
130
+
131
+
132
+ add_option('wuc_logo', $new_value5);
133
  }
134
+ $new_value6 = (sanitize_text_field($_REQUEST['wuc_facebook']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_facebook']);
135
  if (get_option('wuc_facebook') !== false) {
136
  update_option('wuc_facebook', $new_value6);
137
  } else {
138
+
139
+
140
+ add_option('wuc_facebook', 'http://smartcatdesign.net');
141
  }
142
+ $new_value7 = (sanitize_text_field($_REQUEST['wuc_gplus']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_gplus']);
143
  if (get_option('wuc_gplus') !== false) {
144
  update_option('wuc_gplus', $new_value7);
145
  } else {
146
+
147
+
148
+ add_option('wuc_gplus', 'http://smartcatdesign.net');
149
  }
150
+ $new_value8 = (sanitize_text_field($_REQUEST['wuc_twitter']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_twitter']);
151
  if (get_option('wuc_twitter') !== false) {
152
  update_option('wuc_twitter', $new_value8);
153
  } else {
154
+
155
+
156
+ add_option('wuc_twitter', 'http://smartcatdesign.net');
157
  }
158
+ $new_value9 = (sanitize_text_field($_REQUEST['wuc_email']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_email']);
159
  if (get_option('wuc_email') !== false) {
160
  update_option('wuc_email', $new_value9);
161
  } else {
162
+
163
+
164
+ add_option('wuc_email', 'http://smartcatdesign.net');
165
  }
166
+ $new_value10 = (sanitize_text_field($_REQUEST['wuc_background']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_background']);
167
  if (get_option('wuc_background') !== false) {
168
  update_option('wuc_background', $new_value10);
169
  } else {
170
+
171
+
172
+ add_option('wuc_background', '');
173
  }
174
+ $new_value19 = (sanitize_text_field($_REQUEST['wuc_loading']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_loading']);
175
  if (get_option('wuc_loading') !== false) {
176
  update_option('wuc_loading', $new_value19);
177
  } else {
178
+
179
+
180
+ add_option('wuc_loading', 'timer');
181
  }
182
+ $new_value20 = (sanitize_text_field($_REQUEST['wuc_progress']) == "") ? '' : sanitize_text_field($_REQUEST['wuc_progress']);
183
  if (get_option('wuc_progress') !== false) {
184
  update_option('wuc_progress', $new_value20);
185
  } else {
186
+
187
+
188
+ add_option('wuc_progress', '10');
189
  }
190
  }
191
 
223
  }
224
  }
225
  }
 
 
226
 
 
 
227
  add_action('wp_head', 'show_uc');
228
+
229
+
230
+ add_action('wp_enqueue_scripts', 'sc_wuc_load_styles_scripts');
231
+ function sc_wuc_load_styles_scripts(){
232
+ wp_register_style( 'wuc_style', plugins_url() . '/wp-construction-mode/style/style.css', false, '1.9' );
233
+ wp_register_style( 'wuc_font', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400,600', false);
234
+
235
+ wp_enqueue_style( 'wuc_font' );
236
+ wp_enqueue_style( 'wuc_style' );
237
+ }
238
  ?>