$validExts comes from a text field in the configuration, so we need to make sure that we trim the whitespace out and check if user added dot before the extension:

    zip, jpg , doc,.tar.gz   , .txt

becomes:

    $validExts = array('zip',' jpg ',' doc','.tar.gz   ',' .txt');

Most of those aren't valid extensions without some extra work. As you see, we also have tar.gz, which needs to be supported.