WooCommerce Wishlist Plugin - Version 1.3.1

Version Description

Release Date - 26 April 2017

  • Improved theme compatibility tests for shared hosts
  • Improved compatibility for WooCommerce 2 & 3
Download this release

Release Info

Developer templateinvaders
Plugin Icon 128x128 WooCommerce Wishlist Plugin
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3.0 to 1.3.1

admin/tinvwl.class.php CHANGED
@@ -320,12 +320,26 @@ class TInvWL_Admin_TInvWL extends TInvWL_Admin_Base {
320
if ( tinv_get_option( 'template_checker', 'missing_hook_' . $type ) ) {
321
continue;
322
}
323
- $data = array(
324
- 'status' => 'publish',
325
- 'type' => $type,
326
- 'limit' => 1,
327
- );
328
- $products = wc_get_products( $data );
329
if ( ! empty( $products ) ) {
330
$product = array_shift( $products );
331
$result = $tch->run( array( 'url' => $product->get_permalink() ) );
320
if ( tinv_get_option( 'template_checker', 'missing_hook_' . $type ) ) {
321
continue;
322
}
323
+ $products = array();
324
+ if ( function_exists( 'wc_get_products' ) ) {
325
+ $products = wc_get_products( array(
326
+ 'status' => 'publish',
327
+ 'type' => $type,
328
+ 'limit' => 1,
329
+ ) );
330
+ } else {
331
+ $products = array_map( 'wc_get_product', get_posts( array(
332
+ 'post_type' => 'product',
333
+ 'numberposts' => 1,
334
+ 'tax_query' => array(
335
+ array(
336
+ 'taxonomy' => 'product_type',
337
+ 'field' => 'slug',
338
+ 'terms' => $type,
339
+ ),
340
+ ),
341
+ ) ) );
342
+ }
343
if ( ! empty( $products ) ) {
344
$product = array_shift( $products );
345
$result = $tch->run( array( 'url' => $product->get_permalink() ) );
includes/checkerhook.helper.php CHANGED
@@ -92,7 +92,10 @@ class TInvWL_CheckerHook {
92
*/
93
public static function get_remote_data( $data ) {
94
if ( array_key_exists( 'url', $data ) && ! empty( $data['url'] ) ) {
95
- return wp_remote_get( $data['url'] );
96
}
97
}
98
92
*/
93
public static function get_remote_data( $data ) {
94
if ( array_key_exists( 'url', $data ) && ! empty( $data['url'] ) ) {
95
+ $response = wp_remote_get( $data['url'] );
96
+ if ( ! is_wp_error( $response ) ){
97
+ return $response['response']['code'] < 400;
98
+ }
99
}
100
}
101
includes/viewsection.helper.php CHANGED
@@ -280,6 +280,9 @@ class TInvWL_ViewSection extends TInvWL_View {
280
$data[ $field ] = '';
281
}
282
}
283
$data['extra_div'] = $content;
284
$data['show_helper'] = $this->helper;
285
return $data;
280
$data[ $field ] = '';
281
}
282
}
283
+ if ( empty( $data['extra'] ) ) {
284
+ $data['extra'] = array();
285
+ }
286
$data['extra_div'] = $content;
287
$data['show_helper'] = $this->helper;
288
return $data;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://templateinvaders.com/?utm_source=wordpressorg&utm_content=d
4
Tags: wishlist, woocommerce, products, e-commerce, shop, ecommerce wishlist, woocommerce wishlist, woocommerce , shop wishlist, wishlist for Woocommerce
5
Requires at least: 4.5
6
Tested up to: 4.7.4
7
- Stable tag: 1.3.0
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
@@ -126,6 +126,12 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
126
127
== Changelog ==
128
129
= 1.3.0 =
130
*Release Date - 24 April 2017*
131
4
Tags: wishlist, woocommerce, products, e-commerce, shop, ecommerce wishlist, woocommerce wishlist, woocommerce , shop wishlist, wishlist for Woocommerce
5
Requires at least: 4.5
6
Tested up to: 4.7.4
7
+ Stable tag: 1.3.1
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
126
127
== Changelog ==
128
129
+ = 1.3.1 =
130
+ *Release Date - 26 April 2017*
131
+
132
+ * Improved theme compatibility tests for shared hosts
133
+ * Improved compatibility for WooCommerce 2 & 3
134
+
135
= 1.3.0 =
136
*Release Date - 24 April 2017*
137
templates/ti-wishlist-empty.php CHANGED
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
?>
14
<div class="tinv-wishlist woocommerce">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
- <?php wc_print_notices(); ?>
17
<p class="cart-empty">
18
<?php if ( get_current_user_id() === $wishlist['author'] ) { ?>
19
<?php esc_html_e( 'Your Wishlist is currently empty.', 'ti-woocommerce-wishlist' ); ?>
13
?>
14
<div class="tinv-wishlist woocommerce">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
+ <?php if ( function_exists( 'wc_print_notices' ) ) { wc_print_notices(); } ?>
17
<p class="cart-empty">
18
<?php if ( get_current_user_id() === $wishlist['author'] ) { ?>
19
<?php esc_html_e( 'Your Wishlist is currently empty.', 'ti-woocommerce-wishlist' ); ?>
templates/ti-wishlist-user.php CHANGED
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
?>
14
<div class="tinv-wishlist woocommerce tinv-wishlist-clear">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
- <?php wc_print_notices(); ?>
17
<form action="<?php echo esc_url( tinv_url_wishlist() ); ?>" method="post" autocomplete="off">
18
<?php do_action( 'tinvwl_before_wishlist_table', $wishlist ); ?>
19
<table class="tinvwl-table-manage-list">
13
?>
14
<div class="tinv-wishlist woocommerce tinv-wishlist-clear">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
+ <?php if ( function_exists( 'wc_print_notices' ) ) { wc_print_notices(); } ?>
17
<form action="<?php echo esc_url( tinv_url_wishlist() ); ?>" method="post" autocomplete="off">
18
<?php do_action( 'tinvwl_before_wishlist_table', $wishlist ); ?>
19
<table class="tinvwl-table-manage-list">
templates/ti-wishlist.php CHANGED
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
?>
14
<div class="tinv-wishlist woocommerce tinv-wishlist-clear">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
- <?php wc_print_notices(); ?>
17
<form action="<?php echo esc_url( tinv_url_wishlist() ); ?>" method="post" autocomplete="off">
18
<?php do_action( 'tinvwl_before_wishlist_table', $wishlist ); ?>
19
<table class="tinvwl-table-manage-list">
13
?>
14
<div class="tinv-wishlist woocommerce tinv-wishlist-clear">
15
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
16
+ <?php if ( function_exists( 'wc_print_notices' ) ) { wc_print_notices(); } ?>
17
<form action="<?php echo esc_url( tinv_url_wishlist() ); ?>" method="post" autocomplete="off">
18
<?php do_action( 'tinvwl_before_wishlist_table', $wishlist ); ?>
19
<table class="tinvwl-table-manage-list">
ti-woocommerce-wishlist.php CHANGED
@@ -5,7 +5,7 @@
5
* Plugin Name: WooCommerce Wishlist Plugin
6
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
7
* Description: Wishlist functionality for your WooCommerce store.
8
- * Version: 1.3.0
9
* Author: TemplateInvaders
10
* Author URI: https://templateinvaders.com/
11
* License: GPL-2.0+
@@ -37,7 +37,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
37
}
38
39
if ( ! defined( 'TINVWL_FVERSION' ) ) {
40
- define( 'TINVWL_FVERSION', '1.3.0' );
41
}
42
43
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
5
* Plugin Name: WooCommerce Wishlist Plugin
6
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
7
* Description: Wishlist functionality for your WooCommerce store.
8
+ * Version: 1.3.1
9
* Author: TemplateInvaders
10
* Author URI: https://templateinvaders.com/
11
* License: GPL-2.0+
37
}
38
39
if ( ! defined( 'TINVWL_FVERSION' ) ) {
40
+ define( 'TINVWL_FVERSION', '1.3.1' );
41
}
42
43
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
tinv-wishlists-function.php CHANGED
@@ -817,7 +817,7 @@ if ( ! function_exists( 'tinvwl_add_to_cart_need_redirect' ) ) {
817
$need_url_data = array_filter( array_merge( array(
818
'variation_id' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->variation_id : ( $product->is_type( 'variation' ) ? $product->get_id() : 0 ) ),
819
'add-to-cart' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->id : ( $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id() ) ),
820
- ), array_map( 'urlencode', ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->variation_data : array() ) ) ) );
821
$need_url = apply_filters( 'woocommerce_product_add_to_cart_url', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data ) ), $product );
822
$need_url_full = apply_filters( 'woocommerce_product_add_to_cart_url', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data, $product->get_permalink() ) ), $product );
823
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );
817
$need_url_data = array_filter( array_merge( array(
818
'variation_id' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->variation_id : ( $product->is_type( 'variation' ) ? $product->get_id() : 0 ) ),
819
'add-to-cart' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->id : ( $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id() ) ),
820
+ ), array_map( 'urlencode', ( version_compare( WC_VERSION, '3.0.0', '<' ) ? ( is_array( $product->variation_data ) ? $product->variation_data : array() ) : array() ) ) ) );
821
$need_url = apply_filters( 'woocommerce_product_add_to_cart_url', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data ) ), $product );
822
$need_url_full = apply_filters( 'woocommerce_product_add_to_cart_url', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data, $product->get_permalink() ) ), $product );
823
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );