Skip to content

Exclude Linux core dumps from backups by default (#538) - #643

Draft
sourabh-imh wants to merge 1 commit into
masterfrom
cursor/exclude-core-dumps-default-538-b5ba
Draft

Exclude Linux core dumps from backups by default (#538)#643
sourabh-imh wants to merge 1 commit into
masterfrom
cursor/exclude-core-dumps-default-538-b5ba

Conversation

@sourabh-imh

@sourabh-imh sourabh-imh commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves #538. Linux core dump files (e.g. core.12345) were being swept into backups, producing very large archives and resource problems. This adds core.* 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: append core.* 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, and is_all_files() all read this property dynamically, so no other changes are needed. The default remains filterable via the existing boldgrid_backup_default_folder_exclude filter.
  • 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 ([^/]*). So core.*:

  • matches core.12345, wp-content/uploads/core.98765, core.
  • does not match unrelated files that merely contain "core" such as core-plugin/file.php or mycore.php

Testing

phpcs (project ruleset) passes on the changed files, and the new PHPUnit test passes:

OK (5 tests, 11 assertions)

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

  • Changelog/version: per this repo's convention, readme.txt changelog entries and the Stable tag / version bump are added at release-branch time (see the 1.16.4 branch that added the wp-content/cache default), so this feature PR intentionally does not bump the version or add a dated changelog entry. Happy to add one if preferred.
  • Draft PR; not merged.
Open in Web Open in Cursor 

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>
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.

Exclude linux core dumps from backup by default

2 participants