Jetpack::__construct PHP Method

__construct() private method

Constructor. Initializes WordPress hooks
private __construct ( )
    private function __construct()
    {
        /*
         * Check for and alert any deprecated hooks
         */
        add_action('init', array($this, 'deprecated_hooks'));
        /*
         * Load things that should only be in Network Admin.
         *
         * For now blow away everything else until a more full
         * understanding of what is needed at the network level is
         * available
         */
        if (is_multisite()) {
            Jetpack_Network::init();
        }
        add_action('set_user_role', array($this, 'maybe_clear_other_linked_admins_transient'), 10, 3);
        // Unlink user before deleting the user from .com
        add_action('deleted_user', array($this, 'unlink_user'), 10, 1);
        add_action('remove_user_from_blog', array($this, 'unlink_user'), 10, 1);
        if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST && isset($_GET['for']) && 'jetpack' == $_GET['for']) {
            @ini_set('display_errors', false);
            // Display errors can cause the XML to be not well formed.
            require_once JETPACK__PLUGIN_DIR . 'class.jetpack-xmlrpc-server.php';
            $this->xmlrpc_server = new Jetpack_XMLRPC_Server();
            $this->require_jetpack_authentication();
            if (Jetpack::is_active()) {
                // Hack to preserve $HTTP_RAW_POST_DATA
                add_filter('xmlrpc_methods', array($this, 'xmlrpc_methods'));
                $signed = $this->verify_xml_rpc_signature();
                if ($signed && !is_wp_error($signed)) {
                    // The actual API methods.
                    add_filter('xmlrpc_methods', array($this->xmlrpc_server, 'xmlrpc_methods'));
                } else {
                    // The jetpack.authorize method should be available for unauthenticated users on a site with an
                    // active Jetpack connection, so that additional users can link their account.
                    add_filter('xmlrpc_methods', array($this->xmlrpc_server, 'authorize_xmlrpc_methods'));
                }
            } else {
                // The bootstrap API methods.
                add_filter('xmlrpc_methods', array($this->xmlrpc_server, 'bootstrap_xmlrpc_methods'));
            }
            // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
            add_filter('pre_option_enable_xmlrpc', '__return_true');
        } elseif (is_admin() && isset($_POST['action']) && 'jetpack_upload_file' == $_POST['action']) {
            $this->require_jetpack_authentication();
            $this->add_remote_request_handlers();
        } else {
            if (Jetpack::is_active()) {
                add_action('login_form_jetpack_json_api_authorization', array(&$this, 'login_form_json_api_authorization'));
                add_filter('xmlrpc_methods', array($this, 'public_xmlrpc_methods'));
            }
        }
        if (Jetpack::is_active()) {
            Jetpack_Heartbeat::init();
        }
        add_action('jetpack_clean_nonces', array('Jetpack', 'clean_nonces'));
        if (!wp_next_scheduled('jetpack_clean_nonces')) {
            wp_schedule_event(time(), 'hourly', 'jetpack_clean_nonces');
        }
        add_filter('xmlrpc_blog_options', array($this, 'xmlrpc_options'));
        add_action('admin_init', array($this, 'admin_init'));
        add_action('admin_init', array($this, 'dismiss_jetpack_notice'));
        add_filter('admin_body_class', array($this, 'admin_body_class'));
        add_action('wp_dashboard_setup', array($this, 'wp_dashboard_setup'));
        // Filter the dashboard meta box order to swap the new one in in place of the old one.
        add_filter('get_user_option_meta-box-order_dashboard', array($this, 'get_user_option_meta_box_order_dashboard'));
        // returns HTTPS support status
        add_action('wp_ajax_jetpack-recheck-ssl', array($this, 'ajax_recheck_ssl'));
        // If any module option is updated before Jump Start is dismissed, hide Jump Start.
        add_action('update_option', array($this, 'jumpstart_has_updated_module_option'));
        // JITM AJAX callback function
        add_action('wp_ajax_jitm_ajax', array($this, 'jetpack_jitm_ajax_callback'));
        // Universal ajax callback for all tracking events triggered via js
        add_action('wp_ajax_jetpack_tracks', array($this, 'jetpack_admin_ajax_tracks_callback'));
        add_action('wp_loaded', array($this, 'register_assets'));
        add_action('wp_enqueue_scripts', array($this, 'devicepx'));
        add_action('customize_controls_enqueue_scripts', array($this, 'devicepx'));
        add_action('admin_enqueue_scripts', array($this, 'devicepx'));
        add_action('plugins_loaded', array($this, 'extra_oembed_providers'), 100);
        /**
         * These actions run checks to load additional files.
         * They check for external files or plugins, so they need to run as late as possible.
         */
        add_action('wp_head', array($this, 'check_open_graph'), 1);
        add_action('plugins_loaded', array($this, 'check_twitter_tags'), 999);
        add_action('plugins_loaded', array($this, 'check_rest_api_compat'), 1000);
        add_filter('plugins_url', array('Jetpack', 'maybe_min_asset'), 1, 3);
        add_filter('style_loader_tag', array('Jetpack', 'maybe_inline_style'), 10, 2);
        add_filter('map_meta_cap', array($this, 'jetpack_custom_caps'), 1, 4);
        add_filter('jetpack_get_default_modules', array($this, 'filter_default_modules'));
        add_filter('jetpack_get_default_modules', array($this, 'handle_deprecated_modules'), 99);
        // A filter to control all just in time messages
        add_filter('jetpack_just_in_time_msgs', '__return_true');
        // Update the Jetpack plan from API on heartbeats
        add_action('jetpack_heartbeat', array($this, 'refresh_active_plan_from_wpcom'));
        /**
         * This is the hack to concatinate all css files into one.
         * For description and reasoning see the implode_frontend_css method
         *
         * Super late priority so we catch all the registered styles
         */
        if (!is_admin()) {
            add_action('wp_print_styles', array($this, 'implode_frontend_css'), -1);
            // Run first
            add_action('wp_print_footer_scripts', array($this, 'implode_frontend_css'), -1);
            // Run first to trigger before `print_late_styles`
        }
    }
Jetpack