Properties

$instance

$instance

Methods

__construct()

__construct()

get_instance()

get_instance() : \Jetpack_SSO

Returns the single instance of the Jetpack_SSO object

Returns

\Jetpack_SSO

module_configure_button()

module_configure_button()

Add configure button and functionality to the module card on the Jetpack screen

module_configuration_load()

module_configuration_load()

module_configuration_head()

module_configuration_head()

module_configuration_screen()

module_configuration_screen()

maybe_logout_user()

maybe_logout_user()

If jetpack_force_logout == 1 in current user meta the user will be forced to logout and reauthenticate with the site.

xmlrpc_methods()

xmlrpc_methods(array $methods) : array

Adds additional methods the WordPress xmlrpc API for handling SSO specific features

Parameters

array $methods

Returns

array

xmlrpc_user_disconnect()

xmlrpc_user_disconnect( $user_id)

Marks a user's profile for disconnect from WordPress.com and forces a logout the next time the user visits the site.

Parameters

$user_id

register_settings()

register_settings()

Adds settings fields to Settings > General > Single Sign On that allows users to turn off the login form on wp-login.php

render_require_two_step()

render_require_two_step()

Builds the display for the checkbox allowing user to require two step auth be enabled on WordPress.com accounts before login. Displays in Settings > General

validate_settings_require_two_step()

validate_settings_require_two_step( $input) : boolean

Validate the require two step checkbox in Settings > General

Parameters

$input

Returns

boolean

render_match_by_email()

render_match_by_email()

Builds the display for the checkbox allowing the user to allow matching logins by email Displays in Settings > General

validate_settings_match_by_email()

validate_settings_match_by_email( $input) : boolean

Validate the match by email check in Settings > General

Parameters

$input

Returns

boolean

render_remove_login_form_checkbox()

render_remove_login_form_checkbox()

Builds the display for the checkbox allowing users to remove the default WordPress login form from wp-login.php. Displays in Settings > General

validate_settings_remove_login_form_checkbox()

validate_settings_remove_login_form_checkbox( $input) : boolean

Validate settings input from Settings > General

Parameters

$input

Returns

boolean

remove_lost_password_text()

remove_lost_password_text( $text) : string

Removes 'Lost your password?' text from the login form if user does not want to show the login form

Parameters

$text

Returns

string

login_init()

login_init()

login_form()

login_form()

login_footer()

login_footer()

delete_connection_for_user()

delete_connection_for_user( $user_id)

Parameters

$user_id

request_initial_nonce()

request_initial_nonce()

handle_login()

handle_login()

profile_page_url()

profile_page_url()

match_by_email()

match_by_email()

new_user_override()

new_user_override()

allowed_redirect_hosts()

allowed_redirect_hosts( $hosts)

Parameters

$hosts

button()

button( $args)

Parameters

$args

build_sso_url()

build_sso_url( $args)

Parameters

$args

get_user_by_wpcom_id()

get_user_by_wpcom_id( $wpcom_user_id)

Parameters

$wpcom_user_id

error_msg_enable_two_step()

error_msg_enable_two_step(string $message) : string

Error message displayed on the login form when two step is required and the user's account on WordPress.com does not have two step enabled.

Parameters

string $message

Returns

string

msg_login_by_jetpack()

msg_login_by_jetpack(string $message) : string

Message displayed when the site admin has disabled the default WordPress login form in Settings > General > Single Sign On

Parameters

string $message

Returns

string

error_msg_login_method_not_allowed()

error_msg_login_method_not_allowed(string $message)

Error message displayed on the login form when the user attempts to post to the login form and it is disabled.

Parameters

string $message

cant_find_user()

cant_find_user( $message)

Parameters

$message

admin_init()

admin_init()

Deal with user connections.

..

is_user_connected()

is_user_connected(integer $user_id) : boolean

Determines if a local user is connected to WordPress.com

Parameters

integer $user_id
  • Local user id

Returns

boolean

get_user_data()

get_user_data(integer $user_id) : mixed

Retrieves a user's WordPress.com data

Parameters

integer $user_id
  • Local user id

Returns

mixed —

null or stdClass

edit_profile_fields()

edit_profile_fields( $user)

Parameters

$user

wants_to_login()

wants_to_login() : boolean

Checks to determine if the user wants to login on wp-login

This function mostly exists to cover the exceptions to login that may exist as other parameters to $_GET[action] as $_GET[action] does not have to exist. By default WordPress assumes login if an action is not set, however this may not be true, as in the case of logout where $_GET[loggedout] is instead set

Returns

boolean

should_hide_login_form()

should_hide_login_form() : bool

Determing if the login form should be hidden or not

Method is private only because it is only used in this class so far. Feel free to change it later

Returns

bool