underConstruction - Version 1.10

Version Description

  • Fixes a bug where users who aren't admins wouldn't be able to use the admin area of the site if the under construction plugin was enabled
  • Adds French translation (my thanks to David Thomas at studio de cration sympathique)
  • Removed the screenshots from the downloadable bundle in order make the plugin install faster
  • Fixed a minor security issue where users with valid credentials could view a single page when logging in
  • Sorry for all the updates lately
Download this release

Release Info

Developer jkmassel
Plugin Icon 128x128 underConstruction
Version 1.10
Comparing to
See all releases

Code changes from version 1.09 to 1.10

ajax-loader.gif CHANGED
File without changes
defaultMessage.php CHANGED
File without changes
languages/underconstruction-default.mo ADDED
Binary file
languages/underconstruction-default.po ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Under Construction\n"
4
+ "POT-Creation-Date: 2013-06-07 11:49-0700\n"
5
+ "PO-Revision-Date: 2013-06-07 11:49-0700\n"
6
+ "Last-Translator: Jeremy <jeremy@ignitionmedia.ca>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.5\n"
12
+ "X-Poedit-KeywordsList: _e;__;_;gettext;gettext_noop\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: \n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../ucOptions.php:154
19
+ msgid ""
20
+ "JavaScript appears to be disabled in your browser. For this plugin to work "
21
+ "correctly, please enable JavaScript or switch to a more modern browser."
22
+ msgstr ""
23
+
24
+ #: ../ucOptions.php:164
25
+ msgid "Under Construction"
26
+ msgstr ""
27
+
28
+ #: ../ucOptions.php:168 ../ucOptions.php:175
29
+ msgid "Activate or Deactivate"
30
+ msgstr ""
31
+
32
+ #: ../ucOptions.php:178
33
+ msgid "on"
34
+ msgstr ""
35
+
36
+ #: ../ucOptions.php:181
37
+ msgid "off"
38
+ msgstr ""
39
+
40
+ #: ../ucOptions.php:188 ../ucOptions.php:196
41
+ msgid "HTTP Status Code"
42
+ msgstr ""
43
+
44
+ #: ../ucOptions.php:189
45
+ msgid ""
46
+ "You can choose to send the standard HTTP status code with the under "
47
+ "construction page, or send a 503 \"Service Unavailable\" status code. This "
48
+ "will tell Google that this page isn't ready yet, and cause your site not to "
49
+ "be listed until this plugin is disabled."
50
+ msgstr ""
51
+
52
+ #: ../ucOptions.php:199
53
+ msgid "HTTP 200 - ok"
54
+ msgstr ""
55
+
56
+ #: ../ucOptions.php:202
57
+ msgid "HTTP 301 - Redirect"
58
+ msgstr ""
59
+
60
+ #: ../ucOptions.php:204
61
+ msgid "HTTP 503 - Service Unavailable"
62
+ msgstr ""
63
+
64
+ #: ../ucOptions.php:208
65
+ msgid "Redirect Location:"
66
+ msgstr ""
67
+
68
+ #: ../ucOptions.php:215
69
+ msgid "Restrict By Role"
70
+ msgstr ""
71
+
72
+ #: ../ucOptions.php:219
73
+ msgid "Only users at or above this level will be able to log in:"
74
+ msgstr ""
75
+
76
+ #: ../ucOptions.php:221
77
+ msgid "All Users"
78
+ msgstr ""
79
+
80
+ #: ../ucOptions.php:242
81
+ msgid "IP Address Whitelist"
82
+ msgstr ""
83
+
84
+ #: ../ucOptions.php:257
85
+ msgid "Remove Selected IP Address"
86
+ msgstr ""
87
+
88
+ #: ../ucOptions.php:259
89
+ msgid "IP Address:"
90
+ msgstr ""
91
+
92
+ #: ../ucOptions.php:260
93
+ msgid "Add Current Address"
94
+ msgstr ""
95
+
96
+ #: ../ucOptions.php:267 ../ucOptions.php:274
97
+ msgid "Display Options"
98
+ msgstr ""
99
+
100
+ #: ../ucOptions.php:277
101
+ msgid "Display the default under construction page"
102
+ msgstr ""
103
+
104
+ #: ../ucOptions.php:280
105
+ msgid "Display the default under construction page, but use custom text"
106
+ msgstr ""
107
+
108
+ #: ../ucOptions.php:283
109
+ msgid "Display a custom page using your own HTML"
110
+ msgstr ""
111
+
112
+ #: ../ucOptions.php:291
113
+ msgid "Display Custom Text"
114
+ msgstr ""
115
+
116
+ #: ../ucOptions.php:292
117
+ msgid "The text here will replace the text on the default page"
118
+ msgstr ""
119
+
120
+ #: ../ucOptions.php:295
121
+ msgid "Page Title"
122
+ msgstr ""
123
+
124
+ #: ../ucOptions.php:299
125
+ msgid "Header Text"
126
+ msgstr ""
127
+
128
+ #: ../ucOptions.php:303
129
+ msgid "Body Text"
130
+ msgstr ""
131
+
132
+ #: ../ucOptions.php:310
133
+ msgid "Under Construction Page HTML"
134
+ msgstr ""
135
+
136
+ #: ../ucOptions.php:311
137
+ msgid "Put in this area the HTML you want to show up on your front page"
138
+ msgstr ""
139
+
140
+ #: ../ucOptions.php:317
141
+ msgid "Save Changes"
142
+ msgstr ""
143
+
144
+ #: ../underConstruction.php:327
145
+ msgid "Settings"
146
+ msgstr ""
languages/underconstruction-fr_FR.mo ADDED
Binary file
languages/underconstruction-fr_FR.po ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Under Construction\n"
4
+ "POT-Creation-Date: 2013-06-07 11:49-0700\n"
5
+ "PO-Revision-Date: 2013-06-07 11:49-0700\n"
6
+ "Last-Translator: Jeremy <jeremy@ignitionmedia.ca>\n"
7
+ "Language-Team: smol <anou@smol.org>\n"
8
+ "Language: fr-FR\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: _e;__;_;gettext;gettext_noop\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../ucOptions.php:154
20
+ msgid ""
21
+ "JavaScript appears to be disabled in your browser. For this plugin to work "
22
+ "correctly, please enable JavaScript or switch to a more modern browser."
23
+ msgstr ""
24
+ "JavaScript semble être désactivé dans votre navigateur. Pour que cette "
25
+ "extension fonctionne correctement, activez JavaScript ou utilisez à un "
26
+ "navigateur plus moderne."
27
+
28
+ #: ../ucOptions.php:164
29
+ msgid "Under Construction"
30
+ msgstr "En construction"
31
+
32
+ #: ../ucOptions.php:168 ../ucOptions.php:175
33
+ msgid "Activate or Deactivate"
34
+ msgstr "Activer ou Désactiver"
35
+
36
+ #: ../ucOptions.php:178
37
+ msgid "on"
38
+ msgstr "actif"
39
+
40
+ #: ../ucOptions.php:181
41
+ msgid "off"
42
+ msgstr "inactif"
43
+
44
+ #: ../ucOptions.php:188 ../ucOptions.php:196
45
+ msgid "HTTP Status Code"
46
+ msgstr "Code d'état HTTP"
47
+
48
+ #: ../ucOptions.php:189
49
+ msgid ""
50
+ "You can choose to send the standard HTTP status code with the under "
51
+ "construction page, or send a 503 \"Service Unavailable\" status code. This "
52
+ "will tell Google that this page isn't ready yet, and cause your site not to "
53
+ "be listed until this plugin is disabled."
54
+ msgstr ""
55
+ "Vous pouvez choisir d'envoyer le code d'état HTTP standard via la page \"En "
56
+ "construction\" ou envoyer un code d'état 503, \"le serveur est "
57
+ "temporairement indisponible\". Ceci indiquera à Google cette page n'est pas "
58
+ "encore prête, et ainsi votre site ne sera pas référencé jusqu'à la "
59
+ "désactivation de l'extension."
60
+
61
+ #: ../ucOptions.php:199
62
+ msgid "HTTP 200 - ok"
63
+ msgstr "HTTP 200 - ok"
64
+
65
+ #: ../ucOptions.php:202
66
+ msgid "HTTP 301 - Redirect"
67
+ msgstr "HTTP 301 - Redirection"
68
+
69
+ #: ../ucOptions.php:204
70
+ msgid "HTTP 503 - Service Unavailable"
71
+ msgstr "HTTP 503 - Serveur temporairement indisponible"
72
+
73
+ #: ../ucOptions.php:208
74
+ msgid "Redirect Location:"
75
+ msgstr "Adresse de redirection :"
76
+
77
+ #: ../ucOptions.php:215
78
+ msgid "Restrict By Role"
79
+ msgstr "Restriction par rôle"
80
+
81
+ #: ../ucOptions.php:219
82
+ msgid "Only users at or above this level will be able to log in:"
83
+ msgstr ""
84
+ "Seuls les utilisateurs avec ce rôle, ou un rôle de niveau supérieur, seront "
85
+ "en mesure de s'identifier :"
86
+
87
+ #: ../ucOptions.php:221
88
+ msgid "All Users"
89
+ msgstr "Tous les utilisateurs"
90
+
91
+ #: ../ucOptions.php:242
92
+ msgid "IP Address Whitelist"
93
+ msgstr "Liste des adresses IP autorisées"
94
+
95
+ #: ../ucOptions.php:257
96
+ msgid "Remove Selected IP Address"
97
+ msgstr "Supprimer la sélection d'adresses IP"
98
+
99
+ #: ../ucOptions.php:259
100
+ msgid "IP Address:"
101
+ msgstr "Adresse IP :"
102
+
103
+ #: ../ucOptions.php:260
104
+ msgid "Add Current Address"
105
+ msgstr "Ajouter l'adresse IP actuelle"
106
+
107
+ #: ../ucOptions.php:267 ../ucOptions.php:274
108
+ msgid "Display Options"
109
+ msgstr "Options d'affichage"
110
+
111
+ #: ../ucOptions.php:277
112
+ msgid "Display the default under construction page"
113
+ msgstr "Afficher la page \"En construction\" par défaut"
114
+
115
+ #: ../ucOptions.php:280
116
+ msgid "Display the default under construction page, but use custom text"
117
+ msgstr ""
118
+ "Afficher la page \"En construction\" par défaut, mais avec un texte "
119
+ "personnalisé"
120
+
121
+ #: ../ucOptions.php:283
122
+ msgid "Display a custom page using your own HTML"
123
+ msgstr ""
124
+ "Afficher une page \"En construction\" personnalisé en utilisant votre propre "
125
+ "code HTML"
126
+
127
+ #: ../ucOptions.php:291
128
+ msgid "Display Custom Text"
129
+ msgstr "Texte personnalisé"
130
+
131
+ #: ../ucOptions.php:292
132
+ msgid "The text here will replace the text on the default page"
133
+ msgstr ""
134
+ "Le texte renseigné ci-dessous remplacera le texte de la page par défaut"
135
+
136
+ #: ../ucOptions.php:295
137
+ msgid "Page Title"
138
+ msgstr "Titre de la page (title) "
139
+
140
+ #: ../ucOptions.php:299
141
+ msgid "Header Text"
142
+ msgstr "Titre de la page (h1)"
143
+
144
+ #: ../ucOptions.php:303
145
+ msgid "Body Text"
146
+ msgstr "Texte principal"
147
+
148
+ #: ../ucOptions.php:310
149
+ msgid "Under Construction Page HTML"
150
+ msgstr "HTML de la page \"En construction\""
151
+
152
+ #: ../ucOptions.php:311
153
+ msgid "Put in this area the HTML you want to show up on your front page"
154
+ msgstr ""
155
+ "Insérer dans cette zone le code HTML que vous souhaitez afficher sur votre "
156
+ "page d'accueil"
157
+
158
+ #: ../ucOptions.php:317
159
+ msgid "Save Changes"
160
+ msgstr "Enregistrer les modifications"
161
+
162
+ #: ../underConstruction.php:327
163
+ msgid "Settings"
164
+ msgstr "Paramètres"
165
+
166
+ #~ msgid "Display a custom page using your own Template file"
167
+ #~ msgstr ""
168
+ #~ "Afficher une page \"En construction\" personnalisé en utilisant votre "
169
+ #~ "propre fichier gabarit."
170
+
171
+ #~ msgid "Choose your template file"
172
+ #~ msgstr "Choisissez votre fichier"
173
+
174
+ #~ msgid ""
175
+ #~ "The files listed here are the files from the <em>/templates</em> folder "
176
+ #~ "of the plugin.<br />If you want to add one, duplicate the "
177
+ #~ "<em>defaultMessage.php</em> file, rename it and modify it as per your "
178
+ #~ "needs."
179
+ #~ msgstr ""
180
+ #~ "Les fichiers listés ci-dessous sont les fichiers du dossier <em>/"
181
+ #~ "templates</em> de l'extension.<br />Si vous voulez en ajouter un, "
182
+ #~ "dupliquez le fichier <em>defaultMessage.php</em>, renommer-le et modifiez-"
183
+ #~ "le selon vos besoins."
184
+
185
+ #~ msgid "Under Construction Settings"
186
+ #~ msgstr "Paramètres de \"En construction\""
187
+
188
+ #~ msgid "%d is coming soon"
189
+ #~ msgstr "%d arrive bientôt"
190
+
191
+ #~ msgid " is coming soon"
192
+ #~ msgstr " arrive bientôt"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://masseltech.com/donate/
4
  Tags: construction, under construction, private, preview, security, coming soon
5
  Requires at least: 2.7
6
  Tested up to: 3.5.1
7
- Stable tag: 1.09
8
 
9
  Creates a 'Coming Soon' page that will show for all users who are not logged in
10
 
@@ -43,6 +43,13 @@ Sorry, I get a lot of questions. But visit the homepage for this plugin and leav
43
 
44
  == Changelog ==
45
 
 
 
 
 
 
 
 
46
  = 1.09 =
47
  * Fixed an issue identified Charlie Eriksen. Listed as Secunia Advisory SA52881. Fixes a security issue that could possibly result in the plugin being inadvertently deactivated.
48
  * Fixes a typo on the options screen
4
  Tags: construction, under construction, private, preview, security, coming soon
5
  Requires at least: 2.7
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.10
8
 
9
  Creates a 'Coming Soon' page that will show for all users who are not logged in
10
 
43
 
44
  == Changelog ==
45
 
46
+ = 1.10 =
47
+ * Fixes a bug where users who aren't admins wouldn't be able to use the admin area of the site if the under construction plugin was enabled
48
+ * Adds French translation (my thanks to David Thomas at studio de création sympathique)
49
+ * Removed the screenshots from the downloadable bundle in order make the plugin install faster
50
+ * Fixed a minor security issue where users with valid credentials could view a single page when logging in
51
+ * Sorry for all the updates lately
52
+
53
  = 1.09 =
54
  * Fixed an issue identified Charlie Eriksen. Listed as Secunia Advisory SA52881. Fixes a security issue that could possibly result in the plugin being inadvertently deactivated.
55
  * Fixes a typo on the options screen
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
ucOptions.php CHANGED
@@ -9,13 +9,11 @@ if($_SERVER['REQUEST_METHOD'] == "POST"){
9
  if (isset($_GET['turnOnUnderConstructionMode']))
10
  {
11
  update_option('underConstructionActivationStatus', 1);
12
-
13
  }
14
 
15
  if (isset($_GET['turnOffUnderConstructionMode']))
16
  {
17
  update_option('underConstructionActivationStatus', 0);
18
-
19
  }
20
 
21
  // ======================================
@@ -142,16 +140,10 @@ if(isset($_POST['remove_selected_ip_btn'])){
142
  if(isset($_POST['required_role'])){
143
  update_option('underConstructionRequiredRole', $_POST['required_role']);
144
  }
145
-
146
-
147
-
148
-
149
  ?>
150
  <noscript>
151
  <div class='updated' id='javascriptWarn'>
152
- <p>JavaScript appears to be disabled in your browser. For this plugin
153
- to work correctly, please enable JavaScript or switch to a more
154
- modern browser</p>
155
  </div>
156
  </noscript>
157
  <div class="wrap">
@@ -161,194 +153,160 @@ if(isset($_POST['required_role'])){
161
  <form method="post"
162
  action="<?php echo $GLOBALS['PHP_SELF'] . '?page=' . $this->mainOptionsPage; ?>"
163
  id="ucoptions">
164
- <h2>Under Construction</h2>
165
  <table>
166
  <tr>
167
  <td>
168
- <h3>Activate or Deactivate</h3>
169
  </td>
170
  </tr>
171
  <tr>
172
  <td>
173
  <fieldset>
174
  <legend class="screen-reader-text">
175
- <span> Activate or Deactivate </span>
176
  </legend>
177
- <label title="activate"> <input type="radio" name="activate"
178
- value="1"
179
- <?php if ($this->pluginIsActive()) { echo ' checked="checked"'; } ?>>
180
- on </label> <br /> <label title="deactivate"> <input type="radio"
181
- name="activate" value="0"
182
- <?php if (!$this->pluginIsActive()) { echo ' checked="checked"'; } ?>>
183
- off </label>
184
  </fieldset>
185
  </td>
186
  </tr>
187
  <tr>
188
  <td>
189
- <h3>HTTP Status Code</h3>
190
- <p>You can choose to send the standard HTTP status code with the
191
- under construction page, or send a 503 "Service Unavailable"
192
- status code. This will tell Google that this page isn't ready yet,
193
- and cause your site not to be listed until this plugin is disabled
194
- </p>
195
  </td>
196
  </tr>
197
  <tr>
198
  <td>
199
  <fieldset>
200
  <legend class="screen-reader-text">
201
- <span> HTTP Status Code </span>
202
  </legend>
203
- <label title="HTTP200"> <input type="radio" name="http_status"
204
- value="200" id="200_status"
205
- <?php if ($this->httpStatusCodeIs(200)) { echo ' checked="checked"'; } ?>>
206
- HTTP 200 - ok </label> <br /> <label title="HTTP301"> <input
207
- type="radio" name="http_status" value="301" id="301_status"
208
- <?php if ($this->httpStatusCodeIs(301)) { echo ' checked="checked"'; } ?>>
209
- HTTP 301 - Redirect </label> <br /> <label title="HTTP503"> <input
210
- type="radio" name="http_status" value="503" id="503_status"
211
- <?php if ($this->httpStatusCodeIs(503)) { echo ' checked="checked"'; } ?>>
212
- HTTP 503 - Service Unavailable </label>
213
  </fieldset>
214
-
215
- <div id="redirect_panel" <?php if(!$this->httpStatusCodeIs(301)):?>
216
- class="hidden" <?php endif;?>>
217
- <br /> <label for="url">Redirect Location: </label><input
218
- type="text" name="url" id="url"
219
- value="<?php echo get_option('underConstructionRedirectURL');?>" />
220
  </div>
221
  </td>
222
  </tr>
223
-
224
  <tr>
225
  <td>
226
- <h3>Restrict By Role</h3>
227
  </td>
228
  </tr>
229
  <tr>
230
- <td>Only users at or above this level will be able to log in: <select id="required_role" name="required_role">
231
- <option value="0">All Users</option>
232
- <?php
233
- $selected = get_option('underConstructionRequiredRole');
234
- $editable_roles = get_editable_roles();
235
-
236
- foreach ( $editable_roles as $role => $details ) {
237
- $name = translate_user_role($details['name'] );
238
- if ( $selected == $role ) // preselect specified role
239
- $p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";
240
- else
241
- $r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>";
242
- }
243
- echo $p . $r;
244
- ?>
 
 
 
245
  </select>
246
  </td>
247
-
248
-
249
- <tr>
250
-
251
-
252
  <tr>
253
  <td>
254
- <h3>IP Address Whitelist</h3>
255
  </td>
256
  </tr>
257
  <tr>
258
- <td><?php
259
- $whitelist = get_option('underConstructionIPWhitelist');
260
-
261
- if(count($whitelist)):
262
-
263
- ?> <select size="4" id="ip_whitelist" name="ip_whitelist"
264
- style="width: 250px; height: 100px;">
265
  <?php for($i = 0; $i < count($whitelist); $i++):?>
266
  <option id="<?php echo $i; ?>" value="<?php echo $i;?>">
267
  <?php echo $whitelist[$i];?>
268
  </option>
269
  <?php endfor;?>
 
270
 
271
- </select><br /> <input type="submit"
272
- value="Remove Selected IP Address" name="remove_selected_ip_btn"
273
- id="remove_selected_ip_btn" /> <br /> <br /> <?php endif; ?> <label>IP
274
- Address: <input type="text" name="ip_address" id="ip_address" /> </label>
275
- <a id="add_current_address_btn" style="cursor: pointer;">Add
276
- Current Address</a><img id="loading_current_address"
277
- class="hidden"
278
- src="<?php echo plugins_url( 'ajax-loader.gif' , __FILE__ ); ?>" />
279
-
280
  <br />
281
  </td>
282
  </tr>
283
-
284
  <tr>
285
  <td>
286
- <h3>Display Options</h3>
287
  </td>
288
  </tr>
289
  <tr>
290
  <td>
291
  <fieldset>
292
  <legend class="screen-reader-text">
293
- <span> Display Options </span>
294
  </legend>
295
- <label title="defaultPage"> <input type="radio"
296
- name="display_options" value="0" id="displayOption0"
297
- <?php if ($this->displayStatusCodeIs(0)) { echo ' checked="checked"'; } ?>>
298
- Display the default under construction page </label> <br /> <label
299
- title="HTTP503"> <input type="radio" name="display_options"
300
- value="1" id="displayOption1"
301
- <?php if ($this->displayStatusCodeIs(1)) { echo ' checked="checked"'; } ?>>
302
- Display the default under construction page, but use custom text
303
- </label> <br /> <label title="HTTP503"> <input type="radio"
304
- name="display_options" value="2" id="displayOption2"
305
- <?php if ($this->displayStatusCodeIs(2)) { echo ' checked="checked"'; } ?>>
306
- Display a custom page using your own HTML </label>
307
  </fieldset>
308
  </td>
309
  </tr>
310
  </table>
311
- <div id="customText"
312
- <?php if (!$this->displayStatusCodeIs(1)) { echo ' style="display: none;"'; } ?>>
313
- <h3>Display Custom Text</h3>
314
- <p>The text here will replace the text on the default page</p>
315
  <table>
316
  <tr valign="top">
317
- <th scope="row"><label for="pageTitle"> Page Title </label>
318
- </th>
319
- <td><input name="pageTitle" type="text" id="pageTitle"
320
- value="<?php echo $this->getCustomPageTitle(); ?>"
321
- class="regular-text" size="50">
322
- </td>
323
  </tr>
324
  <tr valign="top">
325
- <th scope="row"><label for="headerText"> Header Text </label>
326
- </th>
327
- <td><input name="headerText" type="text" id="headerText"
328
- value="<?php echo $this->getCustomHeaderText(); ?>"
329
- class="regular-text" size="50">
330
- </td>
331
  </tr>
332
  <tr valign="top">
333
- <th scope="row"><label for="bodyText"> Body Text </label>
334
- </th>
335
- <td><?php echo '<textarea rows="2" cols="44" name="bodyText" id="bodyText" class="regular-text">'.trim($this->getCustomBodyText()).'</textarea>'; ?>
336
- </td>
337
  </tr>
338
  </table>
339
  </div>
340
- <div id="customHTML"
341
- <?php if (!$this->displayStatusCodeIs(2)) { echo ' style="display: none;"'; } ?>>
342
- <h3>Under Construction Page HTML</h3>
343
- <p>Put in this area the HTML you want to show up on your front page</p>
344
  <?php echo '<textarea name="ucHTML" rows="15" cols="75">'.$this->getCustomHTML().'</textarea>'; ?>
345
  </div>
346
- <p class="submit">
347
- <?php wp_nonce_field('save_options','save_options_field'); ?>
348
-
349
 
350
- <input type="submit" name="Submit" class="button-primary"
351
- value="Save Changes" id="submitChangesToUnderConstructionPlugin" />
 
352
  </p>
353
  </form>
354
  </div>
9
  if (isset($_GET['turnOnUnderConstructionMode']))
10
  {
11
  update_option('underConstructionActivationStatus', 1);
 
12
  }
13
 
14
  if (isset($_GET['turnOffUnderConstructionMode']))
15
  {
16
  update_option('underConstructionActivationStatus', 0);
 
17
  }
18
 
19
  // ======================================
140
  if(isset($_POST['required_role'])){
141
  update_option('underConstructionRequiredRole', $_POST['required_role']);
142
  }
 
 
 
 
143
  ?>
144
  <noscript>
145
  <div class='updated' id='javascriptWarn'>
146
+ <p><?php _e('JavaScript appears to be disabled in your browser. For this plugin to work correctly, please enable JavaScript or switch to a more modern browser.', 'underconstruction');?></p>
 
 
147
  </div>
148
  </noscript>
149
  <div class="wrap">
153
  <form method="post"
154
  action="<?php echo $GLOBALS['PHP_SELF'] . '?page=' . $this->mainOptionsPage; ?>"
155
  id="ucoptions">
156
+ <h2><?php _e('Under Construction', 'underconstruction');?></h2>
157
  <table>
158
  <tr>
159
  <td>
160
+ <h3><?php _e('Activate or Deactivate', 'underconstruction');?></h3>
161
  </td>
162
  </tr>
163
  <tr>
164
  <td>
165
  <fieldset>
166
  <legend class="screen-reader-text">
167
+ <span><?php _e('Activate or Deactivate', 'underconstruction');?></span>
168
  </legend>
169
+ <label title="activate">
170
+ <input type="radio" name="activate" value="1"<?php if ($this->pluginIsActive()) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('on', 'underconstruction');?>
171
+ </label><br />
172
+ <label title="deactivate">
173
+ <input type="radio" name="activate" value="0"<?php if (!$this->pluginIsActive()) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('off', 'underconstruction');?>
174
+ </label>
 
175
  </fieldset>
176
  </td>
177
  </tr>
178
  <tr>
179
  <td>
180
+ <h3><?php _e('HTTP Status Code', 'underconstruction');?></h3>
181
+ <p><?php _e("You can choose to send the standard HTTP status code with the under construction page, or send a 503 \"Service Unavailable\" status code. This will tell Google that this page isn't ready yet, and cause your site not to be listed until this plugin is disabled.", 'underconstruction');?></p>
 
 
 
 
182
  </td>
183
  </tr>
184
  <tr>
185
  <td>
186
  <fieldset>
187
  <legend class="screen-reader-text">
188
+ <span><?php _e('HTTP Status Code', 'underconstruction');?></span>
189
  </legend>
190
+ <label title="HTTP200">
191
+ <input type="radio" name="http_status" value="200" id="200_status"<?php if ($this->httpStatusCodeIs(200)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('HTTP 200 - ok', 'underconstruction');?>
192
+ </label> <br />
193
+ <label title="HTTP301">
194
+ <input type="radio" name="http_status" value="301" id="301_status"<?php if ($this->httpStatusCodeIs(301)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('HTTP 301 - Redirect', 'underconstruction');?> </label> <br />
195
+ <label title="HTTP503">
196
+ <input type="radio" name="http_status" value="503" id="503_status"<?php if ($this->httpStatusCodeIs(503)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('HTTP 503 - Service Unavailable', 'underconstruction');?>
197
+ </label>
 
 
198
  </fieldset>
199
+ <div id="redirect_panel" <?php echo !$this->httpStatusCodeIs(301) ? 'class="hidden"' : '';?>><br />
200
+ <label for="url"><?php _e('Redirect Location:', 'underconstruction');?></label>
201
+ <input type="text" name="url" id="url" value="<?php echo get_option('underConstructionRedirectURL');?>" />
 
 
 
202
  </div>
203
  </td>
204
  </tr>
 
205
  <tr>
206
  <td>
207
+ <h3><?php _e('Restrict By Role', 'underconstruction');?></h3>
208
  </td>
209
  </tr>
210
  <tr>
211
+ <td><?php _e('Only users at or above this level will be able to log in:', 'underconstruction');?>
212
+ <select id="required_role" name="required_role">
213
+ <option value="0"><?php _e('All Users', 'underconstruction');?></option>
214
+ <?php
215
+ $selected = get_option('underConstructionRequiredRole');
216
+ $editable_roles = get_editable_roles();
217
+ //to get rid of Notices "Undefined var"...
218
+ $p = $r = '';
219
+
220
+ foreach ( $editable_roles as $role => $details ) {
221
+ $name = translate_user_role($details['name'] );
222
+ if ( $selected == $role ) // preselect specified role
223
+ $p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";
224
+ else
225
+ $r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>";
226
+ }
227
+ echo $p . $r;
228
+ ?>
229
  </select>
230
  </td>
231
+ </tr>
 
 
 
 
232
  <tr>
233
  <td>
234
+ <h3><?php _e('IP Address Whitelist', 'underconstruction');?></h3>
235
  </td>
236
  </tr>
237
  <tr>
238
+ <td>
239
+ <?php $whitelist = get_option('underConstructionIPWhitelist');
240
+ if(count($whitelist)): ?>
241
+ <select size="4" id="ip_whitelist" name="ip_whitelist" style="width: 250px; height: 100px;">
 
 
 
242
  <?php for($i = 0; $i < count($whitelist); $i++):?>
243
  <option id="<?php echo $i; ?>" value="<?php echo $i;?>">
244
  <?php echo $whitelist[$i];?>
245
  </option>
246
  <?php endfor;?>
247
+ </select><br />
248
 
249
+ <input type="submit" value="<?php _e('Remove Selected IP Address', 'underconstruction'); ?>" name="remove_selected_ip_btn" id="remove_selected_ip_btn" /> <br /> <br />
250
+ <?php endif; ?>
251
+ <label><?php _e('IP Address:', 'underconstruction');?> <input type="text" name="ip_address" id="ip_address" /> </label>
252
+ <a id="add_current_address_btn" style="cursor: pointer;"><?php _e('Add Current Address', 'underconstruction');?></a>
253
+ <img id="loading_current_address" class="hidden" src="<?php echo plugins_url( 'ajax-loader.gif' , __FILE__ ); ?>" />
 
 
 
 
254
  <br />
255
  </td>
256
  </tr>
 
257
  <tr>
258
  <td>
259
+ <h3><?php _e('Display Options', 'underconstruction');?></h3>
260
  </td>
261
  </tr>
262
  <tr>
263
  <td>
264
  <fieldset>
265
  <legend class="screen-reader-text">
266
+ <span><?php _e('Display Options', 'underconstruction');?> </span>
267
  </legend>
268
+ <label title="defaultPage">
269
+ <input type="radio" name="display_options" value="0" id="displayOption0"<?php if ($this->displayStatusCodeIs(0)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Display the default under construction page', 'underconstruction');?>
270
+ </label> <br />
271
+ <label title="defaultPage-customText">
272
+ <input type="radio" name="display_options" value="1" id="displayOption1"<?php if ($this->displayStatusCodeIs(1)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Display the default under construction page, but use custom text', 'underconstruction');?>
273
+ </label> <br />
274
+ <label title="customPage-customHTML">
275
+ <input type="radio" name="display_options" value="2" id="displayOption2"<?php if ($this->displayStatusCodeIs(2)) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Display a custom page using your own HTML', 'underconstruction');?>
276
+ </label> <br />
 
 
 
277
  </fieldset>
278
  </td>
279
  </tr>
280
  </table>
281
+
282
+ <div id="customText"<?php if (!$this->displayStatusCodeIs(1) && !$this->displayStatusCodeIs(3)) { echo ' style="display: none;"'; } ?>>
283
+ <h3><?php _e('Display Custom Text', 'underconstruction');?></h3>
284
+ <p><?php _e('The text here will replace the text on the default page', 'underconstruction');?></p>
285
  <table>
286
  <tr valign="top">
287
+ <th scope="row"><label for="pageTitle"> <?php _e('Page Title', 'underconstruction');?> </label></th>
288
+ <td><input name="pageTitle" type="text" id="pageTitle" value="<?php echo $this->getCustomPageTitle(); ?>" class="regular-text" size="50"></td>
 
 
 
 
289
  </tr>
290
  <tr valign="top">
291
+ <th scope="row"><label for="headerText"> <?php _e('Header Text', 'underconstruction');?> </label></th>
292
+ <td><input name="headerText" type="text" id="headerText" value="<?php echo $this->getCustomHeaderText(); ?>" class="regular-text" size="50"></td>
 
 
 
 
293
  </tr>
294
  <tr valign="top">
295
+ <th scope="row"><label for="bodyText"> <?php _e('Body Text', 'underconstruction');?> </label></th>
296
+ <td><?php echo '<textarea rows="2" cols="44" name="bodyText" id="bodyText" class="regular-text">'.trim($this->getCustomBodyText()).'</textarea>'; ?></td>
 
 
297
  </tr>
298
  </table>
299
  </div>
300
+
301
+ <div id="customHTML"<?php if (!$this->displayStatusCodeIs(2)) { echo ' style="display: none;"'; } ?>>
302
+ <h3><?php _e('Under Construction Page HTML', 'underconstruction');?></h3>
303
+ <p><?php _e('Put in this area the HTML you want to show up on your front page', 'underconstruction');?></p>
304
  <?php echo '<textarea name="ucHTML" rows="15" cols="75">'.$this->getCustomHTML().'</textarea>'; ?>
305
  </div>
 
 
 
306
 
307
+ <p class="submit">
308
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
309
+ <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'underconstruction'); ?>" id="submitChangesToUnderConstructionPlugin" />
310
  </p>
311
  </form>
312
  </div>
underConstruction.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Under Construction
4
  Plugin URI: http://www.masseltech.com/
5
  Description: Makes it so your site can only be accessed by users who log in. Useful for developing a site on a live server, without the world being able to see it
6
- Version: 1.09
7
  Author: Jeremy Massel
8
  Author URI: http://www.masseltech.com/
9
  */
@@ -127,6 +127,10 @@ class underConstruction
127
 
128
  function uc_admin_override_WP(){
129
 
 
 
 
 
130
  if(get_option('underConstructionRequiredRole')){
131
  $editable_roles = get_editable_roles();
132
 
@@ -292,14 +296,19 @@ $underConstructionPlugin = new underConstruction();
292
 
293
  add_action('template_redirect', array($underConstructionPlugin, 'uc_overrideWP'));
294
  add_action('admin_init', array($underConstructionPlugin, 'uc_admin_override_WP'));
 
 
 
 
 
 
 
295
 
296
  register_activation_hook(__FILE__, array($underConstructionPlugin, 'uc_activate'));
297
  register_deactivation_hook(__FILE__, array($underConstructionPlugin, 'uc_deactivate'));
298
  register_uninstall_hook(__FILE__, 'underConstructionPlugin_delete');
299
 
300
 
301
- add_action('admin_init', array($underConstructionPlugin, 'underConstructionAdminInit'));
302
- add_action('admin_menu', array($underConstructionPlugin, 'uc_adminMenu'));
303
 
304
  function underConstructionPlugin_delete()
305
  {
@@ -326,6 +335,11 @@ function underConstructionPluginLinks($links, $file)
326
  return $links;
327
  }
328
 
 
 
 
 
 
329
  add_filter('plugin_action_links', 'underConstructionPluginLinks', 10, 2);
330
 
331
 
3
  Plugin Name: Under Construction
4
  Plugin URI: http://www.masseltech.com/
5
  Description: Makes it so your site can only be accessed by users who log in. Useful for developing a site on a live server, without the world being able to see it
6
+ Version: 1.10
7
  Author: Jeremy Massel
8
  Author URI: http://www.masseltech.com/
9
  */
127
 
128
  function uc_admin_override_WP(){
129
 
130
+ if(!$this->pluginIsActive()){
131
+ return;
132
+ }
133
+
134
  if(get_option('underConstructionRequiredRole')){
135
  $editable_roles = get_editable_roles();
136
 
296
 
297
  add_action('template_redirect', array($underConstructionPlugin, 'uc_overrideWP'));
298
  add_action('admin_init', array($underConstructionPlugin, 'uc_admin_override_WP'));
299
+ add_action('wp_login', array($underConstructionPlugin, 'uc_admin_override_WP'));
300
+
301
+
302
+ add_action('plugins_loaded', 'underConstructionInitTranslation');
303
+
304
+ add_action('admin_init', array($underConstructionPlugin, 'underConstructionAdminInit'));
305
+ add_action('admin_menu', array($underConstructionPlugin, 'uc_adminMenu'));
306
 
307
  register_activation_hook(__FILE__, array($underConstructionPlugin, 'uc_activate'));
308
  register_deactivation_hook(__FILE__, array($underConstructionPlugin, 'uc_deactivate'));
309
  register_uninstall_hook(__FILE__, 'underConstructionPlugin_delete');
310
 
311
 
 
 
312
 
313
  function underConstructionPlugin_delete()
314
  {
335
  return $links;
336
  }
337
 
338
+ function underConstructionInitTranslation() {
339
+ load_plugin_textdomain( 'underconstruction', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
340
+ }
341
+
342
+
343
  add_filter('plugin_action_links', 'underConstructionPluginLinks', 10, 2);
344
 
345
 
underconstruction.dev.js CHANGED
File without changes
underconstruction.min.js CHANGED
File without changes