Ticket #4529 (new enhancement)

Opened 2 years ago

Last modified 1 week ago

"Trash" status for comments and posts

Reported by: markjaquith Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: Administration Version:
Severity: normal Keywords: needs-patch dev-feedback 2nd-opinion needs-testing
Cc: caesarsgrunt, markjaquith, ryan

Description

Lets channel some Robert Hoekman Jr. and get rid of all modal AYS dialogs. Recommended alternative is "N nouns were verbed. Undo?"

This would require some place to store deleted items temporarily. We'd need to store one item (or batch of items... the result of a single operation) per user... so the usermeta table seems a good place. I don't think we necessarily need a new table just for this purpose.

This would be a fairly massive undertaking, but it'd make WP more fun to use.

Attachments

delete-comment.diff (7.0 kB) - added by caesarsgrunt on 08/30/08 15:24:05.
Temporary deletion of comments, first attempt.
delete-comment.2.diff (7.7 kB) - added by caesarsgrunt on 09/01/08 21:48:15.
Temporary deletion of comments, with auto-destruction
delete-comment.3.diff (8.1 kB) - added by caesarsgrunt on 09/29/08 08:11:49.
Updated patch, due to major changes in the WP core…

Change History

06/25/07 03:30:19 changed by filosofo

Wouldn't this undercut the protection from CSRF-type attacks offered by the AYS dialogs?

For example, say I visit a hostile site that uses Javascript in an iframe or whatever to attempt to delete one of my posts. As I understand the current system, I might not see the AYS dialog that would appear upon receiving such a non-nonced command, but my failure to approve it would stop the deletion from occurring. It seems like under your scenario the deletion would occur and I would be none the wiser.

06/25/07 20:57:29 changed by markjaquith

You're confusing the CSRF-preventing HTML form AYS screens (which have to stay) with modal JS AYS dialogs (which are JS popup windows that you have to deal with before you can do anything else in your browser window). The modal JS windows are to prevent accidental actions because of errant mouse clicks, not to prevent CSRF. They are layered on top of the CSRF protection (that is, they ask you if you're sure, and then go to the nonce'd URL, which, with an incorrect nonce, would trigger the CSRF AYS HTML form).

Bottom line: no, this won't make WordPress any less secure from CSRF attacks.

12/28/07 21:04:28 changed by darkdragon

  • milestone changed from 2.4 to 2.5.

I don't think it is likely that this will get in to 2.4 without a patch. Sending to the next version, because of the lack of a patch and being close to the release.

07/12/08 18:28:16 changed by MattyRob

  • milestone changed from 2.6 to 2.7.

I don't think it is likely that this will get in to 2.6 without a patch. Sending to the next version, because of the lack of a patch and being close to the release.

08/26/08 12:02:35 changed by caesarsgrunt

  • cc set to caesarsgrunt.
  • type changed from task to enhancement.

+1

I occasionally delete the wrong comments by mistake. Once I've clicked delete I just click OK automatically before realising - too late - that it's the wrong one.

How about adding a 'deleted' status value for posts and comments, in addition the the existing 'draft', 'published', 'moderated', etc. This would IMO be an easy, simple, and intuitive method of going about this. Then a 'Trash' page can be added for seeing deleted posts/comments/etc, from which they can be permanently destroyed, and a cron/whatever script can destroy items which were deleted more than a certain time ago.

Maybe the priority/severity should be raised? I don't know how many people are bothered by this or regularly loose things...

08/30/08 15:24:05 changed by caesarsgrunt

  • attachment delete-comment.diff added.

Temporary deletion of comments, first attempt.

08/30/08 15:42:15 changed by caesarsgrunt

  • keywords set to has-patch dev-feedback 2nd-opinion needs-testing.

Here's a first try at enabling 'temporary' deletion of comments - OS X 'Trash' / Windows 'Recycle Bin' style - allowing them to later be either restored or permanently deleted.

This patch doesn't automatically destroy comments which were deleted x days ago, yet, though this will be a necessity.

I hope I included all of the changed files I changed in the patch...

Please have a look and let me know what you think of it.

09/01/08 07:28:05 changed by caesarsgrunt

Some feedback on the temporary deletion of comments would be nice, so I know if there's any point in me carrying on enhancing it...
I'd very much like to see this feature get into trunk!

09/01/08 21:48:15 changed by caesarsgrunt

  • attachment delete-comment.2.diff added.

Temporary deletion of comments, with auto-destruction

09/01/08 22:01:13 changed by caesarsgrunt

  • priority changed from normal to high.

This second patch automatically destroys (ie. permanently) comments 30 days after they were deleted (ie. temporarily). (Maybe this should be an option?)

Next I might add a note at the top of the page after comments are deleted, Gmail style. "X posts were deleted. Undo?"

Note that at present if you 'reply' to a comment using the new ajax reply form, and then delete the second comment on the page, the delete function is called twice for that comment. Due to the nature of my 'patch' this causes that comment to be permanently deleted immediately, like it currently is anyway without the 'patch', whilst temporarily incrementing the deleted comment count by two.
I think this is a bug with the reply feature, but I'm not sure.

Feedback please!
If popular I'll do the same for posts; should be just as easy.
If unpopular I'll try making it into a plugin, at least for myself. Might be harder...

09/29/08 08:11:49 changed by caesarsgrunt

  • attachment delete-comment.3.diff added.

Updated patch, due to major changes in the WP core...

09/29/08 08:48:15 changed by caesarsgrunt

  • cc changed from caesarsgrunt to caesarsgrunt, markjaquith, ryan.
  • keywords changed from has-patch dev-feedback 2nd-opinion needs-testing to has-patch dev-feedback 2nd-opinion needs-testing commit.
  • version deleted.
  • summary changed from Modal "Are You Sure?" dialogs should be replaced with "Undo" functionality. to "Trash" status for comments and posts.

Just uploaded an updated patch, taking account of major changes which have been made to the WP core since I originally created this patch.
I hope I've included all the files I changed...

Since no-one is giving their opinions on this, perhaps it could be committed?

10/09/08 13:30:41 changed by ShaneF

  • priority changed from high to normal.

This is a first time I am looking at this. +1 to this idea. Having a 'deleted' comments area is different than 'spam' and it allow for us to historically (if we wanted) regular user comments that we removed for any particular reason.

Changing this back to 'normal' priority.

10/14/08 21:51:33 changed by matt

  • milestone changed from 2.7 to 2.9.

01/01/09 16:51:03 changed by mrmist

  • keywords changed from has-patch dev-feedback 2nd-opinion needs-testing commit to needs-patch dev-feedback 2nd-opinion needs-testing.

Needs tweaking against a new build again. Nice idea though.