[wp-hackers] Comment management in admin

Martin Sturm msturm10 at gmail.com
Wed Feb 21 12:00:45 GMT 2007


Hi everybody,

First, I want to let you know that I'm new to this list and not very
involved in the current development of Wordpress.

I was redesigning my weblog and I am also cleaning up the comments
(there is a lot of spam and garbage in the comments of my weblog).
During this process, I find it annoying that it wasn't possible to
'mass-edit' comments for one post.
So, I decided to fix this (and hoped this was a straight forward
patch). However, I discovered that the wp-admin/edit-comments.php is
not very clean. Deletion of comments is hardcoded in this file, as is
the mass-edit mode. Moreover, I discoverd that the display of the
comments of one post (in the admin that is) is duplicated in the
wp-admin/edit.php file.

As a programmer, that is not logical to me. I expected that the
comment display and management was abstracted in seperate functions or
at least in seperate files, so it would be easy to use it in several
'views' in the admin. Is there any reason why this is done so 'ugly'?

I also noticed that the bot aforementioned files (wp-admin/edit.php
and wp-admin/edit-comments.php) are not formatted according to the
coding style used in Wordpress (see
http://codex.wordpress.org/WordPress_Coding_Standards). For example,
different style for opening and closing 'if' and 'for' blocks are used
(sometimes with braces, sometimes with 'endif' and 'endfor', sometimes
without either of those). The if and for blocks are also very, very
long, which makes it very hard to maintain or improve the code,
especially since the indentation is also quite messy.

I have a patch ready for the mass-edit mode for individual posts (I
will put it in the bugtracking system), but I think it would be nice
if this part of the admin is cleaned up a little.

--
Martin Sturm


More information about the wp-hackers mailing list