diff --git admin.php admin.php
index 481b0f3..07e5e60 100644
|
|
|
function akismet_check_for_spam_button($comment_status) { |
| 575 | 575 | else |
| 576 | 576 | $link = 'edit-comments.php?page=akismet-admin&recheckqueue=true&noheader=true'; |
| 577 | 577 | echo "</div><div class='alignleft'><a class='button-secondary checkforspam' href='$link'>" . __('Check for Spam') . "</a>"; |
| | 578 | echo '<img src="'.esc_url(admin_url('images/wpspin_light.gif')).'" class="checkforspam-spinner" />'; |
| 578 | 579 | } |
| 579 | 580 | add_action('manage_comments_nav', 'akismet_check_for_spam_button'); |
| 580 | 581 | |
| … |
… |
function akismet_recheck_queue() { |
| 758 | 759 | if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) ) |
| 759 | 760 | return; |
| 760 | 761 | |
| 761 | | $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A ); |
| | 762 | $paginate = ''; |
| | 763 | if ( isset( $_REQUEST['limit'] ) && isset( $_REQUEST['offset'] ) ) { |
| | 764 | $paginate = $wpdb->prepare("LIMIT %d OFFSET %d", array( |
| | 765 | $_REQUEST['limit'], |
| | 766 | $_REQUEST['offset'], |
| | 767 | )); |
| | 768 | } |
| | 769 | $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0' $paginate", ARRAY_A ); |
| | 770 | |
| 762 | 771 | foreach ( (array) $moderation as $c ) { |
| 763 | 772 | $c['user_ip'] = $c['comment_author_IP']; |
| 764 | 773 | $c['user_agent'] = $c['comment_agent']; |
| … |
… |
function akismet_recheck_queue() { |
| 801 | 810 | |
| 802 | 811 | delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' ); |
| 803 | 812 | } |
| 804 | | $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' ); |
| 805 | | wp_safe_redirect( $redirect_to ); |
| 806 | | exit; |
| 807 | | } |
| 808 | 813 | |
| | 814 | if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
| | 815 | wp_send_json(array( |
| | 816 | 'processed' => count((array) $moderation), |
| | 817 | )); |
| | 818 | } |
| | 819 | else { |
| | 820 | $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' ); |
| | 821 | wp_safe_redirect( $redirect_to ); |
| | 822 | exit; |
| | 823 | } |
| | 824 | } |
| 809 | 825 | add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue'); |
| | 826 | add_action('wp_ajax_akismet_recheck_queue', 'akismet_recheck_queue'); |
| 810 | 827 | |
| 811 | 828 | // Adds an 'x' link next to author URLs, clicking will remove the author URL and show an undo link |
| 812 | 829 | function akismet_remove_comment_author_url() { |
diff --git akismet.css akismet.css
index e96bc8a..b4981db 100644
|
|
|
|
| 1 | | #submitted-on{position:relative}#the-comment-list .author .akismet-user-comment-count{display:inline}#the-comment-list .author a span{text-decoration:none;color:#999}#the-comment-list .remove_url{margin-left:3px;color:#999;padding:2px 3px 2px 0}#the-comment-list .remove_url:hover{color:#A7301F;font-weight:bold;padding:2px 2px 2px 0}#dashboard_recent_comments .akismet-status{display:none}.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}span.comment-link a{text-decoration:underline}span.comment-link:after{content:" "attr(title) " ";color:#aaa;text-decoration:none}.mshot-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #5C5C5C;position:absolute;left:-6px;top:91px}.mshot-container{background:#5C5C5C;position:absolute;top:-94px;padding:7px;width:450px;height:338px;z-index:20000;-moz-border-radius:6px;border-radius:6px;-webkit-border-radius:6px}h2.ak-header{padding-left:38px;background:url('img/logo.png') no-repeat 0 9px;margin-bottom:14px;line-height:32px}.key-status{padding:0.4em 1em;color:#fff;font-weight:bold;text-align:center;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;max-width:23.3em}input#key{width:25.3em !important}input#key.valid{border-color:#4F800D}input#key.invalid,input#key.failed{border-color:#888}.key-status.under-input{margin-top:-5px;padding-bottom:0px}.key-status.invalid,.key-status.failed{background-color:#888}.key-status.valid{background-color:#4F800D}.key-status.some{background-color:#993300}.key-status.empty{display:none}table.network-status th,table.network-status td{padding:0.4em;margin:0;text-align:center}table.network-status{border-color:#dfdfdf;border-width:0 0 1px 1px;border-style:solid;border-spacing:0;width:25.6em}table.network-status th,table.network-status td{border-color:#dfdfdf;border-width:1px 1px 0 0;border-style:solid;margin:0;border-spacing:0}table.network-status td.key-status{border-radius:0px;-webkit-border-radius:0px} |
| 2 | | No newline at end of file |
| | 1 | #submitted-on{position:relative}#the-comment-list .author .akismet-user-comment-count{display:inline}#the-comment-list .author a span{text-decoration:none;color:#999}#the-comment-list .remove_url{margin-left:3px;color:#999;padding:2px 3px 2px 0}#the-comment-list .remove_url:hover{color:#A7301F;font-weight:bold;padding:2px 2px 2px 0}#dashboard_recent_comments .akismet-status{display:none}.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}span.comment-link a{text-decoration:underline}span.comment-link:after{content:" "attr(title) " ";color:#aaa;text-decoration:none}.mshot-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #5C5C5C;position:absolute;left:-6px;top:91px}.mshot-container{background:#5C5C5C;position:absolute;top:-94px;padding:7px;width:450px;height:338px;z-index:20000;-moz-border-radius:6px;border-radius:6px;-webkit-border-radius:6px}h2.ak-header{padding-left:38px;background:url('img/logo.png') no-repeat 0 9px;margin-bottom:14px;line-height:32px}.key-status{padding:0.4em 1em;color:#fff;font-weight:bold;text-align:center;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;max-width:23.3em}input#key{width:25.3em !important}input#key.valid{border-color:#4F800D}input#key.invalid,input#key.failed{border-color:#888}.key-status.under-input{margin-top:-5px;padding-bottom:0px}.key-status.invalid,.key-status.failed{background-color:#888}.key-status.valid{background-color:#4F800D}.key-status.some{background-color:#993300}.key-status.empty{display:none}table.network-status th,table.network-status td{padding:0.4em;margin:0;text-align:center}table.network-status{border-color:#dfdfdf;border-width:0 0 1px 1px;border-style:solid;border-spacing:0;width:25.6em}table.network-status th,table.network-status td{border-color:#dfdfdf;border-width:1px 1px 0 0;border-style:solid;margin:0;border-spacing:0}table.network-status td.key-status{border-radius:0px;-webkit-border-radius:0px}.checkforspam{display:inline-block !important;}.checkforspam-spinner{position:relative;top:3px;display:none;} |
diff --git akismet.js akismet.js
index f3da8fd..216f373 100644
|
|
|
jQuery(document).ready(function () { |
| 109 | 109 | }).mouseout(function () { |
| 110 | 110 | jQuery(this).find('.mShot').hide(); |
| 111 | 111 | }); |
| | 112 | jQuery('.checkforspam:not(.button-disabled)').on('click', function(e) { |
| | 113 | jQuery('.checkforspam:not(.button-disabled)').addClass('button-disabled'); |
| | 114 | jQuery('.checkforspam-spinner').show(); |
| | 115 | akismet_check_for_spam(0, 100); |
| | 116 | e.preventDefault(); |
| | 117 | }); |
| 112 | 118 | }); |
| | 119 | |
| | 120 | // Ajax "Check for Spam" |
| | 121 | function akismet_check_for_spam(offset, limit) { |
| | 122 | jQuery.post( |
| | 123 | ajaxurl, |
| | 124 | { |
| | 125 | 'action': 'akismet_recheck_queue', |
| | 126 | 'offset': offset, |
| | 127 | 'limit': limit |
| | 128 | }, |
| | 129 | function(result) { |
| | 130 | if (result.processed < limit) { |
| | 131 | window.location.reload(); |
| | 132 | } |
| | 133 | else { |
| | 134 | akismet_check_for_spam(offset + limit, limit); |
| | 135 | } |
| | 136 | } |
| | 137 | ); |
| | 138 | } |
| | 139 | |
| 113 | 140 | // URL encode plugin |
| 114 | 141 | jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/; |
| 115 | 142 | while(x<c.length){var m=r.exec(c.substr(x)); |