+ $('.checkforspam:not(.button-disabled)').click( function(e) {
+ $('.checkforspam:not(.button-disabled)').addClass('button-disabled');
+ $('.checkforspam-spinner').show();
+ akismet_check_for_spam(0, 100);
+ e.preventDefault();
+ });
+
+ function akismet_check_for_spam(offset, limit) {
+ $.post(
+ ajaxurl,
+ {
+ 'action': 'akismet_recheck_queue',
+ 'offset': offset,
+ 'limit': limit
+ },
+ function(result) {
+ if (result.processed < limit) {
+ window.location.reload();
+ }
+ else {
+ akismet_check_for_spam(offset + limit, limit);
+ }
+ }
+ );
+ }