Title: PHP Warning
Last modified: June 21, 2026

---

# PHP Warning

 *  [Frank](https://wordpress.org/support/users/bandy1967/)
 * (@bandy1967)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/php-warning-572/)
 * PHP Warning (Attempt to read property “childNodes” on null) in simple-html-to-
   markdown.php
 * Hi there,
 * I noticed a PHP warning in my server logs caused by the **Meerkat Markdown for
   AI Visibility** plugin. The error occurs under PHP 8.5.x when the HTML-to-Markdown
   parser encounters an unexpected or empty node.
 * **Error Log:**
 * Plaintext
 *     ```wp-block-code
       [proxy_fcgi:error] AH01071: Got error 'PHP message: PHP Warning: Attempt to read property "childNodes" on null in /wp-content/plugins/meerkat-markdown-for-ai-visibility/includes/simple-html-to-markdown.php on line 50; PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /wp-content/plugins/meerkat-markdown-for-ai-visibility/includes/simple-html-to-markdown.php on line 50'
       ```
   
 * **Cause:** In `includes/simple-html-to-markdown.php`, the method `process_nodes(
   $node )` receives `$node` which can sometimes be `null` (either on the initial
   call or during recursion). Line 50 tries to access `$node->childNodes` directly
   without validating the variable first.
 * **Suggested Fix:** Adding a simple guard clause at the very beginning of the `
   process_nodes` function resolves the issue cleanly:
 * PHP
 *     ```wp-block-code
       private function process_nodes( $node ) {
           if ( ! $node ) {
               return '';
           }
   
           $markdown = '';
   
           foreach ( $node->childNodes as $child ) {
               // ... rest of the code
       ```
   
 * Could you please include a null-check in the next plugin update to prevent these
   warnings from flooding the logs?
 * Thank you for your great work!
 * Best regards,
 * Frank

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-572%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/meerkat-markdown-for-ai-visibility/assets/icon-256x256.png?
   rev=3339084)
 * [Meerkat Markdown for AI Visibility](https://wordpress.org/plugins/meerkat-markdown-for-ai-visibility/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/meerkat-markdown-for-ai-visibility/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/meerkat-markdown-for-ai-visibility/)
 * [Active Topics](https://wordpress.org/support/plugin/meerkat-markdown-for-ai-visibility/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/meerkat-markdown-for-ai-visibility/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/meerkat-markdown-for-ai-visibility/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Frank](https://wordpress.org/support/users/bandy1967/)
 * Last activity: [1 week, 2 days ago](https://wordpress.org/support/topic/php-warning-572/)
 * Status: not resolved