Skip to content

Upd. Cron. Limiting the launch of Cron tasks - #758

Merged
AntonV1211 merged 7 commits into
devfrom
fix_init_cron_av
Oct 29, 2026
Merged

AntonV1211 merged 7 commits into
devfrom
fix_init_cron_av

Conversation

@AntonV1211

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Excluding ordinary GET requests without a recurring background wakeup can delay scheduled security work for hours.

1 open issue
What changed in this PR

This PR limits the security plugin’s cron workload to reduce its impact on visitor requests.

Changes:

  • Restricts cron ticks to POST and WordPress cron requests, excluding remote calls.
  • Runs one task per tick, prioritizing the most overdue.
  • Preserves skipped tasks’ schedules for later ticks.
File Description
security-malware-firewall.php Applies request gating before running cron.
lib/​CleantalkSP/​SpbctWP/​Cron.php Defines eligible requests and the one-task limit.
lib/​CleantalkSP/​Common/​Cron.php Limits and orders due tasks while preserving deferred work.

Review effort: Balanced

Comment thread lib/CleantalkSP/SpbctWP/Cron.php

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Cron recovery can stall, scanner errors can terminate background ticks, and wakeup authentication and concurrency handling need correction.

5 open issues
1 resolved since last review

Review effort: Balanced

Comment thread lib/CleantalkSP/SpbctWP/State.php Outdated
Comment thread security-malware-firewall.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Cron.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Cron.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/RemoteCalls.php Outdated
@AntonV1211
AntonV1211 requested review from Glomberg and svedge October 23, 2026 11:20
Comment thread lib/CleantalkSP/SpbctWP/Cron.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/RemoteCalls.php Outdated
@AntonV1211
AntonV1211 requested a review from Glomberg October 26, 2026 11:28
@AntonV1211
AntonV1211 merged commit 44f41e6 into dev Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants