Description
Site owner to add voting functionality to the blog posts.

Features
1. Control voting feature via voting on/off (admin feature)
2. Control allow or disallow post author to vote his own posts (admin feature)
3. Control allow or disallow public voting (admin feature)
4. Customise vote and voted text (admin feature)
5. Customise vote and voted buttons images (admin feature)
6. Customise alert message for non logged in users (admin feature)
7. Voting logs for site administrator (admin feature)
8. Sort voting logs by vote count or voted date (admin feature)
9. Show current vote count and vote button on frontend templates
10. Compitible with almost all of the themes. You just need to call required function from your template
11. Total vote count widget
12. Top voted widget
13. Now public voting supported.
14. Now shortcode supported. e.g. [wpvoting]
15. Top voted posts list shortcode

Features in future releases
1. Export to CSV for admin voting logs
2. Registered user voting logs
3. Re-implement backend voting log list with WP_List_Table class

Installation
1. Upload `wpv-voting` folder to `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Go to Voting menu >> Voting Options and turn on the voting feature
4. You may add the custom alert message for non logged in users
5. You can use shortcode `[wpvoting]` directly in your posts content < OR >
6. Add

 if(function_exists('wpv_voting_display_vote'))
 wpv_voting_display_vote(get_the_ID()); 

between the wordpress loop of your theme templates such as category.php or single.php
7. You may also use shortcodes or widgets

Shorcode Usage

– Vote button –

[wpvoting]

– Top voted –

[wpv-top-voted show=&quot;10&quot; nopostmsg=&quot;Nothing to show!&quot;]

Note: This plugin will create two tables in your wordpress database

FAQ
Q: Where all of my voting logs gone after I deactivated and reactivated the plugin?
A: This plugin’s uninstall function removes two tables which were created during plugin activation.

Q: Why that two tables need to be deleted during deactivation?
A: Because it is good for those people like who really want to completely remove the plugin from their CMS.

Q: So how can I record the voting logs before I deactivate the plugin?
A: In the next release, I will add export to csv feature to record the voting logs.

Q: Why I cannot vote even I am a logged in user?
A: Because the site admin disallowed post author to vote his own posts and the post what you are intended to vote might be your own post .

Q: How do I style the widgets to blend them into my theme?
A: You could use custom css feature which is on the voting options page to style the widgets.  For more information, please see the help section of the plugin option page (voting options page)

Changelog
1.0
The first release of the plugin

1.1
Fixed broken images

1.2
Added allow or disallow post author to vote his own posts feature

1.2.1
Fixed voting on/off options not getting selected state after initial plugin activate
Fixed allow post author to vote his own posts options not getting selected state after initial plugin activate
Fixed allow post author to vote his own posts options not getting deleted after deactivate the plugin

1.3
Added custom vote text feature
Added custom voted text feature
Added custom vote button feature
Added custom voted button feature

1.4
Added shortcode support
Tested compability with WordPress 3.2.1

1.4.1
Fixed admin css

1.4.2
Added rest all voting

1.5
Added total vote count widget
Re-design admin voting options page

1.5.1
Added db version to options tbl for next release (public voting)

1.6
Added public voting feature (unregistered / non-logged in users voting)

1.7
Added top vote widget
Add safe-guard javascript pop-up confirmation box for “Reset All” button
Implemented proper un-installation (Now deactivate won’t delete db tables and settings)
Bug fix (two or more users voting from same computer can’t vote)

1.8
Added top voted list shortcode
Added wpv_voting_get_display_vote function to overcome vote button is keep showing at the top of the post
Now wpv_voting_display_vote will just echo out the wpv_voting_get_display_vote return
Vote button implementation is moved to wpv_voting_get_display_vote
Fixed vote button is keep showing at the top of the post when user uses [wpvoting] shortcode
Fixed minor CSS rule
Fixed minor spacing issue in javascript

Download

Note: Kindly please rate this plugin or vote the compatibility whatever this plugin is working for you or not. So I could review it and improve the quality of this plugin. Appreciate your help!

Resources
http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/
http://www.onextrapixel.com/2009/06/22/how-to-add-pagination-into-list-of-records-or-wordpress-plugin/
http://www.onextrapixel.com/2009/07/01/how-to-design-and-style-your-wordpress-plugin-admin-panel/
http://planetozh.com/blog/2009/09/top-10-most-common-coding-mistakes-in-wordpress-plugins/
http://wordpress.org/extend/plugins/vote-it-up/
http://wordpress.org/extend/plugins/shortcodes-ultimate/

161 thoughts on “WP Voting Plugin

  1. Warning: Missing argument 2 for wpdb::prepare(), called in /web/htdocs/www.chitarristi.org/home/wp-content/plugins/wp-voting/wpv-voting-func.php on line 169 and defined in /web/htdocs/www.chitarristi.org/home/wp-includes/wp-db.php on line 990
    Warning: Missing argument 2 for wpdb::prepare(), called in /web/htdocs/www.chitarristi.org/home/wp-content/plugins/wp-voting/wpv-voting-func.php on line 217 and defined in /web/htdocs/www.chitarristi.org/home/wp-includes/wp-db.php on line 990

    but all works… can we help me ? WP 3.5

    Reply
  2. Hi,
    I am testing this plugin, but for some reason when I press a button to vote it does not create a record in a table wpv_voting. When I create a record manualy it works OK.
    I am using a “[wpvoting]” tag in a post. Any idea???

    Can you email me please. Thanks.

    Reply
  3. Hey, I’m trying to use your plugin. For some reason some posts cannot be voted on, they are grayed out as if voting is closed, but I didn’t close anything out, as far as I know. Any suggestions? Thanks!

    Reply
  4. Hi Tristan,

    At first: Great Plugin!

    After installing and activating I got the following error message:

    Warning: Missing argument 2 for wpdb::prepare(), called in /www/htdocs/w00fe3d8/www/wp-content/plugins/wp-voting/wpv-voting-func.php on line 169 and defined in /www/htdocs/w00fe3d8/www/wp-includes/wp-db.php on line 990
    No Record Found

    I am using WP 3.5 and BuddyPress 1.6 and it seems to me that there is the issue. Any idea?

    Thanks a lot!

    Reply
  5. Hello:

    How can we use the shortcode to display the top voted lists by Category?

    [wpv-top-voted show="10" nopostmsg="Nothing to show yet!"]

    Thanks!

    Reply
  6. Hi Tristan,

    I’m wondering if you have any suggestions for sorting the blog post by vote in the blog roll and in the category blog roll?

    The code you suggested in functions.php will sort the primary blog roll, but it does not work in the categories.

    Thanks!

    Reply
  7. i think there is a bug in this plugin
    when i activate it, and go to my website, i lose the button on the top, which is the button going to dashboard

    Reply
  8. Thanks. I tried to send you money, but it says:

    “Currently PayPal accounts in Singapore are only able to send payments. This recipient is not eligible to receive funds.”

    Anyways, here is the code. I need it to sort posts by vote count, but also sort the category posts. You can look on my test website to see that it does not work on Categories. I get error, “No Results Found.” Code in functions.php below.

    add_filter(‘posts_orderby’, ‘edit_posts_orderby’);
    add_filter(‘posts_join_paged’,'edit_posts_join_paged’);

    function edit_posts_join_paged($join_paged_statement) {
    global $wpdb;
    $join_paged_statement = “LEFT JOIN “.$wpdb->prefix.”wpv_voting ON “.$wpdb- >prefix.”wpv_voting.post_id = $wpdb->posts.ID”;
    return $join_paged_statement;
    }

    function edit_posts_orderby($orderby_statement) {
    global $wpdb;
    $orderby_statement = “(“.$wpdb->prefix.”wpv_voting.vote_count) DESC”;
    return $orderby_statement;
    }

    Reply
  9. Hi Tristin,

    I’m trying to sort the posts by vote count on the main blog page AND also in the Categories. Currently, if I add the suggested code, it does not work in Categories.

    The site I’m working on is here:
    http://dreamgrowers.org/dobeforeyoudie/

    The code I’m using is:

    prefix."wpv_voting ON ".$wpdb- >prefix."wpv_voting.post_id = $wpdb->posts.ID";
    return $join_paged_statement;
    }

    function edit_posts_orderby($orderby_statement) {
    global $wpdb;
    $orderby_statement = "(".$wpdb->prefix."wpv_voting.vote_count) DESC";
    return $orderby_statement;
    }
    ?>

    Reply
    • prefix.”wpv_voting ON “.$wpdb- >prefix.”wpv_voting.post_id = $wpdb->posts.ID”;
      return $join_paged_statement;
      }

      function edit_posts_orderby($orderby_statement) {
      global $wpdb;
      $orderby_statement = “(“.$wpdb->prefix.”wpv_voting.vote_count) DESC”;
      return $orderby_statement;
      }
      ?>

      Reply

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>