Skip to content

Add phpMyAdmin support#2834

Draft
wojtekn wants to merge 12 commits intotrunkfrom
add-phpmyadmin-support
Draft

Add phpMyAdmin support#2834
wojtekn wants to merge 12 commits intotrunkfrom
add-phpmyadmin-support

Conversation

@wojtekn
Copy link
Contributor

@wojtekn wojtekn commented Mar 17, 2026

Related issues

How AI was used in this PR

I planned the feature architecture - data model, CLI flags, server config propagation, UI placement, offline handling, and persistence. Implementation was carried out by Claude (Sonnet 4.6) following that plan step by step.

Proposed Changes

Adds per-site phpMyAdmin support using the --phpmyadmin flag already available in @wp-playground/cli:

  • persist flag value in Studio appdata file
  • phpMyAdmin checkbox in the Debugging tab (offline-aware: disabled with tooltip)
  • phpMyAdmin button always visible in the "Open in…" grid. Disabled when phpMyAdmin is off, server is loading, or offline
  • phpMyAdmin row in the Debugging section of Settings tab, showing Enabled/Disabled
  • patch for @wp-playground/cli@3.1.12 removing the --phpmyadmin requires SQLite guard (see below)
  • site set --phpmyadmin / --no-phpmyadmin flag to persist the setting

A DEFAULT_ENABLE_PHPMYADMIN = false constant in tools/common/constants.ts makes it easy to flip the default on for all new sites.

CleanShot 2026-03-17 at 17 19 03

Known Issues

The PR includes two patches for Playground packages.

The first patch-package patch in this PR removes the --skip-sqlite-setup guard that previously prevented even getting this far - that guard was overly broad and blocked Studio's use case entirely. This also should be fixed upstream.

The second one fixes the path to the SQLite plugin hardcoded in the Playground CLI shim. The Playground CLI bundles phpMyAdmin and injects a SQLite-to-MySQL compatibility shim, but the path it hardcodes (/internal/shared/sqlite-database-integration/wp-pdo-mysql-on-sqlite.php) doesn't match where Studio mounts the SQLite integration. This is a bug in @wp-playground/cli that needs to be fixed upstream before this feature can ship.

Without that patch, phpMyAdmin loads but immediately crashes with:

Internal error in ./libraries/classes/Dbal/DbiMysqli.php#26
ErrorException: require_once(/internal/shared/sqlite-database-integration/wp-pdo-mysql-on-sqlite.php):
Failed to open stream: No such file or directory
Backtrace

Testing Instructions

  1. Build the CLI: npm run cli:build
  2. Start Studio
  3. Start a site
  4. Open Edit Site → Debugging tab → enable phpMyAdmin → Save
  5. The Overview tab will show a phpMyAdmin button in the "Open in…" grid
  6. Clicking it opens the phpMyAdmin URL - you'll see the SQLite path error described above
  7. Close and reopen Studio - the phpMyAdmin setting should persist (the persistence bug was fixed in this PR)

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

wojtekn added 9 commits March 17, 2026 16:44
- Add enablePhpMyAdmin field to siteDetailsSchema and ipc-types.d.ts
- Add DEFAULT_ENABLE_PHPMYADMIN = false constant for easy toggling
- Add enablePhpMyAdmin to ServerConfig IPC type
- Pass enablePhpMyAdmin from site data through to RunCLI args (phpmyadmin: true)
- Add phpmyadminChanged to SiteSettingChanges and siteNeedsRestart
- Add --phpmyadmin / --no-phpmyadmin to CLI site set command
- Persist enablePhpMyAdmin in appdata via site set
- Add phpmyadmin to EditSiteOptions and buildCliArgs
- Detect enablePhpMyAdmin changes in updateSite IPC handler
- Add Enable phpMyAdmin checkbox in Edit Site → Debugging tab
- Checkbox is disabled with offline tooltip when user has no internet
- Add phpMyAdmin button to Open in… section on Overview tab
- Button only shown when phpMyAdmin is enabled for the site
- Button is disabled with offline tooltip when user has no internet
@wojtekn wojtekn self-assigned this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant