I want to be able to delete assets that are not linked to. I have adapted the following code from previous examples of this kind of thing, but it doesn't seem to pick up all the related entries, just some of them. Some photos do not show a related entry but if I go to the entry where I think it might have been used it is still in use. Am I missing something in matching the entries to the assets?
{% set photos = craft.assets.kind('image') %}
{% for photo in photos %}
<img src="{{ photo.getUrl('square') }}">
<br>{{ photo.filename }} / {{ photo.folderId }}
<ul>
{# Loop throught entries related to this asset #}
{% for entry in craft.entries.relatedTo(photo).order('title') %}
<li>{{ entry.title }}</li>
{% endfor %}
</ul>
{% endfor %}
I have tried using the assetusage plugin but it doesn't seem to work with non images and I also wanted to test if it was working properly. I also looked at the Asset-Use plugin but that is beta and only does images.