Title: WP_DEBUG and plugin&#039;s PHP errors
Last modified: August 31, 2016

---

# WP_DEBUG and plugin's PHP errors

 *  Resolved [kreestal](https://wordpress.org/support/users/kreestal/)
 * (@kreestal)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/)
 * Hi!
 * I’m setting the WP_DEBUG variable to true on my development environment.
 * I noticed that WP YouTube Lyte creates a few warnings:
 *     ```
       Warning: Illegal string offset 'title' in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
   
       Notice: Uninitialized string offset: 0 in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
   
       Warning: Illegal string offset 'title' in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
   
       Notice: Uninitialized string offset: 0 in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
   
       Warning: Illegal string offset 'title' in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
   
       Notice: Uninitialized string offset: 0 in /path/to/wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 311
       ```
   
 * Line 311 is the following:
 *     ```
       $lytetemplate = $wrapper."<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\"><div id=\"lyte_".$vid."\" data-src=\"".$thumbUrl."\" class=\"pL\"><div class=\"tC".$titleClass."\"><div class=\"tT\">".$yt_resp_array["title"]."</div></div><div class=\"play\"></div><div class=\"ctrl\"><div class=\"Lctrl\"></div><div class=\"Rctrl\"></div></div></div>".$noscript."</div></div>".$lytelinks_txt;
       ```
   
 * I temporarily fixed it by replacing line 311 with these:
 *     ```
       $lytetemplate = $wrapper."<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\"><div id=\"lyte_".$vid."\" data-src=\"".$thumbUrl."\" class=\"pL\">";
   
       if (isset($yt_resp_array) && !empty($yt_resp_array) && $yt_resp_array["title"] != NULL) :
       				$lytetemplate .= "<div class=\"tC".$titleClass."\"><div class=\"tT\">".$yt_resp_array['title']."</div></div>";
       				endif;
   
       $lytetemplate .= "<div class=\"play\"></div><div class=\"ctrl\"><div class=\"Lctrl\"></div><div class=\"Rctrl\"></div></div></div>".$noscript."</div></div>".$lytelinks_txt;
       ```
   
 * And yes, I know this will be overwritten with the next plugin’s update, but let’s
   hope it will be fixed by then 🙂
 * [https://wordpress.org/plugins/wp-youtube-lyte/](https://wordpress.org/plugins/wp-youtube-lyte/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6994864)
 * Well, … you can always [fork Lyte on GitHub](https://github.com/futtta/wp-youtube-lyte),
   fix & issue a pull request 🙂
 * frank
 *  Thread Starter [kreestal](https://wordpress.org/support/users/kreestal/)
 * (@kreestal)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6994889)
 * Here you are: [https://github.com/futtta/wp-youtube-lyte/pull/1](https://github.com/futtta/wp-youtube-lyte/pull/1)
   🙂
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6995194)
 * I pushed out a new version which includes (a slightly tweaked version of) your
   fixes as well kReEsTaL 🙂
 * frank
 *  [agkozak](https://wordpress.org/support/users/agkozak/)
 * (@agkozak)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6995195)
 * I never had any trouble before, but the new update (v1.6.5) really doesn’t work
   for me. On the production site (PHP v5.5.13), all of the videos went invisible.
   In my PHP error log I find
 * `PHP Warning: Invalid argument supplied for foreach() in /home/elsiecar/public_html/
   wp-content/plugins/wp-youtube-lyte/wp-youtube-lyte.php on line 58`
 * On the development site, using PHP v5.5.12, with WP_DEBUG set to true, for every
   video, instead of a video, I receive the error messages
 * `NOTICE: UNDEFINED VARIABLE: LYTETEMPLATE IN C:\WAMP\WWW\LOCALELSIE\WP-CONTENT\
   PLUGINS\WP-YOUTUBE-LYTE\WP-YOUTUBE-LYTE.PHP ON LINE 322`
 * and
 * `NOTICE: UNDEFINED VARIABLE: TEMPLATETYPE IN C:\WAMP\WWW\LOCALELSIE\WP-CONTENT\
   PLUGINS\WP-YOUTUBE-LYTE\WP-YOUTUBE-LYTE.PHP ON LINE 322`
 * It’s the same for PHP v7.0.2, actually.
 * I’ve switch back to v.1.6.4 of the plugin. Let me know if you would like me to
   test anything.
 * Alex
    [http://www.elsiecarlisle.com](http://www.elsiecarlisle.com)
 *  [agkozak](https://wordpress.org/support/users/agkozak/)
 * (@agkozak)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6995196)
 * P.S. I know those are warnings and notices and not fatal errors, but I didn’t
   receive them before, and I don’t get any videos displayed now, so something is
   wrong. 🙂
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6995197)
 * can’t find similar errors in any of my PROD or TEST-instances Alex, all works
   as it should.
 * Can you on your local dev environment go back to 1.6.5 and:
    * make (and upload)
   a screenshot of the page with broken lyte’s so I can see (or not see) what is
   happening? * look at your browser console for JS errors that might cause the 
   vids to disappear? * check if you have any customizations (using AO’s API or 
   other) that might be impacting things (I see the vids look different from stock
   lyte’s to start with, so …)
 * frank

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

The topic ‘WP_DEBUG and plugin's PHP errors’ is closed to new replies.

 * ![](https://ps.w.org/wp-youtube-lyte/assets/icon-128x128.png?rev=1836005)
 * [WP YouTube Lyte](https://wordpress.org/plugins/wp-youtube-lyte/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-youtube-lyte/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-youtube-lyte/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-youtube-lyte/reviews/)

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [PHP errors](https://wordpress.org/support/topic-tag/php-errors/)

 * 6 replies
 * 3 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/wp_debug-and-plugins-php-errors/#post-6995197)
 * Status: resolved