Changeset 47585
- Timestamp:
- 04/16/2020 08:18:49 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-health.php
r47528 r47585 1085 1085 1086 1086 /** 1087 * Test if there's an active PHP session that can affect loopback requests. 1088 * 1089 * @since 5.5.0 1090 * 1091 * @return array The test results. 1092 */ 1093 public function get_test_php_sessions() { 1094 $result = array( 1095 'label' => __( 'No PHP sessions detected' ), 1096 'status' => 'good', 1097 'badge' => array( 1098 'label' => __( 'Performance' ), 1099 'color' => 'blue', 1100 ), 1101 'description' => sprintf( 1102 '<p>%s</p>', 1103 sprintf( 1104 /* translators: 1: session_start(), 2: session_write_close() */ 1105 __( 'PHP sessions created by a %1$s function call may interfere with REST API and loopback requests. An active session should be closed by %2$s before making any HTTP requests.' ), 1106 '<code>session_start()</code>', 1107 '<code>session_write_close()</code>' 1108 ) 1109 ), 1110 'test' => 'php_sessions', 1111 ); 1112 1113 if ( PHP_SESSION_ACTIVE === session_status() ) { 1114 $result['status'] = 'critical'; 1115 1116 $result['label'] = __( 'An active PHP session was detected' ); 1117 1118 $result['description'] = sprintf( 1119 '<p>%s</p>', 1120 sprintf( 1121 /* translators: 1: session_start(), 2: session_write_close() */ 1122 __( 'A PHP session was created by a %1$s function call. This interferes with REST API and loopback requests. The session should be closed by %2$s before making any HTTP requests.' ), 1123 '<code>session_start()</code>', 1124 '<code>session_write_close()</code>' 1125 ) 1126 ); 1127 } 1128 1129 return $result; 1130 } 1131 1132 /** 1087 1133 * Test if the SQL server is up to date. 1088 1134 * … … 1939 1985 'label' => __( 'PHP Default Timezone' ), 1940 1986 'test' => 'php_default_timezone', 1987 ), 1988 'php_sessions' => array( 1989 'label' => __( 'PHP Sessions' ), 1990 'test' => 'php_sessions', 1941 1991 ), 1942 1992 'sql_server' => array(
Note: See TracChangeset
for help on using the changeset viewer.