Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#16608 closed enhancement (invalid)

Adding an xml-rpc call to get the count of spam comments

Reported by: plopmaster's profile plopmaster Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.5
Component: XML-RPC Keywords: close
Focuses: Cc:

Description

I made a patch to add an xml-rpc call to get the count of comments in various status (spam, approuved, ...)
The call is name wp.getCommentsStatusCount

Attachments (2)

01-xmlrpc-add-wp.getCommentsStatusCount.patch.gz (733 bytes) - added by plopmaster 14 years ago.
01-xmlrpc-add-wp.getCommentsStatusCount.patch (1.4 KB) - added by ericmann 14 years ago.
Real patch file.

Download all attachments as: .zip

Change History (9)

#1 @ericmann
14 years ago

As much as I like compression, you can't read a gzipped file in Trac.

#2 @ericmann
14 years ago

And I just realized that right-clicking and saving the patch file saves the HTML output of the Trac ticket instead ... uploading the real patch in a readable format ...

Last edited 14 years ago by ericmann (previous) (diff)

#3 @ericmann
14 years ago

  • Keywords needs-refresh added

Two things:

  1. What version of WordPress is this patched against? Since it's a patch on xmlrpc.php and not wp-includes/class-wp-xmlrpc-server.php I'm guessing you're not using the latest version (also apparent in your "since 2.7.0" note). Please patch against the current version of WP.
  2. Why do you accept a fourth parameter for status, but hardcode "status=spam"?

#4 @greuben
14 years ago

  • Keywords close added; needs-refresh removed

Comment count function in xml-rpc has been added since 2.5.0

#5 @josephscott
14 years ago

  • Resolution set to invalid
  • Status changed from new to closed

There is already an XML-RPC method to get this data: wp.getCommentCount( blog_id, username, password, <post_id> )

The post_id parameter is optional, if it is left off it will give you the comment count totals for the entire site. If you provide it the counts will be just for that post. The counts are broken down by comment status, results look like this:

    [approved] => 31
    [awaiting_moderation] => 2
    [spam] => 2
    [total_comments] => 35

#6 @ocean90
14 years ago

  • Milestone Awaiting Review deleted

#7 @plopmaster
14 years ago

@ericmann :

1/ I use the latest version of WP. But I indeed lack of knowledge on WP programming...

2/ Bug in the patch :)

@josephscott : so, documentation (http://codex.wordpress.org/XML-RPC_wp#wp.getCommentCount) is lacking this precision ...

Thanks for the help :)

Note: See TracTickets for help on using tickets.