It doesn't work if a custom login page has been configured and access to the wp-login.php file is blocked. It also makes no sense to detect CMS by relying on the "generator" meta tag because it can contain false information or be hidden.