Skip to content

Commit f4e915e

Browse files
feat(tracking): include the web-server family in server data
Adds $_SERVER['SERVER_SOFTWARE'] (e.g. "Apache/2.4.62", "nginx/1.24.0", "Microsoft-IIS/10.0") to the tracking payload's server collection so we can size what proportion of installs run on each server family. Output key: server.ServerSoftware. Empty string when the SAPI does not populate SERVER_SOFTWARE (rare; e.g. some CLI contexts). Refs Yoast/wordpress-seo-premium#4968. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 290a547 commit f4e915e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

admin/tracking/class-tracking-server-data.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ protected function get_server_data() {
3636
$server_data['Hostname'] = gethostbyaddr( $ipaddress );
3737
}
3838

39-
$server_data['os'] = function_exists( 'php_uname' ) ? php_uname() : PHP_OS;
40-
$server_data['PhpVersion'] = PHP_VERSION;
41-
$server_data['CurlVersion'] = $this->get_curl_info();
42-
$server_data['PhpExtensions'] = $this->get_php_extensions();
39+
$server_data['os'] = function_exists( 'php_uname' ) ? php_uname() : PHP_OS;
40+
$server_data['PhpVersion'] = PHP_VERSION;
41+
$server_data['CurlVersion'] = $this->get_curl_info();
42+
$server_data['PhpExtensions'] = $this->get_php_extensions();
43+
$server_data['ServerSoftware'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '';
4344

4445
return $server_data;
4546
}

0 commit comments

Comments
 (0)