PHP Class Jetpack_IDC, jetpack

Since: 4.4.0
Show file Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$current_screen WP_Screen The current screen, which is set if the current user is a non-admin and this is an admin page.
$is_safe_mode_confirmed boolean Has safe mode been confirmed?
$wpcom_home_url string The wpcom value of the home URL

Public Methods

Method Description
admin_page_has_help_tabs ( ) : boolean Does the current admin page have help tabs?
clear_all_idc_options ( ) Clears all IDC specific options. This method is used on disconnect and reconnect.
display_admin_bar_button ( )
display_idc_notice ( ) First "step" of the IDC mitigation. Will provide some messaging and two options/buttons.
display_non_admin_idc_notice ( )
enqueue_admin_bar_css ( )
enqueue_idc_notice_files ( ) Enqueue scripts for the notice
get_confirm_safe_mode_action_explanation ( )
get_confirm_safe_mode_button_text ( )
get_first_step_fix_connection_action_explanation ( )
get_first_step_fix_connection_button_text ( )
get_first_step_header_explanation ( )
get_first_step_header_lead ( )
get_migrate_site_action_explanation ( )
get_migrate_site_button_text ( )
get_non_admin_contact_admin_text ( )
get_non_admin_notice_text ( )
get_second_step_header_lead ( )
get_start_fresh_action_explanation ( )
get_start_fresh_button_text ( )
get_unsure_prompt ( )
init ( )
maybe_clear_migrate_option ( $processed_items ) This method loops through the array of processed items from sync and checks if one of the items was the home_url or site_url callable. If so, then we delete the jetpack_migrate_for_idc option.
non_admins_current_screen_check ( $current_screen )
prepare_url_for_display ( $url )
render_error_notice ( ) Is a container for the error notices.
render_notice_first_step ( )
render_notice_header ( )
render_notice_second_step ( )
wordpress_init ( )

Private Methods

Method Description
__construct ( )

Method Details

admin_page_has_help_tabs() public method

Does the current admin page have help tabs?

clear_all_idc_options() static public method

Clears all IDC specific options. This method is used on disconnect and reconnect.
static public clear_all_idc_options ( )

display_admin_bar_button() public method

display_idc_notice() public method

"Confirm Staging" - Dismiss the notice and continue on with our lives in staging mode. "Fix Jetpack Connection" - Will disconnect the site and start the mitigation...
public display_idc_notice ( )

display_non_admin_idc_notice() public method

enqueue_admin_bar_css() public method

enqueue_idc_notice_files() public method

Enqueue scripts for the notice

get_confirm_safe_mode_action_explanation() public method

get_confirm_safe_mode_button_text() public method

get_first_step_fix_connection_action_explanation() public method

get_first_step_fix_connection_button_text() public method

get_first_step_header_explanation() public method

get_first_step_header_lead() public method

get_migrate_site_action_explanation() public method

get_migrate_site_button_text() public method

get_non_admin_contact_admin_text() public method

get_non_admin_notice_text() public method

get_second_step_header_lead() public method

get_start_fresh_action_explanation() public method

get_start_fresh_button_text() public method

get_unsure_prompt() public method

public get_unsure_prompt ( )

init() static public method

static public init ( )

maybe_clear_migrate_option() public method

This method loops through the array of processed items from sync and checks if one of the items was the home_url or site_url callable. If so, then we delete the jetpack_migrate_for_idc option.
public maybe_clear_migrate_option ( $processed_items )
$processed_items array Array of processed items that were synced to WordPress.com

non_admins_current_screen_check() public method

public non_admins_current_screen_check ( $current_screen )

prepare_url_for_display() static public method

static public prepare_url_for_display ( $url )

render_error_notice() public method

Will be shown/controlled by jQuery in idc-notice.js
public render_error_notice ( )

render_notice_first_step() public method

render_notice_header() public method

render_notice_second_step() public method

wordpress_init() public method

public wordpress_init ( )

Property Details

$current_screen static public property

The current screen, which is set if the current user is a non-admin and this is an admin page.
static public WP_Screen $current_screen
return WP_Screen

$is_safe_mode_confirmed static public property

Has safe mode been confirmed?
static public bool $is_safe_mode_confirmed
return boolean

$wpcom_home_url static public property

The wpcom value of the home URL
static public string $wpcom_home_url
return string