'Version'), 'plugin'); self::$version = $plugin_data['version']; return $plugin_data['version']; } // get_plugin_version // hook things up static function init() { // check if minimal required WP version is present if (false === self::check_wp_version(4.0)) { return false; } if (is_admin()) { // if the plugin was updated from ver < 1.20 upgrade settings array self::maybe_upgrade(); // add UCP menu to admin tools menu group add_action('admin_menu', array(__CLASS__, 'admin_menu')); // settings registration add_action('admin_init', array(__CLASS__, 'register_settings')); // aditional links in plugin description add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(__CLASS__, 'plugin_action_links') ); add_filter('plugin_row_meta', array(__CLASS__, 'plugin_meta_links'), 10, 2); add_filter('admin_footer_text', array(__CLASS__, 'admin_footer_text')); add_filter('admin_footer', array(__CLASS__, 'admin_footer')); // manages admin header notifications add_action('admin_notices', array(__CLASS__, 'admin_notices')); add_action('admin_action_ucp_dismiss_notice', array(__CLASS__, 'dismiss_notice')); add_action('admin_action_ucp_change_status', array(__CLASS__, 'change_status')); add_action('admin_action_ucp_reset_settings', array(__CLASS__, 'reset_settings')); add_action('admin_action_install_weglot', array(__CLASS__, 'install_weglot')); add_action('admin_action_install_wpfssl', array(__CLASS__, 'install_wpfssl')); // enqueue admin scripts add_action('admin_enqueue_scripts', array(__CLASS__, 'admin_enqueue_scripts'), 100, 1); // AJAX endpoints add_action('wp_ajax_ucp_dismiss_pointer', array(__CLASS__, 'dismiss_pointer_ajax')); add_action('wp_ajax_ucp_dismiss_survey', array(__CLASS__, 'dismiss_survey_ajax')); add_action('wp_ajax_ucp_submit_survey', array(__CLASS__, 'submit_survey_ajax')); add_action('wp_ajax_ucp_submit_support_message', array(__CLASS__, 'submit_support_message_ajax')); } else { // main plugin logic add_action('wp', array(__CLASS__, 'display_construction_page'), 0, 1); // show under construction notice on login form add_filter('login_message', array(__CLASS__, 'login_message')); // disable feeds add_action('do_feed_rdf', array(__CLASS__, 'disable_feed'), 0, 1); add_action('do_feed_rss', array(__CLASS__, 'disable_feed'), 0, 1); add_action('do_feed_rss2', array(__CLASS__, 'disable_feed'), 0, 1); add_action('do_feed_atom', array(__CLASS__, 'disable_feed'), 0, 1); add_action('wp_footer', array(__CLASS__, 'whitelisted_notice')); } // if not admin // admin bar notice for frontend & backend add_action('wp_before_admin_bar_render', array(__CLASS__, 'admin_bar')); add_action('wp_head', array(__CLASS__, 'admin_bar_style')); add_action('admin_head', array(__CLASS__, 'admin_bar_style')); UCP_license::init(); } // init // check if user has the minimal WP version required by UCP static function check_wp_version($min_version) { if (!version_compare(get_bloginfo('version'), $min_version, '>=')) { add_action('admin_notices', array(__CLASS__, 'notice_min_wp_version')); return false; } else { return true; } } // check_wp_version // display error message if WP version is too low static function notice_min_wp_version() { echo '
' . sprintf(esc_attr__('UnderConstruction plugin requires WordPress version 4.0 or higher to function properly. You are using WordPress version %s. Please update it.', 'under-construction-page'), get_bloginfo('version'), admin_url('update-core.php')) . '
Create stunning under construction pages for WordPress. Completely free.
'; } elseif ($tmp[0] < '8') { $out .= 'Create a free under construction page for WordPress like this one in under a minute.
'; } elseif ($tmp[0] < 'c') { $out .= 'Join more than 400,000 happy people using the free Under Construction Page plugin for WordPress.
'; } else { $out .= 'Create free under construction pages for WordPress.
'; } } if ($options['login_button'] == '1') { if (is_user_logged_in()) { $out .= '