Skip to content

Commit

Permalink
VERSION 3.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
alarocca130 committed Apr 21, 2021
1 parent 356e1a9 commit d21cf55
Show file tree
Hide file tree
Showing 123 changed files with 12,786 additions and 11,929 deletions.
27 changes: 0 additions & 27 deletions .jshintrc

This file was deleted.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,16 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h

## Changelog

### 3.0.20 - Released on 22 February 2021
### 3.0.21 - Released on 21 April 2021

* New: support for WordPress 5.7
* New: support for WooCommerce 5.1
* New: support for WooCommerce 5.2
* New: added no-robots headers for add_to_wishlist url (thanks to brix720)
* Update: YITH plugin framework
* Fix: wrong data type for item insert query (thanks to jonatanmenendez)
* Dev: added new yith_wcwl_get_wishlist_on_remove filter
* Tweak: code refactoring according to PHPCS
* Fix: avoid setting session_id, until guest performs any edit operation over the lists
* Fix: removed deprecated unbind from scripts
* Dev: added yith_wcwl_main_style_deps filter to allow devs remove unnecessary deps
* Dev: added yith_wcwl_custom_icon_alt and yith_wcwl_custom_width filters, to allow dev customize ATW custom icon

## Support

Expand Down
15 changes: 13 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Contributors: yithemes
Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist
Requires at least: 5.3
Tested up to: 5.7
Stable tag: 3.0.20
Stable tag: 3.0.21
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

YITH WooCommerce Wishlist add all Wishlist features to your website. Needs WooCommerce to work.
WooCommerce 5.0.x compatible.
WooCommerce 5.2.x compatible.

== Description ==

Expand Down Expand Up @@ -113,6 +113,17 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h

== Changelog ==

= 3.0.21 - Released on 21 April 2021 =

* New: support for WooCommerce 5.2
* New: added no-robots headers for add_to_wishlist url (thanks to brix720)
* Update: YITH plugin framework
* Tweak: code refactoring according to PHPCS
* Fix: avoid setting session_id, until guest performs any edit operation over the lists
* Fix: removed deprecated unbind from scripts
* Dev: added yith_wcwl_main_style_deps filter to allow devs remove unnecessary deps
* Dev: added yith_wcwl_custom_icon_alt and yith_wcwl_custom_width filters, to allow dev customize ATW custom icon

= 3.0.20 - Released on 22 February 2021 =

* New: support for WordPress 5.7
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/yith-wcwl.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/jquery.yith-wcwl.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions assets/js/unminified/admin/yith-wcwl.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,15 @@ jQuery( function( $ ) {
return ( 'multipart' === on_sale_item_mail_type.val() || 'plain' === on_sale_item_mail_type.val() ) && isChecked( on_sale_item_mail_enabled )
} );

/* === DATEPICKER === */

// commissions filter
$( ".date-picker-field, .date-picker" ).datepicker ({
dateFormat: "yy-mm-dd",
numberOfMonths: 1,
showButtonPanel: true
} );

/* === TOGGLE BOX HANDLING === */

$(document).on( 'yith-add-box-button-toggle', function(){
Expand Down
26 changes: 14 additions & 12 deletions assets/js/unminified/jquery.yith-wcwl.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ jQuery( function( $ ){
$('a[data-rel^="prettyPhoto[add_to_wishlist_"]')
.add('a[data-rel="prettyPhoto[ask_an_estimate]"]')
.add('a[data-rel="prettyPhoto[create_wishlist]"]')
.unbind( 'click' )
.off( 'click' )
.prettyPhoto( ppParams );

$('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on( 'click', function(){
Expand Down Expand Up @@ -693,9 +693,8 @@ jQuery( function( $ ){
for ( var i in mutationsList ) {
var mutation = mutationsList[ i ];
if ( mutation.type === 'childList' ) {
typeof mutation.addedNodes !== 'undefined' && mutation.addedNodes.forEach( callbackAdd);

typeof mutation.removedNodes !== 'undefined' && mutation.removedNodes.forEach( callbackRemove );
typeof mutation.addedNodes !== 'undefined' && typeof mutation.addedNodes.forEach === 'function' && mutation.addedNodes.forEach( callbackAdd );
typeof mutation.removedNodes !== 'undefined' && typeof mutation.addedNodes.forEach === 'function' && mutation.removedNodes.forEach( callbackRemove );
}
}
} );
Expand Down Expand Up @@ -1029,18 +1028,21 @@ jQuery( function( $ ){
* @since 3.0.0
*/
function init_wishlist_details_popup() {

$('.wishlist_table').filter('.images_grid').not('.enhanced')
.on( 'click', '[data-row-id] .product-thumbnail a', function(ev){
var t = $(this),
item = t.closest('[data-row-id]'),
items = item.siblings( '[data-row-id]' ),
popup = item.find('.item-details');
if ( ! yith_wcwl_l10n.disable_popup_grid_view ){
var t = $(this),
item = t.closest('[data-row-id]'),
items = item.siblings( '[data-row-id]' ),
popup = item.find('.item-details');

ev.preventDefault();
ev.preventDefault();

if( popup.length ){
items.removeClass('show');
item.toggleClass( 'show' );
if( popup.length ){
items.removeClass('show');
item.toggleClass( 'show' );
}
}
} )
.on( 'click', '[data-row-id] a.close', function (ev){
Expand Down
2 changes: 1 addition & 1 deletion includes/class.yith-wcwl-ajax-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static function save_title() {

$return = array(
'result' => true,
'fragments' => YITH_WCWL_Ajax_Handler::refresh_fragments( $fragments ),
'fragments' => self::refresh_fragments( $fragments ),
);

wp_send_json( $return );
Expand Down
25 changes: 12 additions & 13 deletions includes/class.yith-wcwl-cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public function __construct() {
* @return array Array of registered crons ans callbacks
*/
public function get_crons() {
if( empty( $this->_crons ) ){
if ( empty( $this->_crons ) ) {
$this->_crons = array(
'yith_wcwl_delete_expired_wishlists' => array(
'schedule' => 'daily',
'callback' => array( $this, 'delete_expired_wishlists' )
)
'callback' => array( $this, 'delete_expired_wishlists' ),
),
);
}

Expand All @@ -68,12 +68,12 @@ public function get_crons() {
public function schedule() {
$crons = $this->get_crons();

if( ! empty( $crons ) ){
foreach( $crons as $hook => $data ){
if ( ! empty( $crons ) ) {
foreach ( $crons as $hook => $data ) {

add_action( $hook, $data['callback'] );

if( ! wp_next_scheduled( $hook ) ){
if ( ! wp_next_scheduled( $hook ) ) {
wp_schedule_event( time() + MINUTE_IN_SECONDS, $data['schedule'], $hook );
}
}
Expand All @@ -86,10 +86,9 @@ public function schedule() {
* @return void
*/
public function delete_expired_wishlists() {
try{
try {
WC_Data_Store::load( 'wishlist' )->delete_expired();
}
catch( Exception $e ){
} catch ( Exception $e ) {
return;
}
}
Expand All @@ -100,8 +99,8 @@ public function delete_expired_wishlists() {
* @return \YITH_WCWL_Cron
* @since 3.0.0
*/
public static function get_instance(){
if( is_null( self::$instance ) ){
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}

Expand All @@ -116,6 +115,6 @@ public static function get_instance(){
* @return \YITH_WCWL_Cron
* @since 3.0.0
*/
function YITH_WCWL_Cron(){
function YITH_WCWL_Cron() {
return defined( 'YITH_WCWL_PREMIUM' ) ? YITH_WCWL_Cron_Premium::get_instance() : YITH_WCWL_Cron::get_instance();
}
}
20 changes: 15 additions & 5 deletions includes/class.yith-wcwl-exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,29 @@
* @since 1.0.0
*/
class YITH_WCWL_Exception extends Exception {
private $_errorCodes = array(
/**
* Available error codes
*
* @var array
*/
private $_error_codes = array(
0 => 'error',
1 => 'exists'
1 => 'exists',
);

/**
* Returns textual code for the error
*
* @return string Textual code of the error.
*/
public function getTextualCode() {
$code = $this->getCode();

if( array_key_exists( $code, $this->_errorCodes ) ){
return $this->_errorCodes[ $code ];
if ( array_key_exists( $code, $this->_error_codes ) ) {
return $this->_error_codes[ $code ];
}

return 'error';
}
}
}
}
Loading

0 comments on commit d21cf55

Please sign in to comment.