| @@ -174,10 +174,10 @@ | ||
| 174 | 174 | if (defined('WP_DEBUG') && WP_DEBUG) { |
| 175 | 175 | return 'development'; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $host = parse_url(home_url(), PHP_URL_HOST); | |
| 179 | - if (strpos($host, 'staging') !== false || strpos($host, 'dev') !== false) { | |
| 178 | + $host = wp_parse_url(home_url(), PHP_URL_HOST); | |
| 179 | + if ($host !== false && $host !== null && (strpos($host, 'staging') !== false || strpos($host, 'dev') !== false)) { | |
| 180 | 180 | return 'staging'; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | return 'production'; |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | return array( |
| 219 | 219 | 'wordpress_version' => get_bloginfo('version'), |
| 220 | 220 | 'php_version' => PHP_VERSION, |
| 221 | 221 | 'php_os' => PHP_OS_FAMILY, |
| 222 | - 'mysql_version' => method_exists($wpdb, 'get_var') ? $wpdb->get_var('SELECT VERSION()') : 'unknown', | |
| 222 | + 'mysql_version' => method_exists($wpdb, 'get_var') ? $wpdb->get_var('SELECT VERSION()') : 'unknown', // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- diagnostic metadata — SELECT VERSION() has no cached WordPress API | |
| 223 | 223 | 'server_software' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown', |
| 224 | 224 | 'active_plugins' => count(get_option('active_plugins', array())), |
| 225 | 225 | 'active_theme' => get_template(), |
| 226 | 226 | 'multisite' => is_multisite(), |