Plugin Name: Akismet
Plugin URI: http://akismet.com/
Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a <a href="http://wordpress.com/api-keys/">WordPress.com API key</a> to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <code><?php akismet_counter(); ?></code> in your template. See also: <a href="http://wordpress.org/extend/plugins/stats/">WP Stats plugin</a>.
-Version: 2.1.4
+Version: 2.1.8
Author: Matt Mullenweg
-Author URI: http://photomatt.net/
+Author URI: http://ma.tt/
*/
// If you hardcode a WP.com API key here, all key config screens will be hidden
}
function akismet_manage_page() {
- global $wpdb, $submenu;
+ global $wpdb, $submenu, $wp_db_version;
+
+ // WP 2.7 has its own spam management page
+ if ( 8645 <= $wp_db_version )
+ return;
+
$count = sprintf(__('Akismet Spam (%s)'), akismet_spam_count());
if ( isset( $submenu['edit-comments.php'] ) )
add_submenu_page('edit-comments.php', __('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught' );
function akismet_caught() {
global $wpdb, $comment, $akismet_caught, $akismet_nonce;
+
akismet_recheck_queue();
if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) {
check_admin_referer( $akismet_nonce );
if ( isset( $_GET['ctype'] ) )
$current_type = preg_replace( '|[^a-z]|', '', $_GET['ctype'] );
- $comments = akismet_spam_comments( $current_type );
+ $comments = akismet_spam_comments( $current_type, $page );
$total = akismet_spam_count( $current_type );
$totals = akismet_spam_totals();
?>
// For WP >= 2.5
function akismet_check_for_spam_button($comment_status) {
- if ( 'moderated' != $comment_status )
+ if ( 'approved' == $comment_status )
return;
- $count = wp_count_comments();
- if ( !empty($count->moderated ) )
- echo "<a href='edit-comments.php?page=akismet-admin&recheckqueue=true&noheader=true'>" . __('Check for Spam') . "</a>";
+ if ( function_exists('plugins_url') )
+ $link = 'admin.php?action=akismet_recheck_queue';
+ else
+ $link = 'edit-comments.php?page=akismet-admin&recheckqueue=true&noheader=true';
+ echo "</div><div class='alignleft'><a class='button-secondary checkforspam' href='$link'>" . __('Check for Spam') . "</a>";
}
add_action('manage_comments_nav', 'akismet_check_for_spam_button');
function akismet_recheck_queue() {
global $wpdb, $akismet_api_host, $akismet_api_port;
- if ( !isset( $_GET['recheckqueue'] ) )
+ if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
return;
$moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A );
- foreach ( $moderation as $c ) {
+ foreach ( (array) $moderation as $c ) {
$c['user_ip'] = $c['comment_author_IP'];
$c['user_agent'] = $c['comment_agent'];
$c['referrer'] = '';
exit;
}
+add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
+
function akismet_check_db_comment( $id ) {
global $wpdb, $akismet_api_host, $akismet_api_port;