Version Description
- 2019/08/07
- clean up
- NotificationX plugin integration
- 2,812,000
Download this release
Release Info
| Developer | WebFactory |
| Plugin | |
| Version | 3.50 |
| Comparing to | |
| See all releases | |
Code changes from version 3.45 to 3.50
- css/ucp-admin.css +148 -0
- images/nordvpn-logo.png +0 -0
- images/nx-icon.png +0 -0
- images/nx-logo.png +0 -0
- js/ucp-admin.js +61 -0
- readme.txt +9 -1
- under-construction.php +281 -93
css/ucp-admin.css
CHANGED
|
@@ -1043,3 +1043,151 @@ option.weglot-promo {
|
|
| 1043 |
.security-ninja-logo img {
|
| 1044 |
height: 80px;
|
| 1045 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1043 |
.security-ninja-logo img {
|
| 1044 |
height: 80px;
|
| 1045 |
}
|
| 1046 |
+
|
| 1047 |
+
#support-hero {
|
| 1048 |
+
text-align: center;
|
| 1049 |
+
margin: 40px 0;
|
| 1050 |
+
}
|
| 1051 |
+
|
| 1052 |
+
#support-hero p {
|
| 1053 |
+
font-size: 25px;
|
| 1054 |
+
line-height: 1.5;
|
| 1055 |
+
font-weight: 400;
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
#support-hero b {
|
| 1059 |
+
font-weight: 800;
|
| 1060 |
+
}
|
| 1061 |
+
|
| 1062 |
+
#support-hero .button {
|
| 1063 |
+
padding: 15px 10px;
|
| 1064 |
+
display: inline;
|
| 1065 |
+
font-weight: 900;
|
| 1066 |
+
font-size: 22px;
|
| 1067 |
+
line-height: 120%;
|
| 1068 |
+
}
|
| 1069 |
+
|
| 1070 |
+
/* notificationx upsell dialog */
|
| 1071 |
+
.notificationx-upsell-dialog .ui-dialog-titlebar {
|
| 1072 |
+
background: #5614d5;
|
| 1073 |
+
text-align: center;
|
| 1074 |
+
height: 55px;
|
| 1075 |
+
}
|
| 1076 |
+
.notificationx-upsell-dialog .ui-dialog-titlebar img {
|
| 1077 |
+
height: 32px;
|
| 1078 |
+
display: inline-block;
|
| 1079 |
+
margin: 11px 0 0 0;
|
| 1080 |
+
}
|
| 1081 |
+
.notificationx-upsell-dialog .ui-dialog-titlebar-close {
|
| 1082 |
+
color: #fff;
|
| 1083 |
+
height: 55px;
|
| 1084 |
+
}
|
| 1085 |
+
.notificationx-upsell-dialog .ui-dialog-titlebar-close:hover {
|
| 1086 |
+
color: #333;
|
| 1087 |
+
}
|
| 1088 |
+
.notificationx-upsell-dialog .ui-dialog-content {
|
| 1089 |
+
padding: 0;
|
| 1090 |
+
}
|
| 1091 |
+
.notificationx-upsell-dialog .ui-tabs-nav {
|
| 1092 |
+
text-align: center;
|
| 1093 |
+
}
|
| 1094 |
+
.notificationx-upsell-dialog .ui-tabs .upsell-tab {
|
| 1095 |
+
padding: 20px 15px;
|
| 1096 |
+
text-align: center;
|
| 1097 |
+
}
|
| 1098 |
+
.notificationx-upsell-dialog a {
|
| 1099 |
+
color: #333;
|
| 1100 |
+
}
|
| 1101 |
+
.notificationx-upsell-dialog a:hover {
|
| 1102 |
+
color: #000;
|
| 1103 |
+
}
|
| 1104 |
+
option.notificationx-promo {
|
| 1105 |
+
color: #2980b9;
|
| 1106 |
+
}
|
| 1107 |
+
.notificationx-pro-feature {
|
| 1108 |
+
display: inline-block;
|
| 1109 |
+
width: 32%;
|
| 1110 |
+
background: rgba(128, 128, 128, 0.03);
|
| 1111 |
+
margin: 0 5px 20px 5px;
|
| 1112 |
+
padding: 10px;
|
| 1113 |
+
box-sizing: border-box;
|
| 1114 |
+
vertical-align: top;
|
| 1115 |
+
position: relative;
|
| 1116 |
+
border-top: 1px solid #2980b9;
|
| 1117 |
+
}
|
| 1118 |
+
/* upsell dialog */
|
| 1119 |
+
|
| 1120 |
+
#notificationx-popup {
|
| 1121 |
+
position: fixed;
|
| 1122 |
+
width: 240px;
|
| 1123 |
+
bottom: 20px;
|
| 1124 |
+
right: 40px;
|
| 1125 |
+
border: 1px solid #d4d4d4;
|
| 1126 |
+
padding: 16px;
|
| 1127 |
+
background: #FFF;
|
| 1128 |
+
display: none;
|
| 1129 |
+
-webkit-box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.25);
|
| 1130 |
+
-moz-box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.25);
|
| 1131 |
+
box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.25);
|
| 1132 |
+
border-radius: 4px;
|
| 1133 |
+
z-index:99999;
|
| 1134 |
+
}
|
| 1135 |
+
|
| 1136 |
+
#notificationx-popup:hover{
|
| 1137 |
+
cursor: pointer;
|
| 1138 |
+
}
|
| 1139 |
+
|
| 1140 |
+
#notificationx-popup img{
|
| 1141 |
+
width:48px;
|
| 1142 |
+
}
|
| 1143 |
+
|
| 1144 |
+
.settings_page_ucp .notificationx-popup-icon {
|
| 1145 |
+
background: #efefff;
|
| 1146 |
+
padding: 6px 4px 0px 4px;
|
| 1147 |
+
width: 48px;
|
| 1148 |
+
float: left;
|
| 1149 |
+
margin-right: 10px;
|
| 1150 |
+
}
|
| 1151 |
+
|
| 1152 |
+
.settings_page_ucp .notificationx-popup-text {
|
| 1153 |
+
float: left;
|
| 1154 |
+
font-weight: bold;
|
| 1155 |
+
}
|
| 1156 |
+
|
| 1157 |
+
.settings_page_ucp .notificationx-popup-title {
|
| 1158 |
+
color: #6138bd;
|
| 1159 |
+
font-size: 18px;
|
| 1160 |
+
font-weight: bold;
|
| 1161 |
+
padding: 5px 0px;
|
| 1162 |
+
}
|
| 1163 |
+
|
| 1164 |
+
.settings_page_ucp .notificationx-popup-stars .dashicons-star-filled {
|
| 1165 |
+
color:#ecac57;
|
| 1166 |
+
font-size: 14px;
|
| 1167 |
+
}
|
| 1168 |
+
|
| 1169 |
+
.settings_page_ucp .notitificationx-popup-desc {
|
| 1170 |
+
width: 100%;
|
| 1171 |
+
display: block;
|
| 1172 |
+
clear: both;
|
| 1173 |
+
padding: 4px 0;
|
| 1174 |
+
}
|
| 1175 |
+
|
| 1176 |
+
.settings_page_ucp .notificationx-popup-close {
|
| 1177 |
+
position: absolute;
|
| 1178 |
+
top: 4px;
|
| 1179 |
+
right: 6px;
|
| 1180 |
+
}
|
| 1181 |
+
|
| 1182 |
+
.settings_page_ucp .notificationx-popup-close .dashicons {
|
| 1183 |
+
font-size: 24px;
|
| 1184 |
+
}
|
| 1185 |
+
|
| 1186 |
+
.settings_page_ucp .notificationx-popup-close:hover {
|
| 1187 |
+
color:#CCC;
|
| 1188 |
+
cursor: pointer;
|
| 1189 |
+
}
|
| 1190 |
+
|
| 1191 |
+
.settings_page_ucp .put-dismiss-notice {
|
| 1192 |
+
display: none;
|
| 1193 |
+
}
|
images/nordvpn-logo.png
DELETED
|
Binary file
|
images/nx-icon.png
ADDED
|
Binary file
|
images/nx-logo.png
ADDED
|
Binary file
|
js/ucp-admin.js
CHANGED
|
@@ -330,6 +330,36 @@ jQuery(document).ready(function($) {
|
|
| 330 |
return false;
|
| 331 |
});
|
| 332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
|
| 334 |
// upsell dialog init
|
| 335 |
$('#weglot-upsell-dialog').dialog({'dialogClass': 'wp-dialog ucp-dialog weglot-upsell-dialog',
|
|
@@ -426,6 +456,16 @@ jQuery(document).ready(function($) {
|
|
| 426 |
return false;
|
| 427 |
});
|
| 428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
|
| 430 |
$('.settings_page_ucp').on('click', '.open-weglot-upsell', function(e) {
|
| 431 |
e.preventDefault();
|
|
@@ -437,6 +477,16 @@ jQuery(document).ready(function($) {
|
|
| 437 |
return false;
|
| 438 |
});
|
| 439 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
|
| 441 |
$('#tabs_upsell').on('tabsactivate', function(event, ui) {
|
| 442 |
$('#upsell-dialog').dialog("option", "position", {my: "center", at: "center", of: window});
|
|
@@ -457,6 +507,17 @@ jQuery(document).ready(function($) {
|
|
| 457 |
}
|
| 458 |
});
|
| 459 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 460 |
if (!Date.now) {
|
| 461 |
Date.now = function() { return new Date().getTime(); }
|
| 462 |
}
|
| 330 |
return false;
|
| 331 |
});
|
| 332 |
|
| 333 |
+
// upsell dialog init
|
| 334 |
+
$('#notificationx-upsell-dialog').dialog({'dialogClass': 'wp-dialog ucp-dialog notificationx-upsell-dialog',
|
| 335 |
+
'modal': 1,
|
| 336 |
+
'resizable': false,
|
| 337 |
+
'title': 'Display notification bars',
|
| 338 |
+
'zIndex': 9999,
|
| 339 |
+
'width': 550,
|
| 340 |
+
'height': 'auto',
|
| 341 |
+
'show': 'fade',
|
| 342 |
+
'hide': 'fade',
|
| 343 |
+
'open': function(event, ui) {
|
| 344 |
+
ucp_fix_dialog_close(event, ui);
|
| 345 |
+
$(this).siblings().find('span.ui-dialog-title').html(ucp.notificationx_dialog_upsell_title);
|
| 346 |
+
},
|
| 347 |
+
'close': function(event, ui) { },
|
| 348 |
+
'autoOpen': false,
|
| 349 |
+
'closeOnEscape': true
|
| 350 |
+
});
|
| 351 |
+
$(window).resize(function(e) {
|
| 352 |
+
$('#notificationx-upsell-dialog').dialog("option", "position", {my: "center", at: "center", of: window});
|
| 353 |
+
});
|
| 354 |
+
|
| 355 |
+
jQuery('#install-notificationx').on('click',function(e) {
|
| 356 |
+
$('#notificationx-upsell-dialog').dialog('close');
|
| 357 |
+
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.notificationx_install_url + '" style="width:100%;height:100%;border:none;" /></div>');
|
| 358 |
+
jQuery('#wpwrap').css('pointer-events', 'none');
|
| 359 |
+
e.preventDefault();
|
| 360 |
+
return false;
|
| 361 |
+
});
|
| 362 |
+
|
| 363 |
|
| 364 |
// upsell dialog init
|
| 365 |
$('#weglot-upsell-dialog').dialog({'dialogClass': 'wp-dialog ucp-dialog weglot-upsell-dialog',
|
| 456 |
return false;
|
| 457 |
});
|
| 458 |
|
| 459 |
+
$('.settings_page_ucp').on('click', '.open-notificationx-upsell', function(e) {
|
| 460 |
+
e.preventDefault();
|
| 461 |
+
|
| 462 |
+
$(this).blur();
|
| 463 |
+
|
| 464 |
+
$('#notificationx-upsell-dialog').dialog('open');
|
| 465 |
+
|
| 466 |
+
return false;
|
| 467 |
+
});
|
| 468 |
+
|
| 469 |
|
| 470 |
$('.settings_page_ucp').on('click', '.open-weglot-upsell', function(e) {
|
| 471 |
e.preventDefault();
|
| 477 |
return false;
|
| 478 |
});
|
| 479 |
|
| 480 |
+
$('.settings_page_ucp').on('click', '#notificationx-popup', function(e) {
|
| 481 |
+
e.preventDefault();
|
| 482 |
+
|
| 483 |
+
$(this).blur();
|
| 484 |
+
|
| 485 |
+
$('#notificationx-upsell-dialog').dialog('open');
|
| 486 |
+
|
| 487 |
+
return false;
|
| 488 |
+
});
|
| 489 |
+
|
| 490 |
|
| 491 |
$('#tabs_upsell').on('tabsactivate', function(event, ui) {
|
| 492 |
$('#upsell-dialog').dialog("option", "position", {my: "center", at: "center", of: window});
|
| 507 |
}
|
| 508 |
});
|
| 509 |
|
| 510 |
+
ucp_nx = Cookies.get('ucp_nx');
|
| 511 |
+
if(ucp_nx != 'closed'){
|
| 512 |
+
$('#notificationx-popup').delay(2000).slideDown(500);
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
$('.settings_page_ucp').on('click','.notificationx-popup-close',function(e){
|
| 516 |
+
e.stopPropagation();
|
| 517 |
+
$('#notificationx-popup').hide();
|
| 518 |
+
Cookies.set('ucp_nx', 'closed', { expires: 700 });
|
| 519 |
+
});
|
| 520 |
+
|
| 521 |
if (!Date.now) {
|
| 522 |
Date.now = function() { return new Date().getTime(); }
|
| 523 |
}
|
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.2
|
| 7 |
-
Stable tag: 3.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -25,6 +25,8 @@ UCP has full support for collecting leads and subscribers via optin boxes in con
|
|
| 25 |
|
| 26 |
Thanks to our partnership with <a href="https://wordpress.org/plugins/weglot/">Weglot</a>, UCP is fully multilanguage ready and you can instantly translate your under construction page to 100+ languages with one click.
|
| 27 |
|
|
|
|
|
|
|
| 28 |
|
| 29 |
**Options**
|
| 30 |
|
|
@@ -137,6 +139,12 @@ Or if needed, upload manually;
|
|
| 137 |
|
| 138 |
== Changelog ==
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
= 3.45 =
|
| 141 |
* 2019/05/21
|
| 142 |
* bug fixes
|
| 4 |
Requires at least: 4.0
|
| 5 |
Requires PHP: 5.2
|
| 6 |
Tested up to: 5.2
|
| 7 |
+
Stable tag: 3.50
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 25 |
|
| 26 |
Thanks to our partnership with <a href="https://wordpress.org/plugins/weglot/">Weglot</a>, UCP is fully multilanguage ready and you can instantly translate your under construction page to 100+ languages with one click.
|
| 27 |
|
| 28 |
+
Increase 20-40% Sales & Interaction in Your Site with <a href="https://wordpress.org/plugins/notificationx/">NotificationX</a>!
|
| 29 |
+
|
| 30 |
|
| 31 |
**Options**
|
| 32 |
|
| 139 |
|
| 140 |
== Changelog ==
|
| 141 |
|
| 142 |
+
= 3.50 =
|
| 143 |
+
* 2019/08/07
|
| 144 |
+
* clean up
|
| 145 |
+
* NotificationX plugin integration
|
| 146 |
+
* 2,812,000
|
| 147 |
+
|
| 148 |
= 3.45 =
|
| 149 |
* 2019/05/21
|
| 150 |
* bug fixes
|
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.
|
| 8 |
Author URI: https://www.webfactoryltd.com/
|
| 9 |
Text Domain: under-construction-page
|
| 10 |
Domain Path: lang
|
|
@@ -68,6 +68,8 @@ class UCP {
|
|
| 68 |
if (is_admin()) {
|
| 69 |
// if the plugin was updated from ver < 1.20 upgrade settings array
|
| 70 |
self::maybe_upgrade();
|
|
|
|
|
|
|
| 71 |
|
| 72 |
// add UCP menu to admin tools menu group
|
| 73 |
add_action('admin_menu', array(__CLASS__, 'admin_menu'));
|
|
@@ -87,6 +89,7 @@ class UCP {
|
|
| 87 |
add_action('admin_action_ucp_change_status', array(__CLASS__, 'change_status'));
|
| 88 |
add_action('admin_action_ucp_reset_settings', array(__CLASS__, 'reset_settings'));
|
| 89 |
add_action('admin_action_install_mailoptin', array(__CLASS__, 'install_mailoptin'));
|
|
|
|
| 90 |
add_action('admin_action_install_weglot', array(__CLASS__, 'install_weglot'));
|
| 91 |
add_action('admin_action_install_security_ninja', array(__CLASS__, 'install_security_ninja'));
|
| 92 |
|
|
@@ -97,14 +100,16 @@ class UCP {
|
|
| 97 |
add_action('wp_ajax_ucp_dismiss_pointer', array(__CLASS__, 'dismiss_pointer_ajax'));
|
| 98 |
add_action('wp_ajax_ucp_dismiss_survey', array(__CLASS__, 'dismiss_survey_ajax'));
|
| 99 |
add_action('wp_ajax_ucp_submit_survey', array(__CLASS__, 'submit_survey_ajax'));
|
| 100 |
-
add_action('wp_ajax_ucp_submit_earlybird', array(__CLASS__, 'submit_earlybird_ajax'));
|
| 101 |
add_action('wp_ajax_ucp_submit_support_message', array(__CLASS__, 'submit_support_message_ajax'));
|
| 102 |
|
| 103 |
add_filter('install_plugins_table_api_args_featured', array(__CLASS__, 'featured_plugins_tab'));
|
| 104 |
} else {
|
| 105 |
// main plugin logic
|
| 106 |
-
add_action('wp', array(__CLASS__, 'display_construction_page'), 0, 1);
|
| 107 |
|
|
|
|
|
|
|
|
|
|
| 108 |
// show under construction notice on login form
|
| 109 |
add_filter('login_message', array(__CLASS__, 'login_message'));
|
| 110 |
|
|
@@ -155,7 +160,13 @@ class UCP {
|
|
| 155 |
public static function maybe_upgrade() {
|
| 156 |
$meta = self::get_meta();
|
| 157 |
$options = self::get_options();
|
| 158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
// added in v1.70 to rename roles to whitelisted_roles
|
| 160 |
if (isset($options['roles'])) {
|
| 161 |
$options['whitelisted_roles'] = $options['roles'];
|
|
@@ -225,7 +236,7 @@ class UCP {
|
|
| 225 |
static function display_construction_page() {
|
| 226 |
$options = self::get_options();
|
| 227 |
$request_uri = trailingslashit(strtolower(@parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
|
| 228 |
-
|
| 229 |
// just to be on the safe side
|
| 230 |
if (defined('DOING_CRON') && DOING_CRON) {
|
| 231 |
return false;
|
|
@@ -236,7 +247,7 @@ class UCP {
|
|
| 236 |
if (defined('WP_CLI') && WP_CLI) {
|
| 237 |
return false;
|
| 238 |
}
|
| 239 |
-
|
| 240 |
// some URLs have to be accessible at all times
|
| 241 |
if ($request_uri == '/wp-admin/' ||
|
| 242 |
$request_uri == '/feed/' ||
|
|
@@ -249,8 +260,7 @@ class UCP {
|
|
| 249 |
return;
|
| 250 |
}
|
| 251 |
|
| 252 |
-
if (true == self::is_construction_mode_enabled(false)
|
| 253 |
-
|| (is_user_logged_in() && isset($_GET['ucp_preview']))) {
|
| 254 |
header(self::wp_get_server_protocol() . ' 200 OK');
|
| 255 |
if ($options['end_date'] && $options['end_date'] != '0000-00-00 00:00') {
|
| 256 |
header('Retry-After: ' . date('D, d M Y H:i:s T', strtotime($options['end_date'])));
|
|
@@ -265,11 +275,92 @@ class UCP {
|
|
| 265 |
$theme = $options['theme'];
|
| 266 |
}
|
| 267 |
|
| 268 |
-
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
| 271 |
} // display_construction_page
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
// keeping compatibility with WP < v4.4
|
| 275 |
static function wp_get_server_protocol() {
|
|
@@ -298,8 +389,8 @@ class UCP {
|
|
| 298 |
$pointers = get_option(UCP_POINTERS_KEY);
|
| 299 |
|
| 300 |
// auto remove welcome pointer when options are opened
|
| 301 |
-
if (
|
| 302 |
-
unset($pointers['welcome']);
|
| 303 |
update_option(UCP_POINTERS_KEY, $pointers);
|
| 304 |
}
|
| 305 |
|
|
@@ -328,11 +419,12 @@ class UCP {
|
|
| 328 |
'dialog_upsell_title' => '<img alt="' . __('UnderConstructionPage PRO', 'under-construction-page') . '" title="' . __('UnderConstructionPage PRO', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/ucp_pro_logo_white.png' . '">',
|
| 329 |
'mailoptin_dialog_upsell_title' => '<img alt="' . __('MailOptin', 'under-construction-page') . '" title="' . __('MailOptin', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/mailoptin-logo-white.png' . '">',
|
| 330 |
'weglot_dialog_upsell_title' => '<img alt="' . __('Weglot', 'under-construction-page') . '" title="' . __('Weglot', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/weglot-logo-white.png' . '">',
|
|
|
|
| 331 |
'mailoptin_install_url' => add_query_arg(array('action' => 'install_mailoptin'), admin_url('admin.php')),
|
| 332 |
'weglot_install_url' => add_query_arg(array('action' => 'install_weglot'), admin_url('admin.php')),
|
|
|
|
| 333 |
'nonce_dismiss_survey' => wp_create_nonce('ucp_dismiss_survey'),
|
| 334 |
'nonce_submit_survey' => wp_create_nonce('ucp_submit_survey'),
|
| 335 |
-
'nonce_submit_earlybird' => wp_create_nonce('ucp_submit_earlybird'),
|
| 336 |
'nonce_submit_support_message' => wp_create_nonce('ucp_submit_support_message'),
|
| 337 |
'deactivate_confirmation' => __('Are you sure you want to deactivate UnderConstruction plugin?' . "\n" . 'If you are removing it because of a problem please contact our support. They will be more than happy to help.', 'under-construction-page'));
|
| 338 |
|
|
@@ -496,42 +588,6 @@ class UCP {
|
|
| 496 |
} // submit_survey_ajax
|
| 497 |
|
| 498 |
|
| 499 |
-
// submit earlybird email
|
| 500 |
-
static function submit_earlybird_ajax() {
|
| 501 |
-
check_ajax_referer('ucp_submit_earlybird');
|
| 502 |
-
|
| 503 |
-
$options = self::get_options();
|
| 504 |
-
$meta = self::get_meta();
|
| 505 |
-
|
| 506 |
-
$vars = wp_parse_args($_POST, array('type' => '', 'email' => ''));
|
| 507 |
-
|
| 508 |
-
if (empty($vars['email']) || empty($vars['type'])) {
|
| 509 |
-
wp_send_json_error(__('Please tell us your email and how you use UCP.', 'under-construction-page'));
|
| 510 |
-
}
|
| 511 |
-
|
| 512 |
-
$request_params = array('sslverify' => false, 'timeout' => 15, 'redirection' => 2);
|
| 513 |
-
$request_args = array('action' => 'submit_survey',
|
| 514 |
-
'survey' => 'earlybird',
|
| 515 |
-
'email' => $vars['email'],
|
| 516 |
-
'answers' => $vars['type'],
|
| 517 |
-
'custom_answer' => $options['theme'] . '; ' . date('Y-m-d H:i:s', $meta['first_install']),
|
| 518 |
-
'first_version' => $meta['first_version'],
|
| 519 |
-
'version' => UCP::$version,
|
| 520 |
-
'codebase' => 'free',
|
| 521 |
-
'site' => get_home_url());
|
| 522 |
-
|
| 523 |
-
$url = add_query_arg($request_args, self::$licensing_servers[0]);
|
| 524 |
-
$response = wp_remote_get(esc_url_raw($url), $request_params);
|
| 525 |
-
|
| 526 |
-
if (is_wp_error($response) || !wp_remote_retrieve_body($response)) {
|
| 527 |
-
$url = add_query_arg($request_args, self::$licensing_servers[1]);
|
| 528 |
-
$response = wp_remote_get(esc_url_raw($url), $request_params);
|
| 529 |
-
}
|
| 530 |
-
|
| 531 |
-
wp_send_json_success();
|
| 532 |
-
} // submit_earlybird_ajax
|
| 533 |
-
|
| 534 |
-
|
| 535 |
// encode email for frontend use
|
| 536 |
static function encode_email($email) {
|
| 537 |
$len = strlen($email);
|
|
@@ -637,6 +693,17 @@ class UCP {
|
|
| 637 |
$out .= '<link rel="stylesheet" href="' . trailingslashit(UCP_PLUGIN_URL . 'themes/css') . 'font-awesome.min.css?v=' . self::$version . '" type="text/css">' . "\n";
|
| 638 |
|
| 639 |
$out .= '<link rel="shortcut icon" type="image/png" href="' . trailingslashit(UCP_PLUGIN_URL . 'themes/images') . 'favicon.png" />';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
|
| 641 |
if (self::is_weglot_setup()) {
|
| 642 |
$out .= '<link rel="stylesheet" href="' . WEGLOT_URL_DIST . '/css/front-css.css?v=' . WEGLOT_VERSION . '" type="text/css">';
|
|
@@ -644,7 +711,10 @@ class UCP {
|
|
| 644 |
}
|
| 645 |
|
| 646 |
if (self::is_mailoptin_active()) {
|
| 647 |
-
|
|
|
|
|
|
|
|
|
|
| 648 |
$out .= '<script type="text/javascript">
|
| 649 |
var mailoptin_globals = {
|
| 650 |
"admin_url":"' . admin_url() . '",
|
|
@@ -714,6 +784,10 @@ class UCP {
|
|
| 714 |
$out .= '</div>';
|
| 715 |
}
|
| 716 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 717 |
$out = apply_filters('ucp_footer', $out, $options, $template_id);
|
| 718 |
|
| 719 |
return $out;
|
|
@@ -1163,6 +1237,7 @@ class UCP {
|
|
| 1163 |
'heading1' => __('Sorry, we\'re doing some work on the site', 'under-construction-page'),
|
| 1164 |
'content' => __('Thank you for being patient. We are doing some work on the site and will be back shortly.', 'under-construction-page'),
|
| 1165 |
'mailoptin_campaign' => '-1',
|
|
|
|
| 1166 |
'social_facebook' => '',
|
| 1167 |
'social_twitter' => '',
|
| 1168 |
'social_google' => '',
|
|
@@ -1638,15 +1713,64 @@ class UCP {
|
|
| 1638 |
echo '<th><label for="">Optin Boxes & Popups</label></th>';
|
| 1639 |
echo '<td>';
|
| 1640 |
echo '<div class="toggle-wrapper">
|
| 1641 |
-
|
| 1642 |
-
|
| 1643 |
-
|
| 1644 |
echo '<p class="description">Collecting leads and subscribers is one of the most important aspect of any under construction page. ';
|
| 1645 |
echo 'To add optin boxes & optin popups compatible with Mailchimp and many other autoresponders <a href="#" class="open-mailoptin-upsell">install the free MailOptin plugin</a>. It seamlessly integrates with UCP, offers numerous options and will enable you to collect leads without any additional costs.</p>';
|
| 1646 |
echo '</td>';
|
| 1647 |
echo '</tr>';
|
| 1648 |
} // mailoptin not active
|
| 1649 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1650 |
echo '<tr>';
|
| 1651 |
echo '<th><label for="content_font">Content Font</label></th>';
|
| 1652 |
echo '<td><select class="skip-save open-ucp-upsell" id="content_font">';
|
|
@@ -1790,6 +1914,7 @@ class UCP {
|
|
| 1790 |
echo '<tr><th colspan="2"><a id="show-social-icons" href="#" class="js-action">' . __('Show more Social & Contact Icons', 'under-construction-page') . '</a></th></tr>';
|
| 1791 |
|
| 1792 |
echo '</table>';
|
|
|
|
| 1793 |
echo '</div>';
|
| 1794 |
|
| 1795 |
self::footer_buttons();
|
|
@@ -2042,51 +2167,18 @@ class UCP {
|
|
| 2042 |
echo '</div>'; // faq
|
| 2043 |
|
| 2044 |
echo '<div style="display: none;" id="tab_support_contact" class="ucp-tab-content">';
|
| 2045 |
-
|
| 2046 |
-
|
| 2047 |
-
echo '<table class="form-table">';
|
| 2048 |
-
echo '<tr valign="top">
|
| 2049 |
-
<th scope="row"><label for="support_priority">Ticket Priority</label></th>
|
| 2050 |
-
<td>';
|
| 2051 |
-
echo '<select class="skip-save open-ucp-upsell" id="support_priority" name="support_priority">';
|
| 2052 |
-
echo '<option value="0" selected>Low</option>';
|
| 2053 |
-
echo '<option value="-1" class="ucp-promo">Normal</option>';
|
| 2054 |
-
echo '<option value="-1" class="ucp-promo">High</option>';
|
| 2055 |
-
echo '</select>';
|
| 2056 |
-
echo '<p class="description">' . __('We reply to all tickets as fast as possible. However, <a data-pro-ad="support_priority" href="#" class="open-ucp-upsell">PRO users</a> get to jump the queue.', 'under-construction-page') . '</p>';
|
| 2057 |
-
echo '</td></tr>';
|
| 2058 |
-
|
| 2059 |
-
echo '<tr valign="top">
|
| 2060 |
-
<th scope="row"><label for="support_email">' . __('Your Email Address', 'under-construction-page') . '</label></th>
|
| 2061 |
-
<td><input id="support_email" type="text" class="regular-text skip-save" name="support_email" value="" placeholder="name@domain.com">';
|
| 2062 |
-
echo '<p class="description">' . __('We will reply to this email, so please, double-check it.', 'under-construction-page') . '</p>';
|
| 2063 |
-
echo '</td></tr>';
|
| 2064 |
|
| 2065 |
-
echo '<
|
| 2066 |
-
<th scope="row"><label for="support_message">' . __('Message', 'under-construction-page') . '</label></th>
|
| 2067 |
-
<td><textarea rows="5" cols="75" id="support_message" class="skip-save" name="support_message" placeholder="Hi, I just wanted to ..."></textarea>';
|
| 2068 |
-
echo '<p class="description">Please be as descriptive as possible. It will help us to provide faster & better support.</p>';
|
| 2069 |
-
echo '</td></tr>';
|
| 2070 |
-
|
| 2071 |
-
echo '<tr valign="top">
|
| 2072 |
-
<th scope="row"><label for="support_info">' . __('Send Extra Site Info to Support Agents', 'under-construction-page') . '</label></th>
|
| 2073 |
-
<td>';
|
| 2074 |
-
echo '<div class="toggle-wrapper">
|
| 2075 |
-
<input type="checkbox" id="support_info" checked type="checkbox" value="1" name="support_info">
|
| 2076 |
-
<label for="support_info" class="toggle"><span class="toggle_handler"></span></label>
|
| 2077 |
-
</div>';
|
| 2078 |
-
echo '<p class="description">Our support agents need this info to provide faster & better support. The following data will be added to your message;</p>';
|
| 2079 |
echo '<p>WordPress version: <code>' . get_bloginfo('version') . '</code><br>';
|
| 2080 |
echo 'UCP Version: <code>' . self::$version . '</code><br>';
|
| 2081 |
echo 'PHP Version: <code>' . PHP_VERSION . '</code><br>';
|
| 2082 |
echo 'Site URL: <code>' . get_bloginfo('url') . '</code><br>';
|
| 2083 |
echo 'WordPress URL: <code>' . get_bloginfo('wpurl') . '</code><br>';
|
| 2084 |
-
echo 'Theme: <code>' . $theme->get('Name') . ' v' . $theme->get('Version') . '</code
|
| 2085 |
-
echo '
|
| 2086 |
-
|
| 2087 |
-
echo '</table>';
|
| 2088 |
-
echo '<a id="ucp-send-support-message" href="#" class="js-action button button-primary"><span class="dashicons dashicons-update"></span>' . __('Send Message to Support', 'under-construction-page') . '</a>';
|
| 2089 |
-
echo '</table>';
|
| 2090 |
echo '</div>'; // contact
|
| 2091 |
|
| 2092 |
echo '</div>'; // tabs
|
|
@@ -2247,6 +2339,33 @@ class UCP {
|
|
| 2247 |
echo '</div>';
|
| 2248 |
// weglot install dialog
|
| 2249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2250 |
$promo = self::is_promo_active();
|
| 2251 |
if ($promo == 'welcome') {
|
| 2252 |
$header = 'A <b>welcoming discount</b> has been applied to selected packages! It\'s <b>time limited</b> and available for only another <b class="ucp-countdown">59min 30sec</b>.';
|
|
@@ -2414,7 +2533,7 @@ class UCP {
|
|
| 2414 |
|
| 2415 |
$pointers['welcome'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the <b style="font-weight: 800; font-variant: small-caps;">UnderConstructionPage</b> plugin! Please open <a href="' . admin_url('options-general.php?page=ucp'). '">Settings - UnderConstruction</a> to create a beautiful under construction page.');
|
| 2416 |
$pointers['getting_started'] = array('target' => '.ucp-main-tab li:nth-child(2)', 'edge' => 'top', 'align' => 'left', 'content' => 'Watch the short <a href="https://www.youtube.com/watch?v=RN4XABhK7_w" target="_blank">getting started video</a> to get you up to speed with UCP in no time. If that doesn\'t answer your questions watch the longer <a href="https://www.youtube.com/watch?v=K3DF-NP6Fog" target="_blank">in-depth video walktrough</a>.<br>If you need the videos later, links are in the <a href="#" class="change_tab" data-tab="4">FAQ</a>.');
|
| 2417 |
-
|
| 2418 |
update_option(UCP_POINTERS_KEY, $pointers);
|
| 2419 |
} // reset_pointers
|
| 2420 |
|
|
@@ -2592,6 +2711,62 @@ class UCP {
|
|
| 2592 |
echo '</div>';
|
| 2593 |
} // install_security_ninja
|
| 2594 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2595 |
|
| 2596 |
static function is_plugin_installed($slug) {
|
| 2597 |
if (!function_exists('get_plugins')) {
|
|
@@ -2625,6 +2800,19 @@ class UCP {
|
|
| 2625 |
}
|
| 2626 |
} // is_mailoptin_active
|
| 2627 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2628 |
|
| 2629 |
// check if Weglot plugin is active and min version installed
|
| 2630 |
static function is_weglot_active() {
|
| 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.50
|
| 8 |
Author URI: https://www.webfactoryltd.com/
|
| 9 |
Text Domain: under-construction-page
|
| 10 |
Domain Path: lang
|
| 68 |
if (is_admin()) {
|
| 69 |
// if the plugin was updated from ver < 1.20 upgrade settings array
|
| 70 |
self::maybe_upgrade();
|
| 71 |
+
|
| 72 |
+
delete_transient('_nx_meta_activation_notice');
|
| 73 |
|
| 74 |
// add UCP menu to admin tools menu group
|
| 75 |
add_action('admin_menu', array(__CLASS__, 'admin_menu'));
|
| 89 |
add_action('admin_action_ucp_change_status', array(__CLASS__, 'change_status'));
|
| 90 |
add_action('admin_action_ucp_reset_settings', array(__CLASS__, 'reset_settings'));
|
| 91 |
add_action('admin_action_install_mailoptin', array(__CLASS__, 'install_mailoptin'));
|
| 92 |
+
add_action('admin_action_install_notificationx', array(__CLASS__, 'install_notificationx'));
|
| 93 |
add_action('admin_action_install_weglot', array(__CLASS__, 'install_weglot'));
|
| 94 |
add_action('admin_action_install_security_ninja', array(__CLASS__, 'install_security_ninja'));
|
| 95 |
|
| 100 |
add_action('wp_ajax_ucp_dismiss_pointer', array(__CLASS__, 'dismiss_pointer_ajax'));
|
| 101 |
add_action('wp_ajax_ucp_dismiss_survey', array(__CLASS__, 'dismiss_survey_ajax'));
|
| 102 |
add_action('wp_ajax_ucp_submit_survey', array(__CLASS__, 'submit_survey_ajax'));
|
|
|
|
| 103 |
add_action('wp_ajax_ucp_submit_support_message', array(__CLASS__, 'submit_support_message_ajax'));
|
| 104 |
|
| 105 |
add_filter('install_plugins_table_api_args_featured', array(__CLASS__, 'featured_plugins_tab'));
|
| 106 |
} else {
|
| 107 |
// main plugin logic
|
| 108 |
+
add_action('wp', array(__CLASS__, 'display_construction_page'), 0, 1);
|
| 109 |
|
| 110 |
+
if(self::is_notificationx_really_setup_and_active()){
|
| 111 |
+
add_action('shutdown', array(__CLASS__, 'display_construction_page_x'), 0, 1);
|
| 112 |
+
}
|
| 113 |
// show under construction notice on login form
|
| 114 |
add_filter('login_message', array(__CLASS__, 'login_message'));
|
| 115 |
|
| 160 |
public static function maybe_upgrade() {
|
| 161 |
$meta = self::get_meta();
|
| 162 |
$options = self::get_options();
|
| 163 |
+
|
| 164 |
+
if (self::$version != $meta['first_version'] && $meta['first_version'] != '3.50' && $meta['options_ver'] != self::$version) {
|
| 165 |
+
$pointers = array();
|
| 166 |
+
$pointers['nx'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Easily add notifications to your <b style="font-weight: 800; font-variant: small-caps;">Under Construction Page</b> and continue using them once you launch the site. Open <a href="' . admin_url('options-general.php?page=ucp'). '">Settings - UnderConstruction</a> to set them up in a minute.');
|
| 167 |
+
update_option(UCP_POINTERS_KEY, $pointers);
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
// added in v1.70 to rename roles to whitelisted_roles
|
| 171 |
if (isset($options['roles'])) {
|
| 172 |
$options['whitelisted_roles'] = $options['roles'];
|
| 236 |
static function display_construction_page() {
|
| 237 |
$options = self::get_options();
|
| 238 |
$request_uri = trailingslashit(strtolower(@parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
|
| 239 |
+
update_option('ucp_url', $request_uri);
|
| 240 |
// just to be on the safe side
|
| 241 |
if (defined('DOING_CRON') && DOING_CRON) {
|
| 242 |
return false;
|
| 247 |
if (defined('WP_CLI') && WP_CLI) {
|
| 248 |
return false;
|
| 249 |
}
|
| 250 |
+
|
| 251 |
// some URLs have to be accessible at all times
|
| 252 |
if ($request_uri == '/wp-admin/' ||
|
| 253 |
$request_uri == '/feed/' ||
|
| 260 |
return;
|
| 261 |
}
|
| 262 |
|
| 263 |
+
if (true == self::is_construction_mode_enabled(false) || (is_user_logged_in() && isset($_GET['ucp_preview']))) {
|
|
|
|
| 264 |
header(self::wp_get_server_protocol() . ' 200 OK');
|
| 265 |
if ($options['end_date'] && $options['end_date'] != '0000-00-00 00:00') {
|
| 266 |
header('Retry-After: ' . date('D, d M Y H:i:s T', strtotime($options['end_date'])));
|
| 275 |
$theme = $options['theme'];
|
| 276 |
}
|
| 277 |
|
| 278 |
+
if (self::is_notificationx_really_setup_and_active()) {
|
| 279 |
+
ob_start();
|
| 280 |
+
} else {
|
| 281 |
+
echo self::get_template($theme);
|
| 282 |
+
die();
|
| 283 |
+
}
|
| 284 |
}
|
| 285 |
} // display_construction_page
|
| 286 |
|
| 287 |
+
static function display_construction_page_x(){
|
| 288 |
+
$options = self::get_options();
|
| 289 |
+
$request_uri = rtrim(strtolower(@parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)),'/');
|
| 290 |
+
$request_uri = '/'.substr($request_uri, strrpos($request_uri, '/') + 1);
|
| 291 |
+
if($request_uri != '/wp-login.php'){
|
| 292 |
+
$request_uri .= $request_uri.'/';
|
| 293 |
+
}
|
| 294 |
+
update_option('ucp_x_url',$request_uri);
|
| 295 |
+
|
| 296 |
+
// just to be on the safe side
|
| 297 |
+
if (defined('DOING_CRON') && DOING_CRON) {
|
| 298 |
+
return false;
|
| 299 |
+
}
|
| 300 |
+
if (defined('DOING_AJAX') && DOING_AJAX) {
|
| 301 |
+
return false;
|
| 302 |
+
}
|
| 303 |
+
if (defined('WP_CLI') && WP_CLI) {
|
| 304 |
+
return false;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
// some URLs have to be accessible at all times
|
| 308 |
+
if ($request_uri == '/wp-admin/' ||
|
| 309 |
+
$request_uri == '/feed/' ||
|
| 310 |
+
$request_uri == '/feed/rss/' ||
|
| 311 |
+
$request_uri == '/feed/rss2/' ||
|
| 312 |
+
$request_uri == '/feed/rdf/' ||
|
| 313 |
+
$request_uri == '/feed/atom/' ||
|
| 314 |
+
$request_uri == '/admin/' ||
|
| 315 |
+
$request_uri == '/wp-login.php') {
|
| 316 |
+
return;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
if (true == self::is_construction_mode_enabled(false) || (is_user_logged_in() && isset($_GET['ucp_preview']))) {
|
| 320 |
+
header(self::wp_get_server_protocol() . ' 200 OK');
|
| 321 |
+
if ($options['end_date'] && $options['end_date'] != '0000-00-00 00:00') {
|
| 322 |
+
header('Retry-After: ' . date('D, d M Y H:i:s T', strtotime($options['end_date'])));
|
| 323 |
+
} else {
|
| 324 |
+
header('Retry-After: ' . DAY_IN_SECONDS);
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
$themes = self::get_themes();
|
| 328 |
+
if (!empty($_GET['theme']) && substr($_GET['theme'], 5) != '_pro_' && !empty($themes[$_GET['theme']])) {
|
| 329 |
+
$theme = $_GET['theme'];
|
| 330 |
+
} else {
|
| 331 |
+
$theme = $options['theme'];
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
libxml_use_internal_errors(true);
|
| 335 |
+
$doc = new DOMDocument();
|
| 336 |
+
$doc->loadHTML('<?xml encoding="UTF-8">' . ob_get_clean());
|
| 337 |
+
$selector = new DOMXPath($doc);
|
| 338 |
+
|
| 339 |
+
if($options['notificationx_notification'] == 'all'){
|
| 340 |
+
$nx_query = 'nx-bar-';
|
| 341 |
+
} else if($options['notificationx_notification']>0){
|
| 342 |
+
$nx_query = 'nx-bar-'.$options['notificationx_notification'];
|
| 343 |
+
} else {
|
| 344 |
+
$nx_query = false;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
if($nx_query !== false){
|
| 348 |
+
$nodes = $selector->query('//*[starts-with(@id, "'.$nx_query.'")]');
|
| 349 |
+
$nx_bar_html = array();
|
| 350 |
+
foreach($nodes as $node){
|
| 351 |
+
$nx_bar_html[] = $node->ownerDocument->saveHTML($node);
|
| 352 |
+
}
|
| 353 |
+
echo str_replace('<!-- NXBAR -->', implode('',$nx_bar_html),self::get_template($theme));
|
| 354 |
+
} else {
|
| 355 |
+
echo self::get_template($theme);
|
| 356 |
+
}
|
| 357 |
+
exit;
|
| 358 |
+
} else {
|
| 359 |
+
flush();
|
| 360 |
+
return;
|
| 361 |
+
}
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
|
| 365 |
// keeping compatibility with WP < v4.4
|
| 366 |
static function wp_get_server_protocol() {
|
| 389 |
$pointers = get_option(UCP_POINTERS_KEY);
|
| 390 |
|
| 391 |
// auto remove welcome pointer when options are opened
|
| 392 |
+
if ('settings_page_ucp' == $hook) {
|
| 393 |
+
unset($pointers['welcome'], $pointers['nx']);
|
| 394 |
update_option(UCP_POINTERS_KEY, $pointers);
|
| 395 |
}
|
| 396 |
|
| 419 |
'dialog_upsell_title' => '<img alt="' . __('UnderConstructionPage PRO', 'under-construction-page') . '" title="' . __('UnderConstructionPage PRO', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/ucp_pro_logo_white.png' . '">',
|
| 420 |
'mailoptin_dialog_upsell_title' => '<img alt="' . __('MailOptin', 'under-construction-page') . '" title="' . __('MailOptin', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/mailoptin-logo-white.png' . '">',
|
| 421 |
'weglot_dialog_upsell_title' => '<img alt="' . __('Weglot', 'under-construction-page') . '" title="' . __('Weglot', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/weglot-logo-white.png' . '">',
|
| 422 |
+
'notificationx_dialog_upsell_title' => '<img alt="' . __('NotificationX', 'under-construction-page') . '" title="' . __('NotificationX', 'under-construction-page') . '" src="' . UCP_PLUGIN_URL . 'images/nx-logo.png' . '">',
|
| 423 |
'mailoptin_install_url' => add_query_arg(array('action' => 'install_mailoptin'), admin_url('admin.php')),
|
| 424 |
'weglot_install_url' => add_query_arg(array('action' => 'install_weglot'), admin_url('admin.php')),
|
| 425 |
+
'notificationx_install_url' => add_query_arg(array('action' => 'install_notificationx'), admin_url('admin.php')),
|
| 426 |
'nonce_dismiss_survey' => wp_create_nonce('ucp_dismiss_survey'),
|
| 427 |
'nonce_submit_survey' => wp_create_nonce('ucp_submit_survey'),
|
|
|
|
| 428 |
'nonce_submit_support_message' => wp_create_nonce('ucp_submit_support_message'),
|
| 429 |
'deactivate_confirmation' => __('Are you sure you want to deactivate UnderConstruction plugin?' . "\n" . 'If you are removing it because of a problem please contact our support. They will be more than happy to help.', 'under-construction-page'));
|
| 430 |
|
| 588 |
} // submit_survey_ajax
|
| 589 |
|
| 590 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 591 |
// encode email for frontend use
|
| 592 |
static function encode_email($email) {
|
| 593 |
$len = strlen($email);
|
| 693 |
$out .= '<link rel="stylesheet" href="' . trailingslashit(UCP_PLUGIN_URL . 'themes/css') . 'font-awesome.min.css?v=' . self::$version . '" type="text/css">' . "\n";
|
| 694 |
|
| 695 |
$out .= '<link rel="shortcut icon" type="image/png" href="' . trailingslashit(UCP_PLUGIN_URL . 'themes/images') . 'favicon.png" />';
|
| 696 |
+
|
| 697 |
+
$jquery_included = false;
|
| 698 |
+
if(self::is_notificationx_really_setup_and_active()){
|
| 699 |
+
if(!$jquery_included){
|
| 700 |
+
$out .= '<script src="' . includes_url('/js/jquery/jquery.js') . '"></script>';
|
| 701 |
+
$jquery_included = true;
|
| 702 |
+
}
|
| 703 |
+
$out .= '<link rel="stylesheet" href="' . NOTIFICATIONX_PUBLIC_URL . 'assets/css/notificationx-public.min.css" type="text/css">';
|
| 704 |
+
$out .= '<script type="text/javascript" src="' . NOTIFICATIONX_PUBLIC_URL . 'assets/js/Cookies.js"></script>';
|
| 705 |
+
$out .= '<script type="text/javascript" src="' . NOTIFICATIONX_PUBLIC_URL . 'assets/js/notificationx-public.min.js"></script>';
|
| 706 |
+
}
|
| 707 |
|
| 708 |
if (self::is_weglot_setup()) {
|
| 709 |
$out .= '<link rel="stylesheet" href="' . WEGLOT_URL_DIST . '/css/front-css.css?v=' . WEGLOT_VERSION . '" type="text/css">';
|
| 711 |
}
|
| 712 |
|
| 713 |
if (self::is_mailoptin_active()) {
|
| 714 |
+
if(!$jquery_included){
|
| 715 |
+
$out .= '<script src="' . includes_url('/js/jquery/jquery.js') . '"></script>';
|
| 716 |
+
$jquery_included = true;
|
| 717 |
+
}
|
| 718 |
$out .= '<script type="text/javascript">
|
| 719 |
var mailoptin_globals = {
|
| 720 |
"admin_url":"' . admin_url() . '",
|
| 784 |
$out .= '</div>';
|
| 785 |
}
|
| 786 |
|
| 787 |
+
if(self::is_notificationx_really_setup_and_active()){
|
| 788 |
+
$out.='<!-- NXBAR -->';
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
$out = apply_filters('ucp_footer', $out, $options, $template_id);
|
| 792 |
|
| 793 |
return $out;
|
| 1237 |
'heading1' => __('Sorry, we\'re doing some work on the site', 'under-construction-page'),
|
| 1238 |
'content' => __('Thank you for being patient. We are doing some work on the site and will be back shortly.', 'under-construction-page'),
|
| 1239 |
'mailoptin_campaign' => '-1',
|
| 1240 |
+
'notificationx_notification' => '-1',
|
| 1241 |
'social_facebook' => '',
|
| 1242 |
'social_twitter' => '',
|
| 1243 |
'social_google' => '',
|
| 1713 |
echo '<th><label for="">Optin Boxes & Popups</label></th>';
|
| 1714 |
echo '<td>';
|
| 1715 |
echo '<div class="toggle-wrapper">
|
| 1716 |
+
<input type="checkbox" id="mailoptin_support" type="checkbox" value="1" class="skip-save open-mailoptin-upsell">
|
| 1717 |
+
<label for="mailoptin_support" class="toggle"><span class="toggle_handler"></span></label>
|
| 1718 |
+
</div>';
|
| 1719 |
echo '<p class="description">Collecting leads and subscribers is one of the most important aspect of any under construction page. ';
|
| 1720 |
echo 'To add optin boxes & optin popups compatible with Mailchimp and many other autoresponders <a href="#" class="open-mailoptin-upsell">install the free MailOptin plugin</a>. It seamlessly integrates with UCP, offers numerous options and will enable you to collect leads without any additional costs.</p>';
|
| 1721 |
echo '</td>';
|
| 1722 |
echo '</tr>';
|
| 1723 |
} // mailoptin not active
|
| 1724 |
|
| 1725 |
+
if (self::is_notificationx_really_setup_and_active()) {
|
| 1726 |
+
$nx_args = array (
|
| 1727 |
+
'post_type' => array( 'notificationx' ),
|
| 1728 |
+
'post_status' => array( 'publish' ),
|
| 1729 |
+
'nopaging' => true,
|
| 1730 |
+
'order' => 'ASC',
|
| 1731 |
+
);
|
| 1732 |
+
$nx_notifications = get_posts( $nx_args );
|
| 1733 |
+
$nx_notifications_dd = array();
|
| 1734 |
+
|
| 1735 |
+
if(count($nx_notifications)>0){
|
| 1736 |
+
foreach($nx_notifications as $nx_notification){
|
| 1737 |
+
$nx_notifications_dd[] = array('val' => $nx_notification->ID, 'label' => strlen($nx_notification->post_title)?$nx_notification->post_title:'NotificationX '.$nx_notification->ID.' (no title)');
|
| 1738 |
+
}
|
| 1739 |
+
} else {
|
| 1740 |
+
$nx_notifications_dd = false;
|
| 1741 |
+
}
|
| 1742 |
+
|
| 1743 |
+
echo '<tr id="notificationx-settings">';
|
| 1744 |
+
echo '<th><label for="notificationx_notification">Notifications</label></th>';
|
| 1745 |
+
echo '<td>';
|
| 1746 |
+
if ($nx_notifications_dd) {
|
| 1747 |
+
echo '<select name="' . UCP_OPTIONS_KEY . '[notificationx_notification]" id="notificationx_notification">';
|
| 1748 |
+
echo '<option value="-1">none</option>';
|
| 1749 |
+
echo self::create_select_options($nx_notifications_dd, $options['notificationx_notification']);
|
| 1750 |
+
echo '<option value="all" '.($options['notificationx_notification'] == 'all'?'selected':'').'>Show all</option>';
|
| 1751 |
+
echo '</select>';
|
| 1752 |
+
} else {
|
| 1753 |
+
echo '<p><a href="' . admin_url('post-new.php?post_type=notificationx') . '">Create your first notification</a></p>';
|
| 1754 |
+
}
|
| 1755 |
+
echo '<p class="description">Create, edit and manage notifications on the <a href="' . admin_url('edit.php?post_type=notificationx') . '">NotificationX page</a>.</p>';
|
| 1756 |
+
echo '</td>';
|
| 1757 |
+
echo '</tr>';
|
| 1758 |
+
} else {
|
| 1759 |
+
echo '<tr>';
|
| 1760 |
+
echo '<th><label for="">Notification Bar</label></th>';
|
| 1761 |
+
echo '<td>';
|
| 1762 |
+
echo '<div class="toggle-wrapper">
|
| 1763 |
+
<input type="checkbox" id="notificationx_support" type="checkbox" value="1" class="skip-save open-notificationx-upsell">
|
| 1764 |
+
<label for="notificationx_support" class="toggle"><span class="toggle_handler"></span></label>
|
| 1765 |
+
</div>';
|
| 1766 |
+
echo '<p class="description">Add notifications to instantly engage and influence your visitors\' actions using social proof.</p>
|
| 1767 |
+
<p class="description">To add notifications <a href="#" class="open-notificationx-upsell">install the free NotificationX plugin</a>. It seamlessly integrates with UCP and offers numerous options.</p>';
|
| 1768 |
+
echo '</td>';
|
| 1769 |
+
echo '</tr>';
|
| 1770 |
+
|
| 1771 |
+
|
| 1772 |
+
} // notificationx not active
|
| 1773 |
+
|
| 1774 |
echo '<tr>';
|
| 1775 |
echo '<th><label for="content_font">Content Font</label></th>';
|
| 1776 |
echo '<td><select class="skip-save open-ucp-upsell" id="content_font">';
|
| 1914 |
echo '<tr><th colspan="2"><a id="show-social-icons" href="#" class="js-action">' . __('Show more Social & Contact Icons', 'under-construction-page') . '</a></th></tr>';
|
| 1915 |
|
| 1916 |
echo '</table>';
|
| 1917 |
+
|
| 1918 |
echo '</div>';
|
| 1919 |
|
| 1920 |
self::footer_buttons();
|
| 2167 |
echo '</div>'; // faq
|
| 2168 |
|
| 2169 |
echo '<div style="display: none;" id="tab_support_contact" class="ucp-tab-content">';
|
| 2170 |
+
|
| 2171 |
+
echo '<div id="support-hero"><p>Our average response time is 1.5h! <b>85% of tickets are resolved within 1 hour!</b> No ticket is left unanswered. If something is not working, don\'t think twice;</p><p><a class="button button-primary" href="https://wordpress.org/support/plugin/under-construction-page/#new-post" target="_blank">OPEN A SUPPORT TICKET NOW</a></p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2172 |
|
| 2173 |
+
echo '<p class="description">Our support agents need this info to provide faster & better support. Please include the following data in your message;</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2174 |
echo '<p>WordPress version: <code>' . get_bloginfo('version') . '</code><br>';
|
| 2175 |
echo 'UCP Version: <code>' . self::$version . '</code><br>';
|
| 2176 |
echo 'PHP Version: <code>' . PHP_VERSION . '</code><br>';
|
| 2177 |
echo 'Site URL: <code>' . get_bloginfo('url') . '</code><br>';
|
| 2178 |
echo 'WordPress URL: <code>' . get_bloginfo('wpurl') . '</code><br>';
|
| 2179 |
+
echo 'Theme: <code>' . $theme->get('Name') . ' v' . $theme->get('Version') . '</code>';
|
| 2180 |
+
echo '</p>';
|
| 2181 |
+
|
|
|
|
|
|
|
|
|
|
| 2182 |
echo '</div>'; // contact
|
| 2183 |
|
| 2184 |
echo '</div>'; // tabs
|
| 2339 |
echo '</div>';
|
| 2340 |
// weglot install dialog
|
| 2341 |
|
| 2342 |
+
// notificationx install dialog
|
| 2343 |
+
echo '<div id="notificationx-upsell-dialog" style="display: none;" title="NotificationX"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
|
| 2344 |
+
echo '<div style="padding: 20px; font-size: 14px;">';
|
| 2345 |
+
echo '<ul class="ucp-list">';
|
| 2346 |
+
echo '<li>influence your visitors’ actions using social proof notifications';
|
| 2347 |
+
echo '<li>increase your leads, sales & engagements';
|
| 2348 |
+
echo '<li>boost conversion rates using 4 different types of notification';
|
| 2349 |
+
echo '<li>works out-of-the-box';
|
| 2350 |
+
echo '<li>free plugin available from the official WordPress repository';
|
| 2351 |
+
echo '</ul>';
|
| 2352 |
+
echo '<p class="upsell-footer"><a class="button button-primary" id="install-notificationx">Install & activate NotificationX to display notification bars</a></p>';
|
| 2353 |
+
echo '</div>';
|
| 2354 |
+
echo '</div>';
|
| 2355 |
+
|
| 2356 |
+
if (!self::is_notificationx_really_setup_and_active()) {
|
| 2357 |
+
echo '<div id="notificationx-popup" style="display: none;">
|
| 2358 |
+
<div class="notificationx-popup-icon"><img alt="Notification X" src="' . UCP_PLUGIN_URL . 'images/nx-icon.png' . '"></div>
|
| 2359 |
+
<div class="notificationx-popup-text">435 people rated <br />
|
| 2360 |
+
<div class="notificationx-popup-title">Notification X</div>
|
| 2361 |
+
<div class="notificationx-popup-stars"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></div>
|
| 2362 |
+
</div>
|
| 2363 |
+
<div class="notitificationx-popup-desc">Put a notification like this on your page to instantly influence your visitors</div>
|
| 2364 |
+
<div class="notificationx-popup-close"><span title="Close" class="dashicons dashicons-no"></span></div>
|
| 2365 |
+
</div>';
|
| 2366 |
+
}
|
| 2367 |
+
// notificationx install dialog
|
| 2368 |
+
|
| 2369 |
$promo = self::is_promo_active();
|
| 2370 |
if ($promo == 'welcome') {
|
| 2371 |
$header = 'A <b>welcoming discount</b> has been applied to selected packages! It\'s <b>time limited</b> and available for only another <b class="ucp-countdown">59min 30sec</b>.';
|
| 2533 |
|
| 2534 |
$pointers['welcome'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the <b style="font-weight: 800; font-variant: small-caps;">UnderConstructionPage</b> plugin! Please open <a href="' . admin_url('options-general.php?page=ucp'). '">Settings - UnderConstruction</a> to create a beautiful under construction page.');
|
| 2535 |
$pointers['getting_started'] = array('target' => '.ucp-main-tab li:nth-child(2)', 'edge' => 'top', 'align' => 'left', 'content' => 'Watch the short <a href="https://www.youtube.com/watch?v=RN4XABhK7_w" target="_blank">getting started video</a> to get you up to speed with UCP in no time. If that doesn\'t answer your questions watch the longer <a href="https://www.youtube.com/watch?v=K3DF-NP6Fog" target="_blank">in-depth video walktrough</a>.<br>If you need the videos later, links are in the <a href="#" class="change_tab" data-tab="4">FAQ</a>.');
|
| 2536 |
+
|
| 2537 |
update_option(UCP_POINTERS_KEY, $pointers);
|
| 2538 |
} // reset_pointers
|
| 2539 |
|
| 2711 |
echo '</div>';
|
| 2712 |
} // install_security_ninja
|
| 2713 |
|
| 2714 |
+
// auto download / install / activate NotificationX plugin
|
| 2715 |
+
static function install_notificationx() {
|
| 2716 |
+
if (false === current_user_can('administrator')) {
|
| 2717 |
+
wp_die('Sorry, you have to be an admin to run this action.');
|
| 2718 |
+
}
|
| 2719 |
+
|
| 2720 |
+
$plugin_slug = 'notificationx/notificationx.php';
|
| 2721 |
+
$plugin_zip = 'https://downloads.wordpress.org/plugin/notificationx.latest-stable.zip';
|
| 2722 |
+
|
| 2723 |
+
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
| 2724 |
+
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
| 2725 |
+
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
| 2726 |
+
@include_once ABSPATH . 'wp-admin/includes/file.php';
|
| 2727 |
+
@include_once ABSPATH . 'wp-admin/includes/misc.php';
|
| 2728 |
+
echo '<style>
|
| 2729 |
+
body{
|
| 2730 |
+
font-family: sans-serif;
|
| 2731 |
+
font-size: 14px;
|
| 2732 |
+
line-height: 1.5;
|
| 2733 |
+
color: #444;
|
| 2734 |
+
}
|
| 2735 |
+
</style>';
|
| 2736 |
+
|
| 2737 |
+
echo '<div style="margin: 20px; color:#444;">';
|
| 2738 |
+
echo 'If things are not done in a minute <a target="_parent" href="' . admin_url('plugin-install.php?s=notificationx&tab=search&type=term') .'">install the plugin manually via Plugins page</a><br><br>';
|
| 2739 |
+
echo 'Starting ...<br><br>';
|
| 2740 |
+
|
| 2741 |
+
wp_cache_flush();
|
| 2742 |
+
$upgrader = new Plugin_Upgrader();
|
| 2743 |
+
echo 'Check if NotificationX is already installed ... <br />';
|
| 2744 |
+
if (self::is_plugin_installed($plugin_slug)) {
|
| 2745 |
+
echo 'NotificationX is already installed! <br /><br />Making sure it\'s the latest version.<br />';
|
| 2746 |
+
$upgrader->upgrade($plugin_slug);
|
| 2747 |
+
$installed = true;
|
| 2748 |
+
} else {
|
| 2749 |
+
echo 'Installing NotificationX.<br />';
|
| 2750 |
+
$installed = $upgrader->install($plugin_zip);
|
| 2751 |
+
}
|
| 2752 |
+
wp_cache_flush();
|
| 2753 |
+
|
| 2754 |
+
if (!is_wp_error($installed) && $installed) {
|
| 2755 |
+
echo 'Activating NotificationX.<br />';
|
| 2756 |
+
$activate = activate_plugin($plugin_slug);
|
| 2757 |
+
|
| 2758 |
+
if (is_null($activate)) {
|
| 2759 |
+
echo 'NotificationX Activated.<br />';
|
| 2760 |
+
|
| 2761 |
+
echo '<script>setTimeout(function() { top.location = "options-general.php?page=ucp"; }, 1000);</script>';
|
| 2762 |
+
echo '<br>If you are not redirected in a few seconds - <a href="options-general.php?page=ucp" target="_parent">click here</a>.';
|
| 2763 |
+
}
|
| 2764 |
+
} else {
|
| 2765 |
+
echo 'Could not install NotificationX. You\'ll have to <a target="_parent" href="' . admin_url('plugin-install.php?s=notificationx&tab=search&type=term') .'">download and install manually</a>.';
|
| 2766 |
+
}
|
| 2767 |
+
|
| 2768 |
+
echo '</div>';
|
| 2769 |
+
} // install_notificationx
|
| 2770 |
|
| 2771 |
static function is_plugin_installed($slug) {
|
| 2772 |
if (!function_exists('get_plugins')) {
|
| 2800 |
}
|
| 2801 |
} // is_mailoptin_active
|
| 2802 |
|
| 2803 |
+
|
| 2804 |
+
// check if NotificationX plugin is active
|
| 2805 |
+
static function is_notificationx_really_setup_and_active() {
|
| 2806 |
+
if (!function_exists('is_plugin_active') || !function_exists('get_plugin_data')) {
|
| 2807 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
| 2808 |
+
}
|
| 2809 |
+
|
| 2810 |
+
if (is_plugin_active('notificationx/notificationx.php') && version_compare(NOTIFICATIONX_VERSION,'1.0.3','>=')) {
|
| 2811 |
+
return true;
|
| 2812 |
+
} else {
|
| 2813 |
+
return false;
|
| 2814 |
+
}
|
| 2815 |
+
} // is_notificationx_really_setup_and_active
|
| 2816 |
|
| 2817 |
// check if Weglot plugin is active and min version installed
|
| 2818 |
static function is_weglot_active() {
|
