'ManageWP Worker', 'mainwp-child/mainwp-child.php' => 'MainWP Child', 'jetpack/jetpack.php' => 'Jetpack', 'wp-umbrella/wp-umbrella.php' => 'WP Umbrella', 'uptime-robot/uptime-robot.php' => 'UptimeRobot', ]; $detected = []; foreach ($monitors as $file => $label) { if (function_exists('is_plugin_active') && is_plugin_active($file)) $detected[] = $label; } $f[] = $this->finding( 'monitor_plugin', $detected ? 'ok' : 'info', 'Monitoring plugin', $detected ? implode(', ', $detected) : 'none detected', $detected ? 'Pull downtime stats from the relevant dashboard.' : 'External monitoring (UptimeRobot/BetterStack/Pingdom) may still be in place.' ); // www vs non-www: try fetching both and see whether one redirects to the other $home = home_url('/'); $parts = parse_url($home); $host = $parts['host'] ?? ''; $scheme = $parts['scheme'] ?? 'https'; if ($host) { $with_www = $scheme . '://' . (strpos($host, 'www.') === 0 ? $host : 'www.' . $host) . '/'; $without_www = $scheme . '://' . preg_replace('/^www\./', '', $host) . '/'; foreach (['with www' => $with_www, 'without www' => $without_www] as $label => $url) { $resp = wp_remote_head($url, ['timeout' => 5, 'redirection' => 0]); if (is_wp_error($resp)) { $f[] = $this->finding('canonical_' . sanitize_key($label), 'warn', $label, $url, $resp->get_error_message()); continue; } $code = wp_remote_retrieve_response_code($resp); $loc = wp_remote_retrieve_header($resp, 'location'); $detail = $loc ? '→ ' . $loc : ''; $f[] = $this->finding('canonical_' . sanitize_key($label), 'info', $label, 'HTTP ' . $code, $detail); } } return $f; } };