使用带有wordpress wp_filesystem的ZipArchive

I am writing wordpress plugin which needs to create zip file of uploads using ziparchive and wordpress filesystem API, I tried creating zip file directly but its not picking up correct permissions. I do not see any error, but zip created is always having permissions to read by other users, and which is causing me issues on shared hosting.

//dir will be passed to the function
$dir = $wp_filesystem->find_folder($dir);
$fileName = $dir . "example.zip"
$wp_filesystem->put_contents($backup_path,$zip->open($fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE), FS_CHMOD_FILE);

$files = new RecursiveIteratorIterator(
    new RecursiveDirectoryIterator($rootPath),
    RecursiveIteratorIterator::LEAVES_ONLY
);

foreach ($files as $name => $file)
{
    // Skip directories (they would be added automatically)
    if (!$file->isDir())
    {
        // Get real and relative path for current file
        $filePath = $file->getRealPath();
        $relativePath = substr($filePath, strlen($rootPath) + 1);
        $zip->addFile($filePath, $relativePath);
    }
}

// Zip archive will be created only after closing object
$zip->close();