Skip to content

Mod. Backups. Refactoring procedural functions into class methods#626

Open
AntonV1211 wants to merge 13 commits into
devfrom
ref_scanner_av
Open

Mod. Backups. Refactoring procedural functions into class methods#626
AntonV1211 wants to merge 13 commits into
devfrom
ref_scanner_av

Conversation

@AntonV1211
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the legacy procedural backups/rollback logic (inc/spbc-backups.php) into BackupsActions class methods and updates the scanner/admin/remote-call integration points to use the new class-based API.

Changes:

  • Moved backup creation, deletion, rollback, and helper functions from inc/spbc-backups.php into lib/.../ScannerActions/BackupsActions.php.
  • Updated scanner stages/queue, cure log, admin AJAX hooks, and remote call rollback to use BackupsActions methods.
  • Removed the inc/spbc-backups.php bootstrap include and added a unit test for deleteBackupAjax().

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Adds a unit test for the new AJAX delete handler.
security-malware-firewall.php Removes the legacy inc/spbc-backups.php require.
lib/CleantalkSP/SpbctWP/Scanner/Stages/CureStage.php Switches backup creation and “has backup” checks to BackupsActions.
lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php Switches auto-cure backup creation to BackupsActions.
lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Implements the refactored backups/rollback logic and AJAX handlers.
lib/CleantalkSP/SpbctWP/Scanner/CureLog/CureLog.php Switches “has backup” checks and backup cleanup to BackupsActions.
lib/CleantalkSP/SpbctWP/RemoteCalls.php Routes rollback remote-call action through BackupsActions.
inc/spbc-settings.php Updates list table func_data_total to use BackupsActions::countBackups.
inc/spbc-backups.php Removes the old procedural backups implementation.
inc/spbc-admin.php Updates AJAX action handlers to call BackupsActions methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread tests/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread tests/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php Outdated
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php
Comment thread lib/CleantalkSP/SpbctWP/Scanner/ScannerActions/BackupsActions.php
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.

3 participants