I Recommend This - Version 3.8.2

Version Description

Download this release

Release Info

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

Code changes from version 3.8.1 to 3.8.2

i-recommend-this.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: I Recommend This
4
  * Plugin URI: https://themeist.com/plugins/wordpress/i-recommend-this/#utm_source=wp-plugin&utm_medium=i-recommend-this&utm_campaign=plugins-page
5
  * Description: This plugin allows your visitors to simply recommend or like your posts instead of commment it.
6
- * Version: 3.8.1
7
  * Author: Harish Chouhan, Themeist
8
  * Author URI: https://themeist.com/
9
  * Author Email: support@themeist.com
@@ -22,7 +22,7 @@ if( class_exists( 'Themeist_IRecommendThis' ) ) {
22
  return;
23
  }
24
 
25
- define( 'THEMEIST_IRT_VERSION', '3.8.1' );
26
  define( 'THEMEIST_IRT_DB_VERSION', '2.6.2' );
27
 
28
  // require includes
3
  * Plugin Name: I Recommend This
4
  * Plugin URI: https://themeist.com/plugins/wordpress/i-recommend-this/#utm_source=wp-plugin&utm_medium=i-recommend-this&utm_campaign=plugins-page
5
  * Description: This plugin allows your visitors to simply recommend or like your posts instead of commment it.
6
+ * Version: 3.8.2
7
  * Author: Harish Chouhan, Themeist
8
  * Author URI: https://themeist.com/
9
  * Author Email: support@themeist.com
22
  return;
23
  }
24
 
25
+ define( 'THEMEIST_IRT_VERSION', '3.8.2' );
26
  define( 'THEMEIST_IRT_DB_VERSION', '2.6.2' );
27
 
28
  // require includes
includes/class-i-recommend-this.php CHANGED
@@ -17,7 +17,7 @@ class Themeist_IRecommendThis {
17
  if ( defined( 'THEMEIST_IRT_VERSION' ) ) {
18
  $this->version = THEMEIST_IRT_VERSION;
19
  } else {
20
- $this->version = '3.8.1';
21
  }
22
 
23
  if ( defined( 'THEMEIST_IRT_DB_VERSION' ) ) {
17
  if ( defined( 'THEMEIST_IRT_VERSION' ) ) {
18
  $this->version = THEMEIST_IRT_VERSION;
19
  } else {
20
+ $this->version = '3.8.2';
21
  }
22
 
23
  if ( defined( 'THEMEIST_IRT_DB_VERSION' ) ) {
public/class-i-recommend-this-public.php CHANGED
@@ -225,7 +225,7 @@ class Themeist_IRecommendThis_Public {
225
  *--------------------------------------------*/
226
  function shortcode($atts) {
227
  extract(shortcode_atts(array('id' => null), $atts));
228
- return $this->dot_recommend($id);
229
 
230
  } //shortcode
231
 
@@ -318,6 +318,9 @@ class Themeist_IRecommendThis_Public {
318
  function dot_recommended_top_posts($atts, $content = null)
319
  {
320
 
 
 
 
321
  // define attributes and their defaults
322
  // get our variable from $atts
323
  $atts = shortcode_atts(array(
@@ -329,6 +332,13 @@ class Themeist_IRecommendThis_Public {
329
  'show_count' => '1',
330
  ), $atts);
331
 
 
 
 
 
 
 
 
332
  global $wpdb;
333
 
334
  // empty params array to hold params for prepared statement
@@ -366,12 +376,12 @@ class Themeist_IRecommendThis_Public {
366
  $return = '';
367
 
368
  foreach ($posts as $item) {
369
- $post_title = stripslashes($item->post_title);
370
  $permalink = get_permalink($item->ID);
371
- $post_count = $item->meta_value;
372
 
373
  $return .= '<' . esc_html($atts['container']) . '>';
374
- $return .= '<a href="' . esc_url($permalink) . '" title="' . esc_attr($post_title) . '" rel="nofollow">' . esc_html($post_title) . '</a> ';
375
 
376
  if ($atts['show_count'] == '1') {
377
  $return .= '<span class="votes">' . esc_html($post_count) . '</span> ';
225
  *--------------------------------------------*/
226
  function shortcode($atts) {
227
  extract(shortcode_atts(array('id' => null), $atts));
228
+ return $this->dot_recommend(intval($id));
229
 
230
  } //shortcode
231
 
318
  function dot_recommended_top_posts($atts, $content = null)
319
  {
320
 
321
+ // normalize attribute keys, lowercase
322
+ $atts = array_change_key_case((array)$atts, CASE_LOWER);
323
+
324
  // define attributes and their defaults
325
  // get our variable from $atts
326
  $atts = shortcode_atts(array(
332
  'show_count' => '1',
333
  ), $atts);
334
 
335
+ $atts['container'] = sanitize_text_field( $atts['container'] );
336
+ $atts['number'] = intval( $atts['number'] );
337
+ $atts['post_type'] = sanitize_text_field( $atts['post_type'] );
338
+ $atts['year'] = intval( $atts['year'] );
339
+ $atts['monthnum'] = intval( $atts['monthnum'] );
340
+ $atts['show_count'] = intval( $atts['show_count'] );
341
+
342
  global $wpdb;
343
 
344
  // empty params array to hold params for prepared statement
376
  $return = '';
377
 
378
  foreach ($posts as $item) {
379
+ $post_title = get_the_title($item->ID);
380
  $permalink = get_permalink($item->ID);
381
+ $post_count = intval($item->meta_value);
382
 
383
  $return .= '<' . esc_html($atts['container']) . '>';
384
+ $return .= '<a href="' . esc_url($permalink) . '" title="' . esc_html($post_title) . '" rel="nofollow">' . esc_html($post_title) . '</a> ';
385
 
386
  if ($atts['show_count'] == '1') {
387
  $return .= '<span class="votes">' . esc_html($post_count) . '</span> ';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://themeist.com
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.9.8
7
- Stable tag: 3.8.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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.9.8
7
+ Stable tag: 3.8.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10