bassjobsen / wp-defer-loading

Defer loading javascript for WordPress. Without any additional library. Just the way Google ask you to do it.
4 stars 2 forks source link

Jetpack likes plugin stop working #9

Closed bassjobsen closed 11 years ago

bassjobsen commented 11 years ago

More information can be found on http://jetpack.me/support/likes/, Note you will have to connect to wordpress.com to use the like functions.

bassjobsen commented 11 years ago

The like plugin use some javascript which is not enqueued well. See this bug report http://plugins.trac.wordpress.org/ticket/2032

To fix for now:

Suggested solution:

wrap the javascript code from likes_master() in a separate file for example likes/queuehandler.js enqueue this file in action_init()

wp_enqueue_script( 'queuehandler', plugin_dir_url( __FILE__ ).'likes/queuehandlerjs', array( 'jquery','postmessage' ), '20131107' );

Note also the Jetpack share plugin (very similar to the like function ) has the same kind of issues, see: http://plugins.trac.wordpress.org/ticket/2028