[wp-hackers] DOMDocument in plugin

Jeremy Visser jeremy at visser.name
Tue Sep 22 04:11:27 UTC 2009

On Mon, 2009-09-21 at 19:46 -0700, Todd Iceton wrote:
> > PHP Fatal error:  Class 'DOMDocument' not found
> Can't have my plugin causing these kinds of 
> problems, so I'll have to do something else.

If your plugin is intended for public consumption, then unfortunately
depending on classes that are not likely to be installed is not really
possible if users on shared hosts is part of your target audience.

Such is life. :(

If you can manage to parse the content without an XML parser, you could
still include the DOMDocument code for use if the user does happen to
have it installed, for better security/more speed/whatever.

Checking class_exists('DOMDocument') could help you there. :)

More information about the wp-hackers mailing list