There are two different ways you can fix this (without manually patching the plugin):
OPTION ONE:
If .slave files are always zips, the simplest solution is to update your upload_mimes filter hook to use the appropriate ext/type pairing, i.e. $existing_mimes['slave'] = 'application/zip'; (rather than application/octet-stream).
OPTION TWO:
If you want/need to keep the files associated with application/octet-stream in the backend, you can hook into lotf_get_mime_aliases to programmatically expand the alias list used by Lord of the Files.
(This is equivalent to manually patching aliases.php, but saves you the trouble of having to repatch that file every time a new version of the plugin is released.)
function my_custom_mime_aliases ( $mimes, $ext ) {
if ('slave' === $ext) {
// $mimes should already have 'application/octet-stream' since
// it inherits types known to WP (including custom upload_mimes
// types), so you just need to add the ZIP type:
$mimes[] = 'application/zip';
}
return $mimes;
}
add_filter( 'lotf_get_mime_aliases', 'my_custom_mime_aliases', 10, 2 );
Please let me know if either work out for you! I’ll leave the ticket open in the meantime just in case.
Silly me – I had it set to the wrong mime type and should have been $existing_mimes[‘slave’] = ‘application/zip’;
The second method is interesting if I end up needing to add different mime types to a file extension.
Many thanks for your help and I am sure this post will help others too.