Under Construction - Version 3.25

Version Description

  • 2018/11/27
  • new theme - Work Desk
  • started promoting SN & MailOptin in featured plugins tab
  • wp_redirect() vulnerability fix
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Under Construction
Version 3.25
Comparing to
See all releases

Code changes from version 3.20 to 3.25

images/thumbnails/pro/grayscale-city.jpg ADDED
Binary file
images/thumbnails/work_desk.png ADDED
Binary file
js/ucp-admin.js CHANGED
@@ -30,6 +30,7 @@ jQuery(document).ready(function($) {
30
  // init select2
31
  $('#whitelisted_users').select2({ 'placeholder': ucp.whitelisted_users_placeholder});
32
 
 
33
  // autosize textareas
34
  $.each($('textarea[data-autoresize]'), function() {
35
  var offset = this.offsetHeight - this.clientHeight;
@@ -40,6 +41,7 @@ jQuery(document).ready(function($) {
40
  $(this).on('keyup input click', function() { resizeTextarea(this); }).removeAttr('data-autoresize');
41
  });
42
 
 
43
  // maybe init survey dialog
44
  $('#features-survey-dialog').dialog({'dialogClass': 'wp-dialog ucp-dialog ucp-survey-dialog',
45
  'modal': 1,
@@ -323,7 +325,7 @@ jQuery(document).ready(function($) {
323
  jQuery('#install-mailoptin').on('click',function(e){
324
  $('#mailoptin-upsell-dialog').dialog('close');
325
  jQuery('body').append('<div style="width:550px;height:450px; position:fixed;top:10%;left:50%;margin-left:-275px; color:#444; background-color: #fbfbfb;border:1px solid #DDD; border-radius:4px;box-shadow: 0px 0px 0px 4000px rgba(0, 0, 0, 0.85);z-index: 9999999;"><iframe src="' + ucp.mailoptin_install_url + '" style="width:100%;height:100%;border:none;" /></div>');
326
- jQuery('#wpwrap').css('pointer-events', 'none');
327
  e.preventDefault();
328
  return false;
329
  });
@@ -388,7 +390,7 @@ jQuery(document).ready(function($) {
388
  $(this).blur();
389
 
390
  $('#mailoptin-upsell-dialog').dialog('open');
391
-
392
  return false;
393
  });
394
 
30
  // init select2
31
  $('#whitelisted_users').select2({ 'placeholder': ucp.whitelisted_users_placeholder});
32
 
33
+
34
  // autosize textareas
35
  $.each($('textarea[data-autoresize]'), function() {
36
  var offset = this.offsetHeight - this.clientHeight;
41
  $(this).on('keyup input click', function() { resizeTextarea(this); }).removeAttr('data-autoresize');
42
  });
43
 
44
+
45
  // maybe init survey dialog
46
  $('#features-survey-dialog').dialog({'dialogClass': 'wp-dialog ucp-dialog ucp-survey-dialog',
47
  'modal': 1,
325
  jQuery('#install-mailoptin').on('click',function(e){
326
  $('#mailoptin-upsell-dialog').dialog('close');
327
  jQuery('body').append('<div style="width:550px;height:450px; position:fixed;top:10%;left:50%;margin-left:-275px; color:#444; background-color: #fbfbfb;border:1px solid #DDD; border-radius:4px;box-shadow: 0px 0px 0px 4000px rgba(0, 0, 0, 0.85);z-index: 9999999;"><iframe src="' + ucp.mailoptin_install_url + '" style="width:100%;height:100%;border:none;" /></div>');
328
+ jQuery('#wpwrap').css('pointer-events', 'none');
329
  e.preventDefault();
330
  return false;
331
  });
390
  $(this).blur();
391
 
392
  $('#mailoptin-upsell-dialog').dialog('open');
393
+
394
  return false;
395
  });
396
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: maintenance mode, maintenance page, coming soon page, landing page, under
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.0
7
- Stable tag: 3.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -125,15 +125,22 @@ Or if needed, upload manually;
125
  31. Temporarily Closed theme
126
  32. Dumper Truck theme
127
  33. 000webhost theme
128
- 34. Main settings
129
- 35. Design settings
130
- 36. Content settings
131
- 37. Access settings
132
- 38. Support
 
133
 
134
 
135
  == Changelog ==
136
 
 
 
 
 
 
 
137
  = 3.20 =
138
  * 2018/11/12
139
  * few bug fixes
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.0
7
+ Stable tag: 3.25
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
125
  31. Temporarily Closed theme
126
  32. Dumper Truck theme
127
  33. 000webhost theme
128
+ 34. Work Desk theme
129
+ 35. Main settings
130
+ 36. Design settings
131
+ 37. Content settings
132
+ 38. Access settings
133
+ 39. Support
134
 
135
 
136
  == Changelog ==
137
 
138
+ = 3.25 =
139
+ * 2018/11/27
140
+ * new theme - Work Desk
141
+ * started promoting SN & MailOptin in featured plugins tab
142
+ * wp_redirect() vulnerability fix
143
+
144
  = 3.20 =
145
  * 2018/11/12
146
  * few bug fixes
themes/work_desk/index.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * UnderConstructionPage
4
+ * Work Desk theme
5
+ * (c) WebFactory Ltd, 2015 - 2018
6
+ */
7
+
8
+
9
+ // this is an include only WP file
10
+ if (!defined('ABSPATH')) {
11
+ die;
12
+ }
13
+ ?>
14
+ <!DOCTYPE html>
15
+ <html lang="en">
16
+ <head>
17
+ <meta charset="utf-8">
18
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
19
+ <meta name="viewport" content="width=device-width, initial-scale=1">
20
+ <title>[title]</title>
21
+ <meta name="description" content="[description]" />
22
+ <meta name="generator" content="[generator]">
23
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,600,900">
24
+ [head]
25
+ </head>
26
+
27
+ <body>
28
+ <div class="container">
29
+
30
+ <div class="row">
31
+ <div class="col-xs-12 col-md-12 col-lg-12">
32
+ <h1>[heading1]</h1>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="row">
37
+ <div class="col-xs-12 col-md-8 col-md-offset-2 col-lg-offset-2 col-lg-8">
38
+ <p class="content">[content]</p>
39
+ </div>
40
+ </div>
41
+
42
+ <div class="row" id="social">
43
+ <div class="col-xs-12 col-md-12 col-lg-12">
44
+ [social-icons]
45
+ </div>
46
+ </div>
47
+
48
+ </div>
49
+ <div id="desk" style="background-image: url([theme-url]work_desk.png);" alt="Work Desk" title="Work Desk">&nbsp;</div>
50
+ [footer]
51
+ <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
52
+ <script type="text/javascript">
53
+ jQuery(function($) {
54
+ $(window).on('resize', function() {
55
+ if ($(window).width() > 767) {
56
+ tmp = $(window).height() - $('.container').height();
57
+ $('#desk').height(tmp);
58
+ }
59
+ }).trigger('resize');
60
+ });
61
+ </script>
62
+ </body>
63
+ </html>
themes/work_desk/style.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * UnderConstructionPage
3
+ * Work Desk theme CSS
4
+ * (c) WebFactory Ltd, 2015 - 2018
5
+ */
6
+
7
+
8
+ html, body {
9
+ height: 100%;
10
+ padding: 0;
11
+ margin: 0;
12
+ }
13
+
14
+ body {
15
+ font-weight: 400;
16
+ font-size: 14px;
17
+ line-height: 120%;
18
+ color: #58595b;
19
+ background: #ffd72f;
20
+ }
21
+
22
+ #desk {
23
+ background-size: contain;
24
+ max-width: 80%;
25
+ margin: -50px auto 0 auto;
26
+ background-repeat: no-repeat;
27
+ background-position-x: center;
28
+ }
29
+
30
+ h1 {
31
+ font-size: 34px;
32
+ color: #58595b;
33
+ font-family: "Nunito", sans-serif;
34
+ font-weight: 900;
35
+ margin: 35px 0 30px 0;
36
+ text-align: center;
37
+ }
38
+
39
+ .content {
40
+ text-align: center;
41
+ font-family: "Helvetica", "Arial", sans-serif;
42
+ }
43
+
44
+ #social {
45
+ text-align: center;
46
+ margin-top: 30px;
47
+ }
48
+
49
+ #social a i {
50
+ color: #58595b;
51
+ margin: 10px;
52
+ box-sizing: content-box;
53
+ }
54
+
55
+ #social a:hover i {
56
+ color: #e0632f;
57
+ }
58
+
59
+ @media(max-width:767px){
60
+ h1 {
61
+ font-size: 30px;
62
+ margin: 10px 0 30px 0;
63
+ }
64
+ #desk {
65
+ width: 100%;
66
+ height: 100%;
67
+ margin: 0 auto 0 auto;
68
+ background-size: contain;
69
+ background-repeat: no-repeat;
70
+ }
71
+ }
themes/work_desk/work_desk.png ADDED
Binary file
under-construction.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: https://underconstructionpage.com/
5
  Description: Put your site behind a great looking under construction, coming soon, maintenance mode or landing page.
6
  Author: WebFactory Ltd
7
- Version: 3.20
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: under-construction-page
10
  Domain Path: lang
@@ -98,8 +98,7 @@ class UCP {
98
  add_action('wp_ajax_ucp_submit_earlybird', array(__CLASS__, 'submit_earlybird_ajax'));
99
  add_action('wp_ajax_ucp_submit_support_message', array(__CLASS__, 'submit_support_message_ajax'));
100
 
101
- // uninstall survey on plugins page
102
- add_action('admin_footer-plugins.php', array(__CLASS__, 'footer_plugins'));
103
  } else {
104
  // main plugin logic
105
  add_action('wp', array(__CLASS__, 'display_construction_page'), 0, 1);
@@ -915,7 +914,7 @@ class UCP {
915
  // handle dismiss button for notices
916
  static function dismiss_notice() {
917
  if (empty($_GET['notice'])) {
918
- wp_redirect(admin_url());
919
  exit;
920
  }
921
 
@@ -923,30 +922,25 @@ class UCP {
923
 
924
  if ($_GET['notice'] == 'rate') {
925
  $notices['dismiss_rate'] = true;
926
- }
927
-
928
- if ($_GET['notice'] == 'translate') {
929
  $notices['dismiss_translate'] = true;
930
- }
931
-
932
- if ($_GET['notice'] == 'whitelisted') {
933
  $notices['dismiss_whitelisted'] = true;
934
- }
935
-
936
- if ($_GET['notice'] == 'olduser') {
937
  $notices['dismiss_olduser'] = true;
938
- }
939
-
940
- if ($_GET['notice'] == 'welcome') {
941
  $notices['dismiss_welcome'] = true;
 
 
 
942
  }
943
 
944
  update_option(UCP_NOTICES_KEY, $notices);
945
 
946
  if (!empty($_GET['redirect'])) {
947
- wp_redirect($_GET['redirect']);
948
  } else {
949
- wp_redirect(admin_url());
950
  }
951
 
952
  exit;
@@ -959,9 +953,9 @@ class UCP {
959
  update_option(UCP_OPTIONS_KEY, $options);
960
 
961
  if (!empty($_GET['redirect'])) {
962
- wp_redirect($_GET['redirect']);
963
  } else {
964
- wp_redirect(admin_url());
965
  }
966
 
967
  exit;
@@ -971,7 +965,7 @@ class UCP {
971
  // change status via admin bar
972
  static function change_status() {
973
  if (empty($_GET['new_status'])) {
974
- wp_redirect(admin_url());
975
  exit;
976
  }
977
 
@@ -986,9 +980,9 @@ class UCP {
986
  update_option(UCP_OPTIONS_KEY, $options);
987
 
988
  if (!empty($_GET['redirect'])) {
989
- wp_redirect($_GET['redirect']);
990
  } else {
991
- wp_redirect(admin_url());
992
  }
993
 
994
  exit;
@@ -1781,7 +1775,9 @@ class UCP {
1781
  'closed' => __('Temporarily Closed', 'under-construction-page'),
1782
  '_pro_animated-green' => __('Simple Green Animated', 'under-construction-page'),
1783
  'dumper_truck' => __('Dumper Truck', 'under-construction-page'),
1784
- '000webhost' => __('000webhost', 'under-construction-page'));
 
 
1785
 
1786
  $themes = apply_filters('ucp_themes', $themes);
1787
 
@@ -2313,55 +2309,6 @@ class UCP {
2313
  } // footer_buttons
2314
 
2315
 
2316
- // markup for deactivate dialog
2317
- static function footer_plugins() {
2318
- $support_link = admin_url('options-general.php?page=ucp&urgent-support=true#support');
2319
-
2320
- echo '<div id="ucp-deactivate-survey" style="display: none;" title="Please help us make UCP better"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
2321
-
2322
- echo '<div class="question-wrapper-assistance" data-value="urgent">' .
2323
- '<div class="question"><b>Something\'s not working? We offer URGENT assistance!</b><br><a href="' . $support_link . '" class="button">Send a priority ticket to our friendly support agents</a><br><small><i>average response time is under 20 minutes</i></small></div>' . '</div>';
2324
-
2325
- echo '<p class="textcenter"><br>We want to improve! Please tell us:<br><b>Why are you deactivating <span class="ucp-logo">UnderConstructionPage</span>?</b></p>';
2326
-
2327
- $questions = array();
2328
- $questions[] = '<div class="question-wrapper" data-value="temporary">' .
2329
- '<div class="question">It\'s a temporary deactivation, I\'m debugging something</div>' .
2330
- '</div>';
2331
-
2332
- $questions[] = '<div class="question-wrapper" data-value="not-working">' .
2333
- '<div class="question">Plugin is not working<div class="details">Please tell us what exactly is not working: <input type="text" class="normal-text ucp-deactivation-details"></div></div>' .
2334
- '</div>';
2335
-
2336
- $questions[] = '<div class="question-wrapper" data-value="wrong-plugin">' .
2337
- '<div class="question">Plugin is not what I thought it is, I need a different plugin</div>' .
2338
- '</div>';
2339
-
2340
- $questions[] = '<div class="question-wrapper" data-value="site-live">' .
2341
- '<div class="question">It served its purpose - site is now live</div>' .
2342
- '</div>';
2343
-
2344
- $questions[] = '<div class="question-wrapper" data-value="missing-feature">' .
2345
- '<div class="question">It doesn\'t have all the features I need<div class="details">Please tell us what features are missing: <input type="text" class="normal-text ucp-deactivation-details"></div></div>' .
2346
- '</div>';
2347
-
2348
- shuffle($questions);
2349
- $questions[] = '<div class="question-wrapper" data-value="other">' .
2350
- '<div class="question">Something else<div class="details">Please tell us the reason: <input type="text" class="normal-text ucp-deactivation-details"></div></div>' .
2351
- '</div>';
2352
- echo implode(' ', $questions);
2353
-
2354
-
2355
- $current_user = wp_get_current_user();
2356
- echo '<div class="footer">';
2357
- echo '<a class="ucp-cancel-deactivate js-action button-secondary button button-large" href="#">Cancel Deactivation</a> <a data-survey="deactivate" class="button-primary button button-large ucp-deactivate" href="#">Continue with Deactivation</a>';
2358
- echo '<br><br><a href="#" class="js-action ucp-deactivate-direct"><small><i>Deactivate without providing feedback</i></small></a>';
2359
- echo '</div>';
2360
-
2361
- echo '</div>';
2362
- } // footer_plugins
2363
-
2364
-
2365
  // reset all pointers to default state - visible
2366
  static function reset_pointers() {
2367
  $pointers = array();
@@ -2460,6 +2407,60 @@ class UCP {
2460
  } // is_mailoptin_active
2461
 
2462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2463
  // reset pointers on activation
2464
  static function activate() {
2465
  self::reset_pointers();
4
  Plugin URI: https://underconstructionpage.com/
5
  Description: Put your site behind a great looking under construction, coming soon, maintenance mode or landing page.
6
  Author: WebFactory Ltd
7
+ Version: 3.25
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: under-construction-page
10
  Domain Path: lang
98
  add_action('wp_ajax_ucp_submit_earlybird', array(__CLASS__, 'submit_earlybird_ajax'));
99
  add_action('wp_ajax_ucp_submit_support_message', array(__CLASS__, 'submit_support_message_ajax'));
100
 
101
+ add_filter('install_plugins_table_api_args_featured', array(__CLASS__, 'featured_plugins_tab'));
 
102
  } else {
103
  // main plugin logic
104
  add_action('wp', array(__CLASS__, 'display_construction_page'), 0, 1);
914
  // handle dismiss button for notices
915
  static function dismiss_notice() {
916
  if (empty($_GET['notice'])) {
917
+ wp_safe_redirect(admin_url());
918
  exit;
919
  }
920
 
922
 
923
  if ($_GET['notice'] == 'rate') {
924
  $notices['dismiss_rate'] = true;
925
+ } elseif ($_GET['notice'] == 'translate') {
 
 
926
  $notices['dismiss_translate'] = true;
927
+ } elseif ($_GET['notice'] == 'whitelisted') {
 
 
928
  $notices['dismiss_whitelisted'] = true;
929
+ } elseif ($_GET['notice'] == 'olduser') {
 
 
930
  $notices['dismiss_olduser'] = true;
931
+ } elseif ($_GET['notice'] == 'welcome') {
 
 
932
  $notices['dismiss_welcome'] = true;
933
+ } else {
934
+ wp_safe_redirect(admin_url());
935
+ exit;
936
  }
937
 
938
  update_option(UCP_NOTICES_KEY, $notices);
939
 
940
  if (!empty($_GET['redirect'])) {
941
+ wp_safe_redirect($_GET['redirect']);
942
  } else {
943
+ wp_safe_redirect(admin_url());
944
  }
945
 
946
  exit;
953
  update_option(UCP_OPTIONS_KEY, $options);
954
 
955
  if (!empty($_GET['redirect'])) {
956
+ wp_safe_redirect($_GET['redirect']);
957
  } else {
958
+ wp_safe_redirect(admin_url());
959
  }
960
 
961
  exit;
965
  // change status via admin bar
966
  static function change_status() {
967
  if (empty($_GET['new_status'])) {
968
+ wp_safe_redirect(admin_url());
969
  exit;
970
  }
971
 
980
  update_option(UCP_OPTIONS_KEY, $options);
981
 
982
  if (!empty($_GET['redirect'])) {
983
+ wp_safe_redirect($_GET['redirect']);
984
  } else {
985
+ wp_safe_redirect(admin_url());
986
  }
987
 
988
  exit;
1775
  'closed' => __('Temporarily Closed', 'under-construction-page'),
1776
  '_pro_animated-green' => __('Simple Green Animated', 'under-construction-page'),
1777
  'dumper_truck' => __('Dumper Truck', 'under-construction-page'),
1778
+ '000webhost' => __('000webhost', 'under-construction-page'),
1779
+ '_pro_grayscale-city' => __('Grayscale City', 'under-construction-page'),
1780
+ 'work_desk' => __('Work Desk', 'under-construction-page'));
1781
 
1782
  $themes = apply_filters('ucp_themes', $themes);
1783
 
2309
  } // footer_buttons
2310
 
2311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2312
  // reset all pointers to default state - visible
2313
  static function reset_pointers() {
2314
  $pointers = array();
2407
  } // is_mailoptin_active
2408
 
2409
 
2410
+ // helper function for adding plugins to fav list
2411
+ static function featured_plugins_tab($args) {
2412
+ add_filter('plugins_api_result', array(__CLASS__, 'plugins_api_result'), 10, 3);
2413
+
2414
+ return $args;
2415
+ } // featured_plugins_tab
2416
+
2417
+
2418
+ // add single plugin to list of favs
2419
+ static function add_plugin_favs($plugin_slug, $res) {
2420
+ if (is_array($res->plugins)) {
2421
+ foreach ($res->plugins as $plugin) {
2422
+ if ($plugin->slug == $plugin_slug) {
2423
+ return $res;
2424
+ }
2425
+ } // foreach
2426
+ }
2427
+
2428
+ if ($plugin_info = get_transient('wf-plugin-info-' . $plugin_slug)) {
2429
+ $res->plugins[] = $plugin_info;
2430
+ } else {
2431
+ $plugin_info = plugins_api('plugin_information', array(
2432
+ 'slug' => $plugin_slug,
2433
+ 'is_ssl' => is_ssl(),
2434
+ 'fields' => array(
2435
+ 'banners' => true,
2436
+ 'reviews' => true,
2437
+ 'downloaded' => true,
2438
+ 'active_installs' => true,
2439
+ 'icons' => true,
2440
+ 'short_description' => true,
2441
+ )
2442
+ ));
2443
+ if (!is_wp_error($plugin_info)) {
2444
+ $res->plugins[] = $plugin_info;
2445
+ set_transient('wf-plugin-info-' . $plugin_slug, $plugin_info, DAY_IN_SECONDS * 7);
2446
+ }
2447
+ }
2448
+
2449
+ return $res;
2450
+ } // add_plugin_favs
2451
+
2452
+
2453
+ // add our plugins to recommended list
2454
+ static function plugins_api_result($res, $action, $args) {
2455
+ remove_filter('plugins_api_result', array(__CLASS__, 'plugins_api_result'), 10, 3);
2456
+
2457
+ $res = self::add_plugin_favs('mailoptin', $res);
2458
+ $res = self::add_plugin_favs('security-ninja', $res);
2459
+
2460
+ return $res;
2461
+ } // plugins_api_result
2462
+
2463
+
2464
  // reset pointers on activation
2465
  static function activate() {
2466
  self::reset_pointers();