WP Product Review Lite - Version 3.0.8

Version Description

  • 2017-09-01
Download this release

Release Info

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

Code changes from version 3.0.7 to 3.0.8

CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
 
 
 
 
 
 
 
 
2
  ### v3.0.7 - 2017-08-29
3
  **Changes:**
4
  * Fixed empty links for reviews.
1
 
2
+ ### v3.0.8 - 2017-09-01
3
+ **Changes:**
4
+ * Fix for out of memory errors.
5
+ * Fix for options saving when there is no value for each option.
6
+ * Fix for compatibility with Bookrev.
7
+ * Fix for rich snippet reviewer author.
8
+
9
  ### v3.0.7 - 2017-08-29
10
  **Changes:**
11
  * Fixed empty links for reviews.
assets/css/frontpage.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.0.7
3
  */
4
  #review-statistics {
5
  width: 100%;
1
  /*
2
+ Version: 3.0.8
3
  */
4
  #review-statistics {
5
  width: 100%;
includes/admin/helpers/class-wppr-logger.php CHANGED
@@ -19,17 +19,48 @@ class WPPR_Logger {
19
  *
20
  * @since 3.0.0
21
  * @access public
 
22
  * @param string $msg The message to report.
23
  */
24
  public function warning( $msg = '' ) {
25
  $this->message( $msg, 'warning' );
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * The error msg to report.
30
  *
31
  * @since 3.0.0
32
  * @access public
 
33
  * @param string $msg The error msg.
34
  */
35
  public function error( $msg = '' ) {
@@ -41,31 +72,10 @@ class WPPR_Logger {
41
  *
42
  * @since 3.0.0
43
  * @access public
 
44
  * @param string $msg The message to report as notice.
45
  */
46
  public function notice( $msg = '' ) {
47
  $this->message( $msg, 'notice' );
48
  }
49
-
50
- /**
51
- * Report a message as error|warning|notice.
52
- *
53
- * @since 3.0.0
54
- * @access private
55
- * @param string $msg The message.
56
- * @param string $type The type of the message.
57
- */
58
- private function message( $msg, $type ) {
59
- $type = strtoupper( $type );
60
- $msg = $type . ' : ' . $msg;
61
- $bt = debug_backtrace();
62
- $caller = array_shift( $bt );
63
- $caller = array_shift( $bt );
64
- $caller = array_shift( $bt );
65
- $msg = $msg . ' [ ' . $caller['file'];
66
- $msg = $msg . ' : ' . $caller['line'] . ' ]';
67
- if ( defined( 'WPPR_DEBUG' ) && WPPR_DEBUG ) {
68
- error_log( $msg );
69
- }
70
- }
71
  }
19
  *
20
  * @since 3.0.0
21
  * @access public
22
+ *
23
  * @param string $msg The message to report.
24
  */
25
  public function warning( $msg = '' ) {
26
  $this->message( $msg, 'warning' );
27
  }
28
 
29
+ /**
30
+ * Report a message as error|warning|notice.
31
+ *
32
+ * @since 3.0.0
33
+ * @access private
34
+ *
35
+ * @param string $msg The message.
36
+ * @param string $type The type of the message.
37
+ */
38
+ private function message( $msg, $type ) {
39
+
40
+ if ( ! defined( 'WPPR_DEBUG' ) ) {
41
+ return;
42
+ }
43
+ if ( ! WPPR_DEBUG ) {
44
+ return;
45
+ }
46
+ $type = strtoupper( $type );
47
+ $msg = $type . ' : ' . $msg;
48
+ $bt = debug_backtrace();
49
+ $caller = array_shift( $bt );
50
+ $caller = array_shift( $bt );
51
+ $caller = array_shift( $bt );
52
+ $msg = $msg . ' [ ' . $caller['file'];
53
+ $msg = $msg . ' : ' . $caller['line'] . ' ]';
54
+ error_log( $msg );
55
+
56
+ }
57
+
58
  /**
59
  * The error msg to report.
60
  *
61
  * @since 3.0.0
62
  * @access public
63
+ *
64
  * @param string $msg The error msg.
65
  */
66
  public function error( $msg = '' ) {
72
  *
73
  * @since 3.0.0
74
  * @access public
75
+ *
76
  * @param string $msg The message to report as notice.
77
  */
78
  public function notice( $msg = '' ) {
79
  $this->message( $msg, 'notice' );
80
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
includes/admin/models/abstract/class-wppr-model-abstract.php CHANGED
@@ -81,6 +81,7 @@ class WPPR_Model_Abstract {
81
  return apply_filters( 'wppr_get_old_option', $this->options[ $key ], $key );
82
  }
83
  $default = $this->get_default( $key );
 
84
  return apply_filters( 'wppr_get_old_option', $default, $key );
85
  }
86
 
@@ -107,6 +108,15 @@ class WPPR_Model_Abstract {
107
  return $all[ $key ]['default'];
108
  }
109
 
 
 
 
 
 
 
 
 
 
110
  /**
111
  * Update a global wppr option.
112
  *
81
  return apply_filters( 'wppr_get_old_option', $this->options[ $key ], $key );
82
  }
83
  $default = $this->get_default( $key );
84
+
85
  return apply_filters( 'wppr_get_old_option', $default, $key );
86
  }
87
 
108
  return $all[ $key ]['default'];
109
  }
110
 
111
+ /**
112
+ * Return all options.
113
+ *
114
+ * @return array All options.
115
+ */
116
+ public function get_all() {
117
+ return $this->options;
118
+ }
119
+
120
  /**
121
  * Update a global wppr option.
122
  *
includes/admin/models/class-wppr-editor-model.php CHANGED
@@ -59,6 +59,7 @@ class WPPR_Editor_Model extends WPPR_Model_Abstract {
59
  *
60
  * @since 3.0.0
61
  * @access public
 
62
  * @param WP_Post $post The post object.
63
  */
64
  public function __construct( $post ) {
@@ -92,7 +93,9 @@ class WPPR_Editor_Model extends WPPR_Model_Abstract {
92
  *
93
  * @since 3.0.0
94
  * @access public
 
95
  * @param string $key The field name.
 
96
  * @return string
97
  */
98
  public function get_value( $key ) {
@@ -192,10 +195,10 @@ class WPPR_Editor_Model extends WPPR_Model_Abstract {
192
  $cons = isset( $data['wppr-editor-cons'] ) ? $data['wppr-editor-cons'] : array();
193
  $options = array();
194
  foreach ( $options_names as $k => $op_name ) {
195
- if ( isset( $options_values[ $k ] ) && ! empty( $op_name ) && ! empty( $options_values[ $k ] ) ) {
196
  $options[] = array(
197
  'name' => sanitize_text_field( $op_name ),
198
- 'value' => sanitize_text_field( $options_values[ $k ] ),
199
  );
200
 
201
  }
@@ -246,17 +249,17 @@ class WPPR_Editor_Model extends WPPR_Model_Abstract {
246
  $assets = array(
247
  'css' => array(
248
  'dashboard-styles' => array(
249
- 'path' => WPPR_URL . '/assets/css/dashboard_styles.css',
250
  'required' => array(),
251
  ),
252
- 'default-editor' => array(
253
- 'path' => WPPR_URL . '/assets/css/editor.css',
254
  'required' => array(),
255
  ),
256
  ),
257
- 'js' => array(
258
  'default-editor' => array(
259
- 'path' => WPPR_URL . '/assets/js/admin-review.js',
260
  'required' => array( 'jquery' ),
261
  ),
262
  ),
59
  *
60
  * @since 3.0.0
61
  * @access public
62
+ *
63
  * @param WP_Post $post The post object.
64
  */
65
  public function __construct( $post ) {
93
  *
94
  * @since 3.0.0
95
  * @access public
96
+ *
97
  * @param string $key The field name.
98
+ *
99
  * @return string
100
  */
101
  public function get_value( $key ) {
195
  $cons = isset( $data['wppr-editor-cons'] ) ? $data['wppr-editor-cons'] : array();
196
  $options = array();
197
  foreach ( $options_names as $k => $op_name ) {
198
+ if ( ! empty( $op_name ) ) {
199
  $options[] = array(
200
  'name' => sanitize_text_field( $op_name ),
201
+ 'value' => sanitize_text_field( isset( $options_values[ $k ] ) ? ( empty( $options_values[ $k ] ) ? 0 : $options_values[ $k ] ) : 0 ),
202
  );
203
 
204
  }
249
  $assets = array(
250
  'css' => array(
251
  'dashboard-styles' => array(
252
+ 'path' => WPPR_URL . '/assets/css/dashboard_styles.css',
253
  'required' => array(),
254
  ),
255
+ 'default-editor' => array(
256
+ 'path' => WPPR_URL . '/assets/css/editor.css',
257
  'required' => array(),
258
  ),
259
  ),
260
+ 'js' => array(
261
  'default-editor' => array(
262
+ 'path' => WPPR_URL . '/assets/js/admin-review.js',
263
  'required' => array( 'jquery' ),
264
  ),
265
  ),
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.7';
71
 
72
  $this->load_dependencies();
73
  $this->set_locale();
67
  */
68
  public function __construct() {
69
  $this->plugin_name = 'wppr';
70
+ $this->version = '3.0.8';
71
 
72
  $this->load_dependencies();
73
  $this->set_locale();
includes/legacy.php CHANGED
@@ -35,3 +35,16 @@ function cwppos_show_review( $post_id ) {
35
 
36
  return $output;
37
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  return $output;
37
  }
38
+
39
+ /**
40
+ * Legacy functions for return all the options.
41
+ *
42
+ * @deprecated
43
+ *
44
+ * @return mixed Array of global options.
45
+ */
46
+ function cwppos() {
47
+ $options = new WPPR_Options_Model();
48
+
49
+ return $options->get_all();
50
+ }
includes/public/layouts/rich-json-ld.php CHANGED
@@ -52,8 +52,8 @@ if ( $review_object->wppr_get_option( 'wppr_rich_snippet' ) == 'yes' ) {
52
  "price": "' . number_format( $review_object->get_price(), 2 ) . '",
53
  "priceCurrency": "' . $review_object->get_currency() . '",
54
  "seller": {
55
- "@type": "Organization",
56
- "name": "' . get_the_author() . '"
57
  }
58
  }
59
  }</script>';
52
  "price": "' . number_format( $review_object->get_price(), 2 ) . '",
53
  "priceCurrency": "' . $review_object->get_currency() . '",
54
  "seller": {
55
+ "@type": "Person",
56
+ "name": "' . get_the_author() . '"
57
  }
58
  }
59
  }</script>';
readme.txt CHANGED
@@ -67,6 +67,14 @@ 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.7 - 2017-08-29 =
71
 
72
  * Fixed empty links for reviews.
67
  * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
68
 
69
  == Changelog ==
70
+ = 3.0.8 - 2017-09-01 =
71
+
72
+ * Fix for out of memory errors.
73
+ * Fix for options saving when there is no value for each option.
74
+ * Fix for compatibility with Bookrev.
75
+ * Fix for rich snippet reviewer author.
76
+
77
+
78
  = 3.0.7 - 2017-08-29 =
79
 
80
  * Fixed empty links for reviews.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit5d80c55356a9df28e3bba37cae15e986::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit9eaef6f6e70aef395c1322c733506e0c::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit9bbe254b12d96f4e2a2fc88cd8d107f3::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit86d46abce0bdea91457932424bfa7b78
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire86d46abce0bdea91457932424bfa7b78($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire86d46abce0bdea91457932424bfa7b78($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 ComposerAutoloaderInit5d80c55356a9df28e3bba37cae15e986
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit5d80c55356a9df28e3bba37cae15e986', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit5d80c55356a9df28e3bba37cae15e986', '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
+ composerRequire5d80c55356a9df28e3bba37cae15e986($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire5d80c55356a9df28e3bba37cae15e986($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 ComposerAutoloaderInit9eaef6f6e70aef395c1322c733506e0c {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit9eaef6f6e70aef395c1322c733506e0c {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit9eaef6f6e70aef395c1322c733506e0c', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit9eaef6f6e70aef395c1322c733506e0c', '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 ComposerAutoloaderInit9bbe254b12d96f4e2a2fc88cd8d107f3 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit9bbe254b12d96f4e2a2fc88cd8d107f3', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit9bbe254b12d96f4e2a2fc88cd8d107f3', '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.7
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.7' );
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.8
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.8' );
71
  define( 'WPPR_PATH', dirname( __FILE__ ) );
72
  define( 'WPPR_SLUG', 'wppr' );
73
  define( 'WPPR_UPSELL_LINK', 'https://themeisle.com/plugins/wp-product-review/' );