get_vulnerabilities(); $files = array( '.svn', '.git' ); foreach ( $files as $file ) { $url = esc_html( get_site_url() . '/' . $file ); if ( file_exists( ABSPATH . $file ) ) { $response = wp_remote_head( $url, array( 'timeout' => 5 ) ); $code = wp_remote_retrieve_response_code( $response ); if ( 200 === $code ) { $this->add_vulnerability( __( 'A publicly accessible ' . esc_html( $file ) . ' file was found. The file could expose your websites\'s source code.', 'wpscan' ), 'high', sanitize_title( $file ), 'https://blog.wpscan.com/2021/03/23/wordpress-version-control-files.html' ); } } } } }