Changeset 3461494
- Timestamp:
- 02/14/2026 08:09:29 PM (6 weeks ago)
- Location:
- spamanvil
- Files:
-
- 8 edited
- 1 copied
-
tags/1.1.4 (copied) (copied from spamanvil/trunk)
-
tags/1.1.4/admin/class-spamanvil-admin.php (modified) (1 diff)
-
tags/1.1.4/includes/class-spamanvil-queue.php (modified) (1 diff)
-
tags/1.1.4/readme.txt (modified) (2 diffs)
-
tags/1.1.4/spamanvil.php (modified) (2 diffs)
-
trunk/admin/class-spamanvil-admin.php (modified) (1 diff)
-
trunk/includes/class-spamanvil-queue.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/spamanvil.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
spamanvil/tags/1.1.4/admin/class-spamanvil-admin.php
r3461389 r3461494 432 432 } 433 433 434 // Trigger immediate cron run so the queue starts processing without waiting. 435 if ( $enqueued > 0 ) { 436 spawn_cron(); 437 } 438 434 439 wp_send_json_success( array( 435 440 'enqueued' => $enqueued, -
spamanvil/tags/1.1.4/includes/class-spamanvil-queue.php
r3461359 r3461494 67 67 set_transient( $lock_key, true, 300 ); // 5-minute lock. 68 68 69 $processed = 0; 69 // Default time limit for cron: 50 seconds (safe for most hosts). 70 if ( 0 === $time_limit && ! $force ) { 71 $time_limit = 50; 72 } 73 74 $processed = 0; 75 $start_time = microtime( true ); 76 70 77 try { 71 78 $batch_size = (int) get_option( 'spamanvil_batch_size', 5 ); 72 $items = $this->claim_items( $batch_size, $force ); 73 $start_time = microtime( true ); 74 75 foreach ( $items as $item ) { 76 $this->process_single( $item ); 77 $processed++; 78 79 // Time guard: stop if approaching limit. 80 if ( $time_limit > 0 ) { 81 $elapsed = microtime( true ) - $start_time; 82 if ( $elapsed >= $time_limit ) { 83 // Release unclaimed items back to queue. 84 $remaining_ids = array_slice( wp_list_pluck( $items, 'id' ), $processed ); 85 if ( ! empty( $remaining_ids ) ) { 86 $this->release_items( $remaining_ids ); 79 80 // Loop through batches until queue is empty or time runs out. 81 do { 82 $items = $this->claim_items( $batch_size, $force ); 83 84 if ( empty( $items ) ) { 85 break; 86 } 87 88 foreach ( $items as $item ) { 89 $this->process_single( $item ); 90 $processed++; 91 92 // Time guard: stop if approaching limit. 93 if ( $time_limit > 0 ) { 94 $elapsed = microtime( true ) - $start_time; 95 if ( $elapsed >= $time_limit ) { 96 // Release unclaimed items back to queue. 97 $current_index = array_search( $item, $items, true ); 98 $remaining = array_slice( $items, $current_index + 1 ); 99 $remaining_ids = wp_list_pluck( $remaining, 'id' ); 100 if ( ! empty( $remaining_ids ) ) { 101 $this->release_items( $remaining_ids ); 102 } 103 return $processed; 87 104 } 88 break;89 105 } 90 106 } 91 } 107 108 // After force-processing one batch, stop looping (AJAX handles its own loop). 109 if ( $force ) { 110 break; 111 } 112 113 } while ( true ); 92 114 } finally { 93 115 delete_transient( $lock_key ); -
spamanvil/tags/1.1.4/readme.txt
r3461481 r3461494 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 38 Stable tag: 1.1.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 211 211 == Changelog == 212 212 213 = 1.1.4 = 214 * Fix: Cron now processes the entire queue per run (up to 50 seconds) instead of only 5 items — large backlogs clear in minutes, not hours 215 * Fix: Queue processing starts immediately after "Scan Pending Comments" (spawns cron) instead of waiting up to 5 minutes 216 213 217 = 1.1.3 = 214 218 * Fix: "Process Queue Now" button is now enabled immediately after "Scan Pending Comments" enqueues items (no page reload needed) -
spamanvil/tags/1.1.4/spamanvil.php
r3461481 r3461494 4 4 * Plugin URI: https://software.amato.com.br/spamanvil-antispam-plugin-for-wordpress/ 5 5 * Description: Blocks comment spam using AI/LLM services with support for multiple providers, async processing, and intelligent heuristics. 6 * Version: 1.1. 36 * Version: 1.1.4 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 … … 19 19 } 20 20 21 define( 'SPAMANVIL_VERSION', '1.1. 3' );21 define( 'SPAMANVIL_VERSION', '1.1.4' ); 22 22 define( 'SPAMANVIL_DB_VERSION', '1.0.0' ); 23 23 define( 'SPAMANVIL_PLUGIN_FILE', __FILE__ ); -
spamanvil/trunk/admin/class-spamanvil-admin.php
r3461389 r3461494 432 432 } 433 433 434 // Trigger immediate cron run so the queue starts processing without waiting. 435 if ( $enqueued > 0 ) { 436 spawn_cron(); 437 } 438 434 439 wp_send_json_success( array( 435 440 'enqueued' => $enqueued, -
spamanvil/trunk/includes/class-spamanvil-queue.php
r3461359 r3461494 67 67 set_transient( $lock_key, true, 300 ); // 5-minute lock. 68 68 69 $processed = 0; 69 // Default time limit for cron: 50 seconds (safe for most hosts). 70 if ( 0 === $time_limit && ! $force ) { 71 $time_limit = 50; 72 } 73 74 $processed = 0; 75 $start_time = microtime( true ); 76 70 77 try { 71 78 $batch_size = (int) get_option( 'spamanvil_batch_size', 5 ); 72 $items = $this->claim_items( $batch_size, $force ); 73 $start_time = microtime( true ); 74 75 foreach ( $items as $item ) { 76 $this->process_single( $item ); 77 $processed++; 78 79 // Time guard: stop if approaching limit. 80 if ( $time_limit > 0 ) { 81 $elapsed = microtime( true ) - $start_time; 82 if ( $elapsed >= $time_limit ) { 83 // Release unclaimed items back to queue. 84 $remaining_ids = array_slice( wp_list_pluck( $items, 'id' ), $processed ); 85 if ( ! empty( $remaining_ids ) ) { 86 $this->release_items( $remaining_ids ); 79 80 // Loop through batches until queue is empty or time runs out. 81 do { 82 $items = $this->claim_items( $batch_size, $force ); 83 84 if ( empty( $items ) ) { 85 break; 86 } 87 88 foreach ( $items as $item ) { 89 $this->process_single( $item ); 90 $processed++; 91 92 // Time guard: stop if approaching limit. 93 if ( $time_limit > 0 ) { 94 $elapsed = microtime( true ) - $start_time; 95 if ( $elapsed >= $time_limit ) { 96 // Release unclaimed items back to queue. 97 $current_index = array_search( $item, $items, true ); 98 $remaining = array_slice( $items, $current_index + 1 ); 99 $remaining_ids = wp_list_pluck( $remaining, 'id' ); 100 if ( ! empty( $remaining_ids ) ) { 101 $this->release_items( $remaining_ids ); 102 } 103 return $processed; 87 104 } 88 break;89 105 } 90 106 } 91 } 107 108 // After force-processing one batch, stop looping (AJAX handles its own loop). 109 if ( $force ) { 110 break; 111 } 112 113 } while ( true ); 92 114 } finally { 93 115 delete_transient( $lock_key ); -
spamanvil/trunk/readme.txt
r3461481 r3461494 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1.1. 38 Stable tag: 1.1.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 211 211 == Changelog == 212 212 213 = 1.1.4 = 214 * Fix: Cron now processes the entire queue per run (up to 50 seconds) instead of only 5 items — large backlogs clear in minutes, not hours 215 * Fix: Queue processing starts immediately after "Scan Pending Comments" (spawns cron) instead of waiting up to 5 minutes 216 213 217 = 1.1.3 = 214 218 * Fix: "Process Queue Now" button is now enabled immediately after "Scan Pending Comments" enqueues items (no page reload needed) -
spamanvil/trunk/spamanvil.php
r3461481 r3461494 4 4 * Plugin URI: https://software.amato.com.br/spamanvil-antispam-plugin-for-wordpress/ 5 5 * Description: Blocks comment spam using AI/LLM services with support for multiple providers, async processing, and intelligent heuristics. 6 * Version: 1.1. 36 * Version: 1.1.4 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 … … 19 19 } 20 20 21 define( 'SPAMANVIL_VERSION', '1.1. 3' );21 define( 'SPAMANVIL_VERSION', '1.1.4' ); 22 22 define( 'SPAMANVIL_DB_VERSION', '1.0.0' ); 23 23 define( 'SPAMANVIL_PLUGIN_FILE', __FILE__ );
Note: See TracChangeset
for help on using the changeset viewer.