Title: How to debug PHP warnings?
Last modified: June 2, 2023

---

# How to debug PHP warnings?

 *  Resolved [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [3 years ago](https://wordpress.org/support/topic/ho-to-debug-php-warnings/)
 * Hi, first: thanks for this excellent plugin!
 * One small issue I ran into: my error log is being flooded with PHP warning messages.
   I assume they are coming from one of the code snippets but… Since there are many
   snippets, is there a way to find out quickly from where it is coming?
 *     ```wp-block-code
       [02-Jun-2023 10:13:09 UTC] PHP Warning:  Undefined variable $args in /home/xxx/xxx/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(277) : eval()'d code on line 28
       [02-Jun-2023 10:13:09 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/xxx/xxx/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(277) : eval()'d code on line 28
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years ago](https://wordpress.org/support/topic/ho-to-debug-php-warnings/#post-16788916)
 * Hi Rolf,
 * Thank you for the feedback. The best way to find the source of that notice is
   to go to the list of WPCode snippets on your site and use the top-right search
   box to search for “$args” [https://a.supportally.com/i/SNYnhj](https://a.supportally.com/i/SNYnhj)
 * From the list of results that you get (if there are multiple results), the snippet
   causing the issue should have the $args variable on line 28 of the PHP code.
 * In this case, it looks like the $args variable is not defined there so you might
   need to add a check or adjust the name of the variable.
 * If you need further assistance you can reach out using the form at [https://wpcode.com/contact](https://wpcode.com/contact)
   so that you can share the snippet code with us, we’ll try to suggest an adjustment.
 *  Thread Starter [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [3 years ago](https://wordpress.org/support/topic/ho-to-debug-php-warnings/#post-16788937)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/) thanks for pointing
   me to the search function right there in front of me! Excellent stuff 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to debug PHP warnings?’ is closed to new replies.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/ho-to-debug-php-warnings/#post-16788937)
 * Status: resolved