mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-rest-api-docs.git
synced 2026-04-24 04:42:50 +08:00
Document the new wp_environment_type field added to the System Status REST API endpoint in woocommerce/woocommerce#62458. This field returns the WordPress environment type (production, staging, development, or local) from wp_get_environment_type().
15 KiB
15 KiB
System status
The system status API allows you to view all system status items.
System status properties
| Attribute | Type | Description |
|---|---|---|
environment |
object | Environment. See System status - Environment properties read-only |
database |
object | Database. See System status - Database properties read-only |
active_plugins |
array | Active plugins. read-only |
theme |
object | Theme. See System status - Theme properties read-only |
settings |
object | Settings. See System status - Settings properties read-only |
security |
object | Security. See System status - Security properties read-only |
pages |
array | WooCommerce pages. read-only |
System status - Environment properties
| Attribute | Type | Description |
|---|---|---|
home_url |
string | Home URL. read-only |
site_url |
string | Site URL. read-only |
version |
string | WooCommerce version. read-only |
log_directory |
string | Log directory. read-only |
log_directory_writable |
boolean | Is log directory writable? read-only |
wp_version |
string | WordPress version. read-only |
wp_multisite |
boolean | Is WordPress multisite? read-only |
wp_memory_limit |
integer | WordPress memory limit. read-only |
wp_debug_mode |
boolean | Is WordPress debug mode active? read-only |
wp_cron |
boolean | Are WordPress cron jobs enabled? read-only |
wp_environment_type |
string | WordPress environment type. read-only |
language |
string | WordPress language. read-only |
server_info |
string | Server info. read-only |
php_version |
string | PHP version. read-only |
php_post_max_size |
integer | PHP post max size. read-only |
php_max_execution_time |
integer | PHP max execution time. read-only |
php_max_input_vars |
integer | PHP max input vars. read-only |
curl_version |
string | cURL version. read-only |
suhosin_installed |
boolean | Is SUHOSIN installed? read-only |
max_upload_size |
integer | Max upload size. read-only |
mysql_version |
string | MySQL version. read-only |
default_timezone |
string | Default timezone. read-only |
fsockopen_or_curl_enabled |
boolean | Is fsockopen/cURL enabled? read-only |
soapclient_enabled |
boolean | Is SoapClient class enabled? read-only |
domdocument_enabled |
boolean | Is DomDocument class enabled? read-only |
gzip_enabled |
boolean | Is GZip enabled? read-only |
mbstring_enabled |
boolean | Is mbstring enabled? read-only |
remote_post_successful |
boolean | Remote POST successful? read-only |
remote_post_response |
string | Remote POST response. read-only |
remote_get_successful |
boolean | Remote GET successful? read-only |
remote_get_response |
string | Remote GET response. read-only |
System status - Database properties
| Attribute | Type | Description |
|---|---|---|
wc_database_version |
string | WC database version. read-only |
database_prefix |
string | Database prefix. read-only |
maxmind_geoip_database |
string | MaxMind GeoIP database. read-only |
database_tables |
array | Database tables. read-only |
System status - Theme properties
| Attribute | Type | Description |
|---|---|---|
name |
string | Theme name. read-only |
version |
string | Theme version. read-only |
version_latest |
string | Latest version of theme. read-only |
author_url |
string | Theme author URL. read-only |
is_child_theme |
boolean | Is this theme a child theme? read-only |
has_woocommerce_support |
boolean | Does the theme declare WooCommerce support? read-only |
has_woocommerce_file |
boolean | Does the theme have a woocommerce.php file? read-only |
has_outdated_templates |
boolean | Does this theme have outdated templates? read-only |
overrides |
array | Template overrides. read-only |
parent_name |
string | Parent theme name. read-only |
parent_version |
string | Parent theme version. read-only |
parent_author_url |
string | Parent theme author URL. read-only |
System status - Settings properties
| Attribute | Type | Description |
|---|---|---|
api_enabled |
boolean | REST API enabled? read-only |
force_ssl |
boolean | SSL forced? read-only |
currency |
string | Currency. read-only |
currency_symbol |
string | Currency symbol. read-only |
currency_position |
string | Currency position. read-only |
thousand_separator |
string | Thousand separator. read-only |
decimal_separator |
string | Decimal separator. read-only |
number_of_decimals |
integer | Number of decimals. read-only |
geolocation_enabled |
boolean | Geolocation enabled? read-only |
taxonomies |
array | Taxonomy terms for product/order statuses. read-only |
System status - Security properties
| Attribute | Type | Description |
|---|---|---|
secure_connection |
boolean | Is the connection to your store secure? read-only |
hide_errors |
boolean | Hide errors from visitors? read-only |
List all system status items
This API helps you to view all the system status items.
HTTP request
GET
/wp-json/wc/v3/system_status
curl https://example.com/wp-json/wc/v3/system_status \
-u consumer_key:consumer_secret
WooCommerce.get("system_status")
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error.response.data);
});
<?php print_r($woocommerce->get('system_status')); ?>
print(wcapi.get("system_status").json())
woocommerce.get("system_status").parsed_response
JSON response example:
{
"environment": {
"home_url": "http://example.com",
"site_url": "http://example.com",
"version": "3.0.0",
"log_directory": "/var/www/woocommerce/wp-content/uploads/wc-logs/",
"log_directory_writable": true,
"wp_version": "4.7.3",
"wp_multisite": false,
"wp_memory_limit": 134217728,
"wp_debug_mode": true,
"wp_cron": true,
"wp_environment_type": "production",
"language": "en_US",
"server_info": "Apache/2.4.18 (Ubuntu)",
"php_version": "7.1.3-2+deb.sury.org~yakkety+1",
"php_post_max_size": 8388608,
"php_max_execution_time": 30,
"php_max_input_vars": 1000,
"curl_version": "7.50.1, OpenSSL/1.0.2g",
"suhosin_installed": false,
"max_upload_size": 2097152,
"mysql_version": "5.7.17",
"default_timezone": "UTC",
"fsockopen_or_curl_enabled": true,
"soapclient_enabled": true,
"domdocument_enabled": true,
"gzip_enabled": true,
"mbstring_enabled": true,
"remote_post_successful": true,
"remote_post_response": "200",
"remote_get_successful": true,
"remote_get_response": "200"
},
"database": {
"wc_database_version": "3.0.0",
"database_prefix": "wp_",
"maxmind_geoip_database": "/var/www/woocommerce/wp-content/uploads/GeoIP.dat",
"database_tables": {
"woocommerce_sessions": true,
"woocommerce_api_keys": true,
"woocommerce_attribute_taxonomies": true,
"woocommerce_downloadable_product_permissions": true,
"woocommerce_order_items": true,
"woocommerce_order_itemmeta": true,
"woocommerce_tax_rates": true,
"woocommerce_tax_rate_locations": true,
"woocommerce_shipping_zones": true,
"woocommerce_shipping_zone_locations": true,
"woocommerce_shipping_zone_methods": true,
"woocommerce_payment_tokens": true,
"woocommerce_payment_tokenmeta": true
}
},
"active_plugins": [
{
"plugin": "woocommerce/woocommerce.php",
"name": "WooCommerce",
"version": "3.0.0-rc.1",
"version_latest": "2.6.14",
"url": "https://woocommerce.com/",
"author_name": "Automattic",
"author_url": "https://woocommerce.com",
"network_activated": false
}
],
"theme": {
"name": "Twenty Sixteen",
"version": "1.3",
"version_latest": "1.3",
"author_url": "https://wordpress.org/",
"is_child_theme": false,
"has_woocommerce_support": true,
"has_woocommerce_file": false,
"has_outdated_templates": false,
"overrides": [],
"parent_name": "",
"parent_version": "",
"parent_version_latest": "",
"parent_author_url": ""
},
"settings": {
"api_enabled": true,
"force_ssl": false,
"currency": "USD",
"currency_symbol": "$",
"currency_position": "left",
"thousand_separator": ",",
"decimal_separator": ".",
"number_of_decimals": 2,
"geolocation_enabled": false,
"taxonomies": {
"external": "external",
"grouped": "grouped",
"simple": "simple",
"variable": "variable"
}
},
"security": {
"secure_connection": true,
"hide_errors": true
},
"pages": [
{
"page_name": "Shop base",
"page_id": "4",
"page_set": true,
"page_exists": true,
"page_visible": true,
"shortcode": "",
"shortcode_required": false,
"shortcode_present": false
},
{
"page_name": "Cart",
"page_id": "5",
"page_set": true,
"page_exists": true,
"page_visible": true,
"shortcode": "[woocommerce_cart]",
"shortcode_required": true,
"shortcode_present": true
},
{
"page_name": "Checkout",
"page_id": "6",
"page_set": true,
"page_exists": true,
"page_visible": true,
"shortcode": "[woocommerce_checkout]",
"shortcode_required": true,
"shortcode_present": true
},
{
"page_name": "My account",
"page_id": "7",
"page_set": true,
"page_exists": true,
"page_visible": true,
"shortcode": "[woocommerce_my_account]",
"shortcode_required": true,
"shortcode_present": true
}
]
}