WooCommerce Code Reference

Search results

WC_REST_System_Status_Controller extends WC_REST_System_Status_V2_Controller

System status controller class.

Table of Contents

$namespace Endpoint namespace. string
$namespace Endpoint namespace. string
$rest_base Route base. string
register_routes() Register the route for /system_status mixed
get_items_permissions_check() Check whether a given request has permission to view system status. WP_Error|bool
get_items() Get a system status info, by section. WP_Error|WP_REST_Response
get_item_schema() Get the system status schema, conforming to JSON Schema. array
get_item_mappings() Return an array of sections and the data associated with each. array
get_item_mappings_per_fields() Return an array of sections and the data associated with each. array
get_environment_info() Get array of environment information. Includes thing like software versions, and various server settings. array
check_if_field_item_exists() Check if field item exists. bool
get_environment_info_per_fields() Get array of environment information. Includes thing like software versions, and various server settings. array
add_db_table_prefix() Add prefix to table. stromg
get_database_info() Get array of database information. Version, prefix, and table existence. array
get_post_type_counts() Get array of counts of objects. Orders, products, etc. array
get_active_plugins() Get a list of plugins active on the site. array
get_inactive_plugins() Get a list of inplugins active on the site. array
format_plugin_data() Format plugin data, including data on updates, into a standard format. array
get_dropins_mu_plugins() Get a list of Dropins and MU plugins. array
get_theme_info() Get info on the current active theme, info on parent theme (if presnet) and a list of template overrides. array
get_settings() Get some setting values for the site that are useful for debugging purposes. For full settings access, use the settings api. array
get_security_info() Returns security tips. array
get_pages() Returns a mini-report on WC pages and if they are configured correctly: Present, visible, and including the correct shortcode. array
get_collection_params() Get any query params needed. array
prepare_item_for_response() Prepare the system status response WP_REST_Response
add_additional_fields_schema() Add the schema from additional fields to an schema array. array
get_endpoint_args_for_item_schema() Compatibility functions for WP 5.5, since custom types are not supported anymore. array
adjust_wp_5_5_datatype_compatibility() Change datatypes `date-time` to string, and `mixed` to composite of all built in types. This is required for maintaining forward compatibility with WP 5.5 since custom post types are not supported anymore. mixed
get_normalized_rest_base() Get normalized rest base. string
check_batch_limit() Check batch limit. bool|WP_Error
batch_items() Bulk create, update and delete items. array
validate_setting_text_field() Validate a text value for a text based setting. string
validate_setting_select_field() Validate select based settings. string|WP_Error
validate_setting_multiselect_field() Validate multiselect based settings. array|WP_Error
validate_setting_image_width_field() Validate image_width based settings. string|WP_Error
validate_setting_radio_field() Validate radio based settings. string|WP_Error
validate_setting_checkbox_field() Validate checkbox based settings. string|WP_Error
validate_setting_textarea_field() Validate textarea based settings. string
add_meta_query() Add meta query. array
get_public_batch_schema() Get the batch schema, conforming to JSON Schema. array
get_fields_for_response() Gets an array of fields to be included on the response. array

Properties

Methods

get_items_permissions_check()

Check whether a given request has permission to view system status.

public get_items_permissions_check( $request : WP_REST_Request ) : WP_Error|bool
Parameters
$request : WP_REST_Request

Full details about the request.

Return values
WP_Error|bool

get_items()

Get a system status info, by section.

public get_items( $request : WP_REST_Request ) : WP_Error|WP_REST_Response
Parameters
$request : WP_REST_Request

Full details about the request.

Return values
WP_Error|WP_REST_Response

get_item_mappings_per_fields()

Return an array of sections and the data associated with each.

public get_item_mappings_per_fields( $fields : array ) : array
Parameters
$fields : array

List of fields to be included on the response.

Tags
since
Return values
array

get_environment_info()

Get array of environment information. Includes thing like software versions, and various server settings.

public get_environment_info( ) : array
Tags
deprecated
Return values
array

check_if_field_item_exists()

Check if field item exists.

private check_if_field_item_exists( $section : string , $items : array , $fields : array ) : bool
Parameters
$section : string

Fields section.

$items : array

List of items to check for.

$fields : array

List of fields to be included on the response.

Tags
since
Return values
bool

get_environment_info_per_fields()

Get array of environment information. Includes thing like software versions, and various server settings.

public get_environment_info_per_fields( $fields : array ) : array
Parameters
$fields : array

List of fields to be included on the response.

Return values
array

format_plugin_data()

Format plugin data, including data on updates, into a standard format.

protected format_plugin_data( $plugin : string , $data : array ) : array
Parameters
$plugin : string

Plugin directory/file.

$data : array

Plugin data from WP.

Tags
since
Return values
array

Formatted data.

get_theme_info()

Get info on the current active theme, info on parent theme (if presnet) and a list of template overrides.

public get_theme_info( ) : array
Return values
array

get_settings()

Get some setting values for the site that are useful for debugging purposes. For full settings access, use the settings api.

public get_settings( ) : array
Return values
array

get_pages()

Returns a mini-report on WC pages and if they are configured correctly: Present, visible, and including the correct shortcode.

public get_pages( ) : array
Return values
array

prepare_item_for_response()

Prepare the system status response

public prepare_item_for_response( $system_status : array , $request : WP_REST_Request ) : WP_REST_Response
Parameters
$system_status : array

System status data.

$request : WP_REST_Request

Request object.

Return values
WP_REST_Response

add_additional_fields_schema()

Add the schema from additional fields to an schema array.

protected add_additional_fields_schema( $schema : array ) : array

The type of object is inferred from the passed schema.

Parameters
$schema : array

Schema array.

Return values
array

get_endpoint_args_for_item_schema()

Compatibility functions for WP 5.5, since custom types are not supported anymore.

public get_endpoint_args_for_item_schema( [ $method : string = WP_REST_Server::CREATABLE ] ) : array

See @link https://core.trac.wordpress.org/changeset/48306

Parameters
$method : string = WP_REST_Server::CREATABLE

Optional. HTTP method of the request.

Return values
array

Endpoint arguments.

adjust_wp_5_5_datatype_compatibility()

Change datatypes `date-time` to string, and `mixed` to composite of all built in types. This is required for maintaining forward compatibility with WP 5.5 since custom post types are not supported anymore.

protected adjust_wp_5_5_datatype_compatibility( $endpoint_args : array ) : mixed

See @link https://core.trac.wordpress.org/changeset/48306

We still use the 'mixed' type, since if we convert to composite type everywhere, it won't work in 5.4 anymore because they require to define the full schema.

Parameters
$endpoint_args : array

Schema with datatypes to convert.

Return values
mixed

Schema with converted datatype.

get_normalized_rest_base()

Get normalized rest base.

protected get_normalized_rest_base( ) : string
Return values
string

check_batch_limit()

Check batch limit.

protected check_batch_limit( $items : array ) : bool|WP_Error
Parameters
$items : array

Request items.

Return values
bool|WP_Error

batch_items()

Bulk create, update and delete items.

public batch_items( $request : WP_REST_Request ) : array
Parameters
$request : WP_REST_Request

Full details about the request.

Return values
array

Of WP_Error or WP_REST_Response.

validate_setting_text_field()

Validate a text value for a text based setting.

public validate_setting_text_field( $value : string , $setting : array ) : string
Parameters
$value : string

Value.

$setting : array

Setting.

Tags
since
Return values
string

validate_setting_select_field()

Validate select based settings.

public validate_setting_select_field( $value : string , $setting : array ) : string|WP_Error
Parameters
$value : string

Value.

$setting : array

Setting.

Tags
since
Return values
string|WP_Error

validate_setting_multiselect_field()

Validate multiselect based settings.

public validate_setting_multiselect_field( $values : array , $setting : array ) : array|WP_Error
Parameters
$values : array

Values.

$setting : array

Setting.

Tags
since
Return values
array|WP_Error

validate_setting_image_width_field()

Validate image_width based settings.

public validate_setting_image_width_field( $values : array , $setting : array ) : string|WP_Error
Parameters
$values : array

Values.

$setting : array

Setting.

Tags
since
Return values
string|WP_Error

validate_setting_radio_field()

Validate radio based settings.

public validate_setting_radio_field( $value : string , $setting : array ) : string|WP_Error
Parameters
$value : string

Value.

$setting : array

Setting.

Tags
since
Return values
string|WP_Error

validate_setting_checkbox_field()

Validate checkbox based settings.

public validate_setting_checkbox_field( $value : string , $setting : array ) : string|WP_Error
Parameters
$value : string

Value.

$setting : array

Setting.

Tags
since
Return values
string|WP_Error

validate_setting_textarea_field()

Validate textarea based settings.

public validate_setting_textarea_field( $value : string , $setting : array ) : string
Parameters
$value : string

Value.

$setting : array

Setting.

Tags
since
Return values
string

add_meta_query()

Add meta query.

protected add_meta_query( $args : array , $meta_query : array ) : array
Parameters
$args : array

Query args.

$meta_query : array

Meta query.

Tags
since
Return values
array

get_public_batch_schema()

Get the batch schema, conforming to JSON Schema.

public get_public_batch_schema( ) : array
Return values
array

get_fields_for_response()

Gets an array of fields to be included on the response.

public get_fields_for_response( $request : WP_REST_Request ) : array

Included fields are based on item schema and _fields= request argument. Updated from WordPress 5.3, included into this class to support old versions.

Parameters
$request : WP_REST_Request

Full details about the request.

Tags
since
Return values
array

Fields to be included in the response.

Back to the top