Exclude Linux core dumps from backups by default (#538) - #643
Draft
sourabh-imh wants to merge 1 commit into
Draft
Conversation
Add the core.* pattern to the default folder-exclusion list so Linux core dump files are excluded from backups out of the box, avoiding oversized archives. Users can still override or remove this default via the existing Files and Folders exclusion settings. Add PHPUnit coverage for the new default, the core.* match behavior, and user overrides. Co-authored-by: sourabh-imh <sourabh-imh@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #538. Linux core dump files (e.g.
core.12345) were being swept into backups, producing very large archives and resource problems. This addscore.*to the plugin's default folder-exclusion list so core dumps are excluded out of the box, while users can still override or remove the default via the existing Settings → Files and Folders exclusion UI.Changes
admin/class-boldgrid-backup-admin-folder-exclusion.php: appendcore.*to$default_exclude(now.git,node_modules,wp-content/cache,core.*). This is the single source of truth for the default exclude list — the settings UI (admin/partials/settings/folders.php), the JS "Use default settings" reset, andis_all_files()all read this property dynamically, so no other changes are needed. The default remains filterable via the existingboldgrid_backup_default_folder_excludefilter.tests/admin/test-class-boldgrid-backup-admin-folder-exclusion.php: new PHPUnit coverage.Behavior notes
The plugin converts exclude patterns to anchored regex in
create_pattern(), where.is literal and*matches within a path segment ([^/]*). Socore.*:core.12345,wp-content/uploads/core.98765,core.core-plugin/file.phpormycore.phpTesting
phpcs(project ruleset) passes on the changed files, and the new PHPUnit test passes:Covered:
core.*is present in the default exclude, the match behavior above, a core dump is excluded under default settings while a normal file is kept, a user override re-includes core dumps, and the default remains filterable.Notes
readme.txtchangelog entries and theStable tag/ version bump are added at release-branch time (see the 1.16.4 branch that added thewp-content/cachedefault), so this feature PR intentionally does not bump the version or add a dated changelog entry. Happy to add one if preferred.