Commit c84f1475ca for woocommerce

commit c84f1475ca7531ccf44d61f1448ce02ce623f828
Author: Eric Binnion <ericbinnion@gmail.com>
Date:   Wed Dec 17 16:13:20 2025 -0600

    Add WordPress environment type to site status report (#62458)

    * Add WordPress environment type to site status report

    Adds wp_get_environment_type() value to the WordPress Environment
    section of the WooCommerce system status report. This helps identify
    whether a site is configured as production, staging, development,
    or local.

    * Add changefile(s) from automation for the following project(s): woocommerce

    ---------

    Co-authored-by: github-actions <github-actions@github.com>

diff --git a/plugins/woocommerce/changelog/62458-update-add-wp-environment-to-ssr b/plugins/woocommerce/changelog/62458-update-add-wp-environment-to-ssr
new file mode 100644
index 0000000000..36f0a42cb9
--- /dev/null
+++ b/plugins/woocommerce/changelog/62458-update-add-wp-environment-to-ssr
@@ -0,0 +1,4 @@
+Significance: patch
+Type: add
+
+Add WordPress environment type to site status report.
\ No newline at end of file
diff --git a/plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php b/plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php
index 5a5237f1e0..39636d36cb 100644
--- a/plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php
+++ b/plugins/woocommerce/includes/admin/views/html-admin-page-status-report.php
@@ -221,6 +221,11 @@ if ( file_exists( $plugin_path ) ) {
 				<?php endif; ?>
 			</td>
 		</tr>
+		<tr>
+			<td data-export-label="WP Environment Type"><?php esc_html_e( 'Environment type', 'woocommerce' ); ?>:</td>
+			<td class="help"><?php echo wc_help_tip( esc_html__( 'The current environment type set for this site.', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
+			<td><?php echo esc_html( $environment['wp_environment_type'] ); ?></td>
+		</tr>
 		<tr>
 			<td data-export-label="Language"><?php esc_html_e( 'Language', 'woocommerce' ); ?>:</td>
 			<td class="help"><?php echo wc_help_tip( esc_html__( 'The current language used by WordPress. Default = English', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php
index 03cba7cfda..986a90e9d4 100644
--- a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php
+++ b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php
@@ -206,6 +206,12 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
 							'context'     => array( 'view' ),
 							'readonly'    => true,
 						),
+						'wp_environment_type'       => array(
+							'description' => __( 'The WordPress environment type.', 'woocommerce' ),
+							'type'        => 'string',
+							'context'     => array( 'view' ),
+							'readonly'    => true,
+						),
 						'language'                  => array(
 							'description' => __( 'WordPress language.', 'woocommerce' ),
 							'type'        => 'string',
@@ -1007,6 +1013,7 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
 			'wp_memory_limit'           => $wp_memory_limit,
 			'wp_debug_mode'             => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
 			'wp_cron'                   => ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
+			'wp_environment_type'       => wp_get_environment_type(),
 			'language'                  => get_locale(),
 			'external_object_cache'     => wp_using_ext_object_cache(),
 			'server_info'               => isset( $_SERVER['SERVER_SOFTWARE'] ) ? wc_clean( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php
index 025b1566fb..82bebb4667 100644
--- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php
+++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version2/system-status.php
@@ -119,7 +119,7 @@ class WC_Tests_REST_System_Status_V2 extends WC_REST_Unit_Test_Case {
 		$environment = (array) $this->fetch_or_get_system_status_data_for_user( self::$administrator_user )['environment'];

 		// Make sure all expected data is present.
-		$this->assertEquals( 34, count( $environment ) );
+		$this->assertEquals( 35, count( $environment ) );

 		// Test some responses to make sure they match up.
 		$this->assertEquals( get_option( 'home' ), $environment['home_url'] );
@@ -127,6 +127,7 @@ class WC_Tests_REST_System_Status_V2 extends WC_REST_Unit_Test_Case {
 		$this->assertEquals( get_option( \WC_Install::STORE_ID_OPTION, null ), $environment['store_id'] );
 		$this->assertEquals( $store_id, $environment['store_id'] );
 		$this->assertEquals( WC()->version, $environment['version'] );
+		$this->assertEquals( wp_get_environment_type(), $environment['wp_environment_type'] );
 	}

 	/**
diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php
index d6f75ebcc2..91fda6f1a3 100644
--- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php
+++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/system-status.php
@@ -126,7 +126,7 @@ class WC_Tests_REST_System_Status extends WC_REST_Unit_Test_Case {
 		$environment = (array) $this->fetch_or_get_system_status_data_for_user( self::$administrator_user )['environment'];

 		// Make sure all expected data is present.
-		$this->assertEquals( 34, count( $environment ) );
+		$this->assertEquals( 35, count( $environment ) );

 		// Test some responses to make sure they match up.
 		$this->assertEquals( get_option( 'home' ), $environment['home_url'] );
@@ -134,6 +134,7 @@ class WC_Tests_REST_System_Status extends WC_REST_Unit_Test_Case {
 		$this->assertEquals( get_option( \WC_Install::STORE_ID_OPTION, null ), $environment['store_id'] );
 		$this->assertEquals( $store_id, $environment['store_id'] );
 		$this->assertEquals( WC()->version, $environment['version'] );
+		$this->assertEquals( wp_get_environment_type(), $environment['wp_environment_type'] );
 	}

 	/**