Repository navigation
Handled missing DOM extension during XML import - #540
Merged
Merged
Conversation
Collaborator
pirate-bot
requested changes
Oct 23, 2026
Collaborator
There was a problem hiding this comment.
🟡 Changes requested
The DOM gate fixes the reported crash, but a host without dom and xml still crashes, and one new test passes without the change.
Validation details
- Files reviewed: 2/2 changed files.
- The new tests pass at HEAD:
cd /repo && set -o pipefail; timeout 300 phpunit --do-not-cache-result --filter 'WXR_Parser_Test::' 2>&1 | tee /workspac…printedOK (2 tests, 2 assertions)(run R3) - On the pr-base parser, the first test still passes:
set -o pipefail; cd /workspace/checks/R1b/tree && ls phpunit*.xml* 2>/dev/null; { echo "== HEAD tests, pr-base WXR_Parse…printedOK (1 test, 1 assertion)(run R17) The fallback test fails there. - Without
dom, pr-base crashes: `cd /workspace/checks/R1 && cat > stub-fs.inc <<'EOF'
Untested areas
- The full PHPUnit suite was not run. CI owns it. - The no-DOM runs used a small harness without WordPress. The first failure on the full import path is traced from source only. - The reported host's `xml` extension state is unknown.
pirate-bot
approved these changes
Oct 23, 2026
Collaborator
There was a problem hiding this comment.
🟢 Approved
The PR passes. Both earlier findings are fixed, and the re-review found no new problem.
Validation details
- Files reviewed: 2/2 changed files.
- The parser tests pass at HEAD:
cd /repo && set -o pipefail; timeout 300 phpunit --do-not-cache-result --filter 'WXR_Parser_Test::' 2>&1 | tee /workspac…printedOK (2 tests, 2 assertions)(run R9) - Both tests fail with the pr-base parser:
set -o pipefail; rm -rf /workspace/checks/R2/base-tree && cp -a /repo /workspace/checks/R2/base-tree && cd /workspace/ch…printedTests: 2, Assertions: 2, Failures: 2.(run R11) - With only
simplexmlloaded, HEAD returns a readable error:cd /workspace/checks/R2 && sed -i "s#^require '/var/www/html/wp-includes/class-wp-error.php';#&\nrequire '/var/www/html/…printedWXR_parser_unavailable(run R4) - With
simplexmlandxmlbut nodom, HEAD uses the XML parser:cd /workspace/checks/R2 && set -o pipefail; echo "== (c2) simplexml+xml, no dom"; php -n -d extension=simplexml.so -d ex…printedRESULT: array(run R5)
Untested areas
- The full PHPUnit suite was not run. CI owns it.
- The no-DOM runs used a small harness without a full import request.
- A Beaver Builder import without
xmlstill returnsnull. That code is unchanged from pr-base.
🤖 Automated review · run code-review-agent_6adb1cde62ba59.52383674.
🤖 Review agent — review posted ✅ on 282aae50 · approved · 0 findings · 9 min
Run code-review-agent_6adb1cde62ba59.52383674 · trail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the robustness of the WXR parser selection logic by ensuring that the SimpleXML parser is only used when both the
simplexmlextension and theDOMDocumentclass are available. It also adds comprehensive tests to verify parser selection behavior based on the environment's capabilities.Check before Pull Request is ready:
Closes #539