Booster for WooCommerce - Version 3.9.1

Version Description

  • 06/09/2018 =
  • Fix - Shortcodes - General - [wcj_cross_sell_display] - Returning the result instead of echoing.
  • Fix - Shortcodes - General - [wcj_cross_sell_display] - Additional checks added for WC()->cart to exist before executing the shortcode's code.
  • Dev - PRODUCTS - Product Input Fields - "Strip slashes" option added.
  • Dev - Translations - Files updated: az, es_ES, fr_FR, is_IS, it_IT, ja, nl_NL, pt_BR, ro_RO, ru_RU, sv_SE.
  • Dev - Translations - New files added: cs_CZ, el.
Download this release

Release Info

Developer algoritmika
Plugin Icon 128x128 Booster for WooCommerce
Version 3.9.1
Comparing to
See all releases

Code changes from version 3.9.0 to 3.9.1

includes/input-fields/class-wcj-product-input-fields-core.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Core
4
  *
5
- * @version 3.8.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -456,10 +456,20 @@ class WCJ_Product_Input_Fields_Core {
456
  update_post_meta( $_product_id, '_wcj_product_input_fields', $values );
457
  }
458
 
 
 
 
 
 
 
 
 
 
 
459
  /**
460
  * add_product_input_fields_to_frontend.
461
  *
462
- * @version 3.8.0
463
  * @todo `$set_value` - add "default" option for all other types except checkbox
464
  * @todo `$set_value` - 'file' type
465
  * @todo add `required` attributes
@@ -521,7 +531,7 @@ class WCJ_Product_Input_Fields_Core {
521
  if ( $this->is_enabled( $i, $_product_id ) ) {
522
 
523
  $set_value = ( isset( $_POST[ $field_name ] ) ?
524
- $_POST[ $field_name ] :
525
  ( 'checkbox' == $type ?
526
  ( 'yes' === $this->get_value( 'wcj_product_input_fields_type_checkbox_default_' . $this->scope . '_' . $i, $_product_id, 'no' ) ? 'on' : 'off' ) :
527
  ''
@@ -668,7 +678,7 @@ class WCJ_Product_Input_Fields_Core {
668
  *
669
  * from `$_POST` to `$cart_item_data`
670
  *
671
- * @version 3.1.0
672
  */
673
  function add_product_input_fields_to_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
674
  $total_number = apply_filters( 'booster_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
@@ -687,7 +697,7 @@ class WCJ_Product_Input_Fields_Core {
687
  }
688
  } else {
689
  if ( isset( $_POST[ $value_name ] ) ) {
690
- $cart_item_data[ $value_name ] = $_POST[ $value_name ];
691
  }
692
  }
693
  }
@@ -700,8 +710,9 @@ class WCJ_Product_Input_Fields_Core {
700
  function get_cart_item_product_input_fields_from_session( $item, $values, $key ) {
701
  $total_number = apply_filters( 'booster_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
702
  for ( $i = 1; $i <= $total_number; $i++ ) {
703
- if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i, $values ) )
704
  $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] = $values[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
 
705
  }
706
  return $item;
707
  }
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Core
4
  *
5
+ * @version 3.9.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
456
  update_post_meta( $_product_id, '_wcj_product_input_fields', $values );
457
  }
458
 
459
+ /**
460
+ * maybe_stripslashes.
461
+ *
462
+ * @version 3.9.1
463
+ * @since 3.9.1
464
+ */
465
+ function maybe_stripslashes( $str ) {
466
+ return ( 'yes' === get_option( 'wcj_product_input_fields_stripslashes', 'no' ) ? stripslashes( $str ) : $str );
467
+ }
468
+
469
  /**
470
  * add_product_input_fields_to_frontend.
471
  *
472
+ * @version 3.9.1
473
  * @todo `$set_value` - add "default" option for all other types except checkbox
474
  * @todo `$set_value` - 'file' type
475
  * @todo add `required` attributes
531
  if ( $this->is_enabled( $i, $_product_id ) ) {
532
 
533
  $set_value = ( isset( $_POST[ $field_name ] ) ?
534
+ $this->maybe_stripslashes( $_POST[ $field_name ] ) :
535
  ( 'checkbox' == $type ?
536
  ( 'yes' === $this->get_value( 'wcj_product_input_fields_type_checkbox_default_' . $this->scope . '_' . $i, $_product_id, 'no' ) ? 'on' : 'off' ) :
537
  ''
678
  *
679
  * from `$_POST` to `$cart_item_data`
680
  *
681
+ * @version 3.9.1
682
  */
683
  function add_product_input_fields_to_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
684
  $total_number = apply_filters( 'booster_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
697
  }
698
  } else {
699
  if ( isset( $_POST[ $value_name ] ) ) {
700
+ $cart_item_data[ $value_name ] = $this->maybe_stripslashes( $_POST[ $value_name ] );
701
  }
702
  }
703
  }
710
  function get_cart_item_product_input_fields_from_session( $item, $values, $key ) {
711
  $total_number = apply_filters( 'booster_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
712
  for ( $i = 1; $i <= $total_number; $i++ ) {
713
+ if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i, $values ) ) {
714
  $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] = $values[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
715
+ }
716
  }
717
  return $item;
718
  }
includes/settings/wcj-settings-product-input-fields.php CHANGED
@@ -2,9 +2,10 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Product Input Fields
4
  *
5
- * @version 3.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
 
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -338,6 +339,14 @@ $settings = array_merge( $settings, array(
338
  'default' => 'yes',
339
  'type' => 'checkbox',
340
  ),
 
 
 
 
 
 
 
 
341
  array(
342
  'type' => 'sectionend',
343
  'id' => 'wcj_product_input_fields_advanced_options',
2
  /**
3
  * Booster for WooCommerce - Settings - Product Input Fields
4
  *
5
+ * @version 3.9.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
+ * @todo [dev] maybe set "Strip slashes" option to `yes` by default (or even remove the option completely and always strip slashes)
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
339
  'default' => 'yes',
340
  'type' => 'checkbox',
341
  ),
342
+ array(
343
+ 'title' => __( 'Strip slashes', 'woocommerce-jetpack' ),
344
+ 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
345
+ 'desc_tip' => sprintf( __( 'Enable this if you have single quotes %s converted to %s.', 'woocommerce-jetpack' ), '<code>\'</code>', '<code>\\\'</code>' ),
346
+ 'id' => 'wcj_product_input_fields_stripslashes',
347
+ 'default' => 'no',
348
+ 'type' => 'checkbox',
349
+ ),
350
  array(
351
  'type' => 'sectionend',
352
  'id' => 'wcj_product_input_fields_advanced_options',
includes/shortcodes/class-wcj-shortcodes-general.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Shortcodes - General
4
  *
5
- * @version 3.9.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -188,11 +188,15 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
188
  /**
189
  * wcj_cross_sell_display.
190
  *
191
- * @version 3.6.0
192
  * @since 3.6.0
193
  */
194
  function wcj_cross_sell_display( $atts ) {
195
 
 
 
 
 
196
  $limit = ( isset( $atts['limit'] ) ? $atts['limit'] : 2 );
197
  $columns = ( isset( $atts['columns'] ) ? $atts['columns'] : 2 );
198
  $orderby = ( isset( $atts['orderby'] ) ? $atts['orderby'] : 'rand' );
@@ -211,6 +215,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
211
  $limit = apply_filters( 'woocommerce_cross_sells_total', $limit );
212
  $cross_sells = $limit > 0 ? array_slice( $cross_sells, 0, $limit ) : $cross_sells;
213
 
 
214
  wc_get_template( 'cart/cross-sells.php', array(
215
  'cross_sells' => $cross_sells,
216
 
@@ -219,6 +224,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
219
  'orderby' => $orderby,
220
  'columns' => $columns,
221
  ) );
 
222
  }
223
 
224
  /**
2
  /**
3
  * Booster for WooCommerce - Shortcodes - General
4
  *
5
+ * @version 3.9.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
188
  /**
189
  * wcj_cross_sell_display.
190
  *
191
+ * @version 3.9.1
192
  * @since 3.6.0
193
  */
194
  function wcj_cross_sell_display( $atts ) {
195
 
196
+ if ( ! function_exists( 'WC' ) || ! isset( WC()->cart ) ) {
197
+ return '';
198
+ }
199
+
200
  $limit = ( isset( $atts['limit'] ) ? $atts['limit'] : 2 );
201
  $columns = ( isset( $atts['columns'] ) ? $atts['columns'] : 2 );
202
  $orderby = ( isset( $atts['orderby'] ) ? $atts['orderby'] : 'rand' );
215
  $limit = apply_filters( 'woocommerce_cross_sells_total', $limit );
216
  $cross_sells = $limit > 0 ? array_slice( $cross_sells, 0, $limit ) : $cross_sells;
217
 
218
+ ob_start();
219
  wc_get_template( 'cart/cross-sells.php', array(
220
  'cross_sells' => $cross_sells,
221
 
224
  'orderby' => $orderby,
225
  'columns' => $columns,
226
  ) );
227
+ return ob_get_clean();
228
  }
229
 
230
  /**
langs/woocommerce-jetpack-az.mo CHANGED
Binary file
langs/woocommerce-jetpack-cs_CZ.mo ADDED
Binary file
langs/woocommerce-jetpack-el.mo ADDED
Binary file
langs/woocommerce-jetpack-es_ES.mo CHANGED
Binary file
langs/woocommerce-jetpack-fr_FR.mo CHANGED
Binary file
langs/woocommerce-jetpack-is_IS.mo CHANGED
Binary file
langs/woocommerce-jetpack-it_IT.mo CHANGED
Binary file
langs/woocommerce-jetpack-ja.mo CHANGED
Binary file
langs/woocommerce-jetpack-nl_NL.mo CHANGED
Binary file
langs/woocommerce-jetpack-pt_BR.mo CHANGED
Binary file
langs/woocommerce-jetpack-ro_RO.mo CHANGED
Binary file
langs/woocommerce-jetpack-ru_RU.mo CHANGED
Binary file
langs/woocommerce-jetpack-sv_SE.mo CHANGED
Binary file
readme.txt CHANGED
@@ -3,11 +3,11 @@ Contributors: algoritmika, anbinder, debugeris
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 3.9.0
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
- Supercharge your WordPress WooCommerce site with these awesome powerful features.
11
 
12
  == Description ==
13
 
@@ -189,6 +189,13 @@ You can see the differences between versions in this [table](https://booster.io/
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
192
  = 3.9.0 - 05/09/2018 =
193
  * Feature - PRICES & CURRENCIES - Currencies - Shortcodes (e.g. `[wcj_wpml]`) can now be used in currency symbol fields.
194
  * Feature - PRICES & CURRENCIES - Currency Exchange Rates - Exchange Rates Server - "The Free Currency Converter API" server added.
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
+ Stable tag: 3.9.1
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
+ Supercharge your WordPress WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
11
 
12
  == Description ==
13
 
189
 
190
  == Changelog ==
191
 
192
+ = 3.9.1 - 06/09/2018 =
193
+ * Fix - Shortcodes - General - `[wcj_cross_sell_display]` - Returning the result instead of echoing.
194
+ * Fix - Shortcodes - General - `[wcj_cross_sell_display]` - Additional checks added for `WC()->cart` to exist before executing the shortcode's code.
195
+ * Dev - PRODUCTS - Product Input Fields - "Strip slashes" option added.
196
+ * Dev - Translations - Files updated: `az`, `es_ES`, `fr_FR`, `is_IS`, `it_IT`, `ja`, `nl_NL`, `pt_BR`, `ro_RO`, `ru_RU`, `sv_SE`.
197
+ * Dev - Translations - New files added: `cs_CZ`, `el`.
198
+
199
  = 3.9.0 - 05/09/2018 =
200
  * Feature - PRICES & CURRENCIES - Currencies - Shortcodes (e.g. `[wcj_wpml]`) can now be used in currency symbol fields.
201
  * Feature - PRICES & CURRENCIES - Currency Exchange Rates - Exchange Rates Server - "The Free Currency Converter API" server added.
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
6
- Version: 3.9.0
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
@@ -57,7 +57,7 @@ final class WC_Jetpack {
57
  * @var string
58
  * @since 2.4.7
59
  */
60
- public $version = '3.9.0';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
6
+ Version: 3.9.1
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
57
  * @var string
58
  * @since 2.4.7
59
  */
60
+ public $version = '3.9.1';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class