coyote-team / coyote-wp

Wordpress Plug-in for Coyote
2 stars 2 forks source link

Non images are being captured by the plugin #84

Open sinabahram opened 3 years ago

sinabahram commented 3 years ago

We need to only submit images to Coyote, but right now all attachments e.g. PDF files, M4A files, mp4 files, are being submitted.

I suggest filtering on popular image extensions for now.

jkva commented 3 years ago

I'm unable to reproduce this. Implementation-wise there exists explicit filtering on anything not of mime-type image/*. When creating a new organisation and importing existing attachments and posts including PDF attachments, PDFs are not imported.

In an older organisation I have seen PDFs that were once imported, and I'm inclined to think this was a glitch during older imports. I've checked the mime-type that WordPress used for those imported PDFs, and those seemed to be correctly set to application/pdf.

I'm keeping this issue open for now, perhaps I can reproduce it at another time.

jkva commented 2 years ago

This logic should be moved into the main WordPressPlugin class and generalised such that a WP_Post or ID can be provided and checked whether it should be processed. This relates to #90.