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 to SQLite settings, with database status, size, and a database path that can be revealed or copied.
    • Added setup guidance showing requirements and whether installation is available. Installation is blocked when required SQLite support is missing or the database location cannot be determined.
    • Added database-location status and protection guidance in settings, plus a Site Health recommendation for potentially public database locations.
  • Bug Fixes
    • Improved database-size reporting to include SQLite sidecar files and clearly indicate when a size is unavailable.
  • 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 →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f37f79c7-6985-465e-ab61-af1ab8828586
📥 Commits

Reviewing files that changed from the base of the PR and between 97b4e79 and 583b842.

📒 Files selected for processing: 5
  • packages/plugin-sqlite-database-integration/admin-page.css
  • packages/plugin-sqlite-database-integration/admin-page.php
  • packages/plugin-sqlite-database-integration/health-check.php
  • packages/plugin-sqlite-database-integration/storage-health.php
  • tests/phpunit/WP_SQLite_Storage_Health_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 SQLite database-location classification and size accounting. The admin page provides setup, overview, and database-protection views. Site Health can report a public database location under specified environment and capability conditions.

Changes: SQLite storage protection

Layer / File(s) Summary
Classify and measure database storage
packages/plugin-sqlite-database-integration/storage-health.php, packages/plugin-sqlite-database-integration/load.php, tests/phpunit/WP_SQLite_Storage_Health_Test.php
Adds database path selection, path normalization, location classification, warning generation, and size accounting for SQLite sidecar files. Tests cover location cases, symlinks, path handling, 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
Adds the tabbed settings interface, setup checks, database details, protection status and instructions, and clipboard feedback. Styles, FAQ text, and admin-screen tests cover the updated interface.
Report public database locations
packages/plugin-sqlite-database-integration/health-check.php, tests/phpunit/WP_SQLite_Storage_Health_Test.php
Uses the shared size helper 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

Merge Risk: ⚪ Minimal · up to 583b8

The reported path warning and test-order concerns do not block merging; proceed with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 44.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 7 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: database-location checks and the SQLite settings redesign.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 44.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 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.2.16)

PHPStan reported 1 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
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 97b4e79 to 583b842 Compare October 15, 2026 08:43

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