WP Product Review Lite - Version 3.0.10

Version Description

  • 2017-09-12
Download this release

Release Info

Developer codeinwp
Plugin Icon WP Product Review Lite
Version 3.0.10
Comparing to
See all releases

Code changes from version 3.0.9 to 3.0.10

CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
 
 
 
 
 
 
 
2
  ### v3.0.9 - 2017-09-07
3
  **Changes:**
4
  * Improved JSON-LD scheme.
1
 
2
+ ### v3.0.10 - 2017-09-12
3
+ **Changes:**
4
+ * Fix for decimal separator in rich snippet.
5
+ * Improvements for template engine, allowing overwriting in child themes also.
6
+ * Added review content and excerpt proprieties.
7
+
8
  ### v3.0.9 - 2017-09-07
9
  **Changes:**
10
  * Improved JSON-LD scheme.
assets/css/frontpage.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.0.9
3
  */
4
  #review-statistics {
5
  width: 100%;
1
  /*
2
+ Version: 3.0.10
3
  */
4
  #review-statistics {
5
  width: 100%;
includes/admin/models/abstract/class-wppr-model-abstract.php CHANGED
@@ -82,7 +82,7 @@ class WPPR_Model_Abstract {
82
  }
83
  $default = $this->get_default( $key );
84
 
85
- return apply_filters( 'wppr_get_old_option', $default, $key );
86
  }
87
 
88
  /**
82
  }
83
  $default = $this->get_default( $key );
84
 
85
+ return apply_filters( 'wppr_get_default_option', $default, $key );
86
  }
87
 
88
  /**
includes/admin/models/class-wppr-review-model.php CHANGED
@@ -982,7 +982,7 @@ class WPPR_Review_Model extends WPPR_Model_Abstract {
982
  );
983
  $ld['offers'] = array(
984
  '@type' => 'Offer',
985
- 'price' => number_format( $this->get_price(), 2 ),
986
  'priceCurrency' => $this->get_currency(),
987
  'seller' => array(
988
  '@type' => 'Person',
@@ -1054,6 +1054,7 @@ class WPPR_Review_Model extends WPPR_Model_Abstract {
1054
  return '';
1055
  }
1056
  $content = $this->get_content();
 
1057
 
1058
  $excerpt_length = apply_filters( 'excerpt_length', 55 );
1059
 
982
  );
983
  $ld['offers'] = array(
984
  '@type' => 'Offer',
985
+ 'price' => number_format( $this->get_price(), 2, '.', '' ),
986
  'priceCurrency' => $this->get_currency(),
987
  'seller' => array(
988
  '@type' => 'Person',
1054
  return '';
1055
  }
1056
  $content = $this->get_content();
1057
+ $content = strip_shortcodes( $content );
1058
 
1059
  $excerpt_length = apply_filters( 'excerpt_length', 55 );
1060
 
includes/admin/widgets/class-wppr-latest-products-widget.php CHANGED
@@ -75,8 +75,14 @@ class WPPR_Latest_Products_Widget extends WPPR_Widget_Abstract {
75
  if ( ! empty( $instance['title'] ) ) {
76
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
77
  }
78
-
79
- include WPPR_PATH . '/includes/public/layouts/widget/' . $instance['cwp_tp_layout'];
 
 
 
 
 
 
80
 
81
  echo $args['after_widget'];
82
  }
@@ -97,7 +103,7 @@ class WPPR_Latest_Products_Widget extends WPPR_Widget_Abstract {
97
  $instance['title'] = __( 'Latest Products', 'wp-product-review' );
98
  }
99
 
100
- $instance = parent::form( $instance );
101
 
102
  include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
103
  }
75
  if ( ! empty( $instance['title'] ) ) {
76
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
77
  }
78
+ $template = new WPPR_Template();
79
+ $template->render(
80
+ 'widget/' . $instance['cwp_tp_layout'], array(
81
+ 'results' => $results,
82
+ 'title_length' => self::RESTRICT_TITLE_CHARS,
83
+ 'instance' => $instance,
84
+ )
85
+ );
86
 
87
  echo $args['after_widget'];
88
  }
103
  $instance['title'] = __( 'Latest Products', 'wp-product-review' );
104
  }
105
 
106
+ $instance = parent::form( $instance );
107
 
108
  include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
109
  }
includes/admin/widgets/class-wppr-top-products-widget.php CHANGED
@@ -91,8 +91,14 @@ class WPPR_Top_Products_Widget extends WPPR_Widget_Abstract {
91
  if ( ! empty( $instance['title'] ) ) {
92
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
93
  }
94
- include WPPR_PATH . '/includes/public/layouts/widget/' . $instance['cwp_tp_layout'];
95
-
 
 
 
 
 
 
96
  echo $args['after_widget'];
97
  }
98
 
@@ -111,7 +117,7 @@ class WPPR_Top_Products_Widget extends WPPR_Widget_Abstract {
111
  if ( ! isset( $instance['title'] ) ) {
112
  $instance['title'] = __( 'Top Products', 'wp-product-review' );
113
  }
114
- $instance = parent::form( $instance );
115
 
116
  include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
117
  }
91
  if ( ! empty( $instance['title'] ) ) {
92
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
93
  }
94
+ $template = new WPPR_Template();
95
+ $template->render(
96
+ 'widget/' . $instance['cwp_tp_layout'], array(
97
+ 'results' => $results,
98
+ 'title_length' => self::RESTRICT_TITLE_CHARS,
99
+ 'instance' => $instance,
100
+ )
101
+ );
102
  echo $args['after_widget'];
103
  }
104
 
117
  if ( ! isset( $instance['title'] ) ) {
118
  $instance['title'] = __( 'Top Products', 'wp-product-review' );
119
  }
120
+ $instance = parent::form( $instance );
121
 
122
  include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
123
  }
includes/class-wppr-template.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Implements templating behaviour in WPPR.
5
+ *
6
+ * @package WPPR
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.10
10
+ */
11
+ class WPPR_Template {
12
+ /**
13
+ * Directories where to search in.
14
+ *
15
+ * @var array Directories path.
16
+ */
17
+ private $dirs = array();
18
+
19
+ /**
20
+ * WPPR_Template constructor.
21
+ */
22
+ public function __construct() {
23
+ $this->setup_locations();
24
+ }
25
+
26
+ /**
27
+ * Setup directories where wppr templates resides.
28
+ */
29
+ private function setup_locations() {
30
+ $this->dirs[] = WPPR_PATH . '/includes/public/layouts/';
31
+ $custom_paths = apply_filters( 'wppr_templates_dir', array() );
32
+ $theme_paths = array();
33
+ $theme_paths[] = get_template_directory() . '/wppr';
34
+ $theme_paths[] = get_stylesheet_directory() . '/wppr';
35
+ $this->dirs = array_merge( $this->dirs, $custom_paths, $theme_paths );
36
+ $this->dirs = array_map( 'trailingslashit', $this->dirs );
37
+
38
+ }
39
+
40
+ /**
41
+ * Render the template file.
42
+ *
43
+ * @param string $template Template name.
44
+ * @param array $args Args of variable to load.
45
+ * @param bool $echo Either to echo or return content.
46
+ *
47
+ * @return string Return template content.
48
+ */
49
+ public function render( $template, $args = array(), $echo = true ) {
50
+ $location = $this->locate_template( $template );
51
+ if ( empty( $location ) ) {
52
+ return '';
53
+ }
54
+ foreach ( $args as $name => $value ) {
55
+ if ( is_numeric( $name ) ) {
56
+ continue;
57
+ }
58
+ $$name = $value;
59
+ }
60
+
61
+ ob_start();
62
+ require_once( $location );
63
+ $content = ob_get_contents();
64
+
65
+ ob_end_clean();
66
+ if ( ! $echo ) {
67
+ return $content;
68
+ }
69
+ echo $content;
70
+
71
+ return '';
72
+ }
73
+
74
+ /**
75
+ * Locate template file.
76
+ *
77
+ * @param string $template Filename to look for.
78
+ *
79
+ * @return string The template location.
80
+ */
81
+ public function locate_template( $template ) {
82
+ $dirs = array_reverse( $this->dirs );
83
+ $template = str_replace( '.php', '', $template );
84
+ $template = $template . '.php';
85
+ foreach ( $dirs as $dir ) {
86
+ if ( file_exists( $dir . $template ) ) {
87
+ return $dir . $template;
88
+ }
89
+ }
90
+
91
+ return '';
92
+ }
93
+ }
includes/class-wppr.php CHANGED
@@ -67,7 +67,7 @@ class WPPR {
67
  */
68
  public function __construct() {
69
  $this->plugin_name = 'wppr';
70
- $this->version = '3.0.9';
71
 
72
  $this->load_dependencies();
73
  $this->set_locale();
67
  */
68
  public function __construct() {
69
  $this->plugin_name = 'wppr';
70
+ $this->version = '3.0.10';
71
 
72
  $this->load_dependencies();
73
  $this->set_locale();
includes/legacy.php CHANGED
@@ -24,13 +24,18 @@ function cwppos_show_review( $post_id ) {
24
  $public->load_review_assets( $review_object );
25
  $output = '';
26
  if ( $review_object->is_active() ) {
27
- $theme_template = get_template_directory() . '/wppr/default.php';
28
- if ( file_exists( $theme_template ) ) {
29
- include( $theme_template );
30
- } else {
31
- include( WPPR_PATH . '/includes/public/layouts/default-tpl.php' );
32
- }
33
- include( WPPR_PATH . '/includes/public/layouts/rich-json-ld.php' );
 
 
 
 
 
34
  }
35
 
36
  return $output;
24
  $public->load_review_assets( $review_object );
25
  $output = '';
26
  if ( $review_object->is_active() ) {
27
+ $template = new WPPR_Template();
28
+ $output .= $template->render(
29
+ 'default', array(
30
+ 'review_object' => $review_object,
31
+ ), false
32
+ );
33
+
34
+ $output .= $template->render(
35
+ 'rich-json-ld', array(
36
+ 'review_object' => $review_object,
37
+ ), false
38
+ );
39
  }
40
 
41
  return $output;
includes/public/class-wppr-public.php CHANGED
@@ -294,18 +294,20 @@ class Wppr_Public {
294
  }
295
  if ( $this->review->is_active() && is_singular() ) {
296
  $output = '';
297
- $visual = 'full';
298
  $review_object = $this->review;
299
- if ( $visual == 'full' ) {
300
- $theme_template = get_template_directory() . '/wppr/default.php';
301
- if ( file_exists( $theme_template ) ) {
302
- include( $theme_template );
303
- } else {
304
- include( WPPR_PATH . '/includes/public/layouts/default-tpl.php' );
305
- }
306
- }
307
-
308
- include_once( WPPR_PATH . '/includes/public/layouts/rich-json-ld.php' );
 
 
 
309
 
310
  $review_position_before_content = $this->review->wppr_get_option( 'cwppos_show_reviewbox' );
311
  if ( $review_position_before_content == 'yes' ) {
294
  }
295
  if ( $this->review->is_active() && is_singular() ) {
296
  $output = '';
 
297
  $review_object = $this->review;
298
+ $template = new WPPR_Template();
299
+
300
+ $output .= $template->render(
301
+ 'default', array(
302
+ 'review_object' => $review_object,
303
+ ), false
304
+ );
305
+
306
+ $output .= $template->render(
307
+ 'rich-json-ld', array(
308
+ 'review_object' => $review_object,
309
+ ), false
310
+ );
311
 
312
  $review_position_before_content = $this->review->wppr_get_option( 'cwppos_show_reviewbox' );
313
  if ( $review_position_before_content == 'yes' ) {
includes/public/layouts/default-tpl.php CHANGED
@@ -1,104 +1,15 @@
1
  <?php
2
  /**
3
- * WP Prodact Review front page layout.
4
  *
5
- * @package WPPR
6
- * @subpackage Layouts
7
- * @global WPPR_Review_Model $review_object The inherited review object.
8
- * @copyright Copyright (c) 2017, Bogdan Preda
9
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
- * @since 3.0.0
11
  */
12
-
13
- $price_raw = $review_object->get_price_raw();
14
-
15
- $lightbox = '';
16
-
17
- $links = $review_object->get_links();
18
- $multiple_affiliates_class = 'affiliate-button';
19
- $links = array_filter( $links );
20
- $image_link = reset( $links );
21
- if ( count( $links ) > 1 ) {
22
- $multiple_affiliates_class = 'affiliate-button2 affiliate-button';
23
- }
24
- if ( $review_object->get_click() == 'image' ) {
25
- $lightbox = 'data-lightbox="' . esc_url( $review_object->get_small_thumbnail() ) . '"';
26
- $image_link = $review_object->get_image();
27
  }
28
- $output = '<!-- Start WPPR Review -->
29
- <section id="review-statistics" class="article-section">
30
- <div class="review-wrap-up cwpr_clearfix" >
31
- <div class="cwpr-review-top cwpr_clearfix">
32
- <span><h2 class="cwp-item">' . esc_html( $review_object->get_name() ) . '</h2></span>
33
- <span class="cwp-item-price cwp-item"><span>
34
- <span>' . esc_html( empty( $price_raw ) ? '' : $price_raw ) . '</span>
35
- </span></span>
36
- </div><!-- end .cwpr-review-top -->
37
- <div class="review-wu-left">
38
- <div class="rev-wu-image">
39
- <a href="' . esc_url( $image_link ) . '" ' . $lightbox . ' rel="nofollow" target="_blank"><img src="' . esc_attr( $review_object->get_small_thumbnail() ) . '" alt="' . esc_attr( $review_object->get_name() ) . '" class="photo photo-wrapup wppr-product-image" /></a>
40
- </div><!-- end .rev-wu-image -->
41
- <div class="review-wu-grade">
42
- <div class="cwp-review-chart ">
43
- <span>
44
- <div class="cwp-review-percentage" data-percent="' . esc_attr( $review_object->get_rating() ) . '">
45
- <span class="cwp-review-rating">' . esc_html( $review_object->get_rating() ) . '</span>
46
- </div>
47
- </span>
48
- </div><!-- end .chart -->
49
- </div><!-- end .review-wu-grade -->
50
- <div class="review-wu-bars">
51
- ';
52
- foreach ( $review_object->get_options() as $option ) {
53
- $output .= '
54
- <div class="rev-option" data-value=' . $option['value'] . '>
55
- <div class="cwpr_clearfix">
56
- <h3>' . esc_html( apply_filters( 'wppr_option_name_html', $option['name'] ) ) . '</h3>
57
- <span>' . esc_html( round( $option['value'] / 10 ) ) . '/10</span>
58
- </div>
59
- <ul class="cwpr_clearfix"></ul>
60
- </div>
61
- ';
62
- }
63
- $output .= '
64
- </div><!-- end .review-wu-bars -->
65
- </div><!-- end .review-wu-left -->
66
- <div class="review-wu-right">
67
- <div class="pros">
68
- <h2>' .
69
- esc_html( apply_filters( 'wppr_review_pros_text', $review_object->wppr_get_option( 'cwppos_pros_text' ) ) )
70
- . '</h2>
71
- <ul>';
72
- foreach ( $review_object->get_pros() as $pro ) {
73
- $output .= '<li>' . esc_html( $pro ) . '</li>';
74
- }
75
- $output .= '
76
- </ul>
77
- </div><!-- end .pros -->
78
- <div class="cons">
79
- <h2>' .
80
- esc_html( apply_filters( 'wppr_review_cons_text', $review_object->wppr_get_option( 'cwppos_cons_text' ) ) )
81
- .
82
- '</h2>
83
- <ul>';
84
- foreach ( $review_object->get_cons() as $con ) {
85
- $output .= '<li>' . esc_html( $con ) . '</li>';
86
- }
87
- $output .= '
88
- </ul>
89
- </div>
90
- </div><!-- end .review-wu-right -->
91
- </div><!-- end .review-wrap-up -->
92
- </section><!-- end #review-statistics -->
93
- ';
94
 
95
- foreach ( $links as $title => $link ) {
96
- if ( ! empty( $title ) && ! empty( $link ) ) {
97
- $output .= '
98
- <div class="' . esc_attr( $multiple_affiliates_class ) . '">
99
- <a href="' . esc_url( $link ) . '" rel="nofollow" target="_blank"><span>' . esc_html( $title ) . '</span> </a>
100
- </div><!-- end .affiliate-button -->
101
- ';
102
- }
103
- }
104
- $output .= '<!-- End WPPR Review -->';
1
  <?php
2
  /**
3
+ * Legacy file used for assuring backwards compatibility with old pro version.
4
  *
5
+ * @deprecated
6
+ * @package WPPR
 
 
 
 
7
  */
8
+ ob_start();
9
+ include_once WPPR_PATH . '/includes/public/layouts/default.php';
10
+ if ( ! isset( $output ) ) {
11
+ $output = '';
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
+ $output .= ob_get_contents();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ ob_end_clean();
 
 
 
 
 
 
 
 
 
includes/public/layouts/default.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Prodact Review front page layout.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @global WPPR_Review_Model $review_object The inherited review object.
8
+ * @copyright Copyright (c) 2017, Bogdan Preda
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 3.0.0
11
+ */
12
+
13
+ $price_raw = $review_object->get_price_raw();
14
+
15
+ $lightbox = '';
16
+
17
+ $links = $review_object->get_links();
18
+ $multiple_affiliates_class = 'affiliate-button';
19
+ $links = array_filter( $links );
20
+ $image_link = reset( $links );
21
+ if ( count( $links ) > 1 ) {
22
+ $multiple_affiliates_class = 'affiliate-button2 affiliate-button';
23
+ }
24
+ if ( $review_object->get_click() == 'image' ) {
25
+ $lightbox = 'data-lightbox="' . esc_url( $review_object->get_small_thumbnail() ) . '"';
26
+ $image_link = $review_object->get_image();
27
+ }
28
+ ?>
29
+ <section id="review-statistics" class="article-section">
30
+ <div class="review-wrap-up cwpr_clearfix">
31
+ <div class="cwpr-review-top cwpr_clearfix">
32
+ <span><h2 class="cwp-item"><?php echo esc_html( $review_object->get_name() ); ?></h2></span>
33
+ <span class="cwp-item-price cwp-item"><span>
34
+ <span><?php echo esc_html( empty( $price_raw ) ? '' : $price_raw ); ?></span>
35
+ </span></span>
36
+ </div><!-- end .cwpr-review-top -->
37
+ <div class="review-wu-left">
38
+ <div class="rev-wu-image">
39
+ <a href="<?php echo esc_url( $image_link ); ?>" <?php echo $lightbox; ?> rel="nofollow"
40
+ target="_blank"><img
41
+ src="<?php echo esc_attr( $review_object->get_small_thumbnail() ); ?>"
42
+ alt="<?php echo esc_attr( $review_object->get_name() ); ?>"
43
+ class="photo photo-wrapup wppr-product-image"/></a>
44
+ </div><!-- end .rev-wu-image -->
45
+ <div class="review-wu-grade">
46
+ <div class="cwp-review-chart ">
47
+ <span>
48
+ <div class="cwp-review-percentage"
49
+ data-percent="<?php echo esc_attr( $review_object->get_rating() ); ?>">
50
+ <span class="cwp-review-rating"><?php echo esc_html( $review_object->get_rating() ); ?></span>
51
+ </div>
52
+ </span>
53
+ </div><!-- end .chart -->
54
+ </div><!-- end .review-wu-grade -->
55
+ <div class="review-wu-bars">
56
+ <?php
57
+ foreach ( $review_object->get_options() as $option ) {
58
+ ?>
59
+ <div class="rev-option" data-value="<?php echo $option['value']; ?>">
60
+ <div class="cwpr_clearfix">
61
+ <h3><?php echo esc_html( apply_filters( 'wppr_option_name_html', $option['name'] ) ); ?></h3>
62
+ <span><?php echo esc_html( round( $option['value'] / 10 ) ); ?>/10 </span>
63
+ </div>
64
+ <ul class="cwpr_clearfix"></ul>
65
+ </div>
66
+ <?php
67
+ }
68
+ ?>
69
+ </div><!-- end .review-wu-bars -->
70
+ </div><!-- end .review-wu-left -->
71
+ <div class="review-wu-right">
72
+ <div class="pros">
73
+ <h2>
74
+ <?php
75
+ echo esc_html(
76
+ apply_filters(
77
+ 'wppr_review_pros_text', $review_object->wppr_get_option(
78
+ 'cwppos_pros_text'
79
+ )
80
+ )
81
+ );
82
+ ?>
83
+ </h2>
84
+ <ul>
85
+ <?php
86
+ foreach ( $review_object->get_pros() as $pro ) {
87
+ ?>
88
+ <li><?php echo esc_html( $pro ); ?></li>
89
+ <?php
90
+ }
91
+ ?>
92
+ </ul>
93
+ </div><!-- end .pros -->
94
+ <div class="cons">
95
+ <h2>
96
+ <?php
97
+ echo esc_html(
98
+ apply_filters(
99
+ 'wppr_review_cons_text', $review_object->wppr_get_option(
100
+ 'cwppos_cons_text'
101
+ )
102
+ )
103
+ );
104
+ ?>
105
+ </h2>
106
+ <ul>
107
+ <?php
108
+ foreach ( $review_object->get_cons() as $con ) {
109
+ ?>
110
+
111
+ <li><?php echo esc_html( $con ); ?></li>
112
+
113
+ <?php } ?>
114
+ </ul>
115
+ </div>
116
+ </div><!-- end .review-wu-right -->
117
+ </div><!-- end .review-wrap-up -->
118
+ </section>
119
+ <?php
120
+ foreach ( $links as $title => $link ) {
121
+ if ( ! empty( $title ) && ! empty( $link ) ) {
122
+ ?>
123
+ <div class="<?php echo esc_attr( $multiple_affiliates_class ); ?>">
124
+ <a href="<?php echo esc_url( $link ); ?>" rel="nofollow"
125
+ target="_blank"><span><?php echo esc_html( $title ); ?></span> </a>
126
+ </div><!-- end .affiliate-button -->
127
+ <?php
128
+ }
129
+ }
130
+
includes/public/layouts/rating-tpl.php CHANGED
@@ -7,6 +7,7 @@
7
  * @copyright Copyright (c) 2017, Bogdan Preda
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 3.0.0
 
10
  */
11
 
12
  $review = $review_object->get_review_data();
7
  * @copyright Copyright (c) 2017, Bogdan Preda
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 3.0.0
10
+ * @deprecated
11
  */
12
 
13
  $review = $review_object->get_review_data();
includes/public/layouts/rich-json-ld.php CHANGED
@@ -11,6 +11,7 @@
11
  */
12
 
13
  if ( $review_object->wppr_get_option( 'wppr_rich_snippet' ) == 'yes' ) {
14
- $output .= '
15
- <script type="application/ld+json">' . json_encode( $review_object->get_json_ld() ) . '</script>';
 
16
  }
11
  */
12
 
13
  if ( $review_object->wppr_get_option( 'wppr_rich_snippet' ) == 'yes' ) {
14
+ ?>
15
+ <script type="application/ld+json"><?php echo json_encode( $review_object->get_json_ld() ); ?></script>
16
+ <?php
17
  }
includes/public/layouts/score-tpl.php CHANGED
@@ -7,6 +7,7 @@
7
  * @copyright Copyright (c) 2017, Bogdan Preda
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 3.0.0
 
10
  */
11
 
12
  $output = number_format( floor( $review_object->get_rating() ) / 10, 1 );
7
  * @copyright Copyright (c) 2017, Bogdan Preda
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 3.0.0
10
+ * @deprecated
11
  */
12
 
13
  $output = number_format( floor( $review_object->get_rating() ) / 10, 1 );
includes/public/layouts/widget/default.php CHANGED
@@ -9,14 +9,16 @@
9
  * @since 3.0.0
10
  */
11
 
12
- echo '<ul>';
 
 
13
  foreach ( $results as $review ) :
14
- $rview_obj = new WPPR_Review_Model( $review['ID'] );
15
- $product_title_display = ( $instance['post_type'] == true ) ? $review['cwp_rev_product_name'] : get_the_title( $review['ID'] );
16
- $product_image = $rview_obj->get_small_thumbnail();
17
 
18
- if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
19
- $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
20
  }
21
  ?>
22
  <li class="cwp-popular-review cwp_top_posts_widget_
@@ -28,28 +30,29 @@ foreach ( $results as $review ) :
28
  }
29
  ?>
30
  ">
31
- <?php
32
- if ( $instance['show_image'] == true && ! empty( $product_image ) ) {
33
- ?>
34
- <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
35
- alt="<?php echo $review['cwp_rev_product_name']; ?>">
36
- <?php } ?>
37
- <a href="<?php echo get_the_permalink( $review['ID'] ); ?>" class="wppr-col"
38
- title="<?php echo $review['cwp_rev_product_name']; ?>">
39
  <?php echo $product_title_display; ?>
40
- </a>
 
 
 
 
 
 
 
 
 
 
 
 
41
  <?php
42
- $review_score = $review['wppr_rating'];
43
- if ( ! empty( $review_score ) ) {
44
- ?>
45
- <div class="review-grade-widget wppr-col">
46
- <div class="cwp-review-chart absolute">
47
- <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
48
- </div><!-- end .chart -->
49
- </div>
50
- <?php } ?>
51
- </li>
52
- <?php
53
- endforeach;
54
- ?>
55
  </ul>
9
  * @since 3.0.0
10
  */
11
 
12
+ ?>
13
+ <ul>
14
+ <?php
15
  foreach ( $results as $review ) :
16
+ $review_object = new WPPR_Review_Model( $review['ID'] );
17
+ $product_title_display = ( $instance['post_type'] == true ) ? $review_object->get_name() : get_the_title( $review['ID'] );
18
+ $product_image = $review_object->get_small_thumbnail();
19
 
20
+ if ( strlen( $product_title_display ) > $title_length ) {
21
+ $product_title_display = substr( $product_title_display, 0, $title_length ) . '...';
22
  }
23
  ?>
24
  <li class="cwp-popular-review cwp_top_posts_widget_
30
  }
31
  ?>
32
  ">
33
+ <?php
34
+ if ( $instance['show_image'] == true && ! empty( $product_image ) ) {
35
+ ?>
36
+ <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
37
+ alt="<?php echo $review_object->get_name(); ?>">
38
+ <?php } ?>
39
+ <a href="<?php echo get_the_permalink( $review['ID'] ); ?>" class="wppr-col"
40
+ title="<?php echo $review_object->get_name(); ?>">
41
  <?php echo $product_title_display; ?>
42
+ </a>
43
+ <?php
44
+ $review_score = $review_object->get_rating();
45
+ if ( ! empty( $review_score ) ) {
46
+ ?>
47
+ <div class="review-grade-widget wppr-col">
48
+ <div class="cwp-review-chart absolute">
49
+ <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span>
50
+ </div>
51
+ </div><!-- end .chart -->
52
+ </div>
53
+ <?php } ?>
54
+ </li>
55
  <?php
56
+ endforeach;
57
+ ?>
 
 
 
 
 
 
 
 
 
 
 
58
  </ul>
includes/public/layouts/widget/style 1.php CHANGED
@@ -14,56 +14,58 @@
14
  <div class="wppr-prodlist">
15
  <?php
16
  foreach ( $results as $review ) :
17
- $product_image = $review['cwp_rev_product_image'];
18
- $product_title = ( $instance['post_type'] == true ) ? $review['cwp_rev_product_name'] : get_the_title( $review['ID'] );
 
 
19
  $product_title_display = $product_title;
20
- if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
21
- $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
22
  }
23
-
24
- $affiliate_link = reset( $review['wppr_links'] );
25
- $review_link = get_the_permalink($review['ID']);
26
 
27
  $showingImg = $instance['show_image'] == true && ! empty( $product_image );
28
  ?>
29
 
30
- <div class="wppr-prodrow">
31
  <?php if ( $showingImg ) { ?>
32
- <div class="wppr-prodrowleft">
33
- <a href="<?php echo $review_link; ?>" class="wppr-col" title="<?php echo $product_title; ?>">
34
- <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
35
- alt="<?php echo $product_title; ?>"/>
36
- </a>
37
- </div>
38
  <?php
39
  }
40
  ?>
41
- <div class="wppr-prodrowright <?php echo $showingImg ? 'wppr-prodrowrightadjust' : '' ?>">
42
- <p><strong><?php echo $product_title_display; ?></strong></p>
43
  <?php
44
- $review_score = $review['wppr_rating'];
45
 
46
  if ( ! empty( $review_score ) ) {
47
  if ( $instance['cwp_tp_rating_type'] == 'round' ) {
48
  ?>
49
- <div class="review-grade-widget wppr-col">
50
- <div class="cwp-review-chart relative">
51
- <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>">
52
- <span></span></div>
53
- </div><!-- end .chart -->
54
- </div>
55
- <div class="clear"></div>
56
  <?php
57
  } else {
58
  ?>
59
- <div class="wppr-rating">
60
- <div style="width:<?php echo $review_score; ?>%;"> <?php echo $review_score; ?></div>
61
- </div>
62
  <?php
63
  }
64
  }
65
  ?>
66
- <p class="wppr-style1-buttons">
67
  <?php
68
  $link = "<a href='{$affiliate_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_buynow'], 'wp-product-review' ) . '</a>';
69
  if ( ! empty( $instance['cwp_tp_buynow'] ) ) {
@@ -75,9 +77,9 @@
75
  echo apply_filters( 'wppr_widget_style1_readreview_link', $link, $review['ID'], $review_link, $instance['cwp_tp_readreview'] );
76
  }
77
  ?>
78
- </p>
79
- </div>
80
- <div class="clear"></div>
81
- </div>
82
  <?php endforeach; ?>
83
  </div>
14
  <div class="wppr-prodlist">
15
  <?php
16
  foreach ( $results as $review ) :
17
+
18
+ $review_object = new WPPR_Review_Model( $review['ID'] );
19
+ $product_image = $review_object->get_small_thumbnail();
20
+ $product_title = ( $instance['post_type'] == true ) ? $review_object->get_name() : get_the_title( $review['ID'] );
21
  $product_title_display = $product_title;
22
+ if ( strlen( $product_title_display ) > $title_length ) {
23
+ $product_title_display = substr( $product_title_display, 0, $title_length ) . '...';
24
  }
25
+ $links = $review_object->get_links();
26
+ $affiliate_link = reset( $links );
27
+ $review_link = get_the_permalink( $review['ID'] );
28
 
29
  $showingImg = $instance['show_image'] == true && ! empty( $product_image );
30
  ?>
31
 
32
+ <div class="wppr-prodrow">
33
  <?php if ( $showingImg ) { ?>
34
+ <div class="wppr-prodrowleft">
35
+ <a href="<?php echo $review_link; ?>" class="wppr-col" title="<?php echo $product_title; ?>">
36
+ <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
37
+ alt="<?php echo $product_title; ?>"/>
38
+ </a>
39
+ </div>
40
  <?php
41
  }
42
  ?>
43
+ <div class="wppr-prodrowright <?php echo $showingImg ? 'wppr-prodrowrightadjust' : '' ?>">
44
+ <p><strong><?php echo $product_title_display; ?></strong></p>
45
  <?php
46
+ $review_score = $review_object->get_rating();
47
 
48
  if ( ! empty( $review_score ) ) {
49
  if ( $instance['cwp_tp_rating_type'] == 'round' ) {
50
  ?>
51
+ <div class="review-grade-widget wppr-col">
52
+ <div class="cwp-review-chart relative">
53
+ <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>">
54
+ <span></span></div>
55
+ </div><!-- end .chart -->
56
+ </div>
57
+ <div class="clear"></div>
58
  <?php
59
  } else {
60
  ?>
61
+ <div class="wppr-rating">
62
+ <div style="width:<?php echo $review_score; ?>%;"> <?php echo $review_score; ?></div>
63
+ </div>
64
  <?php
65
  }
66
  }
67
  ?>
68
+ <p class="wppr-style1-buttons">
69
  <?php
70
  $link = "<a href='{$affiliate_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_buynow'], 'wp-product-review' ) . '</a>';
71
  if ( ! empty( $instance['cwp_tp_buynow'] ) ) {
77
  echo apply_filters( 'wppr_widget_style1_readreview_link', $link, $review['ID'], $review_link, $instance['cwp_tp_readreview'] );
78
  }
79
  ?>
80
+ </p>
81
+ </div>
82
+ <div class="clear"></div>
83
+ </div>
84
  <?php endforeach; ?>
85
  </div>
readme.txt CHANGED
@@ -67,6 +67,13 @@ If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-
67
  * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
68
 
69
  == Changelog ==
 
 
 
 
 
 
 
70
  = 3.0.9 - 2017-09-07 =
71
 
72
  * Improved JSON-LD scheme.
67
  * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
68
 
69
  == Changelog ==
70
+ = 3.0.10 - 2017-09-12 =
71
+
72
+ * Fix for decimal separator in rich snippet.
73
+ * Improvements for template engine, allowing overwriting in child themes also.
74
+ * Added review content and excerpt proprieties.
75
+
76
+
77
  = 3.0.9 - 2017-09-07 =
78
 
79
  * Improved JSON-LD scheme.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf59e4ef4fe9fdac27d56952dd9c6404c::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit367620a0efc78d5dd5e5acdfa0931b53::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit7c67ef5a72e9defc21b0727f04bb3495::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit996ebc0bfc279a2bc6cb41ba05661c5d
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire996ebc0bfc279a2bc6cb41ba05661c5d($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire996ebc0bfc279a2bc6cb41ba05661c5d($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf59e4ef4fe9fdac27d56952dd9c6404c
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf59e4ef4fe9fdac27d56952dd9c6404c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf59e4ef4fe9fdac27d56952dd9c6404c', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequiref59e4ef4fe9fdac27d56952dd9c6404c($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequiref59e4ef4fe9fdac27d56952dd9c6404c($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit367620a0efc78d5dd5e5acdfa0931b53 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit367620a0efc78d5dd5e5acdfa0931b53 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit367620a0efc78d5dd5e5acdfa0931b53', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit367620a0efc78d5dd5e5acdfa0931b53', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit7c67ef5a72e9defc21b0727f04bb3495 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit7c67ef5a72e9defc21b0727f04bb3495', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit7c67ef5a72e9defc21b0727f04bb3495', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
wp-product-review.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Product Review Lite
16
  * Plugin URI: https://themeisle.com/plugins/wp-product-review/
17
  * Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews.
18
- * Version: 3.0.9
19
  * Author: ThemeIsle
20
  * Author URI: https://themeisle.com/
21
  * Requires at least: 3.5
@@ -67,7 +67,7 @@ register_deactivation_hook( __FILE__, 'deactivate_wppr' );
67
  */
68
  function run_wppr() {
69
 
70
- define( 'WPPR_LITE_VERSION', '3.0.9' );
71
  define( 'WPPR_PATH', dirname( __FILE__ ) );
72
  define( 'WPPR_SLUG', 'wppr' );
73
  define( 'WPPR_UPSELL_LINK', 'https://themeisle.com/plugins/wp-product-review/' );
15
  * Plugin Name: WP Product Review Lite
16
  * Plugin URI: https://themeisle.com/plugins/wp-product-review/
17
  * Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews.
18
+ * Version: 3.0.10
19
  * Author: ThemeIsle
20
  * Author URI: https://themeisle.com/
21
  * Requires at least: 3.5
67
  */
68
  function run_wppr() {
69
 
70
+ define( 'WPPR_LITE_VERSION', '3.0.10' );
71
  define( 'WPPR_PATH', dirname( __FILE__ ) );
72
  define( 'WPPR_SLUG', 'wppr' );
73
  define( 'WPPR_UPSELL_LINK', 'https://themeisle.com/plugins/wp-product-review/' );