Title: class-wpcode-snippet-execute.php(268)
Last modified: January 7, 2023

---

# class-wpcode-snippet-execute.php(268)

 *  Resolved [Jeremy Wu](https://wordpress.org/support/users/dreamingwu/)
 * (@dreamingwu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/class-wpcode-snippet-execute-php268/)
 * HI
   I found the message “class-wpcode-snippet-execute.php(268)” frequently recorded
   in the debug.log files of several different websites. Have you noticed this situation?
   The site contains a PHP 7.4 and PHP 8.0 environment, and it looks like it’s been
   there for a while, hope you find it and try to fix it.
 * recorded code:
 *     ```wp-block-code
       [14-Dec-2022 13:37:24 UTC] PHP Notice: Undefined offset: 0 in /home/trans-groups.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()'d code on line 11
       [14-Dec-2022 13:37:24 UTC] PHP Notice: Undefined offset: 0 in /home/trans-groups.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()'d code on line 8
       ```
   
 * or:
 *     ```wp-block-code
       thrown in /home/xxxx.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()'d code on line 4
       [07-Jan-2023 05:35:33 UTC] PHP Fatal error:  Uncaught TypeError: setcookie(): Argument #3 ($expires_or_options) must be of type array|int, string given in /home/xxxx.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()'d code:4
       Stack trace:
       #0 /home/xxxx.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(268) : eval()'d code(4): setcookie()
       #1 /home/xxxx.com/public_html/wp-includes/class-wp-hook.php(308): WPCode_Snippet_Execute->{closure}()
       #2 /home/xxxx.com/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
       #3 /home/xxxx.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
       #4 /home/xxxx.com/public_html/wp-includes/general-template.php(3043): do_action()
       #5 /home/xxxx.com/public_html/wp-content/themes/woodmart/header.php(12): wp_head()
       #6 /home/xxxx.com/public_html/wp-includes/template.php(783): require_once('...')
       #7 /home/xxxx.com/public_html/wp-includes/template.php(718): load_template()
       #8 /home/xxxx.com/public_html/wp-includes/general-template.php(48): locate_template()
       #9 /home/xxxx.com/public_html/wp-content/themes/woodmart/woocommerce/archive-product.php(26): get_header()
       #10 /home/xxxx.com/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('...')
       #11 /home/xxxx.com/public_html/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template()
       #12 /home/xxxx.com/public_html/wp-includes/template-loader.php(106): include('...')
       #13 /home/xxxx.com/public_html/wp-blog-header.php(19): require_once('...')
       #14 /home/xxxx.com/public_html/index.php(17): require('...')
       #15 {main}
       ```
   

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

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/class-wpcode-snippet-execute-php268/#post-16349773)
 * Hi [@dreamingwu](https://wordpress.org/support/users/dreamingwu/),
 * Those errors are being thrown in the snippets you have on the site – that’s simply
   the line where your custom code is being executed in the plugin.
 * I would look for the snippet using “setcookie” and the snippet trying to access
   the offset 0 of an array/string and add some extra checks there to prevent those
   notices from being thrown.
 * Please reach out at [https://wpcode.com/contact](https://wpcode.com/contact) 
   if you need help debugging the snippets so that you can share more info with 
   us.
 *  Thread Starter [Jeremy Wu](https://wordpress.org/support/users/dreamingwu/)
 * (@dreamingwu)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/class-wpcode-snippet-execute-php268/#post-16349915)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/) 
   Thank you for 
   your explanation. If there is any further demand, I will raise it again. Thank
   you

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

The topic ‘class-wpcode-snippet-execute.php(268)’ 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: [Jeremy Wu](https://wordpress.org/support/users/dreamingwu/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/class-wpcode-snippet-execute-php268/#post-16349915)
 * Status: resolved