Shouldn't $site->path() return the site folder path? Currently it's returning site content folder path.