Title: Plugin doesn&#039;t work in custom plugins dir
Last modified: August 22, 2016

---

# Plugin doesn't work in custom plugins dir

 *  Resolved [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/)
 * Hoi,
 * My plugins dir is not the standard wp-content/plugins but wp-content/myplugins.
   When I want to use your plugin the video won’t show.
 * This is the url I got:
    `http://www.domain.com/wp-content/plugins/wp-youtube-
   lyte/lyte/lyte-min.js?wyl_version=1.5.0` and it should be `http://www.domain.
   com/wp-content/myplugins/wp-youtube-lyte/lyte/lyte-min.js?wyl_version=1.5.0`
 * Other plugins do work btw
 * Thanks
 * [https://wordpress.org/plugins/wp-youtube-lyte/](https://wordpress.org/plugins/wp-youtube-lyte/)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/page/2/?output_format=md)

 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721771)
 * Has to do with `dirname(__FILE__)`. It works again when I hard coded it.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721819)
 * Hi Wendihihihihihihihihi:
    I can confirm non-default wp-content dirs were never
   taken into account until now (you’re the first to ask, I think). That being said,
   I’ll have a look at the code and report back here 🙂
 * kind regards,
    frank
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721820)
 * Sounds good! Thanks
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721882)
 * Middag Wendi;
    Could you open up /wp-content/myplugins/wp-youtube-lyte/wp-youtube-
   lyte.php and on line 45 change
 *     ```
       $wp_lyte_plugin_url = trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)) . '/';
       ```
   
 * into
 *     ```
       // $wp_lyte_plugin_url = trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)) . '/';
       ```
   
 * so essentially just putting that line in comment, same on line 65 which should
   become;
 *     ```
       // $lyteSettings['path']=$wp_lyte_plugin_url.'lyte/';
       ```
   
 * and finally around line 82 change
 *     ```
       function lyte_parse($the_content,$doExcerpt=false) {
       	global $lyteSettings;
   
       	$urlArr=parse_url($lyteSettings['path']);
       ```
   
 * into
 *     ```
       function lyte_parse($the_content,$doExcerpt=false) {
       	global $lyteSettings;
   
       	$lyteSettings['path']=plugins_url() . "/" . dirname(plugin_basename(__FILE__)) . '/';
       	$urlArr=parse_url($lyteSettings['path']);
       ```
   
 * [plugins_url() is a stock WP function](http://codex.wordpress.org/Function_Reference/plugins_url)
   which should know about your deviant config, but it isn’t available in the global
   context, so it has to be called inside lyte_parse instead, hence above juggling.
 * Let me know if that solved your “myplugins”-troubles 😉
 * Groetjes,
    Frank
 *  [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721981)
 * Thanks Frank. Would this be something that you would implement in the next update
   or is this only a fix for me?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721983)
 * Hi Okoth1 and/or Wendihihihi;
    If you can confirm this indeed fixes the problem,
   then indeed this would go in the next version (which will focus on [the switch to the YouTube v3 API with required authentication](http://blog.futtta.be/2015/01/27/wp-youtube-lyte-and-youtube-api-v2-end-of-life/)
   by the way)!
 * Kind regards,
    frank
 *  [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5721984)
 * Great, replying with my hubby’s account!
 * I’ll do this probably on Saturday, no time tomorrow.
 * Nice guys, these Google people. Just when everything runs smoothly you can change
   it again…
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722002)
 * Hi Frank,
 * Temporary bad news: it doesn’t work yet with the changes above.
 * Shouldn’t there also not be some modifications in player_sizes.inc.php and options.
   php?
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722003)
 * Sorry, here is a bit more helpful info:
 * `Someone wanted to go to http://www.domein.com/wp-content/myplugins/wp-youtube-
   lyte/lyte-min.js?wyl_version=1.5.0, but it doesn't exist.`
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722004)
 * And this solved it…
 *     ```
       function lyte_parse($the_content,$doExcerpt=false) {
       	global $lyteSettings;
   
       	$lyteSettings['path']=plugins_url() . "/" . dirname(plugin_basename(__FILE__)) . '/lyte/';
       	$urlArr=parse_url($lyteSettings['path']);
       ```
   
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722018)
 * super Wendihihihihi, thanks for fixing that! 🙂
 * as confirmed earlier, this will go into wp youtube lyte 1.6.0 (hope to be able
   to push that out in the 2nd half of february).
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722019)
 * My pleasure!
 * Looking forward to v1.6.0
 * Thanks for the help!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722114)
 * Hi Wendihihihi;
    I’ve got a beta of 1.6.0, which includes this fix, ready. Main
   new feature; support for YouTube API v3 (as v2 is going to be decommissioned 
   soon). Biggest impact; you’ll need an API key for Lyte to be able to access YouTube’s
   API.
 * Would be great if you could [test-drive it](https://downloads.wordpress.org/plugin/wp-youtube-lyte.zip),
   there’s more info here; [http://blog.futtta.be/2015/02/18/wanted-testers-for-wp-youtube-lyte-the-one-with-the-new-yt-api/](http://blog.futtta.be/2015/02/18/wanted-testers-for-wp-youtube-lyte-the-one-with-the-new-yt-api/)
   🙂
 * Kind regards,
    frank
 *  Thread Starter [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * (@wendihihihi)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722116)
 * Hi Frank,
 * You want me to test it on a WP install with a renamed plugins folder?
 * Regards
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/#post-5722117)
 * well, test it in the same circumstances as when you created this thread here;
 * > My plugins dir is not the standard wp-content/plugins but wp-content/myplugins.
   > When I want to use your plugin the video won’t show.
 * and then play around with WP YouTube Lyte, I’m esp. interested in your experience
   with the YouTube API change 🙂
 * frank

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/page/2/?output_format=md)

The topic ‘Plugin doesn't work in custom plugins dir’ 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/)

 * 19 replies
 * 3 participants
 * Last reply from: [Wendihihihi](https://wordpress.org/support/users/wendihihihi/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/plugin-doesnt-work-in-custom-plugins-dir/page/2/#post-5722138)
 * Status: resolved