Fix site export in offline mode - #2481
Conversation
| let loggerReportSuccessSpy: jest.SpyInstance; | ||
| let loggerReportWarningSpy: jest.SpyInstance; | ||
|
|
||
| const createPathExistsMock = ( sitePathExists = false ) => { |
There was a problem hiding this comment.
Unrelated change to fix npm run lint warning.
📊 Performance Test ResultsComparing f798c84 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
| ); | ||
| } | ||
|
|
||
| // Try to parse the output first - WordPress may produce warnings on stderr |
There was a problem hiding this comment.
Parsing the output first makes sense 👍
One question about the code is that we are parsing stdout, but the comment mentions WordPress may produce warnings on stderr, should that be stdout in the comment 🤔 ?
There was a problem hiding this comment.
Good catch, I updated the comment in f798c84
Let me know if it's clear now 🙏
There was a problem hiding this comment.
That's much clearer now, and it makes total sense, thanks for updating!
gcsecsey
left a comment
There was a problem hiding this comment.
Thanks for the fix @bcotrim! These changes LGTM, I tested them on Windows to make sure the path updates work there too. I confirm being able to export and reimport sites without issues now. 👍


Related issues
Proposed Changes
sqlite exportcommand to use absolute path/wordpress/<filename>instead of relative path. The WASM filesystem mounts the site at/wordpressbut PHP's working directory isn't set there, causing relative paths to fail. This is the same fix applied tosqlite importin PR Fix backup import for Jetpack, Local, Wpress and Studio formats #2422.getSitePluginsandgetSiteThemesto tolerate stderr warnings when stdout contains valid JSON. When offline, WordPress produces warnings about being unable to connect to WordPress.org for update checks, but the plugin/theme list commands still return valid data.Testing Instructions
Pre-merge Checklist