I Recommend This - Version 3.7.3

Version Description

Download this release

Release Info

Developer hchouhan
Plugin Icon 128x128 I Recommend This
Version 3.7.3
Comparing to
See all releases

Code changes from version 3.7.2 to 3.7.3

Files changed (2) hide show
  1. dot-irecommendthis.php +55 -38
  2. readme.txt +41 -28
dot-irecommendthis.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: I Recommend This
4
  * Plugin URI: http://www.harishchouhan.com/personal-projects/i-recommend-this/
5
  * Description: This plugin allows your visitors to simply recommend or like your posts instead of commment it.
6
- * Version: 3.7.2
7
  * Author: Harish Chouhan
8
  * Author URI: http://www.harishchouhan.com
9
  * Author Email: me@harishchouhan.com
@@ -671,53 +671,70 @@ if ( ! class_exists( 'DOT_IRecommendThis' ) )
671
 
672
  function dot_recommended_top_posts( $atts, $content = null )
673
  {
674
- // get our variable from $atts
675
- extract(shortcode_atts(array(
676
- 'container' => 'li',
677
- 'number' => '10',
678
- 'post_type' => 'post',
679
- 'year' => '',
680
- 'monthnum' => '',
681
- 'show_count' => '1',
682
- ), $atts));
683
 
684
- global $wpdb;
 
 
 
 
 
 
 
 
 
685
 
686
- $request = "SELECT * FROM $wpdb->posts, $wpdb->postmeta";
687
- $request .= " WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id";
 
 
688
 
689
- if ($year != '') {
690
- $request .= " AND YEAR(post_date) = '$year'";
691
- }
692
 
693
- if ($monthnum != '') {
694
- $request .= " AND MONTH(post_date) = '$monthnum'";
695
- }
 
 
 
 
 
 
 
 
696
 
697
- $request .= " AND post_status='publish' AND post_type='$post_type' AND meta_key='_recommended'";
698
- $request .= " ORDER BY $wpdb->postmeta.meta_value+0 DESC LIMIT $number";
699
- $posts = $wpdb->get_results($request);
700
 
701
- $return = '';
 
 
702
 
 
 
703
 
704
- foreach ($posts as $item) {
705
- $post_title = stripslashes($item->post_title);
706
- $permalink = get_permalink($item->ID);
707
- $post_count = $item->meta_value;
708
 
709
- $return .= '<' . $container . '>';
710
- $return .= '<a href="' . $permalink . '" title="' . $post_title.'" rel="nofollow">' . $post_title . '</a> ';
711
 
712
- if ( $show_count == '1') {
713
- $return .= '<span class="votes">' . $post_count . '</span> ';
714
- }
 
715
 
716
- //$return .= get_the_post_thumbnail($item->ID, 'showcase-thumbnail');
717
- $return .= '</' . $container . '>';
718
 
719
- }
720
- return $return;
 
 
 
 
 
 
721
 
722
  } //dot_recommended_top_posts
723
 
@@ -866,7 +883,7 @@ if ( ! class_exists( 'DOT_IRecommendThis' ) )
866
  }
867
 
868
  function dot_column_register_sortable( $columns ) {
869
- $columns['likes'] = 'likes';
870
  return $columns;
871
  }
872
 
@@ -883,6 +900,6 @@ if ( ! class_exists( 'DOT_IRecommendThis' ) )
883
  add_filter('request', 'dot_column_orderby');
884
  add_filter('manage_edit-post_sortable_columns', 'dot_column_register_sortable');
885
  add_filter('manage_posts_columns', 'dot_columns_head');
886
- add_action('manage_posts_custom_column', 'dot_column_content', 10, 2);
887
 
888
  ?>
3
  * Plugin Name: I Recommend This
4
  * Plugin URI: http://www.harishchouhan.com/personal-projects/i-recommend-this/
5
  * Description: This plugin allows your visitors to simply recommend or like your posts instead of commment it.
6
+ * Version: 3.7.3
7
  * Author: Harish Chouhan
8
  * Author URI: http://www.harishchouhan.com
9
  * Author Email: me@harishchouhan.com
671
 
672
  function dot_recommended_top_posts( $atts, $content = null )
673
  {
 
 
 
 
 
 
 
 
 
674
 
675
+ // define attributes and their defaults
676
+ // get our variable from $atts
677
+ $atts = shortcode_atts( array(
678
+ 'container' => 'li',
679
+ 'number' => '10',
680
+ 'post_type' => 'post',
681
+ 'year' => '',
682
+ 'monthnum' => '',
683
+ 'show_count' => '1',
684
+ ), $atts );
685
 
686
+ global $wpdb;
687
+
688
+ // empty params array to hold params for prepared statement
689
+ $params = array();
690
 
691
+ // build query string
692
+ $sql = "SELECT * FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id";
 
693
 
694
+ // add year
695
+ if( '' !== $atts['year'] ) {
696
+ $sql .= ' AND YEAR(post_date) = %d';
697
+ $params[] = $atts['year'];
698
+ }
699
+
700
+ // add monthnum
701
+ if( '' !== $atts['monthnum'] ) {
702
+ $sql .= ' AND MONTH(post_date) = %d';
703
+ $params[] = $atts['monthnum'];
704
+ }
705
 
706
+ // add post WHERE
707
+ $sql .= " AND post_status = 'publish' AND post_type = %s AND meta_key = '_recommended'";
708
+ $params[] = $atts['post_type'];
709
 
710
+ // add order by and limit
711
+ $sql .= " ORDER BY {$wpdb->postmeta}.meta_value+0 DESC LIMIT %d";
712
+ $params[] = $atts['number'];
713
 
714
+ // prepare sql statement
715
+ $query = $wpdb->prepare( $sql, $params );
716
 
717
+ // execute query
718
+ $posts = $wpdb->get_results( $query );
 
 
719
 
720
+ $return = '';
 
721
 
722
+ foreach ($posts as $item) {
723
+ $post_title = stripslashes( $item->post_title );
724
+ $permalink = get_permalink( $item->ID );
725
+ $post_count = $item->meta_value;
726
 
727
+ $return .= '<' . esc_html( $atts['container'] ) . '>';
728
+ $return .= '<a href="' . esc_url( $permalink ) . '" title="' . esc_attr( $post_title ) .'" rel="nofollow">' . esc_html( $post_title ) . '</a> ';
729
 
730
+ if ( $atts['show_count'] == '1') {
731
+ $return .= '<span class="votes">' . esc_html( $post_count ) . '</span> ';
732
+ }
733
+
734
+ $return .= '</' . esc_html( $atts['container'] ) . '>';
735
+
736
+ }
737
+ return $return;
738
 
739
  } //dot_recommended_top_posts
740
 
883
  }
884
 
885
  function dot_column_register_sortable( $columns ) {
886
+ $columns['likes'] = 'likes';
887
  return $columns;
888
  }
889
 
900
  add_filter('request', 'dot_column_orderby');
901
  add_filter('manage_edit-post_sortable_columns', 'dot_column_register_sortable');
902
  add_filter('manage_posts_columns', 'dot_columns_head');
903
+ add_action('manage_posts_custom_column', 'dot_column_content', 10, 2);
904
 
905
  ?>
readme.txt CHANGED
@@ -1,56 +1,66 @@
1
  === Plugin Name ===
2
- Contributors: hchouhan, dreamsonline, dreamsmedia, Benoit "LeBen" Burgener
3
- Donate link: http://www.dreamsonline.net
4
  Tags: recommend, like, love, post, rate, rating, post rating, heart, dribbble like, tumblr like
5
- Requires at least: 3.7
6
- Tested up to: 3.9.1
7
- Stable tag: 3.7.2
8
- Last Updated: 2014-June-21
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  This plugin allows your visitors to simply like/recommend your posts instead of comment on it.
13
 
14
-
15
  == Description ==
16
 
17
  This plugin allows your visitors to simply like/recommend your posts instead of comment on it.
18
 
 
19
 
20
- = This plugin includes =
21
- * A counter to display the number of "like" and to vote.
22
- * A widget and a function to display the X most liked posts.
23
- * A preference pane with some options.
24
- * Saves Cookie as well as users IP address to disable voting on the same post again
25
- * Displays Number of likes on Post Edit page along with sorting option Thanks to [HSG](http://profiles.wordpress.org/HSG/)
26
 
 
27
 
28
- = Advanced Options =
29
  * Hide count if count is zero
30
  * Set a default messages when count is zero, one or more
31
- * Choose between a "Thumbs Up" or a "Heart" icon to allow recommending on a post
32
- * Disable CSS to allow you to add your own styling rules
33
  * Disable saving of IP address in the table.
34
 
35
- = Shortcodes =
36
- * You can add the voting link to any page using shortcodes
37
- * Now using shortcode display a specific number of most recommended posts of all time or from a specific time period with support to chose the post type.
 
 
 
 
 
 
 
38
 
39
  = Translations =
40
- * French translation added. Thanks to Murat from [wptheme.fr](http://wptheme.fr/)
41
- * Portuguese translation added. Thanks to Darlan ten Caten - http://i9solucoesdigitais.com.br/
42
- * Persian translation added. Thanks to Hossein Soroor Golshani - Thanks to [HSG](http://profiles.wordpress.org/HSG/)
43
 
44
- This plugin is based exactly on Benoit "LeBen" Burgener's "I Like This" Plugin and has been modified after getting requests for the changes I had made on my website.
 
 
 
 
45
 
46
- Please report any bugs you find via http://www.dreamsonline.net/wordpress-plugins/i-recommend-this/ or via WordPress forums.
47
 
48
- = Examples of how the plugin has been used =
49
 
50
- * [Flat UI Design Gallery](http://flattrendz.com) - Example usage in website Design Gallery
51
- * [Harish's blog](http://www.harishchouhan.com/blog/) -
52
- * [OnePageMania.com](http://onepagemania.com/) -
53
 
 
 
 
 
 
 
54
 
55
  = My Links =
56
 
@@ -89,6 +99,9 @@ You can also visit the [support center](http://www.dreamsonline.net/wordpress-pl
89
 
90
  == Changelog ==
91
 
 
 
 
92
  = 3.7.2
93
  * Updated 'dot_irecommendthis.js' file to make plugin work even when the like button is on a hidden element. Thanks to [forthewinn](http://wordpress.org/support/profile/forthewinn). [Support Ticket](http://wordpress.org/support/topic/recommendation-to-fix-usage-in-hiddenexpanding-elements)
94
 
1
  === Plugin Name ===
2
+ Contributors: hchouhan, themeist, dreamsmedia, Benoit "LeBen" Burgener
3
+ Donate link: http://themeist.co
4
  Tags: recommend, like, love, post, rate, rating, post rating, heart, dribbble like, tumblr like
5
+ Requires at least: 4.0
6
+ Tested up to: 4.0
7
+ Stable tag: 3.7.3
8
+ Last Updated: 2014-September-24
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  This plugin allows your visitors to simply like/recommend your posts instead of comment on it.
13
 
 
14
  == Description ==
15
 
16
  This plugin allows your visitors to simply like/recommend your posts instead of comment on it.
17
 
18
+ = Features of I Recommend This =
19
 
20
+ - A counter to display the number of "like" and to vote.
21
+ - A widget and a function to display the X most liked posts.
22
+ - Saves Cookie as well as users IP address to disable voting on the same post again.
23
+ - Displays Number of likes on Post Edit page along with sorting option. [HSG](http://profiles.wordpress.org/HSG/)
24
+ - A preference pane with some options.
 
25
 
26
+ ** Advanced Options **
27
 
 
28
  * Hide count if count is zero
29
  * Set a default messages when count is zero, one or more
30
+ * Choose between a "Thumbs Up" or a "Heart" icon to allow post recommending.
31
+ * Disable plugin CSS to allow you to add your own styling rules
32
  * Disable saving of IP address in the table.
33
 
34
+ ** Shortcodes **
35
+
36
+ - Add the voting link to any page using shortcodes
37
+ - Display specific number of most recommended posts of all time or from a specific time period with support for custom post types.
38
+
39
+ = Examples of how the plugin has been used =
40
+
41
+ - [Flat UI Design Gallery](http://flattrendz.com)
42
+ - [Harish's blog](http://www.harishchouhan.com/blog/)
43
+ - [OnePageMania.com](http://onepagemania.com/)
44
 
45
  = Translations =
 
 
 
46
 
47
+ - English (en_US) - Harish Chouhan
48
+ - French (fr_FR) - Murat [wptheme.fr](http://wptheme.fr/)
49
+ - Portuguese (pt_BR) - [Darlan ten Caten](http://i9solucoesdigitais.com.br/)
50
+ - Persian (fa_IR) - [Hossein Soroor Golshani](http://profiles.wordpress.org/HSG/)
51
+ - Spanish (es_ES) - [Andrew Kurtis - WebHostingHub](http://www.webhostinghub.com/)
52
 
53
+ If you have created your own language pack (or have an update of an existing one) you can send in your .PO and .MO files so we can bundle it into I Recommend This plugin. You can [download the latest POT file](http://plugins.svn.wordpress.org/i-recommend-this/trunk/languages/dot-en.po), and [PO files in each language](http://plugins.svn.wordpress.org/i-recommend-this/trunk/languages/).
54
 
 
55
 
56
+ This plugin is based exactly on Benoit "LeBen" Burgener's "I Like This" Plugin and has been modified after getting requests for the changes I had made on my website.
 
 
57
 
58
+ Please report any bugs you find via [Support Forum](https://wordpress.org/support/plugin/i-recommend-this) or via comment on http://www.dreamsonline.net/wordpress-plugins/i-recommend-this/
59
+
60
+ > ** For Developers **
61
+ >
62
+ > If you're a developer and want to contribute, head over to [I Recommend This plugin on GitHub](https://github.com/hchouhan/I-Recommend-This)
63
+ >
64
 
65
  = My Links =
66
 
99
 
100
  == Changelog ==
101
 
102
+ = 3.7.3
103
+ * Fixed a Possible SQL injection vulnerability reported by [Oskar Adin](https://github.com/osadi) and fixed by [Danny van Kooten](https://twitter.com/DannyvanKooten).
104
+
105
  = 3.7.2
106
  * Updated 'dot_irecommendthis.js' file to make plugin work even when the like button is on a hidden element. Thanks to [forthewinn](http://wordpress.org/support/profile/forthewinn). [Support Ticket](http://wordpress.org/support/topic/recommendation-to-fix-usage-in-hiddenexpanding-elements)
107