Version Description
- Bug fixes and minor improvements
Download this release
Release Info
Developer | ivole |
Plugin | Customer Reviews for WooCommerce |
Version | 5.6.2 |
Comparing to | |
See all releases |
Code changes from version 5.6.1 to 5.6.2
- class-ivole-endpoint-replies.php +15 -17
- class-ivole.php +3 -3
- includes/emails/class-cr-email-coupon.php +20 -0
- includes/emails/class-cr-email.php +24 -2
- includes/google/class-cr-admin-menu-product-feed.php +4 -1
- includes/google/class-cr-google-shopping-feed.php +3 -0
- includes/reminders/class-cr-local-forms.php +14 -1
- class-ivole-endpoint.php → includes/reviews/class-cr-endpoint.php +1 -3
- ivole.php +1 -1
- readme.txt +3 -1
class-ivole-endpoint-replies.php
CHANGED
@@ -8,32 +8,32 @@ require_once('firebase/src/JWT.php');
|
|
8 |
require_once('firebase/src/SignatureInvalidException.php');
|
9 |
use \ivole\Firebase\JWT\JWT;
|
10 |
|
11 |
-
if ( ! class_exists( '
|
12 |
|
13 |
-
class
|
14 |
|
15 |
private $decoded_message = null;
|
16 |
|
17 |
-
|
18 |
add_action( 'rest_api_init', array( $this, 'init_endpoint' ) );
|
19 |
-
|
20 |
|
21 |
public function init_endpoint( ) {
|
22 |
$this->register_routes();
|
23 |
}
|
24 |
|
25 |
public function register_routes() {
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
|
38 |
public function manage_replies( $request ) {
|
39 |
if( $this->decoded_message ) {
|
@@ -199,5 +199,3 @@ if ( ! class_exists( 'Ivole_Endpoint_Replies' ) ) :
|
|
199 |
}
|
200 |
|
201 |
endif;
|
202 |
-
|
203 |
-
?>
|
8 |
require_once('firebase/src/SignatureInvalidException.php');
|
9 |
use \ivole\Firebase\JWT\JWT;
|
10 |
|
11 |
+
if ( ! class_exists( 'CR_Endpoint_Replies' ) ) :
|
12 |
|
13 |
+
class CR_Endpoint_Replies {
|
14 |
|
15 |
private $decoded_message = null;
|
16 |
|
17 |
+
public function __construct() {
|
18 |
add_action( 'rest_api_init', array( $this, 'init_endpoint' ) );
|
19 |
+
}
|
20 |
|
21 |
public function init_endpoint( ) {
|
22 |
$this->register_routes();
|
23 |
}
|
24 |
|
25 |
public function register_routes() {
|
26 |
+
$version = '1';
|
27 |
+
$namespace = 'ivole/v' . $version;
|
28 |
+
register_rest_route( $namespace, '/review-reply', array(
|
29 |
+
array(
|
30 |
+
'methods' => 'POST, PATCH',
|
31 |
+
'callback' => array( $this, 'manage_replies' ),
|
32 |
+
'permission_callback' => array( $this, 'manage_replies_permissions_check' ),
|
33 |
+
'args' => array()
|
34 |
+
)
|
35 |
+
) );
|
36 |
+
}
|
37 |
|
38 |
public function manage_replies( $request ) {
|
39 |
if( $this->decoded_message ) {
|
199 |
}
|
200 |
|
201 |
endif;
|
|
|
|
class-ivole.php
CHANGED
@@ -8,7 +8,6 @@ require_once( __DIR__ . '/includes/emails/class-cr-email-func.php' );
|
|
8 |
require_once( __DIR__ . '/includes/emails/class-cr-sender.php' );
|
9 |
require_once( __DIR__ . '/includes/emails/class-cr-email.php' );
|
10 |
require_once( __DIR__ . '/includes/emails/class-cr-email-coupon.php' );
|
11 |
-
require_once('class-ivole-endpoint.php');
|
12 |
require_once('class-ivole-endpoint-replies.php');
|
13 |
require_once('class-cr-referrals.php');
|
14 |
require_once( __DIR__ . '/includes/reminders/class-cr-manual.php' );
|
@@ -25,6 +24,7 @@ require_once( __DIR__ . '/includes/reviews/class-cr-ajax-reviews.php');
|
|
25 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews-list-table.php' );
|
26 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews-media-download.php' );
|
27 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews.php' );
|
|
|
28 |
require_once( __DIR__ . '/includes/settings/class-cr-admin.php' );
|
29 |
require_once( __DIR__ . '/includes/settings/class-cr-admin-menu-settings.php' );
|
30 |
require_once( __DIR__ . '/includes/settings/class-cr-settings-review-reminder.php' );
|
@@ -66,7 +66,7 @@ require_once( __DIR__ . '/includes/qna/class-cr-qna-shortcode.php' );
|
|
66 |
require_once( __DIR__ . '/includes/qna/class-cr-qna-email.php' );
|
67 |
|
68 |
class Ivole {
|
69 |
-
const CR_VERSION = '5.6.
|
70 |
|
71 |
public function __construct() {
|
72 |
if( function_exists( 'wc' ) ) {
|
@@ -74,7 +74,7 @@ class Ivole {
|
|
74 |
$cr_sender = new CR_Sender();
|
75 |
$cr_reviews = new CR_Reviews();
|
76 |
$cr_endpoint = new CR_Endpoint();
|
77 |
-
$
|
78 |
$cr_referrals = new CR_Referrals();
|
79 |
$cr_structured_data = new CR_StructuredData();
|
80 |
$cr_checkout = new CR_Checkout();
|
8 |
require_once( __DIR__ . '/includes/emails/class-cr-sender.php' );
|
9 |
require_once( __DIR__ . '/includes/emails/class-cr-email.php' );
|
10 |
require_once( __DIR__ . '/includes/emails/class-cr-email-coupon.php' );
|
|
|
11 |
require_once('class-ivole-endpoint-replies.php');
|
12 |
require_once('class-cr-referrals.php');
|
13 |
require_once( __DIR__ . '/includes/reminders/class-cr-manual.php' );
|
24 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews-list-table.php' );
|
25 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews-media-download.php' );
|
26 |
require_once( __DIR__ . '/includes/reviews/class-cr-reviews.php' );
|
27 |
+
require_once( __DIR__ . '/includes/reviews/class-cr-endpoint.php' );
|
28 |
require_once( __DIR__ . '/includes/settings/class-cr-admin.php' );
|
29 |
require_once( __DIR__ . '/includes/settings/class-cr-admin-menu-settings.php' );
|
30 |
require_once( __DIR__ . '/includes/settings/class-cr-settings-review-reminder.php' );
|
66 |
require_once( __DIR__ . '/includes/qna/class-cr-qna-email.php' );
|
67 |
|
68 |
class Ivole {
|
69 |
+
const CR_VERSION = '5.6.2';
|
70 |
|
71 |
public function __construct() {
|
72 |
if( function_exists( 'wc' ) ) {
|
74 |
$cr_sender = new CR_Sender();
|
75 |
$cr_reviews = new CR_Reviews();
|
76 |
$cr_endpoint = new CR_Endpoint();
|
77 |
+
$cr_endpoint_replies = new CR_Endpoint_Replies();
|
78 |
$cr_referrals = new CR_Referrals();
|
79 |
$cr_structured_data = new CR_StructuredData();
|
80 |
$cr_checkout = new CR_Checkout();
|
includes/emails/class-cr-email-coupon.php
CHANGED
@@ -98,6 +98,26 @@ class CR_Email_Coupon {
|
|
98 |
}
|
99 |
}
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
//a safety check if some translation plugin removed language
|
102 |
if ( empty( $this->language ) || 'WPML' === $this->language ) {
|
103 |
$this->language = 'EN';
|
98 |
}
|
99 |
}
|
100 |
|
101 |
+
// TranslatePress integration
|
102 |
+
if( function_exists( 'trp_translate' ) ) {
|
103 |
+
$trp_order_language = '';
|
104 |
+
if ( $order_id ) {
|
105 |
+
$trp_order_language = get_post_meta( $order_id, 'trp_language', true );
|
106 |
+
}
|
107 |
+
if( $trp_order_language ) {
|
108 |
+
$this->heading = trp_translate( $this->heading, $trp_order_language, false );
|
109 |
+
$this->subject = trp_translate( $this->subject, $trp_order_language, false );
|
110 |
+
$this->from = trp_translate( $this->from, $trp_order_language, false );
|
111 |
+
$this->from_name = trp_translate( $this->from_name, $trp_order_language, false );
|
112 |
+
$this->replyto = trp_translate( $this->replyto, $trp_order_language, false );
|
113 |
+
$this->footer = trp_translate( $this->footer, $trp_order_language, false );
|
114 |
+
if ( empty( $this->from_name ) ) {
|
115 |
+
$this->from_name = self::get_blogname();
|
116 |
+
}
|
117 |
+
$this->language = strtoupper( substr( $trp_order_language, 0, 2 ) );
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
//a safety check if some translation plugin removed language
|
122 |
if ( empty( $this->language ) || 'WPML' === $this->language ) {
|
123 |
$this->language = 'EN';
|
includes/emails/class-cr-email.php
CHANGED
@@ -74,7 +74,7 @@ class Ivole_Email {
|
|
74 |
$this->replyto = apply_filters( 'wpml_translate_single_string', $this->replyto, 'ivole', 'ivole_email_replyto', $wpml_current_language );
|
75 |
$this->footer = apply_filters( 'wpml_translate_single_string', $this->footer, 'ivole', 'ivole_email_footer', $wpml_current_language );
|
76 |
if ( empty( $this->from_name ) ) {
|
77 |
-
$this->from_name =
|
78 |
}
|
79 |
if ( 'WPML' === $this->language && $wpml_current_language ) {
|
80 |
$this->language = strtoupper( $wpml_current_language );
|
@@ -96,13 +96,35 @@ class Ivole_Email {
|
|
96 |
$this->replyto = pll_translate_string( $this->replyto, $polylang_current_language );
|
97 |
$this->footer = pll_translate_string( $this->footer, $polylang_current_language );
|
98 |
if ( empty( $this->from_name ) ) {
|
99 |
-
$this->from_name =
|
100 |
}
|
101 |
if ( 'WPML' === $this->language ) {
|
102 |
$this->language = strtoupper( $polylang_current_language );
|
103 |
}
|
104 |
}
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
//a safety check if some translation plugin removed language
|
107 |
if ( empty( $this->language ) || 'WPML' === $this->language ) {
|
108 |
$this->language = 'EN';
|
74 |
$this->replyto = apply_filters( 'wpml_translate_single_string', $this->replyto, 'ivole', 'ivole_email_replyto', $wpml_current_language );
|
75 |
$this->footer = apply_filters( 'wpml_translate_single_string', $this->footer, 'ivole', 'ivole_email_footer', $wpml_current_language );
|
76 |
if ( empty( $this->from_name ) ) {
|
77 |
+
$this->from_name = self::get_blogname();
|
78 |
}
|
79 |
if ( 'WPML' === $this->language && $wpml_current_language ) {
|
80 |
$this->language = strtoupper( $wpml_current_language );
|
96 |
$this->replyto = pll_translate_string( $this->replyto, $polylang_current_language );
|
97 |
$this->footer = pll_translate_string( $this->footer, $polylang_current_language );
|
98 |
if ( empty( $this->from_name ) ) {
|
99 |
+
$this->from_name = self::get_blogname();
|
100 |
}
|
101 |
if ( 'WPML' === $this->language ) {
|
102 |
$this->language = strtoupper( $polylang_current_language );
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
// TranslatePress integration
|
107 |
+
if( function_exists( 'trp_translate' ) ) {
|
108 |
+
$trp_order_language = '';
|
109 |
+
if ( $order_id ) {
|
110 |
+
$trp_order_language = get_post_meta( $order_id, 'trp_language', true );
|
111 |
+
}
|
112 |
+
if( $trp_order_language ) {
|
113 |
+
$this->heading = trp_translate( $this->heading, $trp_order_language, false );
|
114 |
+
$this->subject = trp_translate( $this->subject, $trp_order_language, false );
|
115 |
+
$this->form_header = trp_translate( $this->form_header, $trp_order_language, false );
|
116 |
+
$this->form_body = trp_translate( $this->form_body, $trp_order_language, false );
|
117 |
+
$this->from = trp_translate( $this->from, $trp_order_language, false );
|
118 |
+
$this->from_name = trp_translate( $this->from_name, $trp_order_language, false );
|
119 |
+
$this->replyto = trp_translate( $this->replyto, $trp_order_language, false );
|
120 |
+
$this->footer = trp_translate( $this->footer, $trp_order_language, false );
|
121 |
+
if ( empty( $this->from_name ) ) {
|
122 |
+
$this->from_name = self::get_blogname();
|
123 |
+
}
|
124 |
+
$this->language = strtoupper( substr( $trp_order_language, 0, 2 ) );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
//a safety check if some translation plugin removed language
|
129 |
if ( empty( $this->language ) || 'WPML' === $this->language ) {
|
130 |
$this->language = 'EN';
|
includes/google/class-cr-admin-menu-product-feed.php
CHANGED
@@ -50,7 +50,10 @@ if ( ! class_exists( 'CR_Product_Feed_Admin_Menu' ) ):
|
|
50 |
WC_Admin_Settings::add_message( sprintf( __( 'XML Product Feed for Google Shopping is being generated in background - products %1$s to %2$s out of %3$s (reload the page to see the latest progress)', 'customer-reviews-woocommerce' ), $cron_options['current'], $offset, $cron_options['total'] ) );
|
51 |
}
|
52 |
// XML Product Review Feed
|
53 |
-
$review_cron_options = get_option(
|
|
|
|
|
|
|
54 |
if( $review_cron_options['started'] ){
|
55 |
$review_offset = ( $review_cron_options['offset'] < $review_cron_options['total'] ) ? $review_cron_options['offset'] : $review_cron_options['total'];
|
56 |
WC_Admin_Settings::add_message( sprintf( __( 'XML Product Review Feed for Google Shopping is being generated in background - reviews %1$s to %2$s out of %3$s (reload the page to see the latest progress)', 'customer-reviews-woocommerce' ), $review_cron_options['current'], $review_offset, $review_cron_options['total'] ) );
|
50 |
WC_Admin_Settings::add_message( sprintf( __( 'XML Product Feed for Google Shopping is being generated in background - products %1$s to %2$s out of %3$s (reload the page to see the latest progress)', 'customer-reviews-woocommerce' ), $cron_options['current'], $offset, $cron_options['total'] ) );
|
51 |
}
|
52 |
// XML Product Review Feed
|
53 |
+
$review_cron_options = get_option(
|
54 |
+
'ivole_product_reviews_feed_cron',
|
55 |
+
array( 'started' => false )
|
56 |
+
);
|
57 |
if( $review_cron_options['started'] ){
|
58 |
$review_offset = ( $review_cron_options['offset'] < $review_cron_options['total'] ) ? $review_cron_options['offset'] : $review_cron_options['total'];
|
59 |
WC_Admin_Settings::add_message( sprintf( __( 'XML Product Review Feed for Google Shopping is being generated in background - reviews %1$s to %2$s out of %3$s (reload the page to see the latest progress)', 'customer-reviews-woocommerce' ), $review_cron_options['current'], $review_offset, $review_cron_options['total'] ) );
|
includes/google/class-cr-google-shopping-feed.php
CHANGED
@@ -52,6 +52,7 @@ class CR_Google_Shopping_Feed {
|
|
52 |
$this->cron_options['offset'] = 0;
|
53 |
$this->cron_options['limit'] = $this->default_limit;
|
54 |
$this->cron_options['current'] = 0;
|
|
|
55 |
|
56 |
update_option('ivole_product_reviews_feed_cron', $this->cron_options);
|
57 |
|
@@ -64,6 +65,7 @@ class CR_Google_Shopping_Feed {
|
|
64 |
$this->cron_options['started'] = false;
|
65 |
$this->cron_options['offset'] = 0;
|
66 |
$this->cron_options['current'] = 0;
|
|
|
67 |
update_option( 'ivole_product_reviews_feed_cron', $this->cron_options );
|
68 |
|
69 |
if( $w_file ) {
|
@@ -485,6 +487,7 @@ class CR_Google_Shopping_Feed {
|
|
485 |
|
486 |
$this->cron_options['offset'] = 0;
|
487 |
$this->cron_options['started'] = false;
|
|
|
488 |
update_option('ivole_product_reviews_feed_cron', $this->cron_options);
|
489 |
|
490 |
if ( file_exists( $this->file_path ) ) {
|
52 |
$this->cron_options['offset'] = 0;
|
53 |
$this->cron_options['limit'] = $this->default_limit;
|
54 |
$this->cron_options['current'] = 0;
|
55 |
+
$this->cron_options['total'] = 0;
|
56 |
|
57 |
update_option('ivole_product_reviews_feed_cron', $this->cron_options);
|
58 |
|
65 |
$this->cron_options['started'] = false;
|
66 |
$this->cron_options['offset'] = 0;
|
67 |
$this->cron_options['current'] = 0;
|
68 |
+
$this->cron_options['total'] = 0;
|
69 |
update_option( 'ivole_product_reviews_feed_cron', $this->cron_options );
|
70 |
|
71 |
if( $w_file ) {
|
487 |
|
488 |
$this->cron_options['offset'] = 0;
|
489 |
$this->cron_options['started'] = false;
|
490 |
+
$this->cron_options['total'] = 0;
|
491 |
update_option('ivole_product_reviews_feed_cron', $this->cron_options);
|
492 |
|
493 |
if ( file_exists( $this->file_path ) ) {
|
includes/reminders/class-cr-local-forms.php
CHANGED
@@ -90,10 +90,23 @@ if ( ! class_exists( 'CR_Local_Forms' ) ) :
|
|
90 |
return;
|
91 |
}
|
92 |
if( $this->language ) {
|
|
|
93 |
if ( has_filter( 'wpml_translate_single_string' ) ) {
|
94 |
-
// WPML integration
|
95 |
do_action( 'wpml_switch_language', strtolower( $this->language ) );
|
96 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
$this->form_header();
|
99 |
foreach( $this->items as $item ) {
|
90 |
return;
|
91 |
}
|
92 |
if( $this->language ) {
|
93 |
+
// WPML integration
|
94 |
if ( has_filter( 'wpml_translate_single_string' ) ) {
|
|
|
95 |
do_action( 'wpml_switch_language', strtolower( $this->language ) );
|
96 |
}
|
97 |
+
// TranslatePress integration
|
98 |
+
global $TRP_LANGUAGE;
|
99 |
+
if( $TRP_LANGUAGE ) {
|
100 |
+
$languages = get_available_languages();
|
101 |
+
$order_lang = strtolower( $this->language );
|
102 |
+
$full_lang_codes = array_filter( $languages, function( $value ) use( $order_lang ) {
|
103 |
+
return strpos( strtolower( $value ), $order_lang ) !== false;
|
104 |
+
} );
|
105 |
+
if( 0 < count( $full_lang_codes ) ) {
|
106 |
+
$full_lang_codes = array_values( $full_lang_codes );
|
107 |
+
$TRP_LANGUAGE = $full_lang_codes[0];
|
108 |
+
}
|
109 |
+
}
|
110 |
}
|
111 |
$this->form_header();
|
112 |
foreach( $this->items as $item ) {
|
class-ivole-endpoint.php → includes/reviews/class-cr-endpoint.php
RENAMED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
|
7 |
if ( ! class_exists( 'CR_Endpoint' ) ) :
|
8 |
|
9 |
-
require_once(
|
10 |
|
11 |
class CR_Endpoint {
|
12 |
public function __construct() {
|
@@ -662,5 +662,3 @@ if ( ! class_exists( 'CR_Endpoint' ) ) :
|
|
662 |
}
|
663 |
|
664 |
endif;
|
665 |
-
|
666 |
-
?>
|
6 |
|
7 |
if ( ! class_exists( 'CR_Endpoint' ) ) :
|
8 |
|
9 |
+
require_once( 'class-cr-custom-questions.php' );
|
10 |
|
11 |
class CR_Endpoint {
|
12 |
public function __construct() {
|
662 |
}
|
663 |
|
664 |
endif;
|
|
|
|
ivole.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Customer Reviews for WooCommerce
|
4 |
Description: Customer Reviews for WooCommerce plugin helps you get more customer reviews for your shop by sending automated reminders and coupons.
|
5 |
Plugin URI: https://wordpress.org/plugins/customer-reviews-woocommerce/
|
6 |
-
Version: 5.6.
|
7 |
Author: CusRev
|
8 |
Author URI: https://www.cusrev.com/business/
|
9 |
Text Domain: customer-reviews-woocommerce
|
3 |
Plugin Name: Customer Reviews for WooCommerce
|
4 |
Description: Customer Reviews for WooCommerce plugin helps you get more customer reviews for your shop by sending automated reminders and coupons.
|
5 |
Plugin URI: https://wordpress.org/plugins/customer-reviews-woocommerce/
|
6 |
+
Version: 5.6.2
|
7 |
Author: CusRev
|
8 |
Author URI: https://www.cusrev.com/business/
|
9 |
Text Domain: customer-reviews-woocommerce
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: ivole
|
|
3 |
Tags: woocommerce, review plugin, review reminder, customer reviews, review for discount
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 5.6.
|
7 |
License: GPLv3 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl.html
|
9 |
|
@@ -218,6 +218,8 @@ If you would like to change how reviews are sorted on product pages, it is possi
|
|
218 |
|
219 |
== Changelog ==
|
220 |
|
|
|
|
|
221 |
= 5.6.1 =
|
222 |
* Bug fixes and minor improvements
|
223 |
= 5.6.0 =
|
3 |
Tags: woocommerce, review plugin, review reminder, customer reviews, review for discount
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 5.6.2
|
7 |
License: GPLv3 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl.html
|
9 |
|
218 |
|
219 |
== Changelog ==
|
220 |
|
221 |
+
= 5.6.2 =
|
222 |
+
* Bug fixes and minor improvements
|
223 |
= 5.6.1 =
|
224 |
* Bug fixes and minor improvements
|
225 |
= 5.6.0 =
|