-
Notifications
You must be signed in to change notification settings - Fork 95
feat: add --all flag to comment delete command #546
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
src/Comment_Command.php
Outdated
| * : One or more IDs of comments to delete. | ||
| * | ||
| * [--all] | ||
| * : If set, all comments will be deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we warn that this might be slow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swissspidy Just a warning in the comment like this? Or do we need a warning on the prompt?
|
Sorry I'm late to this but in relation to the linked issue this PR is meant to fix -- when there are tens/hundreds of thousands of these it isn't just 'slow' it can be many, many hours. I don't think the current method is really a solution for that particular problem. The correct method for dealing with spam like that is what is in the linked issue, doing: Which takes a few seconds at most. That issue is asking for a Obviously that doesn't delete the comments normally, doesn't fire hooks, etc... so it does feel like that is different than an Really there is just a fundamental difference between "I want to delete all comments the normal WordPress way" and "My site got tens of thousands of spam comments and I want to remove everything". Unclear if it is possible to incorporate the later into this command in a way that makes sense ( |
|
@mrsdizzie Absolutely agreed that this could get very slow. @swissspidy and I had a discussion about that (see #546 (comment)) with my argument being all --all should consistant with the delete command and process all the action hooks. I propose two possible solutions:
|
It needs to be separate from With an appropriate description of what it does and when you'd want to use that. |
Resolves #538
Contributed as part of WordCamp Canada 2025 Contributor Day. #WCEH