Under Construction - Version 3.83

Version Description

  • 2020/10/27
  • removed automatic PRO license activation
Download this release

Release Info

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

Code changes from version 3.82 to 3.83

Files changed (4) hide show
  1. readme.txt +6 -2
  2. ucp-license.php +0 -108
  3. under-construction.php +14 -7
  4. wp301/wp301.php +6 -6
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: WebFactory
3
  Tags: coming soon page, under construction mode, under construction, under construction page, coming soon, maintenance mode, maintenance page, launch page, coming soon mode, maintenance mode page, offline page, maintenance, landing page
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
- Tested up to: 5.5
7
- Stable tag: 3.82
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,10 @@ Or if needed, upload manually;
138
 
139
  == Changelog ==
140
 
 
 
 
 
141
  = 3.82 =
142
  * 2020/10/01
143
  * minor fixes
3
  Tags: coming soon page, under construction mode, under construction, under construction page, coming soon, maintenance mode, maintenance page, launch page, coming soon mode, maintenance mode page, offline page, maintenance, landing page
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
+ Tested up to: 5.6
7
+ Stable tag: 3.83
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
138
 
139
  == Changelog ==
140
 
141
+ = 3.83 =
142
+ * 2020/10/27
143
+ * removed automatic PRO license activation
144
+
145
  = 3.82 =
146
  * 2020/10/01
147
  * minor fixes
ucp-license.php CHANGED
@@ -8,116 +8,8 @@
8
  class UCP_license extends UCP {
9
  // hook things up
10
  static function init() {
11
- if (is_admin()) {
12
- add_filter('pre_set_site_transient_update_plugins', array(__CLASS__, 'update_filter'));
13
- add_filter('plugins_api', array(__CLASS__, 'update_details'), 100, 3);
14
- }
15
  } // init
16
 
17
-
18
- // get plugin info for lightbox
19
- static function update_details($result, $action, $args) {
20
- if (!self::is_activated()) {
21
- return $result;
22
- }
23
-
24
- static $response = false;
25
- $options = parent::get_options();
26
- $plugin = 'under-construction-page';
27
-
28
- if ($action != 'plugin_information' || empty($args->slug) || ($args->slug != $plugin)) {
29
- return $result;
30
- }
31
-
32
- if(empty($response) || is_wp_error($response)) {
33
- $request_params = array('sslverify' => false, 'timeout' => 15, 'redirection' => 2);
34
- $request_args = array('action' => 'plugin_information',
35
- 'request_details' => serialize($args),
36
- 'timestamp' => time(),
37
- 'codebase' => 'free',
38
- 'version' => parent::$version,
39
- 'license_key' => $options['license_key'],
40
- 'license_expires' => $options['license_expires'],
41
- 'license_type' => $options['license_type'],
42
- 'license_active' => $options['license_active'],
43
- 'site' => get_home_url());
44
-
45
- $url = add_query_arg($request_args, parent::$licensing_servers[0]);
46
- $response = wp_remote_get(esc_url_raw($url), $request_params);
47
-
48
- if (is_wp_error($response) || !wp_remote_retrieve_body($response)) {
49
- $url = add_query_arg($request_args, parent::$licensing_servers[1]);
50
- $response = wp_remote_get(esc_url_raw($url), $request_params);
51
- }
52
- } // if !$response
53
-
54
- if (is_wp_error($response) || !wp_remote_retrieve_body($response)) {
55
- $res = new WP_Error('plugins_api_failed', __('An unexpected HTTP error occurred during the API request.', 'under-construction-page'), $response->get_error_message());
56
- } else {
57
- $res = json_decode(wp_remote_retrieve_body($response), false);
58
-
59
- if (!is_object($res)) {
60
- $res = new WP_Error('plugins_api_failed', __('Invalid API respone.', 'under-construction-page'), wp_remote_retrieve_body($response));
61
- } else {
62
- $res->sections = (array) $res->sections;
63
- $res->banners = (array) $res->banners;
64
- $res->icons = (array) $res->icons;
65
- }
66
- }
67
-
68
- return $res;
69
- } // update_details
70
-
71
- // get info on new plugin version if one exists
72
- static function update_filter($current) {
73
- if (!self::is_activated()) {
74
- return $current;
75
- }
76
-
77
- static $response = false;
78
- $options = parent::get_options();
79
- $plugin = 'under-construction-page/under-construction.php';
80
-
81
- if(empty($response) || is_wp_error($response)) {
82
- $request_params = array('sslverify' => false, 'timeout' => 15, 'redirection' => 2);
83
- $request_args = array('action' => 'update_info',
84
- 'timestamp' => time(),
85
- 'codebase' => 'free',
86
- 'version' => parent::$version,
87
- 'license_key' => $options['license_key'],
88
- 'license_expires' => $options['license_expires'],
89
- 'license_type' => $options['license_type'],
90
- 'license_active' => $options['license_active'],
91
- 'site' => get_home_url());
92
-
93
- $url = add_query_arg($request_args, parent::$licensing_servers[0]);
94
- $response = wp_remote_get(esc_url_raw($url), $request_params);
95
-
96
- if (is_wp_error($response)) {
97
- $url = add_query_arg($request_args, parent::$licensing_servers[1]);
98
- $response = wp_remote_get(esc_url_raw($url), $request_params);
99
- }
100
- } // if !$response
101
-
102
- if (!is_wp_error($response) && wp_remote_retrieve_body($response)) {
103
- $data = json_decode(wp_remote_retrieve_body($response), false);
104
- if (empty($current)) {
105
- $current = new stdClass();
106
- }
107
- if (empty($current->response)) {
108
- $current->response = array();
109
- }
110
- if (!empty($data) && is_object($data)) {
111
- $data->icons = (array) $data->icons;
112
- $data->banners = (array) $data->banners;
113
- $current->response[$plugin] = $data;
114
- }
115
- }
116
-
117
- return $current;
118
- } // update_filter
119
-
120
-
121
  // check if license key is valid and not expired
122
  static function is_activated() {
123
  $options = parent::get_options();
8
  class UCP_license extends UCP {
9
  // hook things up
10
  static function init() {
 
 
 
 
11
  } // init
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  // check if license key is valid and not expired
14
  static function is_activated() {
15
  $options = parent::get_options();
under-construction.php CHANGED
@@ -4,11 +4,14 @@
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.82
 
 
 
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: under-construction-page
10
 
11
- Copyright 2015 - 2020 Web factory Ltd (email: ucp@webfactoryltd.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
@@ -765,11 +768,15 @@ class UCP {
765
 
766
  // pro activated - update
767
  if (self::is_plugin_page() && UCP_license::is_activated()) {
768
- $plugin = plugin_basename(__FILE__);
769
- $update_url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . urlencode($plugin)), 'upgrade-plugin_' . $plugin);
770
  echo '<div id="ucp_update_pro" class="notice-error notice">';
771
- echo '<p class="center">Thank you for purchasing UnderConstructionPage PRO! <b>Your license has been verified and activated.</b></p><p>Please <b>click the button below</b> to update plugin files to PRO version.</p>';
772
- echo '<p><a href="' . esc_url($update_url) . '" class="button button-primary">Update UnderConstructionPage files to PRO</a></p>';
 
 
 
 
 
 
773
  echo '</div>';
774
  $shown = true;
775
 
@@ -1247,7 +1254,6 @@ class UCP {
1247
  $options['license_active'] = $tmp['license_active'];
1248
  if ($tmp['license_active']) {
1249
  add_settings_error(UCP_OPTIONS_KEY, 'license_key', __('License key saved and activated!', 'under-construction-page'), 'updated');
1250
- set_site_transient('update_plugins', null);
1251
  } else {
1252
  add_settings_error(UCP_OPTIONS_KEY, 'license_key', 'License not active. ' . $tmp['error'], 'error');
1253
  }
@@ -2064,6 +2070,7 @@ class UCP {
2064
 
2065
  echo '<p class="submit">';
2066
  echo get_submit_button(__('Save &amp; Validate License Key', 'under-construction-page'), 'large secondary', 'license-submit', false);
 
2067
  echo '</p>';
2068
  } // tab_pro
2069
 
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.83
8
+ Requires at least: 4.0
9
+ Requires PHP: 5.2
10
+ Tested up to: 5.6
11
  Author URI: https://www.webfactoryltd.com/
12
  Text Domain: under-construction-page
13
 
14
+ Copyright 2015 - 2020 WebFactory Ltd (email: ucp@webfactoryltd.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License, version 2, as
768
 
769
  // pro activated - update
770
  if (self::is_plugin_page() && UCP_license::is_activated()) {
 
 
771
  echo '<div id="ucp_update_pro" class="notice-error notice">';
772
+ echo '<p class="center">Thank you for purchasing UnderConstructionPage PRO! <b>Your license has been verified and activated.</b><br>To start using the PRO version, please follow these steps:</p>';
773
+ echo '<ol>';
774
+ echo '<li><a href="https://underconstructionpage.com/pro-download/" target="_blank">Download</a> the latest version of the PRO plugin.</li>';
775
+ echo '<li>Go to <a href="' . admin_url('plugin-install.php') . '">Plugins - Add New - Upload Plugin</a> and upload the ZIP you just downloaded.</li>';
776
+ echo '<li>If asked to replace (overwrite) the free version - confirm it.</li>';
777
+ echo '<li>Activate the plugin.</li>';
778
+ echo '<li>That\'s it, no more steps.</li>';
779
+ echo '</ol>';
780
  echo '</div>';
781
  $shown = true;
782
 
1254
  $options['license_active'] = $tmp['license_active'];
1255
  if ($tmp['license_active']) {
1256
  add_settings_error(UCP_OPTIONS_KEY, 'license_key', __('License key saved and activated!', 'under-construction-page'), 'updated');
 
1257
  } else {
1258
  add_settings_error(UCP_OPTIONS_KEY, 'license_key', 'License not active. ' . $tmp['error'], 'error');
1259
  }
2070
 
2071
  echo '<p class="submit">';
2072
  echo get_submit_button(__('Save &amp; Validate License Key', 'under-construction-page'), 'large secondary', 'license-submit', false);
2073
+ echo '<br><br><small><i>By attempting to activate a license you agree to share the following data with <a href="https://www.webfactoryltd.com/" target="_blank">WebFactory Ltd</a>: license key, site URL, site title, site WP version, and UnderConstructionPage (free) version.</i></small>';
2074
  echo '</p>';
2075
  } // tab_pro
2076
 
wp301/wp301.php CHANGED
@@ -22,7 +22,7 @@ if (false == class_exists('wf_wp301')) {
22
  $this->plugin_screen = $plugin_screen;
23
  $this->options = get_option('wp301promo', array());
24
 
25
- if (!is_admin() || !empty($this->options['email_submitted']) || date('Y-m-d') > '2020-11-05') {
26
  return;
27
  } else {
28
  add_action('admin_init', array($this, 'init'));
@@ -147,7 +147,7 @@ if (false == class_exists('wf_wp301')) {
147
  $out .= '#wp301promo_dismiss:hover { text-decoration: underline; }';
148
  $out .= '#wp301promo_widget, #wp301promo_widget p { font-size: 14px; }';
149
  $out .= '#wp301promo_widget .title301 { font-weight: 600; margin: 10px 0 -10px 0; }';
150
- $out .= '#wp301promo_widget img { max-width: 60%; }';
151
  $out .= '#wp301promo_widget .center { text-align: center; }';
152
  $out .= '#wp301promo_email { margin-bottom: 0 !important; }';
153
  $out .= '#wp301promo_widget { background-color: #fafafa; }';
@@ -243,10 +243,10 @@ if (false == class_exists('wf_wp301')) {
243
  to { transform: rotate(360deg); }
244
  }';
245
  $out .= '#wp301promo_widget .inside { overflow: hidden; margin: 0; }
246
- .ribbon { margin: 0; padding: 11px 20px 10px 20px; background: #007cba; color: #FFF; font-weight: 800; position: absolute; top: -17px; right: -17px; transform: translateX(30%) translateY(0%) rotate(45deg); transform-origin: top left; letter-spacing: 1px; }
247
- .ribbon:before, .ribbon:after { content: ""; position: absolute; top:0; margin: 0 -1px; width: 100%; height: 100%; background: #007cba; }
248
- .ribbon:before { right:100%; }
249
- .ribbon:after { left:100%; }';
250
  $out .= '</style>';
251
 
252
  $out .= '<div id="wp301-dialog" style="display: none;" title="Get a WP 301 Redirects PRO license for FREE"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
22
  $this->plugin_screen = $plugin_screen;
23
  $this->options = get_option('wp301promo', array());
24
 
25
+ if (!is_admin() || !empty($this->options['email_submitted']) || date('Y-m-d') > '2020-12-15') {
26
  return;
27
  } else {
28
  add_action('admin_init', array($this, 'init'));
147
  $out .= '#wp301promo_dismiss:hover { text-decoration: underline; }';
148
  $out .= '#wp301promo_widget, #wp301promo_widget p { font-size: 14px; }';
149
  $out .= '#wp301promo_widget .title301 { font-weight: 600; margin: 10px 0 -10px 0; }';
150
+ $out .= '#wp301promo_widget img { max-width: 45%; }';
151
  $out .= '#wp301promo_widget .center { text-align: center; }';
152
  $out .= '#wp301promo_email { margin-bottom: 0 !important; }';
153
  $out .= '#wp301promo_widget { background-color: #fafafa; }';
243
  to { transform: rotate(360deg); }
244
  }';
245
  $out .= '#wp301promo_widget .inside { overflow: hidden; margin: 0; }
246
+ #wp301-dialog .ribbon { margin: 0; padding: 11px 20px 10px 20px; background: #007cba; color: #FFF; font-weight: 800; position: absolute; top: -17px; right: -17px; transform: translateX(30%) translateY(0%) rotate(45deg); transform-origin: top left; letter-spacing: 1px; }
247
+ #wp301-dialog .ribbon:before, #wp301-dialog .ribbon:after { content: ""; position: absolute; top:0; margin: 0 -1px; width: 100%; height: 100%; background: #007cba; }
248
+ #wp301-dialog .ribbon:before { right:100%; }
249
+ #wp301-dialog .ribbon:after { left:100%; }';
250
  $out .= '</style>';
251
 
252
  $out .= '<div id="wp301-dialog" style="display: none;" title="Get a WP 301 Redirects PRO license for FREE"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';