I Recommend This

- taking forward the work of Benoit “LeBen” Burgener

This plugin allows your visitors to simply Recommend/like your posts instead of commment it. I wanted a tumblr like feature and wanted something similar for WordPress.

Background

Benoit “LeBen” Burgener had created a similar plugin http://wordpress.org/extend/plugins/i-like-this/ that works similarly like the like feature on tumblr. However its development has been discontinued. I had customized the CSS of this plugin to make it work a little more like tumblr and had requests by few other developers the code. So after taking permission from Benoit for further development of the plugin I have recently applied at WordPress to create a new plugin with the updated code.

This plugin include

  • A counter/button to display the number of “like” and to vote.
  • A widget and a function to display the X most liked posts.
  • A preference pane with some options

If you are interested in this plugin (the way its used on this website, simply leave a comment below with your email so I could get back to you with the download file)

 

UPDATE:

You can download this from here http://wordpress.org/extend/plugins/i-recommend-this/

Please post your comments so we can enhance this plugin together as  a community.

 

LATEST UPDATE: Version 2.4.1

If you wish to customize the link color, recommend image (heart), you can do so by using below classes in your style sheet. make sure to add !important to every style.

.iRecommendThis
a.recommendThis
a.recommendThis.active

 

Tips & Tricks:

How to Remove the Icon:

  1. Go to the Plugin Settings page “I recommend this” under “Settings” menu.
  2. Check the “Disable CSS” checkbox
  3. Add below CSS code to your theme’s stylesheet.
.dot-irecommendthis {
 background:none;
 padding:0 0 0 10px;
 border: 0 !important;
 margin-bottom: 10px;
 display: inline-block;
 text-decoration: none;
}
.dot-irecommendthis:hover,
.dot-irecommendthis.active {
 color: #F56559 !important;
}

[wpws url="http://wordpress.org/plugins/i-recommend-this/stats/" selector="td .last-child" user_agent="Bot at mysite.com" on_error="error_show"]

68 thoughts on “I Recommend This

  1. thetruthshallsetyoufreeindeed

    Hi, how do you filter unique likes? Is it just via username?
    We have a private site for our company and we’re using one single Internet/Public IP, and once a user liked a post the others can’t like the post anymore.

    Please help.
    Thanks!

    Reply
    1. harishchouhan

      Hello currently we filter unique likes using IP. And I understand how it would affect you if all users have a single IP.
      I am rolling out an update soon that wll allow users to disable the IP requirement. The update would be released before the end of this month, maybe sooner.

      Reply
      1. thetruthshallsetyoufreeindeed

        This is great news! Will look forward to this, hopefully the feature to filter by username can be considered too. :)

        Reply
  2. Ash

    Can you please give me the CSS code to make the heart twice as big and in different color if possible? I am a complete noob at css. thanks and awaiting your response. Great plugin btw. Can’t wait for the update.

    Reply
    1. harishchouhan

      Hello,

      The current CSS code is

      .dot-irecommendthis {
      background:url(../images/default.png) 0 0px no-repeat;
      padding:0 0 0 20px;
      border: 0 !important;
      margin-bottom: 10px;
      display: inline-block;
      text-decoration: none;
      }
      .dot-irecommendthis:hover, .dot-irecommendthis.active { background-position:0 -24px; color: #F56559 !important; }

      You would have to add your own class and your own heart image.

      Reply
        1. harishchouhan

          great. Do share your website. I would be creating a post showcasing some sites that use this plugin.

          Reply
      1. Krystina Montemurro

        hello – your reply sparked my brain – i went into the plugin editor and changed all the “title”s to “like this” or “liked” or “most liked posts”. if anyone else wants to do this proceed carefully to not break the plugin. only change titles.

        Reply
        1. harishchouhan

          Hi there,
          Can you please let me know the lines you modified. I assume you might have modified 2 lines?

          Reply
        1. mijafe

          So we want it to display right under (or to the bottom right of) the photo on the home page where it says – No Comments » • by “MM”

          Reply
    1. harishchouhan

      Hello, I have added the code mentioned on http://wordpress.org/plugins/i-recommend-this/installation/ in your index.php file of the active theme.

      Now the icon is working. You would now have to play with the CSS to better align the icon. Do try the code I had given to another user on the WordPress.org support ticket http://wordpress.org/support/topic/i-reccomend-this-not-showing-up-on-home-page-single-pagecategory-pages-works?replies=20#post-4237221

      Reply
      1. mijafe

        You are an incredible man Harish! Thank you for your time and effort on this request.
        Is it possible to tell us what the code is, or give us instructions for where to insert the code. We are building the real site out of a similar .com domain and had you working on the beta version.
        Thank you!

        Reply
        1. mijafe

          if not just tell us the files you worked on and alternatively we will just duplicate the .css file or whatever onto the new site.

          Reply
          1. harishchouhan

            Code sharing does not work in comment unfortunately, so will email you right now.

    2. harishchouhan

      Hi, Please check your site again and let me know if it works. Also did you receive my earlier email?

      Reply
  3. 倡萌 胡

    I translate it into Simple Chinese, Named it dot-irecommendthis-zh_CN.mo ,and put it in this plugin‘s languages folder, but It doesn’t work.

    Reply
    1. harishchouhan

      Sorry to keep you waiting. I am still working on some changes to the plugin after which will send you a final MO file which you could translate.

      Reply
  4. Timo

    Hello,
    i want to filter unique votes via ip saving. because users could have disabled cookies. then they can vote unlimited.
    but i want to know if the table with the ip adresses is cleared after 24 hours or something like this. because an other user can have an ip adress the other day from an user who already voted.
    can u say me something about this?

    Reply
    1. harishchouhan

      Currently the IP address records are saved permanently. You can write your own script or plugin to remove all records from the table in which the IP’s are saved.

      Reply
    1. harishchouhan

      Hi. Under “Settings” menu you would find a sub menu titled “I Recommend This”. From here you can disable the automated display on posts by unchecking the Automatically display on “Posts” checkbox.

      Reply
  5. Chris Gagner

    How would I display just the number of recommendations (not the button)? I would like to put this on my main page next to comments. Example: 3 Comments – 5 Recommendations. Is there a function i can use to accomplish this?

    Reply
      1. Chris Gagner

        I was hoping to just be able to pull the number. I don’t need it to be clickable in that spot either. I just want readers to be able to see how many recommendations a page has on the main page. Then at the bottom of the post, I would have the button as normal.

        Reply
        1. harishchouhan

          In that case you just need to pull the data in a variable and echo it. below code should work.

          Make sure its placed inside the post loop.

          Reply
  6. tony starr

    Hope someone can assist, I’m getting the following error when clicking on the “like” link: Fatal error: Call to undefined function remove_filter() also I don’t see any thumb or heart images next to the 0.

    Reply
    1. harishchouhan

      Hey Tony, can you please share your website link so I can take a look. If you don’t see heart then the wp_head would be missing from your theme.

      Reply
  7. ystream

    Hi ,

    I have a front page that has displays thumbnails and excerpts from all posts (see http://ystream.staging.wpengine.com ) . I have added this to my loop inside:

    The thumb shows up but all thumbs are using the same post ID , and thus all thumbs display the same count. As if it doesn’t get the specific post’s id.
    How can I get this right?

    THANKS

    johan

    Reply
  8. Emil

    Hi! Thanks for a very nice plugin. I ran into some trouble with it however. If you click to vote very fast multiple times it registers several votes. I’m using this for a contest currently and I’m afraid someone will discover this and use it to cheat. Can I solve it with some code perhaps? There’s a delay between clicking and the text turning unclickable, can this delay be removed altogether? Thanks for any help with this!

    Reply
          1. Emil

            Would you consider discussing this issue with me over e-mail? I’d post a link but the site is live so it’s kind of a sensitive issue.

          2. Emil

            I fixed it by changing this:

            if(link.hasClass(‘active’)) return false;

            To this:

            if(link.hasClass(‘active’)) return false;
            link.addClass(‘active’);

            I tested it in all browsers and my problem seems to have vanished. I guess by adding active directly after the click I prevented the “cheat”. Hopefully this new code doesn’t bite me in the ass :D

    1. harishchouhan

      Hi. As of now since the plugin allows guest voting, its hard to get users name. In future will create a similar plugin for logged in user. No time set for it, but I hope to work on it soon.

      Reply
  9. Stein Peeters

    Hi, I have a wordpress image gallery that I’m using. I would like to use this plugin to add hearts to all images. Is there any way to get this done?

    Reply
    1. harishchouhan

      Nice idea. The plugin won’t be useful as-is in your case. But if you are a developer you could customize the plugin. WordPress saves each image as an attachment (post type) and since the like button is generated dynamically by pulling the post ID from the loop if you find a way to somehow pass the post ID (of image attachment) then it could work.

      Reply
        1. harishchouhan

          Hi,

          As you would know, to manually place the like button, you have to use this

          Can you somehow retrieve the ID of the attachment and include it in the above code like and test. If this works, you won’t have to do anything else.

          Reply
          1. Guest

            I tried it first with a number like you did ’10′ but in the code I can see that the post ID is still used:

          2. Stein Peeters

            I tried it first with a number like you did ’10′ but in the code I can see that the post ID is still used: id = dot-irecommendthis-1092

            You can check it on nicholasensylvie.be/the-wedding

          3. harishchouhan

            Hi. I tried it locally. A correction, the ID can be supplied only when using shortcode. So please visit https://gist.github.com/hchouhan/8161356. use that code. But make sure to replace the ID value with the respective image attachment ID. Do let me know once you have it online, and I will share the link on the plugin page so others can see.

  10. Bigrice

    Thanks for the plugin. I wonder if I can use this plugin on Woocommerce product catalog/shop page? B/c I hope the visitors can ‘recommand’ the product.

    Thank you

    Reply
    1. harishchouhan

      Hi @disqus_K3OxURiClP:disqus. Yes the plugin can work with WooCommerce products. WooCommerce products are similar to posts and saved in same database tables. You would just have to copy the code and drop in your WooCommerce template.

      Reply
  11. Zebster

    The I Remmeber heart shows at the bottom of the post, i want it to show up before the written post. How do i do that?

    Reply
    1. harishchouhan

      Hi. You first have to disable auto display of Recommmend link by going to the plugin settings page under “Settings” menu. After that you have to edit your theme files. In the post look just before content is displayed add below line

      Reply
  12. xinwenfeed

    Wouldn’t it be super cool if the “most recommended posts” could be a ‘post category’ , that could be displayed apart from the sidebar list ??

    Reply
    1. harishchouhan

      Hi, that is actually a very nice suggestion. I am not sure how much time it would take as many are using it for CPT. But I will surely look into this.

      Reply
  13. Luk

    Great plugin! To be even better:

    1) create /css/dot-irecommendthis-admin.css and put in it:

    .column-likes {
    width: 5em;
    }

    2) in dot-irecommendthis.php, near the end, add the 2° line in this existing function:

    function dot_columns_head($defaults) {
    wp_enqueue_style( 'dot-irecommendthis', plugins_url( '/css/dot-irecommendthis-admin.css', __FILE__ ) ); //ADDED
    $defaults['likes'] = __('Likes', 'dot');
    return $defaults;
    }

    and voilà: in the posts manage page, you have the right width for the column “Likes”
    (Without my modification this column is really too much large)

    Reply
  14. Sandra Romano

    Hi!
    Great plugin, many thanks!
    I’m using it in my blog posts, and it works perfectly. But when I try to put it in my projects portfolio (a secondary query inside the home page), the plugin just goes back to the page header, without counting the clicks.
    Any idea of how I could fix it? http://sandraromano.es
    Thanks in advance.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>