Fatal error 'Class "DOMDocument" not found' during starter site XML import when PHP dom extension is missing

Aperta Adatta ai principianti
#539 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@girishpanchal30 ci sta già lavorando.

Dal 23/10/2026.

  • #541 di @pirate-bot — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Leggi includes/Importers/WP/WXR_Parser.php e includes/Importers/WP/WXR_Parser_SimpleXML.php per ricostruire la selezione del parser e la sua dipendenza da DOMDocument. Riproduci il problema con SimpleXML disponibile e DOM assente, poi verifica se il parser di Beaver Builder ha la stessa dipendenza. Il lavoro è completato quando l’importazione viene analizzata con un parser disponibile oppure restituisce un errore comprensibile invece di bloccarsi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug-report bug-report-triage

Summary

Importing a starter site's content fails with an uncaught fatal error: Class "DOMDocument" not found. Expected: the import either parses the XML using an available parser or fails gracefully with a readable error. Actual: the import request crashes with a fatal error. Impact: the site cannot import starter content; the user deactivated the plugin about two hours after install.

Customer context

  • Product / area: Templates Patterns Collection, starter site content import (remote XML)
  • Version: 1.4.7
  • Environment: PHP environment appears to lack the DOM extension (inference from the error); other details not provided
  • Integration / third party: None
  • Reported error / symptom: Uncaught Error: Class "DOMDocument" not found
  • Impact: Import fails; user deactivated plugin

Reproduction notes

Not reproduced. Likely workflow (inference): on a PHP install with simplexml loaded but the dom extension disabled, run a starter site content import via the REST import_remote_xml step. Exact environment not provided.

Diagnosis

Conclusion

The crash trace matches the code path. The parser selector appears to pick the SimpleXML parser based only on the simplexml extension, but that parser constructs a DOMDocument, which depends on the dom extension. Facts: trace and source align. Inference: the site lacks the dom extension.

Where this likely occurs
  • includes/Importers/WP/WXR_Parser.php — WXR_Parser::parse() approx. lines 66-72: checks extension_loaded( 'simplexml' ) before instantiating WXR_Parser_SimpleXML.
  • includes/Importers/WP/WXR_Parser_SimpleXML.php — WXR_Parser_SimpleXML::parse() approx. line 30: new \DOMDocument with no dom-extension check.
  • Call chain per trace: Rest_Server import_remote_xml, Content_Importer::import_file, WP_Import::import, WP_Import::parse.
Engineering notes

The Beaver Builder branch checks extension_loaded( 'xml' ), and the fallback branch checks xml, but neither covers the dom extension. A fatal Error is not caught by the WP_Error handling. Only one crash report was inspected.

Test coverage status

No relevant coverage was found during inspection.

What to verify or explore next
  • May be worth reproducing on PHP with dom disabled and simplexml enabled.
  • Checking whether the Beaver parser has the same dependency.
Unknowns / follow-up

The host's PHP extension list and the single-site prevalence are unknown.

Confidence

Confidence: 75/100

Source shows the parser selection only checks for the simplexml extension, while the SimpleXML parser instantiates DOMDocument (dom extension). Crash trace matches this path. No open issue found.


Source: automated uninstall feedback — templates-patterns-collection, 2026-10-22
Generated by bug-report-triage (ID: bug-report-triage_6adaea21413ba9.06600122)

Lingua principale
JavaScript
Stelle
57
Fork
10
Merge medio
3g 9h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Codeinwp/templates-patterns-collection

Tutte le issue di Codeinwp/templates-patterns-collection

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.