WordPress.org

Ready to get started?Download WordPress

Forums

JW Player for WordPress 1.7.2 and WP 3.5 (2 posts)

  1. hartley_h
    Member
    Posted 1 year ago #

    Since upgrading to WP3.5, my JW Player for WordPress (JWPfW) plug is not working. I upgraded JWPfW to version 1.7.2 but that didn't help. When I view a post with a call the the plugin, most of the page does not render, making me think there may be a PHP error somewhere. A post with a test video showing this behavior can be found here (I dated the post in 2000 so it doesn't show up at the top of my blog and prevent all other content from loading):

    http://www.henryhartley.com/?p=2721

    The content of the post is limited to a call to the plugin:

    [jwplayer mediaid="2724"]

    I have looked through the PHP code and it seems that the problem is somewhere in the generateSWFObject method defined in media/LongTailFramework.php but that could be wrong. I did see that the LongTailFramework::$current_config value is set early on (to "Out-of-the-Box" but by the time we get to the generateSWFObject method it is blank. Don't know if that's intentional or a red herring, though.

  2. hartley_h
    Member
    Posted 1 year ago #

    I made some progress here. I do not now think this is a bug in the JW-Player-for-Wordpress plugin. I'm not entirely sure, though.

    In jwplayermodule.php starting at line 69 for constants are set: JWPLAYER_PLUGIN_DIR, JWPLAYER_PLUGIN_url, JWPLAYER_FILES_DIR, AND JWPLAYER_FILES_URL. These all are created by concatenating some root directory variable or constant with plugin_basename(dirname(__FILE__)) and that's where the problem seems to be.

    The documentation says:

    If your plugin file is located at /home/www/wp-content/plugins/myplugin/myplugin.php, and you call:

    $x = plugin_basename(__FILE__);

    $x will equal "myplugin/myplugin.php".

    But adding a print statement to jwplayermodule.php shows that it is returning the entire path of the file, not just the last directory and the file name. Naturally that causes problems. I have found a second plugin (Lightbox-Plus) which uses plugin_basename() in the same way and exhibits the same problem.

    I have modified jwplayermodule.php so that it works now, but I don't want to have to do that every time an update is released.

    Since this is not a commonly reported problem, I have to assume that the plugin_basename() function is working properly for the vast majority of users. I suspect, but do not know, that the problem I am having is related to the use of the VirtualMultiBlog (VMB http://striderweb.com/nerdaphernalia/features/virtual-multiblog/) configuration along with the fact that I have values set for WP_PLUGIN_DIR, WP_PLUGIN_URL, WP_CONTENT_DIR, and WP_CONTENT_URL on a blog by blog basis.

    Can anyone else confirm that plugin_basename() is working in a standard configuration? Can anyone who uses VMB confirm that this plug-in fails when setting those constants? I have posted a question on the VMB site, so perhaps someone there will be able to help.

Topic Closed

This topic has been closed to new replies.

About this Topic