function admin_init() { // If the plugin is not connected, display a connect message. if (Jetpack_Options::get_option('do_activate') || !Jetpack_Options::get_option('activated')) { Jetpack::plugin_initialize(); } if (!Jetpack::is_active() && !Jetpack::is_development_mode()) { if (4 != Jetpack_Options::get_option('activated')) { // Show connect notice on dashboard and plugins pages add_action('load-index.php', array($this, 'prepare_connect_notice')); add_action('load-plugins.php', array($this, 'prepare_connect_notice')); } } elseif (false === Jetpack_Options::get_option('fallback_no_verify_ssl_certs')) { // Upgrade: 1.1 -> 1.1.1 // Check and see if host can verify the Jetpack servers' SSL certificate $args = array(); Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test')), $args, true); } else { // Show the notice on the Dashboard only for now add_action('load-index.php', array($this, 'prepare_manage_jetpack_notice')); // Identity crisis notices add_action('jetpack_notices', array($this, 'alert_identity_crisis')); } // If the plugin has just been disconnected from WP.com, show the survey notice if (isset($_GET['disconnected']) && 'true' === $_GET['disconnected']) { add_action('jetpack_notices', array($this, 'disconnect_survey_notice')); } if (current_user_can('manage_options') && 'ALWAYS' == JETPACK_CLIENT__HTTPS && !self::permit_ssl()) { add_action('admin_notices', array($this, 'alert_required_ssl_fail')); } add_action('load-plugins.php', array($this, 'intercept_plugin_error_scrape_init')); add_action('admin_enqueue_scripts', array($this, 'admin_menu_css')); add_filter('plugin_action_links_' . plugin_basename(JETPACK__PLUGIN_DIR . 'jetpack.php'), array($this, 'plugin_action_links')); if (Jetpack::is_active() || Jetpack::is_development_mode()) { // Artificially throw errors in certain whitelisted cases during plugin activation add_action('activate_plugin', array($this, 'throw_error_on_activate_plugin')); // Kick off synchronization of user role when it changes add_action('set_user_role', array($this, 'user_role_change')); } // Jetpack Manage Activation Screen from .com Jetpack::module_configuration_activation_screen('manage', array($this, 'manage_activate_screen')); }
function admin_init() { // If the plugin is not connected, display a connect message. if (Jetpack_Options::get_option_and_ensure_autoload('do_activate', '0') || !Jetpack_Options::get_option('activated')) { Jetpack::plugin_initialize(); } if (!Jetpack::is_active() && !Jetpack::is_development_mode()) { Jetpack_Connection_Banner::init(); } elseif (false === Jetpack_Options::get_option('fallback_no_verify_ssl_certs')) { // Upgrade: 1.1 -> 1.1.1 // Check and see if host can verify the Jetpack servers' SSL certificate $args = array(); Jetpack_Client::_wp_remote_request(Jetpack::fix_url_for_bad_hosts(Jetpack::api_url('test')), $args, true); } else { if ($this->can_display_jetpack_manage_notice() && !Jetpack_Options::get_option('dismissed_manage_banner')) { // Show the notice on the Dashboard only for now add_action('load-index.php', array($this, 'prepare_manage_jetpack_notice')); } } if (current_user_can('manage_options') && 'AUTO' == JETPACK_CLIENT__HTTPS && !self::permit_ssl()) { add_action('jetpack_notices', array($this, 'alert_auto_ssl_fail')); } add_action('load-plugins.php', array($this, 'intercept_plugin_error_scrape_init')); add_action('admin_enqueue_scripts', array($this, 'admin_menu_css')); add_filter('plugin_action_links_' . plugin_basename(JETPACK__PLUGIN_DIR . 'jetpack.php'), array($this, 'plugin_action_links')); if (Jetpack::is_active() || Jetpack::is_development_mode()) { // Artificially throw errors in certain whitelisted cases during plugin activation add_action('activate_plugin', array($this, 'throw_error_on_activate_plugin')); } // Jetpack Manage Activation Screen from .com Jetpack::module_configuration_activation_screen('manage', array($this, 'manage_activate_screen')); // Add custom column in wp-admin/users.php to show whether user is linked. add_filter('manage_users_columns', array($this, 'jetpack_icon_user_connected')); add_action('manage_users_custom_column', array($this, 'jetpack_show_user_connected_icon'), 10, 3); add_action('admin_print_styles', array($this, 'jetpack_user_col_style')); }