Skip to content

Add location checks and redesign SQLite settings - #530

Open
JanJakes wants to merge 2 commits into
trunkfrom
warn-public-storage
Open

JanJakes wants to merge 2 commits into
trunkfrom
warn-public-storage

Conversation

@JanJakes

@JanJakes JanJakes commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Randomized paths and DB_PATH do not prevent web downloads. This adds location warnings and a redesigned settings screen to help administrators protect their SQLite database.

  • Location warnings: Flag databases inside the WordPress directory, content directory, or a known web root in SQLite settings and Site Health. Site Health skips this warning on local sites.
  • Database overview: Show integration status, database size including sidecars, and a hidden path that administrators can reveal and copy.
  • Protection guidance: Explain how to choose private storage or block web access in a dedicated Database protection tab, with instructions for new and existing installations.
  • Unified setup: Combine requirements, location guidance, and installation in one panel. Clarify that setup starts a fresh WordPress site without copying existing content.

These checks assess location only. They do not test HTTP access, move a database, or change its configuration. A path outside known public roots is not proof of protection.

Screenshots

Setup

SQLite setup screen showing installation requirements, database location guidance, and the install action

Overview

SQLite Overview tab showing database status and a location warning

Database protection

SQLite Database protection tab showing location status and protection instructions

Related: #502, #512, #520.

Summary by CodeRabbit

  • New Features
    • Added Overview and Database protection tabs with database status, size, location warnings, and protection guidance.
    • Added controls to reveal or copy database paths, with copy status feedback.
    • Added setup guidance and checks for SQLite support, compatible configuration, valid database locations, and writable storage.
    • Added responsive layouts for smaller screens and touch devices.
    • Added a Site Health recommendation for potentially public database locations.
  • Bug Fixes
    • Improved database-size reporting to include SQLite sidecar files and indicate unavailable sizes.
    • Redirects setup requests to the settings page when the database cannot be created.
  • Documentation
    • Added FAQ guidance on database-location warnings and protecting database files.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abdd3181-40f3-43cb-9960-7ba14e26bf4e
Commits

Reviewing files that changed from the base of the PR and between bbcb92d and 2c2435f.

Files selected for processing: 6
  • packages/plugin-sqlite-database-integration/activate.php
  • packages/plugin-sqlite-database-integration/admin-page.php
  • packages/plugin-sqlite-database-integration/storage-health.php
  • packages/plugin-sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-storage.php
  • tests/phpunit/WP_SQLite_Storage_Health_Test.php
  • tests/phpunit/WP_SQLite_Storage_Test.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The change adds database-location classification and write checks, database-size accounting, setup and protection views in the SQLite admin page, and a Site Health recommendation for public database locations. It also adds tests for these behaviors and related admin-screen interactions.

Changes: SQLite storage protection

Layer / File(s) Summary
Classify and validate database storage
packages/plugin-sqlite-database-integration/storage-health.php, packages/plugin-sqlite-database-integration/load.php, packages/plugin-sqlite-database-integration/activate.php, packages/plugin-sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-storage.php, tests/phpunit/WP_SQLite_Storage_Health_Test.php, tests/phpunit/WP_SQLite_Storage_Test.php
Adds database-location classification, path normalization, size accounting for SQLite sidecar files, and storage writability checks. Setup checks the configured location before installation. Tests cover location resolution, filesystem cases, writability, and size results.
Render setup and database protection views
packages/plugin-sqlite-database-integration/admin-page.php, packages/plugin-sqlite-database-integration/admin-page.css, packages/plugin-sqlite-database-integration/admin-page.js, packages/plugin-sqlite-database-integration/readme.txt, tests/phpunit/WP_SQLite_Storage_Health_Test.php, tests/phpunit/WP_SQLite_Database_Integration_Authorization_Test.php, tests/phpunit/WP_SQLite_Dropin_Test_Helpers.php
Adds the tabbed settings interface, setup checks, database details, protection status and instructions, and clipboard feedback. Styles, FAQ text, and tests cover the interface and setup behavior. The authorization tests use a shared drop-in test helper.
Report database status in Site Health
packages/plugin-sqlite-database-integration/health-check.php, tests/phpunit/WP_SQLite_Storage_Health_Test.php
Uses shared size accounting for database-size reporting. Adds a Site Health recommendation for public database locations and tests its conditions and exclusions.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Suggested reviewers: aristath

Merge Risk: Minimal · up to 2c243

This change adds database-location warnings, a database-size display, and a redesigned SQLite settings page. No actionable merge-blocking risk remains after review.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely summarizes the main changes: adding database location checks and redesigning the SQLite settings interface.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

PHPStan (2.3.1)

PHPStan reported 2 non-file analysis error(s); analysis is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JanJakes
JanJakes force-pushed the warn-public-storage branch 3 times, most recently from 90dd170 to 97b4e79 Compare October 14, 2026 12:01
@JanJakes
JanJakes marked this pull request as ready for review October 14, 2026 12:40
@JanJakes
JanJakes force-pushed the warn-public-storage branch 2 times, most recently from 583b842 to 878b4f8 Compare October 21, 2026 16:09
@JanJakes
JanJakes force-pushed the warn-public-storage branch from 878b4f8 to bbcb92d Compare October 29, 2026 10:14
Warn in Site Health and SQLite settings when the database is under a known public root, including randomized and custom paths. Account for symlinks and keep unknown locations distinct from paths outside known public roots. These checks do not test web access or change database storage. Site Health skips the recommendation on local sites.

Organize settings into Overview and Database protection tabs with database size, a hidden path that can be revealed and copied, and instructions for protecting new and existing databases. Site Health Info reports the same database size. Preserve installation and multisite permissions, and cover the behavior with focused tests.
Combine installation requirements, database location guidance, and the install action in one panel. Clarify that switching does not copy the existing content, while preserving installation guards and Query Monitor support.
@JanJakes
JanJakes force-pushed the warn-public-storage branch from bbcb92d to 2c2435f Compare October 29, 2026 11:38

This branch has not been deployed

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

1 participant