If this could cause harm, then an option to delete or not delete images should be available, as there are many customers who need to delete images when posts are also deleted. Make the default to NOT delete, so as to not inadvertently harm anyone, but leaving the images behind when a post is deleted is REALLY BAD. This way, you don't have to do that big search. Either delete or not, at the customer's choice.
If we add an option to allow the site blogger to delete images (show a checkbox confirmation) when the blogger decides to delete a blog post on the site, then this will be a high risk for those sites that have multiple bloggers because the blogger does not know how many images they add into their blog post, if the blogger accidentally ticks the checkbox (delete images) then all these images can't be restored back if another blog post still using it.
And I assume that you will gonna said that if add a check during deleting images process if these images really use for other blog posts or not, then this will fall back to what we are concerned about the big search performance issue.
However, the current behavior is when a post is deleted, the files will be relocated to the user's directory instead.
For example:
1. If you upload a post cover image directly when you click the "upload" button under the post cover dropdown, it will store this media file into this path "/images/easyblog_articles/blogID"
2. If the post is deleted, the system will relocate this "/images/easyblog_articles/blogID" blog id folder to the "/images/easblog_images/BlogTitle" new directory folder.
If you would like to delete a post while deleting the uploaded article image (without upload through the media manager), you can create a plugin that hooks to the event
onAfterEasyBlogDelete. Then in your plugin's method, you just need to run the following code:
public function onAfterEasyBlogDelete($blog)
{
require_once(JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/mediamanager/mediamanager.php');
$uri = 'post:' . $blog->id;
$path = EBMM::getPath($uri);
if (JFolder::exists($path)) {
JFolder::delete($path);
}
}
And for now, you can manually access this directory folder "/images/easblog_images/" and see if that folder is about your post title name, then you can delete it manually for now.