-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PRO] Auto-delete featured image after a number of days when post is deleted #827
Comments
+1 https://secure.helpscout.net/conversation/2544820375/410262/?folderId=212385 "If I can suggest some details on this feature-request: maybe a checkbox that states something like |
@girishpanchal30, we planned to have this part of Feedzy release if we have development time left. The idea is to delete images if a post is deleted when they have it set up to be deleted after particular amount of days: Also, it should only delete an image if it is attached to a single post so there aren't other posts left without image after it is deleted. If you see this complicated or could lead to introducing bugs we might leave it out. |
Implementing the thumbnail image functionality is straightforward and should not cause any issues. However, retrieving and deleting attached media from the post_content will take more time. Should I implement it for the thumbnail image only? Please let me know. Thanks! |
This is only about featured image as if image is used in the description/content of the item we don't import such images to WordPress, we use external URLs to reference them, the same image URL as it is is original XML Feed. Or have you mentioned this because existing image that was imported as featured image can be later used in some other post in the content of it? In such case it is fine, we shouldn't bother about this IMO. It's important to make this an optional functionality, when Auto-delete is set up it should be a checkbox that you need to check to also delete imported featured images attached. |
@vytisbulkevicius Thank you for the clarification! I’ve implemented it in the following PRs. Please review them along with the build zip and let me know if you encounter any issues. Thanks! |
Done!
After importing the posts, you can update the post dates to a past date and then trigger the import job. |
Thanks @girishpanchal30 but this method didn't work for me, unfortunately. Does it work for you? I will see the real scenario soon today if it will delete the posts and images, but changing the data to the past and triggering the import didn't delete either the posts or their images. Screen recording: https://vertis.d.pr/v/A45GGr |
@vytisbulkevicius Apologies for not mentioning how to trigger the import job earlier. The auto-delete feature work with a cron job. You need to trigger the Feedzy cron job, and it should work as expected. |
@girishpanchal30, thanks for clarifying, however, with this PR #1043 there seems to be an issue of how cron works. When you create import it shows that it will be run in almost a month only: Even though Feedzy cron shows that it will run in a hour: But it doesn't run after an hour passes. Also, if I manually trigger feedzy_cron: It doesn't trigger the import job. |
In this PR, I haven't made any changes related to cron jobs. I've been using WP-CLI to trigger the cron job locally. I think this will be help you - https://github.com/Codeinwp/feedzy-rss-feeds-pro/issues/572#issuecomment-2547557668 Thanks |
@vytisbulkevicius I believe it's displaying the wrong time after this change. - 48fa552 |
@HardeepAsrani, can you check? |
@HardeepAsrani Could you please review this patch? It might resolve the issue. |
@girishpanchal30 Thanks for the catch, can you create the PR with that? |
@HardeepAsrani I've opened a new PR - #1047, please review it |
Tested and everything works good now. I confirmed that posts get deleted and featured images as well. Also, if same featured image is attached to another post, featured image is not deleted, just the post. |
What problem does this address?
EDIT by Vytis:
A user asked if we can create a new option for the auto-deleting feature imaged after a certain period because they occupy a lot of space.
Ref: https://secure.helpscout.net/conversation/2425773133/393344?folderId=212385
What is your proposed solution?
Within the general feed settings inside the import, under Auto-Delete, consider adding a new section where users can specify the number of days before the featured image of the posts from that particular import is automatically deleted. Similarly, this setting can be implemented in Feedzy > Settings, providing users with the flexibility to configure this globally or on an individual basis per import.
We can also have a similar approach as we have in Visualizer - https://s3.amazonaws.com/helpscout.net/docs/assets/55192029e4b0221aadf23f55/images/61606f5312c07c18afddbb79/file-FqGbpe8kvS.png
Will this feature require documentation? (Optional)
Yes, it requires documentation.
The text was updated successfully, but these errors were encountered: