WordPress.org

Support

Support » Plugins and Hacks » comments-likes » [Plugin: comments-likes] Bad code practices

[Plugin: comments-likes] Bad code practices

  • Line 74 of comments-likes.php is

    add_action('wp_head','cl_header');
    function cl_header() {
        echo '<link type="text/css" rel="stylesheet" href="'. get_bloginfo('wpurl').'/wp-content/plugins/comments-likes/comments-likes.css" />'."\n";
        echo '<script type="text/javascript" src="'.get_bloginfo('wpurl').'/wp-content/plugins/comments-likes/js/jquery.js"></script>'."\n";
        echo '<script type="text/javascript" src="'.get_bloginfo('wpurl').'/wp-content/plugins/comments-likes/js/comments-likes.js"></script>'."\n";
    }

    First of all, you should register your scripts with wp_register_script and enqueue it via wp_enqueue_script.

    Second of all, you should never load your own version of jQuery from the plugin. Let WordPress use its own jQuery. This screwed up another jQuery plugin I was using and I had to remove the above jQuery load.

    http://wordpress.org/extend/plugins/comments-likes/

  • The topic ‘[Plugin: comments-likes] Bad code practices’ is closed to new replies.
Skip to toolbar