WordPress.org

Ready to get started?Download WordPress

Forums

comments-likes
Bad code practices (1 post)

  1. alxvallejo
    Member
    Posted 2 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.