WP-4634 Added code to check path and force login if required