• Resolved spabav

    (@spabav)


    Hi I am using “use google libraries” for quite some time now.

    Doing a pingdom check on my site, I see that it calls the swf from google, but the link is broken.

    The link is:
    https://ajax.googleapis.com/ajax/libs/swfobject//swfobject.js

    If you look, you will see it does link to a double // before the word swfobject.js , and therefore the link does not work.

    This makes the load not working.

    It does not matter for my site, but its something which could be fixed easily , i guess.

    Would be nice if you could help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jason Penney

    (@jczorkmid)

    I just tested it on a site with only stock WordPress and Use Google Libraries.

    The link I get is:
    https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js

    Is some other plugin re-registering swfobject without it’s version info?

    Thread Starter spabav

    (@spabav)

    Thanks Jason,
    I guess that is the problem then.

    Unfortunately it is “nearly” impossible for me to figure out which plugin it could be, since i got quite a bunch (46) running.

    So far, its funny since it seems it does not affect my site.

    Anyway, thanks for your help.

    Plugin Author Jason Penney

    (@jczorkmid)

    If you have shell access (and if it’s a UNIX/Linux based account) it should be fairly easy to figure out an least what plugins reference swfobject:

    $ cd wp-content/plugins
    
    $ grep -Rl swfobject .

    (that’s a lowercase L on the grep command, not the number one)

    Or, if you feel like posting the list I can see if any jump out at me.

    Thread Starter spabav

    (@spabav)

    Hi Jason,
    thanks for your quick reply.

    I think i found the plugin.
    The JW Player plugin for wordpress is creating a swfobject callup on several occasions inside the plugin.

    The strange thing to me, it looks like it is calling the swfobject, directly with the right version number 2.2 and it is calling it directly from googleapis.

    Not sure if this causes the “wrong swfobject” callup, but it is the only plugin i use, with the swfobject in source.

    Hope you can find what is causing the problem.

    Thanks a lot for your help in advance.

    Plugin Author Jason Penney

    (@jczorkmid)

    Sorry for the delay in getting back to you. The issue is that JW Player is calling wp_*_script functions outside of a hook, in the main body of the plugin, which isn’t supported by WordPress.

    JW Player should use init for the wp_deregister and wp_register calls and wp_enqueue_scripts or admin_enqueue_scripts for the wp_enqueue_script calls as documented in the Codex.

    Also JW Player doesn’t check what version of swfobject WordPress core expects to load and instead hard-codes a specific version, which may cause problems in future.

    JW Player

    (@longtail-video)

    Hey guys,

    Thanks for posting the results of your investigation. SWFObject is only used as a fallback for users using older versions of the player. The intent is that the user have the JW Embedder installed (this is handled by the setup page included with the plugin).

    However, I will look into correcting the placement of the script registration calls.

    Thanks.

    I am also getting the broken Google CDN link with the double forward slashes:

    https://ajax.googleapis.com/ajax/libs/swfobject//swfobject.js

    What would the final solution be then? I can’t disable the “JW Player Plugin for WordPress” because all my videos depend on it, yet I’d like to keep “Use Google Libraries” active. In the JW Player setup and options (in WP) I don’t see any preference to embed the .js or not. What’s the best practice for this type of situation? Thanks ??

    Plugin Author Jason Penney

    (@jczorkmid)

    Besides the registration calls being in the incorrect location in ‘JW Player’, they are also missing the version parameter, so ‘Use Google Libraries’ doesn’t really stand a chance of working correctly at that point.

    I’d suggest that ‘JW Player’ just enqueue SWFObject, rather than assume it’s the only plugin using this WP core javascript. If the user has ‘Use Google Libraries’ then it will load from google, if not it will load from the WordPress install.

    Or the ‘JW Player’ dev(s) could look at how ‘Use Google Libraries’ leaves the version string registered correctly, but doesn’t append ‘?version=x.y’ to the URL without breaking things, which is what assume they were trying to do by removing the version.

    If you want things to work right now, disable UGL, or modify JWP until it’s fixed.

    Thanks for your response, Jason. Could you tell me what code to use in the JWP file (and which file) so I can keep using UGL? I’m a javascript beginner – more a designer type of guy ??

    JW Player

    (@longtail-video)

    @jason,

    The next version (coming out shortly) will be changed to enqueue swfobject.

    Thanks.

    Plugin Author Jason Penney

    (@jczorkmid)

    I just looked at the code, and it seems like this is fixed in JW Player, so I’m marking this resolved. Let me know if you’re still having issues.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Link to SWFOBJECT.js broken’ is closed to new replies.