';
$out .= '
';
} else {
$out .= '
';
}
$out = apply_filters('ucp_footer', $out, $options, $template_id);
return $out;
} // generate_footer
// returnes parsed template
static function get_template($template_id)
{
$vars = array();
$options = self::get_options();
$vars['version'] = self::$version;
$vars['site-url'] = trailingslashit(get_home_url());
$vars['wp-url'] = trailingslashit(get_site_url());
$vars['theme-url'] = trailingslashit(UCP_PLUGIN_URL . 'themes/' . $template_id);
$vars['theme-url-common'] = trailingslashit(UCP_PLUGIN_URL . 'themes');
$vars['title'] = self::parse_vars($options['title']);
$vars['generator'] = esc_attr__('Free UnderConstructionPage plugin for WordPress', 'under-construction-page');
$vars['heading1'] = self::parse_vars($options['heading1']);
$vars['content'] = nl2br(self::parse_vars($options['content']));
$vars['description'] = self::parse_vars($options['description']);
$vars['social-icons'] = self::generate_social_icons($options, $template_id);
$vars['head'] = self::generate_head($options, $template_id);
$vars['footer'] = self::generate_footer($options, $template_id);
$vars = apply_filters('ucp_get_template_vars', $vars, $template_id, $options);
ob_start();
require UCP_PLUGIN_DIR . 'themes/' . $template_id . '/index.php';
$template = ob_get_clean();
foreach ($vars as $var_name => $var_value) {
$var_name = '[' . $var_name . ']';
$template = str_ireplace($var_name, $var_value, $template);
}
$template = apply_filters('ucp_get_template', $template, $vars, $options);
return $template;
} // get_template
// checks if construction mode is enabled for the current visitor
static function is_construction_mode_enabled($settings_only = false)
{
$options = self::get_options();
$current_user = wp_get_current_user();
$override_status = apply_filters('ucp_is_construction_mode_enabled', null, $options);
if (is_bool($override_status)) {
return $override_status;
}
// just check if it's generally enabled
if ($settings_only) {
if ($options['status']) {
return true;
} else {
return false;
}
} else {
// check if enabled for current user
if (!$options['status']) {
return false;
} elseif (self::user_has_role($options['whitelisted_roles'])) {
return false;
} elseif (in_array($current_user->ID, $options['whitelisted_users'])) {
return false;
} elseif (strlen($options['end_date']) === 16 && $options['end_date'] !== '0000-00-00 00:00' && $options['end_date'] < current_time('mysql')) {
return false;
} else {
return true;
}
}
} // is_construction_mode_enabled
// check if user has the specified role
static function user_has_role($roles)
{
$current_user = wp_get_current_user();
if ($current_user->roles) {
$user_role = $current_user->roles[0];
} else {
$user_role = 'guest';
}
return in_array($user_role, $roles);
} // user_has_role
// frontend notification when UCP is enabled but current user is whitelisted
static function whitelisted_notice()
{
$notices = get_option(UCP_NOTICES_KEY);
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
$dismiss_url = add_query_arg(array('action' => 'ucp_dismiss_notice', 'notice' => 'whitelisted', 'redirect' => $redirect_url), admin_url('admin.php'));
$dismiss_url = wp_nonce_url($dismiss_url, 'ucp_dismiss_notice');
if (
empty($notices['dismiss_whitelisted']) &&
is_user_logged_in() &&
self::is_construction_mode_enabled(true) &&
!self::is_construction_mode_enabled(false)
)
// keeping everything inline due to minimal CSS
self::wp_kses_wf('
');
} // whitelisted_notification
// displays various notices in admin header
static function admin_notices()
{
$notices = get_option(UCP_NOTICES_KEY);
$options = self::get_options();
$meta = self::get_meta();
$current_user = wp_get_current_user();
$shown = false;
$promo = self::is_promo_active();
$name = '';
if (!empty($current_user->user_firstname)) {
$name = ' ' . $current_user->user_firstname;
}
// pro activated - update
if (self::is_plugin_page() && UCP_license::is_activated()) {
echo '
';
echo '
Thank you for purchasing UnderConstructionPage PRO! Your license has been verified and activated.
To start using the PRO version, please follow these steps:
';
echo '
';
echo '- Download the latest version of the PRO plugin.
';
echo '- Go to Plugins - Add New - Upload Plugin and upload the ZIP you just downloaded.
';
echo '- If asked to replace (overwrite) the free version - confirm it.
';
echo '- Activate the plugin.
';
echo '- That\'s it, no more steps.
';
echo '
';
echo '
';
$shown = true;
return;
}
// ask for rating; disabled
if (
false && empty($notices['dismiss_rate']) &&
(time() - $meta['first_install']) > (DAY_IN_SECONDS * 1.0)
) {
$rate_url = 'https://wordpress.org/support/plugin/under-construction-page/reviews/#new-post';
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
$dismiss_url = add_query_arg(array('action' => 'ucp_dismiss_notice', 'notice' => 'rate', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$dismiss_url = wp_nonce_url($dismiss_url, 'ucp_dismiss_notice');
echo '
';
$shown = true;
}
// end date in past
if (self::is_plugin_page() && self::is_construction_mode_enabled(true) && !empty($options['end_date']) && $options['end_date'] != '0000-00-00 00:00' && $options['end_date'] < current_time('mysql')) {
echo '
Under construction mode is enabled but the end date is set to a past date so the under construction page will not be shown. Either move the end date to a future date or disable it.
';
$shown = true;
}
// ask for translation
// disabled till further notice
if (
false && self::is_plugin_page() &&
empty($notices['dismiss_translate']) &&
(time() - $meta['first_install']) > 1
) {
$translate_url = self::generate_web_link('translate-notification', 'translate-the-plugin/');
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
$dismiss_url = add_query_arg(array('action' => 'ucp_dismiss_notice', 'notice' => 'translate', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$dismiss_url = wp_nonce_url($dismiss_url, 'ucp_dismiss_notice');
echo '
';
$shown = true;
}
// promo for new users
if (
self::is_plugin_page() &&
empty($notices['dismiss_welcome']) &&
!$shown && $promo == 'welcome'
) {
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
$dismiss_url = add_query_arg(array('action' => 'ucp_dismiss_notice', 'notice' => 'welcome', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$dismiss_url = wp_nonce_url($dismiss_url, 'ucp_dismiss_notice');
echo '
';
$shown = true;
}
// promo for old users
if (
self::is_plugin_page() &&
empty($notices['dismiss_olduser']) &&
!$shown && $promo == 'olduser'
) {
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
$dismiss_url = add_query_arg(array('action' => 'ucp_dismiss_notice', 'notice' => 'olduser', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$dismiss_url = wp_nonce_url($dismiss_url, 'ucp_dismiss_notice');
echo '
';
$shown = true;
}
} // notices
// handle dismiss button for notices
static function dismiss_notice()
{
check_admin_referer( 'ucp_dismiss_notice' );
if (empty($_GET['notice'])) {
wp_safe_redirect(admin_url());
exit;
}
$notices = get_option(UCP_NOTICES_KEY, array());
$notice = sanitize_text_field(wp_unslash($_GET['notice']));
if ($notice == 'rate') {
$notices['dismiss_rate'] = true;
} elseif ($notice == 'translate') {
$notices['dismiss_translate'] = true;
} elseif ($notice == 'whitelisted') {
$notices['dismiss_whitelisted'] = true;
} elseif ($notice == 'olduser') {
$notices['dismiss_olduser'] = true;
} elseif ($notice == 'welcome') {
$notices['dismiss_welcome'] = true;
} else {
wp_safe_redirect(admin_url());
exit;
}
update_option(UCP_NOTICES_KEY, $notices);
if (!empty($_GET['redirect'])) {
wp_safe_redirect(wp_unslash($_GET['redirect']));
} else {
wp_safe_redirect(admin_url());
}
exit;
} // dismiss_notice
// reset all settings to default values
static function reset_settings()
{
check_admin_referer('ucp_reset_settings');
if (false === current_user_can('administrator')) {
wp_safe_redirect(admin_url());
exit;
}
$options = self::default_options();
update_option(UCP_OPTIONS_KEY, $options);
if (!empty($_GET['redirect'])) {
wp_safe_redirect(wp_unslash($_GET['redirect']));
} else {
wp_safe_redirect(admin_url());
}
exit;
} // reset_settings
// change status via admin bar
static function change_status()
{
check_admin_referer('ucp_change_status');
if (false === current_user_can('administrator') || empty($_GET['new_status'])) {
wp_safe_redirect(admin_url());
exit;
}
$options = self::get_options();
if (sanitize_text_field(wp_unslash($_GET['new_status'])) == 'enabled') {
$options['status'] = '1';
} else {
$options['status'] = '0';
}
update_option(UCP_OPTIONS_KEY, $options);
if (!empty($_GET['redirect'])) {
wp_safe_redirect(wp_unslash($_GET['redirect']));
} else {
wp_safe_redirect(admin_url());
}
exit;
} // change_status
static function admin_bar_style()
{
// admin bar has to be anabled, user an admin and custom filter true
if (false === is_admin_bar_showing() || false === current_user_can('administrator') || false === apply_filters('ucp_show_admin_bar', true)) {
return;
}
// no sense in loading a new CSS file for 2 lines of CSS
echo '';
} // admin_bar_style
// add admin bar menu and status
static function admin_bar()
{
global $wp_admin_bar;
// only show to admins
if (false === current_user_can('administrator') || false === apply_filters('ucp_show_admin_bar', true)) {
return;
}
$redirect_url = '';
if(isset($_SERVER['REQUEST_URI'])){
$redirect_url = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
}
if (self::is_construction_mode_enabled(true)) {
$main_label = '
' . esc_attr__('UnderConstruction', 'under-construction-page') . ' ●';
$class = 'ucp-enabled';
$action_url = add_query_arg(array('action' => 'ucp_change_status', 'new_status' => 'disabled', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$action_url = wp_nonce_url($action_url, 'ucp_change_status');
$action = esc_attr__('Under Construction Mode', 'under-construction-page');
$action .= '
OFFON';
} else {
$main_label = '
' . esc_attr__('UnderConstruction', 'under-construction-page') . ' ●';
$class = 'ucp-disabled';
$action_url = add_query_arg(array('action' => 'ucp_change_status', 'new_status' => 'enabled', 'redirect' => urlencode($redirect_url)), admin_url('admin.php'));
$action_url = wp_nonce_url($action_url, 'ucp_change_status');
$action = esc_attr__('Under Construction Mode', 'under-construction-page');
$action .= '
OFFON';
}
$wp_admin_bar->add_menu(array(
'parent' => '',
'id' => 'under-construction-page',
'title' => $main_label,
'href' => admin_url('options-general.php?page=ucp'),
'meta' => array('class' => $class)
));
$wp_admin_bar->add_node(array(
'id' => 'ucp-status',
'title' => $action,
'href' => false,
'parent' => 'under-construction-page'
));
$wp_admin_bar->add_node(array(
'id' => 'ucp-preview',
'title' => esc_attr__('Preview', 'under-construction-page'),
'meta' => array('target' => 'blank'),
'href' => get_home_url() . '/?ucp_preview',
'parent' => 'under-construction-page'
));
$wp_admin_bar->add_node(array(
'id' => 'ucp-settings',
'title' => esc_attr__('Settings', 'under-construction-page'),
'href' => admin_url('options-general.php?page=ucp'),
'parent' => 'under-construction-page'
));
} // admin_bar
// show under construction notice on WP login form
static function login_message($message)
{
if (self::is_construction_mode_enabled(true)) {
$message .= '
' . __('Under Construction Mode is enabled.', 'under-construction-page') . '
';
}
return $message;
} // login_notice
// add settings link to plugins page
static function plugin_action_links($links)
{
$settings_link = '
' . esc_attr__('Settings', 'under-construction-page') . '';
$pro_link = '
' . __('Go PRO', 'under-construction-page') . '';
array_unshift($links, $pro_link);
array_unshift($links, $settings_link);
return $links;
} // plugin_action_links
// add links to plugin's description in plugins table
static function plugin_meta_links($links, $file)
{
$support_link = '
' . esc_attr__('Support', 'under-construction-page') . '';
$pro_link = '
' . __('Get the PRO version', 'under-construction-page') . '';
if ($file == plugin_basename(__FILE__)) {
$links[] = $support_link;
$links[] = $pro_link;
}
return $links;
} // plugin_meta_links
// additional powered by text in admin footer; only on UCP page
static function admin_footer_text($text)
{
if (!self::is_plugin_page()) {
return $text;
}
$text = '
' . esc_attr__('UnderConstructionPage', 'under-construction-page') . ' v' . self::$version . ' by ' . esc_attr__('WebFactory Ltd', 'under-construction-page') . '. Please rate the plugin ★★★★★ to help us spread the word. Thank you!';
return $text;
} // admin_footer_text
// fix for opening the plugin install modal
static function admin_footer()
{
//phpcs:ignore as no nonce needed
if (empty($_GET['fix-install-button']) || empty($_GET['tab']) || sanitize_text_field(wp_unslash($_GET['tab'])) != 'plugin-information') { //phpcs:ignore
return;
}
echo '';
} // admin_footer
// test if we're on plugin's page
static function is_plugin_page()
{
$current_screen = get_current_screen();
if ($current_screen->id == 'settings_page_ucp') {
return true;
} else {
return false;
}
} // is_plugin_page
// create the admin menu item
static function admin_menu()
{
add_options_page(esc_attr__('UnderConstruction', 'under-construction-page'), esc_attr__('UnderConstruction', 'under-construction-page'), 'manage_options', 'ucp', array(__CLASS__, 'main_page'));
} // admin_menu
// all settings are saved in one option
static function register_settings()
{
//phpcs:ignore as 3rd param is sanitize_settings callback
register_setting(UCP_OPTIONS_KEY, UCP_OPTIONS_KEY, array(__CLASS__, 'sanitize_settings'));//phpcs:ignore
} // register_settings
// set default settings
static function default_options()
{
$defaults = array(
'status' => '0',
'license_key' => '',
'license_active' => false,
'license_expires' => '1900-01-01',
'license_type' => '',
'end_date' => '',
'ga_tracking_id' => '',
'theme' => 'mad_designer',
'custom_css' => '',
'title' => '[site-title] is under construction',
'description' => '[site-tagline]',
'heading1' => esc_attr__('Sorry, we\'re doing some work on the site', 'under-construction-page'),
'content' => esc_attr__('Thank you for being patient. We are doing some work on the site and will be back shortly.', 'under-construction-page'),
'social_facebook' => '',
'social_twitter' => '',
'social_linkedin' => '',
'social_youtube' => '',
'social_vimeo' => '',
'social_pinterest' => '',
'social_dribbble' => '',
'social_behance' => '',
'social_instagram' => '',
'social_tumblr' => '',
'social_vk' => '',
'social_email' => '',
'social_phone' => '',
'social_skype' => '',
'social_telegram' => '',
'social_whatsapp' => '',
'login_button' => '1',
'linkback' => '0',
'whitelisted_roles' => array('administrator'),
'whitelisted_users' => array()
);
return $defaults;
} // default_options
// sanitize settings on save
static function sanitize_settings($options)
{
$old_options = self::get_options();
foreach ($options as $key => $value) {
switch ($key) {
case 'title':
case 'description':
$options[$key] = trim(wp_strip_all_tags($value));
break;
case 'heading1':
case 'content':
$options[$key] = trim(wp_kses($value, wp_kses_allowed_html('post')));
break;
case 'custom_css':
case 'social_facebook':
case 'social_twitter':
case 'social_linkedin':
case 'social_youtube':
case 'social_vimeo':
case 'social_pinterest':
case 'social_dribbble':
case 'social_behance':
case 'social_instagram':
case 'social_tumblr':
case 'social_vk':
case 'social_email':
case 'social_phone':
case 'social_telegram':
case 'social_whatsapp':
case 'license_key':
$options[$key] = trim(wp_strip_all_tags($value));
break;
case 'ga_tracking_id':
$options[$key] = substr(strtoupper(trim($value)), 0, 15);
break;
case 'end_date':
$options[$key] = substr(trim($value), 0, 16);
break;
} // switch
} // foreach
$options['title'] = wp_kses_post(wp_unslash($options['title']));
$options['description'] = wp_kses_post(wp_unslash($options['description']));
$options['heading1'] = wp_kses_post(wp_unslash($options['heading1']));
$options['content'] = wp_kses_post(wp_unslash($options['content']));
$options['whitelisted_roles'] = empty($options['whitelisted_roles']) ? array() : $options['whitelisted_roles'];
$options['whitelisted_users'] = empty($options['whitelisted_users']) ? array() : $options['whitelisted_users'];
$options = self::check_var_isset($options, array('status' => 0, 'linkback' => 0, 'login_button' => 0));
if (empty($options['end_date_toggle'])) {
$options['end_date'] = '';
}
if ($options['end_date'] == '0000-00-00 00:00') {
$options['end_date'] = '';
}
unset($options['end_date_toggle']);
if (empty($options['ga_tracking_toggle'])) {
$options['ga_tracking_id'] = '';
}
if (!empty($options['ga_tracking_id']) && preg_match('/^UA-\d{3,}-\d{1,3}$/', $options['ga_tracking_id']) === 0) {
add_settings_error('ucp', 'ga_tracking_id', esc_attr__('Please enter a valid Google Analytics Tracking ID or disable tracking.', 'under-construction-page'));
}
unset($options['ga_tracking_toggle']);
//phpcs:ignore as options save nonce is already vefified by the time we get here
if (!empty($_POST['license-submit'])) { //phpcs:ignore
if (empty($options['license_key'])) {
$options['license_type'] = '';
$options['license_expires'] = '1900-01-01';
$options['license_active'] = false;
$options['license_key'] = '';
add_settings_error(UCP_OPTIONS_KEY, 'license_key', esc_attr__('License key saved.', 'under-construction-page'), 'updated');
} else {
$tmp = UCP_license::validate_license_key($options['license_key']);
if ($tmp['success']) {
$options['license_type'] = $tmp['license_type'];
$options['license_expires'] = $tmp['license_expires'];
$options['license_active'] = $tmp['license_active'];
if ($tmp['license_active']) {
add_settings_error(UCP_OPTIONS_KEY, 'license_key', esc_attr__('License key saved and activated!', 'under-construction-page'), 'updated');
} else {
add_settings_error(UCP_OPTIONS_KEY, 'license_key', 'License not active. ' . $tmp['error'], 'error');
}
} else {
add_settings_error(UCP_OPTIONS_KEY, 'license_key', 'Unable to contact licensing server. Please try again in a few moments.', 'error');
}
}
} // update license
// empty cache in 3rd party plugins
if ($options != $old_options) {
$notices = get_option(UCP_NOTICES_KEY);
if(is_array($notices) && array_key_exists('dismiss_whitelisted', $notices)){
unset($notices['dismiss_whitelisted']);
update_option(UCP_NOTICES_KEY, $notices);
}
self::empty_cache();
}
return array_merge($old_options, $options);
} // sanitize_settings
static function empty_cache()
{
wp_cache_flush();
if (function_exists('w3tc_flush_all')) {
w3tc_flush_all();
}
if (function_exists('wp_cache_clear_cache')) {
wp_cache_clear_cache();
}
if (method_exists('LiteSpeed_Cache_API', 'purge_all')) {
LiteSpeed_Cache_API::purge_all();
}
if (class_exists('Endurance_Page_Cache')) {
$epc = new Endurance_Page_Cache;
$epc->purge_all();
}
if (class_exists('SG_CachePress_Supercacher') && method_exists('SG_CachePress_Supercacher', 'purge_cache')) {
SG_CachePress_Supercacher::purge_cache(true);
}
if (class_exists('SiteGround_Optimizer\Supercacher\Supercacher')) {
SiteGround_Optimizer\Supercacher\Supercacher::purge_cache();
}
if (isset($GLOBALS['wp_fastest_cache']) && method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')) {
$GLOBALS['wp_fastest_cache']->deleteCache(true);
}
if (is_callable(array('Swift_Performance_Cache', 'clear_all_cache'))) {
Swift_Performance_Cache::clear_all_cache();
}
if (is_callable(array('Hummingbird\WP_Hummingbird', 'flush_cache'))) {
Hummingbird\WP_Hummingbird::flush_cache(true, false);
}
if (function_exists('rocket_clean_domain')) {
rocket_clean_domain();
}
do_action('cache_enabler_clear_complete_cache');
} // empty_cache
// checkbox helper function
static function checked($value, $current, $echo = false)
{
$out = '';
if (!is_array($current)) {
$current = (array) $current;
}
if (in_array($value, $current)) {
$out = ' checked="checked" ';
}
if ($echo) {
self::wp_kses_wf($out);
} else {
return $out;
}
} // checked
// helper function for saving options, mostly checkboxes
static function check_var_isset($values, $variables)
{
foreach ($variables as $key => $value) {
if (!isset($values[$key])) {
$values[$key] = $value;
}
}
return $values;
} // check_var_isset
// helper function for creating dropdowns
static function create_select_options($options, $selected = null, $output = true)
{
$out = "\n";
if (!is_array($selected)) {
$selected = array($selected);
}
foreach ($options as $tmp) {
$data = '';
if (isset($tmp['disabled'])) {
$data .= ' disabled="disabled" ';
}
if (in_array($tmp['val'], $selected)) {
$out .= "
\n";
} else {
$out .= "
\n";
}
} // foreach
if ($output) {
UCP::wp_kses_wf($out);
} else {
return $out;
}
} // create_select_options
// helper function to generate tagged buy links
static function generate_web_link($placement = '', $page = '/', $params = array(), $anchor = '')
{
$base_url = 'https://underconstructionpage.com';
if ('/' != $page) {
$page = '/' . trim($page, '/') . '/';
}
if ($page == '//') {
$page = '/';
}
if ($placement) {
$placement = trim($placement, '-');
$placement = '-' . $placement;
}
$parts = array_merge(array('ref' => 'ucp-free' . $placement), $params);
if (!empty($anchor)) {
$anchor = '#' . trim($anchor, '#');
}
$out = $base_url . $page . '?' . http_build_query($parts, '', '&') . $anchor;
return $out;
} // generate_web_link
// first, main tab content
static function tab_main()
{
$options = self::get_options();
$default_options = self::default_options();
echo '
';
self::footer_buttons();
} // tab_main
static function tab_content()
{
global $wpdb;
$options = self::get_options();
$default_options = self::default_options();
echo '
';
if (!self::is_weglot_active()) {
echo '
';
}
echo '
';
self::footer_buttons();
echo '
' . esc_attr__('Social & Contact Icons', 'under-construction-page') . '
';
echo '
';
echo '
';
self::footer_buttons();
} // tab_content
static function get_themes()
{
$themes = array(
'_pro_custom' => esc_attr__('Build Your Own Custom Theme', 'under-construction-page'),
'mad_designer' => esc_attr__('Mad Designer', 'under-construction-page'),
'_pro_simple-beige' => esc_attr__('Simple Beige Text', 'under-construction-page'),
'plain_text' => esc_attr__('Plain Text', 'under-construction-page'),
'_pro_simple-office-theme' => esc_attr__('Simple Office', 'under-construction-page'),
'under_construction' => esc_attr__('Under Construction', 'under-construction-page'),
'_pro_model-portfolio' => esc_attr__('Model Portfolio', 'under-construction-page'),
'dark' => esc_attr__('Things Went Dark', 'under-construction-page'),
'_pro_watch-company' => esc_attr__('The Watch Store', 'under-construction-page'),
'forklift' => esc_attr__('Forklift at Work', 'under-construction-page'),
'_pro_sport-shop' => esc_attr__('Sport Shop', 'under-construction-page'),
'under_construction_text' => esc_attr__('Under Construction Text', 'under-construction-page'),
'_pro_cloud-business-inc' => esc_attr__('Cloud Business', 'under-construction-page'),
'cyber_chick' => esc_attr__('Cyber Chick', 'under-construction-page'),
'_pro_photography' => esc_attr__('Photography', 'under-construction-page'),
'rocket' => esc_attr__('Rocket Launch', 'under-construction-page'),
'_pro_smoothie' => esc_attr__('Green Smoothie Webinar', 'under-construction-page'),
'loader' => esc_attr__('Loader at Work', 'under-construction-page'),
'_pro_stunning-nature' => esc_attr__('Stunning Nature', 'under-construction-page'),
'cyber_chick_dark' => esc_attr__('Cyber Chick Dark', 'under-construction-page'),
'_pro_small-office' => esc_attr__('Small Office', 'under-construction-page'),
'safe' => esc_attr__('Safe', 'under-construction-page'),
'people' => esc_attr__('People at Work', 'under-construction-page'),
'_pro_custom' => esc_attr__('Build Your Own Custom Theme', 'under-construction-page'),
'windmill' => esc_attr__('Windmill', 'under-construction-page'),
'sad_site' => esc_attr__('Sad Site', 'under-construction-page'),
'_pro-soothing-nature' => esc_attr__('Soothing Nature', 'under-construction-page'),
'lighthouse' => esc_attr__('Lighthouse', 'under-construction-page'),
'hot_air_baloon' => esc_attr__('Hot Air Balloon', 'under-construction-page'),
'_pro_business-statistics' => esc_attr__('Business Statistics', 'under-construction-page'),
'people_2' => esc_attr__('People at Work #2', 'under-construction-page'),
'rocket_2' => esc_attr__('Rocket Launch #2', 'under-construction-page'),
'_pro_travel-blog' => esc_attr__('Travel Blog', 'under-construction-page'),
'light_bulb' => esc_attr__('Light Bulb', 'under-construction-page'),
'ambulance' => esc_attr__('Ambulance', 'under-construction-page'),
'_pro_forest-in-the-fog' => esc_attr__('Forest in the Fog', 'under-construction-page'),
'laptop' => esc_attr__('Laptop', 'under-construction-page'),
'puzzles' => esc_attr__('Puzzles', 'under-construction-page'),
'_pro_sunset' => esc_attr__('Sunset', 'under-construction-page'),
'iot' => esc_attr__('Internet of Things', 'under-construction-page'),
'setup' => esc_attr__('Setup', 'under-construction-page'),
'_pro_fitness-studio' => esc_attr__('Fitness Studio Landing Page', 'under-construction-page'),
'stop' => esc_attr__('Stop', 'under-construction-page'),
'clock' => esc_attr__('Clock', 'under-construction-page'),
'_pro_mountain' => esc_attr__('Mountain Peak', 'under-construction-page'),
'bulldozer' => esc_attr__('Bulldozer at Work', 'under-construction-page'),
'christmas' => esc_attr__('Christmas Greetings', 'under-construction-page'),
'_pro_pink-lips' => esc_attr__('Pink Lips', 'under-construction-page'),
'hard_worker' => esc_attr__('Hard Worker', 'under-construction-page'),
'closed' => esc_attr__('Temporarily Closed', 'under-construction-page'),
'_pro_animated-green' => esc_attr__('Simple Green Animated', 'under-construction-page'),
'dumper_truck' => esc_attr__('Dumper Truck', 'under-construction-page'),
'000webhost' => esc_attr__('000webhost', 'under-construction-page'),
'_pro_grayscale-city' => esc_attr__('Grayscale City', 'under-construction-page'),
'work_desk' => esc_attr__('Work Desk', 'under-construction-page'),
'research' => esc_attr__('Research', 'under-construction-page'),
'_pro_wedding' => esc_attr__('Wedding', 'under-construction-page')
);
$themes = apply_filters('ucp_themes', $themes);
return $themes;
} // get_themes
static function tab_design()
{
$options = self::get_options();
$img_path = UCP_PLUGIN_URL . 'images/thumbnails/';
$themes = self::get_themes();
echo '
';
self::footer_buttons();
} // tab_design
// markup & logic for access tab
static function tab_access()
{
$options = self::get_options();
$default_options = self::default_options();
$roles = $users = array();
$tmp_roles = get_editable_roles();
foreach ($tmp_roles as $tmp_role => $details) {
$name = translate_user_role($details['name']);
$roles[] = array('val' => $tmp_role, 'label' => $name);
}
$tmp_users = get_users(array('fields' => array('id', 'display_name')));
foreach ($tmp_users as $user) {
$users[] = array('val' => $user->id, 'label' => $user->display_name);
}
echo '
';
self::footer_buttons();
} // tab_access
// support tab - FAQ and links
static function tab_support()
{
$user = wp_get_current_user();
$theme = wp_get_theme();
$options = self::get_options();
echo '
';
echo '
';
echo '
';
echo '
Do you have any documentation?
Yes, detailed documentation with how-to guides is available on the plugins\'s site.
';
echo '
Do you have a video to help me get started?
We sure do! Getting started with the UnderConstructionPage plugin. If that doesn\'t help we also have an in-depth video walktrough. In case you\'re still uncertain about something don\'t hesitate to contact our friendly support.
';
echo '
UCP is disabled but Twitter and Facebook still show it as my site\'s preview/thumbnail when I post the URL
Twitter and Facebook have their own cache which has to be refreshed. You can either wait and the problem will resolve itself in about a day or you can manually refresh the cache.
For Facebook open the Debugger, input the URL, click "Debug". Once the results who up click "Scrape Again" to fetch the latest version of the page.
For Twitter, open the Card validator, enter the URL and click "Preview card". Latest version of the site should appear.
';
echo '
How can I build a custom page or customize themes?
If you know how to code custom CSS a lot can be accomplished by using the custom CSS option. A much faster and easier solution is to check out UCP PRO with an easy-to-use drag&drop builder and dozens of pre-built themes.
';
echo '
How can I check if construction mode is really enabled on my site?
If the under construction status is green in the admin bar (the very top of the page, above this text), then it\'s enabled. But we made a tool specifically for these kinds of situations so you can double-check everything. Run under construction mode tester.
';
echo '
How can I work on my site while construction mode is enabled?
Make sure your user role (probably admin) is selected under Access - Whitelisted User Roles and open the site while logged in.
';
echo '
How can I log in / access WordPress admin after construction mode has been enabled?
Enable the Login Button option under Content, and a login link will be shown in the lower right corner of the under construction page.
';
echo '
How do I add my logo to the page?
Head over to Content and click "Add Media". Upload/select the logo, position it as you see fit and add other content.
';
echo '
I\'ve made changes to UCP, but they are not visible. What do I do?
Click "Save Changes" one more time. Open your site and force refresh browser cache (Ctrl or Shift + F5). If that doesn\'t help it means you have a caching plugin installed. Purge/delete cache in that plugin or disable it.
';
echo '
How can I get more designs? Where do I download them?
We update the plugin every 7-10 days and each update comes with at least one new theme/design. There is no other way of getting more designs nor a place to download them.
';
echo '
How can I edit designs?
There is an option to add custom CSS. If you want more than that you will have to edit the source files located in /under-construction-page/themes/
.
';
echo '
I have disabled UCP but the under construction page is still visible. How do I remove it?
Open your site and force refresh browser cache (Ctrl or Shift + F5). If that doesn\'t help it means you have a caching plugin installed. Purge/delete cache in that plugin or disable it. If that fails too contact your hosting provider and ask to empty the site cache for you.
';
echo '
I have disabled UCP but the site\'s favicon is still the UCP logo. How do I change/remove it?
Make sure your theme has a favicon defined and empty all caches - browser and server ones. Open the site and force refresh browser cache (Ctrl or Shift + F5). If that doesn\'t help it means you have a caching plugin installed. Purge/delete cache in that plugin or disable it. If that fails too contact your hosting provider and ask to empty the site cache for you.
';
echo '
'; // faq
echo '
';
echo '
Our average response time is 1.5h! 85% of tickets are resolved within 1 hour! No ticket is left unanswered. If something is not working, don\'t think twice;
OPEN A SUPPORT TICKET NOW
';
echo '
Our support agents need this info to provide faster & better support. Please include the following data in your message;
';
echo '
WordPress version: ' . esc_html(get_bloginfo('version')) . '
';
echo 'UCP Version: ' . esc_attr(self::$version) . '
';
echo 'PHP Version: ' . esc_attr(PHP_VERSION) . '
';
echo 'Site URL: ' . esc_url(get_bloginfo('url')) . '
';
echo 'WordPress URL: ' . esc_url(get_bloginfo('wpurl')) . '
';
echo 'Theme: ' . esc_attr($theme->get('Name') . ' v' . $theme->get('Version')) . '
';
echo '
';
echo '
'; // contact
echo '
'; // tabs
} // tab_support
// tab PRO
static function tab_pro()
{
$options = self::get_options();
echo '
';
echo '
 . 'images/ucp_pro_logo.png)
';
if (UCP_license::is_activated()) {
$plugin = plugin_basename(__FILE__);
$update_url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . urlencode($plugin)), 'upgrade-plugin_' . $plugin);
} else {
echo '
';
}
echo '
';
echo '
';
echo '
';
self::wp_kses_wf(get_submit_button(esc_attr__('Save & Validate License Key', 'under-construction-page'), 'large secondary', 'license-submit', false));
echo '
';
} // tab_pro
// output the whole options page
static function main_page()
{
if (!current_user_can('manage_options')) {
wp_die('You do not have sufficient permissions to access this page.');
}
echo '
 . 'images/ucp_logo.png)
 . 'images/ucp_logo_2.png)
';
echo '
'; // ucp_tabs
echo '';
echo '
'; // wrap
// weglot install dialog
echo '
';
echo '
';
echo '
';
echo '- Best-rated WordPress multilingual plugin
';
echo '- Simple 5-minute set-up. No coding required
';
echo '- Accelerated translation management: Machine & human translations with access to professional translators
';
echo '- Compatible with any WordPress theme or plugin
';
echo '- Optimized for multilingual SEO
';
echo '- 10-day Free trial and free plan available
';
echo '
';
echo '';
echo '
';
echo '
';
// weglot install dialog
$promo = self::is_promo_active();
if ($promo == 'welcome') {
$header = 'A
welcoming discount has been applied to selected packages! It\'s
time limited and available for only another
59min 30sec.';
} elseif ($promo == 'olduser') {
$header = 'A special
discount for long-term users has been applied to selected packages!';
} else {
$header = '';
}
$products['agency'] = array('link' => self::generate_web_link('pricing-table', 'buy2/', array('product' => 'agency-welcome')), 'price' => 'BUY NOW
$51 OFF$250 $199
Discount ends in 59min 30sec');
$products['team'] = array('link' => self::generate_web_link('pricing-table', 'buy2/', array('product' => 'team-welcome')), 'price' => 'BUY NOW
$30 OFF$119 $89
Discount ends in 59min 30sec');
$products['personal-monthly'] = array('link' => self::generate_web_link('pricing-table', 'buy2/', array('product' => 'personal-monthly')), 'price' => 'only $8.99
/month');
$products['personal-yearly'] = array('link' => self::generate_web_link('pricing-table', 'buy2/', array('product' => 'personal-yearly')), 'price' => 'BUY NOW
$49
/year');
// upsell dialog
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
Frictionless Drag & Drop Builder';
echo '
Forget about complicated, cumbersome builders that have too many options! UCP builder was purpose-built for the task at hand. Simple, user-friendly & has only the options you need to build pages fast!
';
echo '
';
echo '
';
echo '
5+ Million HD Searchable Images';
echo '
There\'s nothing worse than googling for hours just to find that the perfect image you need is either copyrighted or too small. Enjoy a vast library of 4K+ sized images - categorized & copyright free!
';
echo '
';
echo '
';
echo '
350+ Templates';
echo '
Building your own page from scratch is fun, but often you don\'t have time to do it! Use one of our purpose-built templates, change a few lines of text and you\'re ready to rock!
';
echo '
';
echo '
';
echo '
Affiliate & Traffic Tracking';
echo '
Having traffic is nice. Having targeted traffic is better! Generate tracked inbound links & share them on social media or with your affiliates to pinpoint the best traffic sources.
';
echo '
';
echo '
';
echo '
Unlimited 3rd Party Integrations';
echo '
With our unique universal autoresponder support, you can integrate any email autoresponder or webinar system in a page within seconds. Or push data to Zapier to more than 1,000 applications.
';
echo '
';
echo '
';
echo '
Made for Agencies & Webmasters';
echo '
Creating sites for others? We have your back! Our features, support & licensing options are optimised for agencies while in-house, USA based support guarantee your peace of mind.
';
echo '
';
echo '';
echo '
'; // features tab
echo '
';
if (!empty($header)) {
echo '';
}
echo '
';
echo '';
echo '
'; // pricing tab
echo '
';
echo '
'; // upsell-dialog
} // main_page
// tests if any of the promotions are active and if so returns the name
static function is_promo_active()
{
$meta = self::get_meta();
if ((time() - $meta['first_install']) < HOUR_IN_SECONDS) {
return 'welcome';
}
if ((time() - $meta['first_install']) > DAY_IN_SECONDS * 35) {
return 'olduser';
}
return false;
} // is_promo_active
// save and preview buttons
static function footer_buttons()
{
echo '
';
self::wp_kses_wf(get_submit_button(esc_attr__('Save Changes', 'under-construction-page'), 'primary large', 'submit', false));
echo ' ' . esc_attr__('Preview', 'under-construction-page') . '';
echo '
';
} // footer_buttons
// reset all pointers to default state - visible
static function reset_pointers()
{
$pointers = array();
$pointers['welcome'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for installing the
UnderConstructionPage plugin! Please open
Settings - UnderConstruction to create a beautiful under construction page.');
$pointers['getting_started'] = array('target' => '.ucp-main-tab li:nth-child(2)', 'edge' => 'top', 'align' => 'left', 'content' => 'Watch the short
getting started video to get you up to speed with UCP in no time. If that doesn\'t answer your questions watch the longer
in-depth video walktrough.
If you need the videos later, links are in the
FAQ.');
update_option(UCP_POINTERS_KEY, $pointers);
} // reset_pointers
// auto download / install / activate Weglot plugin
static function install_weglot()
{
check_ajax_referer('install_weglot');
if (false === current_user_can('administrator')) {
wp_die('Sorry, you have to be an admin to run this action.');
}
$plugin_slug = 'weglot/weglot.php';
$plugin_zip = 'https://downloads.wordpress.org/plugin/weglot.latest-stable.zip';
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
@include_once ABSPATH . 'wp-admin/includes/file.php';
@include_once ABSPATH . 'wp-admin/includes/misc.php';
echo '';
echo '
';
echo 'If things are not done in a minute
install the plugin manually via Plugins page';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if Weglot is already installed ...
';
if (self::is_plugin_installed($plugin_slug)) {
echo 'Weglot is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing Weglot.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating Weglot.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'Weglot Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here.';
}
} else {
echo 'Could not install Weglot. You\'ll have to
download and install manually.';
}
echo '
';
} // install_weglot
// auto download / install / activate WP Force SSL plugin
static function install_wpfssl()
{
check_ajax_referer('install_wpfssl');
if (false === current_user_can('administrator')) {
wp_die('Sorry, you have to be an admin to run this action.');
}
$plugin_slug = 'wp-force-ssl/wp-force-ssl.php';
$plugin_zip = 'https://downloads.wordpress.org/plugin/wp-force-ssl.latest-stable.zip';
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
@include_once ABSPATH . 'wp-admin/includes/file.php';
@include_once ABSPATH . 'wp-admin/includes/misc.php';
echo '';
echo '
';
echo 'If things are not done in a minute
install the plugin manually via Plugins page';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if WP Force SSL is already installed ...
';
if (self::is_plugin_installed($plugin_slug)) {
echo 'WP Force SSL is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing WP Force SSL.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating WP Force SSL.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'WP Force SSL Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here.';
}
} else {
echo 'Could not install WP Force SSL. You\'ll have to
download and install manually.';
}
echo '
';
} // install_wpfssl
static function wp_kses_wf($html)
{
add_filter('safe_style_css', function ($styles) {
$styles_wf = array(
'text-align',
'margin',
'color',
'float',
'border',
'background',
'background-color',
'border-bottom',
'border-bottom-color',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-style',
'border-top-width',
'border-width',
'caption-side',
'clear',
'cursor',
'direction',
'font',
'font-family',
'font-size',
'font-style',
'font-variant',
'font-weight',
'height',
'letter-spacing',
'line-height',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'overflow',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'text-decoration',
'text-indent',
'vertical-align',
'width',
'display',
);
foreach ($styles_wf as $style_wf) {
$styles[] = $style_wf;
}
return $styles;
});
$allowed_tags = wp_kses_allowed_html('post');
$allowed_tags['head'] = array(
);
$allowed_tags['!doctype'] = array(
'html' => true,
);
$allowed_tags['body'] = array(
'style' => true,
'class' => true,
'id' => true,
);
$allowed_tags['html'] = array(
'lang' => true
);
$allowed_tags['meta'] = array(
'charset' => true,
'http-equiv' => true,
'content' => true,
'name' => true,
);
$allowed_tags['input'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'size' => true,
'disabled' => true
);
$allowed_tags['textarea'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'cols' => true,
'rows' => true,
'disabled' => true,
'autocomplete' => true
);
$allowed_tags['select'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'multiple' => true,
'disabled' => true
);
$allowed_tags['option'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'selected' => true,
'data-*' => true
);
$allowed_tags['optgroup'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'selected' => true,
'data-*' => true,
'label' => true
);
$allowed_tags['a'] = array(
'href' => true,
'data-*' => true,
'class' => true,
'style' => true,
'id' => true,
'target' => true,
'data-*' => true,
'role' => true,
'aria-controls' => true,
'aria-selected' => true,
'disabled' => true
);
$allowed_tags['div'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'role' => true,
'aria-labelledby' => true,
'value' => true,
'aria-modal' => true,
'tabindex' => true
);
$allowed_tags['li'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'role' => true,
'aria-labelledby' => true,
'value' => true,
'aria-modal' => true,
'tabindex' => true
);
$allowed_tags['span'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'aria-hidden' => true
);
$allowed_tags['style'] = array(
'class' => true,
'id' => true,
'type' => true
);
$allowed_tags['fieldset'] = array(
'class' => true,
'id' => true,
'type' => true
);
$allowed_tags['link'] = array(
'class' => true,
'id' => true,
'type' => true,
'rel' => true,
'href' => true,
'media' => true
);
$allowed_tags['form'] = array(
'style' => true,
'class' => true,
'id' => true,
'method' => true,
'action' => true,
'data-*' => true
);
$allowed_tags['script'] = array(
'class' => true,
'id' => true,
'type' => true,
'src' => true
);
echo wp_kses($html, $allowed_tags);
add_filter('safe_style_css', function ($styles) {
$styles_wf = array(
'text-align',
'margin',
'color',
'float',
'border',
'background',
'background-color',
'border-bottom',
'border-bottom-color',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-style',
'border-top-width',
'border-width',
'caption-side',
'clear',
'cursor',
'direction',
'font',
'font-family',
'font-size',
'font-style',
'font-variant',
'font-weight',
'height',
'letter-spacing',
'line-height',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'overflow',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'text-decoration',
'text-indent',
'vertical-align',
'width'
);
foreach ($styles_wf as $style_wf) {
if (($key = array_search($style_wf, $styles)) !== false) {
unset($styles[$key]);
}
}
return $styles;
});
}
static function is_plugin_installed($slug)
{
if (!function_exists('get_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$all_plugins = get_plugins();
if (!empty($all_plugins[$slug])) {
return true;
} else {
return false;
}
} // is_plugin_installed
// check if Weglot plugin is active and min version installed
static function is_weglot_active()
{
if (!function_exists('is_plugin_active') || !function_exists('get_plugin_data')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if (is_plugin_active('weglot/weglot.php')) {
$weglot_info = get_plugin_data(ABSPATH . 'wp-content/plugins/weglot/weglot.php');
if (version_compare($weglot_info['Version'], '2.5', '<')) {
return false;
} else {
return true;
}
} else {
return false;
}
} // is_weglot_active
// check if Weglot is completely set up
static function is_weglot_setup()
{
if (!self::is_weglot_active()) {
return false;
}
$active_languages = weglot_get_destination_languages();
if (!empty($active_languages)) {
return true;
} else {
return false;
}
} // is_weglot_setup
// reset pointers on activation
static function activate()
{
self::reset_pointers();
self::empty_cache();
} // activate
// clean up on deactivation
static function deactivate()
{
delete_option(UCP_POINTERS_KEY);
delete_option(UCP_NOTICES_KEY);
self::empty_cache();
} // deactivate
// clean up on uninstall
static function uninstall()
{
delete_option(UCP_OPTIONS_KEY);
delete_option(UCP_META_KEY);
delete_option(UCP_POINTERS_KEY);
delete_option(UCP_NOTICES_KEY);
self::empty_cache();
} // uninstall
} // class UCP
// hook everything up
register_activation_hook(__FILE__, array('UCP', 'activate'));
register_deactivation_hook(__FILE__, array('UCP', 'deactivate'));
register_uninstall_hook(__FILE__, array('UCP', 'uninstall'));
add_action('init', array('UCP', 'init'));
add_action('plugins_loaded', array('UCP', 'plugins_loaded'));