Version Description
Release Date - 2 September 2020
- Fixed issue with custom AJAX endpoint loading
- Updated integration with WPC Product Bundles for WooCommerce plugin
- Updated integration with WP Fastest Cache plugin
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.21.4 |
Comparing to | |
See all releases |
Code changes from version 1.21.3 to 1.21.4
- assets/css/admin-form-rtl.min.css +1 -1
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-rtl.min.css +1 -1
- assets/css/admin-setup-rtl.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public-rtl.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme-rtl.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.min.js +1 -1
- includes/activator.class.php +0 -12
- includes/api/ajax.php +19 -17
- integrations/woo-product-bundle.php +5 -1
- integrations/wp-fastest-cache.php +2 -1
- languages/ti-woocommerce-wishlist.pot +11 -11
- public/wishlist/view.class.php +857 -845
- readme.txt +8 -1
- ti-woocommerce-wishlist.php +2 -25
assets/css/admin-form-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-form.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tiwlform-number-container{display:inline-block;margin:2px;position:relative;vertical-align:middle}
|
assets/css/admin-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/admin-setup-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin-setup.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
html{background:#f6f3ed}
|
assets/css/admin.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/public-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/public.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
@font-face{font-family:'tinvwl-webfont';src:url("../fonts/tinvwl-webfont.eot?xu2uyi");src:url("../fonts/tinvwl-webfont.eot?xu2uyi#iefix") format("embedded-opentype"),url("../fonts/tinvwl-webfont.ttf?xu2uyi") format("truetype"),url("../fonts/tinvwl-webfont.woff?xu2uyi") format("woff"),url("../fonts/tinvwl-webfont.svg?xu2uyi#tinvwl-webfont") format("svg");font-weight:normal;font-style:normal}
|
assets/css/theme-rtl.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/css/theme.min.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
.tinv-wishlist,.tinv-wishlist input,.tinv-wishlist select,.tinv-wishlist textarea,.tinv-wishlist button,.tinv-wishlist input[type="button"],.tinv-wishlist input[type="reset"],.tinv-wishlist input[type="submit"]{font-family:Georgia,serif;font-size:14px;font-weight:400;text-transform:none;line-height:1.75}
|
assets/js/admin.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function TInvWL($,h){this.pf="tinvwl",this.g="_",this.ho=h||!1,this.n="TInvWL",this.aj_act=function(t){return[this.pf,t].join(this.g)},this._csel=function(t,n){return"{0}{1}{2}".format(n=n||".",this.pf,t)},this._tm=function(t){var n=$("script#{0}[type='text/template']".format(t));return n.length?n.html():""},this.formElm=function(){if($(this._csel("-form-onoff")).tiwl_onoff(),$("input[type=checkbox][tiwl-show], input[type=checkbox][tiwl-hide]").tiwl_onoffblock(),$("[tiwl-value][tiwl-show], [tiwl-value][tiwl-hide]").tiwl_byvalueblock(),void 0!==$.fn.wpColorPicker){var e=function(t){var n=t.substring(1),i=parseInt(n,16);return.2126*(i>>16&255)+.7152*(i>>8&255)+.0722*(i>>0&255)},n=this._csel("-form-color");$(n).each(function(){var n=$(this),t=$(this).closest(".tinvwl-color-picker"),i=t.find(".tinvwl-eyedropper");n.css("background-color",n.val()),175<e(n.val())&&n.css("color","#000000"),n.iris({mode:"hsv",target:$(this).parent().parent(),change:function(t,n){175<e(n.color.toCSS())?$(this).css("color","#000000"):$(this).css("color",""),$(this).css("background-color",n.color.toCSS())}}),t.on("click",".iris-square-value",function(t){t.preventDefault(),n.iris("toggle")}),i.on("click",function(t){t.preventDefault(),n.iris("show")}),n.on("focusin",function(){n.iris("show")})}),$(document).on("click",function(t){$(t.target).is(n+", .iris-picker, .iris-picker-inner, .iris-slider-offset, .tinvwl-eyedropper, .tinvwl-eyedropper .ftinvwl-eyedropper")?$(n).not($(t.target).closest(".tinvwl-color-picker").find(n)).iris("hide"):$(n).iris("hide")})}},this.wizard_page=function(t){$(t).find("select").change(this._wizard_page_ch),this.wizard_page_ch($(t).find("select"))},this.wizard_page_ch=function(t){var n=(t=$(t)).parent(this._csel("-page-select")),i=n.find("input[type=hidden]").val(),e=n.find(this._csel("-error-icon")),o=n.find(this._csel("-error-desc"));""!==t.val()?(n.removeClass("tinvwl-error"),e.hide(),o.hide()):0==i&&(n.addClass("tinvwl-error"),e.show(),o.show())},this.pageElm=function(){$(this._csel("-header","div.")).prependTo("#wpbody-content"),$(this._csel("-page-select")).each(this._wizard_page),$(".bulkactions [type=submit]").each(this._control_bulkactions),$(".action-search [type=submit]").each(this._control_search)},this.control_bulkactions=function(t){$(t).on("click",this._control_bulkactions_ck)},this.control_bulkactions_ck=function(t,n){var i=(t=$(t)).parents(".bulkactions").eq(0).find("[name=action]"),e=t.parents("form").eq(0);i&&("-1"!==i.val()&&e.find("input[type=checkbox]:checked").length||n.preventDefault())},this.control_search=function(t){$(t).on("click",this._control_search_ck)},this.control_search_ck=function(t,n){var i=(t=$(t)).parents(".action-search").eq(0).find("[name=s]");i&&""===i.val()&&n.preventDefault()},this.Run=function(){this.formElm(),this.pageElm()},this.cg=function(){var t=this.n;if(this.ho){var n=new Date;t=t+n.getFullYear()+n.getMonth()+n.getDate()}window[t]=this},this.cg(),String.prototype.format||(String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==i[n]?i[n]:t})}),function(o){var n=o.n,ho=o.ho,c="";for(var i in ho&&(c="t=new Date(),n=n+t.getFullYear()+t.getMonth()+t.getDate(),"),o)"function"!=typeof o[i]||"_"===i[0]||o.hasOwnProperty("_"+i)||eval("o._"+i+"=function(a,b,c,d){var n='"+n+"',"+c+"o=window[n]||null;if (o) {return o."+i+"(this,a,b,c,d);};};")}(this)}!function(s){s.fn.tiwl_onoff=function(t){var o=s.extend(!0,{},{value:{on:"",off:""},class:"tiwlform-onoff",wrap:"container",button:"button"},t);return s(this).each(function(){var n=s(this),t=s("<div>").attr({class:o.class+"-"+o.button}),i=o.class+"-"+o.wrap,e=s("<div>").attr({id:n.attr("id")+"_"+o.wrap,class:i});return n.is("input")&&(e.attr("class",e.attr("class")+" "+n.attr("class")),n.is(":disabled")&&(e.toggleClass("disabled",n.is(":disabled")),n.prop("disabled",!1)),e.toggleClass("checked",n.is(":checked")),n.hide().removeAttr("class").wrap(e).before(t),e=n.parent(),n.on("change",function(t){if(e.hasClass("disabled"))return t.preventDefault();e.toggleClass("checked",s(this).is(":checked"))}),e.on("click",function(t){if(e.hasClass("disabled"))return t.preventDefault();n.is(":enabled")&&e.hasClass("checked")===n.is(":checked")&&n.click()})),n})},s.fn.tiwl_onoffblock=function(t){var n={onEachElm:function(){},isChecked:function(){return s(this).is(":checked")}},c=s.extend(!0,{},n,t);return s(this).each(function(){function t(){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),e=n.attr("tiwl-hide"),o=c.isChecked.call(n);return"string"==typeof i&&t(i,o),"string"==typeof e&&t(e,!o),n}var n=s(this);return n.is("input")&&"checkbox"==n.attr("type")?(s(this).on("change",t),t.call(n)):n})},s.fn.tiwl_byvalueblock=function(t){var n={onEachElm:function(){},onClick:function(){return s(this).val()==s(this).attr("tiwl-value")}},i=s.extend(!0,{},n,t);return s(this).each(function(){function t(e){function t(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})}var n=s(this),i=n.attr("tiwl-show"),o=n.attr("tiwl-hide"),c=e.onClick.call(n);return"string"==typeof i&&t(i,c),"string"==typeof o&&t(o,!c),n}var n=s(this);return n.is("input")||n.is("select")?(s(this).on("change",function(){t.call(this,i)}),t.call(n,i)):n})};var n=new TInvWL(s);s(document).ready(function(){if(n.Run(),jQuery('input[name="general-show_notice"]').change(function(){var t=!jQuery(this).is(":checked"),n=jQuery('input[name="general-redirect_require_login"]');t&&!n.is(":checked")&&n.click().trigger("change"),n.closest(".tiwlform-onoff-container").toggleClass("disabled",t)}).change(),s(".tablenav").each(function(){var t=s(this);s.trim(t.find(".alignleft").html()).length||t.find(".alignleft").remove(),s.trim(t.find(".alignright").html()).length&&!t.find(".tablenav-pages").hasClass("one-page")||(t.find(".alignright").remove(),t.find(".tinv-wishlist-clear").remove()),s.trim(t.html()).length||t.remove()}),s(".tablenav .bulkactions select").addClass("tinvwl-select grey").wrap('<span class="tinvwl-select-wrap">').parent().append('<span class="tinvwl-caret"><span></span></span>'),s(".tablenav .bulkactions .button.action, .tablenav #search-submit").removeClass("button").addClass("tinvwl-btn grey"),s(".tinvwl-modal-btn").on("click",function(){s(this).next(".tinvwl-modal").addClass("tinvwl-modal-open")}),s(".tinvwl-overlay, .tinvwl-close-modal, .tinvwl_button_close").on("click",function(t){t.preventDefault(),s(this).parents(".tinvwl-modal:first").removeClass("tinvwl-modal-open")}),void 0!==s.fn.popover){var t=s(".tinvwl-help");t.popover({content:function(){return s(this).closest(".tinvwl-info-wrap").find(".tinvwl-info-desc").html()}}),t.on("click",function(){s(this).popover("toggle")}),t.on("focusout",function(){s(this).popover("hide")}),s(window).on("resize",function(){t.popover("hide")})}s("body").on("click",".tinvwl-confirm-reset",function(t){t.preventDefault(),confirm(tinvwl_comfirm.text_comfirm_reset)&&s(this).removeClass("tinvwl-confirm-reset").trigger("click")})})}(jQuery);
|
assets/js/public.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
-
* @version 1.21.
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,d=new FormData;c(n).closest("form.cart[method=post], form.vtajaxform[method=post], .tinvwl-loop-button-wrapper").find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=c.parseJSON(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c(this).find(".tinvwl_add_to_wishlist_button");if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c(this).find(".tinvwl_add_to_wishlist_button");if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=c.parseJSON(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(t){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=c.parseJSON(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter")))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c.each(t.products,function(t,e){var a=t;c("a.tinvwl_add_to_wishlist_button[data-tinv-wl-product='"+a+"']").each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");"false"!==t?jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t):jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products");var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(c.parseJSON(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o.trim(o(this).html()).length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
1 |
/**
|
2 |
* TI WooCommerce Wishlist Plugin - Allow your store guests and customers to add products to Wishlist. Add Wishlist functionality to your store for free.
|
3 |
+
* @version 1.21.4
|
4 |
* @link https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
5 |
*/
|
6 |
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function showTooltip(t,i){t.setAttribute("class","social social-clipboard tooltipped tooltipped-s"),t.setAttribute("aria-label",i)}function clearTooltip(t){t.currentTarget.setAttribute("class","social social-clipboard "),t.currentTarget.removeAttribute("aria-label")}!function(c){c.fn.tinvwl_to_wishlist=function(t){var i={api_url:window.location.href.split("?")[0],text_create:window.tinvwl_add_to_wishlist.text_create,text_already_in:window.tinvwl_add_to_wishlist.text_already_in,class:{dialogbox:".tinvwl_add_to_select_wishlist",select:".tinvwl_wishlist",newtitle:".tinvwl_new_input",dialogbutton:".tinvwl_button_add"},redirectTimer:null,onPrepareList:function(){},onGetDialogBox:function(){},onPrepareDialogBox:function(){c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){c(this).append(c("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){c(t).addClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){c(t).removeClass("tinv-modal-open"),c(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(c(this).is(".disabled-add-wishlist"))return!1;c(this).is(".ftinvwl-animated")&&c(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):e.onActionProduct.call(this)},onPrepareDataAction:function(t,i){c("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var o={};return c("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val();("checkbox"!==i&&"radio"!==i||c(this).is(":checked"))&&(o["form"+t]=n)}),o=o.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof o)return t.in;var i=parseInt(o);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=e.onPrepareList.call(t)||t,t=e.filterProductAlreadyIn.call(this,t)||t,c(this).parent().parent().find(".already-in").remove();var n="";switch(t.length){case 0:break;default:n=c("<ul>");c.each(t,function(t,i){n.append(c("<li>").html(c("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}n.length&&c(this).closest(".tinv-modal-inner").find("img").after(c("<div>").addClass("already-in").html(e.text_already_in+" ").append(n))},onAction:{redirect:function(t){e.redirectTimer&&clearTimeout(e.redirectTimer),e.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(){},msg:function(t){if(!t)return!1;var i=c(t).eq(0);c("body > .tinv-wishlist").length||c("body").append(c("<div>").addClass("tinv-wishlist")),c("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),e.redirectTimer&&clearTimeout(e.redirectTimer)})},status:function(t){c("body").trigger("tinvwl_wishlist_added_status",[this,t])},removed:function(){},make_remove:function(){},wishlists_data:function(t){d(JSON.stringify(t))}}};i.onActionProduct=function(t,i){var r={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:c(this).attr("data-tinv-wl-producttype"),product_id:c(this).attr("data-tinv-wl-product")||0,product_variation:c(this).attr("data-tinv-wl-productvariation")||0,product_action:c(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},n=this,d=new FormData;c(n).closest("form.cart[method=post], form.vtajaxform[method=post], .tinvwl-loop-button-wrapper").find("input:not(:disabled), select:not(:disabled), textarea:not(:disabled)").each(function(){function e(t,i){if("object"!==_typeof(i))return i;for(var n in void 0===t&&(t={}),i)if(""===n){var o=-1;for(o in t)o=o;t[o=parseInt(o)+1]=e(t[n],i[n])}else t[n]=e(t[n],i[n]);return t}var t=c(this).attr("name"),i=c(this).attr("type"),n=c(this).val(),o=10;if("button"!==i&&void 0!==t){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<o;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=n,n=l}t=a[1],o--}if("file"===i){var s=c(this)[0].files;s&&d.append(t,s[0])}"checkbox"===i||"radio"===i?c(this).is(":checked")&&(n.length||"object"===_typeof(n)||(n=!0),r.form[t]=e(r.form[t],n)):r.form[t]=e(r.form[t],n)}}),r=e.onPrepareDataAction.call(n,n,r)||r,c.each(r,function(n,t){"form"===n?c.each(t,function(t,i){"object"===_typeof(i)&&(i=JSON.stringify(i)),d.append(n+"["+t+"]",i)}):d.append(n,t)}),c.ajax({url:e.api_url,method:"POST",contentType:!1,processData:!1,data:d}).done(function(t){if(e.onDialogHide.call(n.tinvwl_dialog,n),"object"===_typeof(t))for(var i in t)"function"==typeof e.onAction[i]&&e.onAction[i].call(n,t[i]);else"function"==typeof e.onAction.msg&&e.onAction.msg.call(n,t)})};var e=c.extend(!0,{},i,t);return c(this).each(function(){if(!c(this).attr("data-tinv-wl-list"))return!1;if(e.dialogbox&&e.dialogbox.length&&(this.tinvwl_dialog=e.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=e.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=c(this).nextAll(e.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){e.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var n=c(this).find(e.class.select).eq(0);c(this).find(e.class.newtitle).hide().val(""),n.html(""),c.each(t,function(t,i){e.onCreateWishList.call(n,i)}),e.text_create&&e.onCreateWishList.call(n,{ID:"",title:e.text_create,in:!1}),e.onMultiProductAlreadyIn.call(n,t),e.onSelectWishList.call(n,t),c(this).find(e.class.newtitle).toggle(""===n.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=c.parseJSON(c(this).attr("data-tinv-wl-list"))||[];t.length?(t=e.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),e.onDialogShow.call(this.tinvwl_dialog,this)):e.onActionProduct.call(this)});var o=this;c(this.tinvwl_dialog).find(e.class.dialogbutton).off("click").on("click",function(){var t,i=c(o.tinvwl_dialog).find(e.class.select),n=c(o.tinvwl_dialog).find(e.class.newtitle);i.val()||n.val()?e.onActionProduct.call(o,i.val(),n.val()):((t=n.is(":visible")?n:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}c(this).off("click").on("click",e.onClick),e.onInited.call(this,e)})},c(document).ready(function(){c("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(c(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);c(this).is(".inited-add-wishlist")||c(this).tinvwl_to_wishlist({onInited:function(t){c(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),c(document).on("hide_variation",".variations_form",function(t){var i=c(this).find(".tinvwl_add_to_wishlist_button");if(i.attr("data-tinv-wl-productvariation",0),i.length&&i.attr("data-tinv-wl-list")){var n=JSON.parse(i.attr("data-tinv-wl-list")),o=!1,e="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var a in n)n[a].hasOwnProperty("in")&&Array.isArray(n[a].in)&&-1<(n[a].in||[]).indexOf(0)&&(o=!0);i.toggleClass("tinvwl-product-in-list",o).toggleClass("tinvwl-product-make-remove",o&&e).attr("data-tinv-wl-action",o&&e?"remove":"addto")}i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),c(document).on("show_variation",".variations_form",function(t,i,n){var o=c(this).find(".tinvwl_add_to_wishlist_button");if(o.attr("data-tinv-wl-productvariation",i.variation_id),o.length&&o.attr("data-tinv-wl-list")){var e=JSON.parse(o.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in e)e[s].hasOwnProperty("in")&&Array.isArray(e[s].in)&&-1<(e[s].in||[]).indexOf(i.variation_id)&&(a=!0);o.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto")}t.preventDefault(),o.removeClass("disabled-add-wishlist")}),c(window).on("storage onstorage",function(t){if(s===t.originalEvent.key&&localStorage.getItem(s)!==sessionStorage.getItem(s)&&localStorage.getItem(s)){var i=c.parseJSON(localStorage.getItem(s));"object"===_typeof(i)&&null!==i&&(i.hasOwnProperty("products")||i.hasOwnProperty("counter"))&&d(localStorage.getItem(s))}});var n=[],i=!1;c("a.tinvwl_add_to_wishlist_button").each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))}),c(".wishlist_products_counter_number").each(function(){i=!0});function o(){if(n.length||i){var t={};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.plugin_url+"includes/api/ajax.php",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)}).fail(function(t){!function(){if(n.length||i){var t={ids:n,counter:i,tinvwl_request:!0};tinvwl_add_to_wishlist.wpml&&(t.lang=tinvwl_add_to_wishlist.wpml),c.ajax({url:tinvwl_add_to_wishlist.rest_root+"wishlist/v1/products",method:"POST",data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",tinvwl_add_to_wishlist.nonce)}}).done(function(t){d(JSON.stringify(t)),r(t)})}}()})}}function e(){if(l&&(tinvwl_add_to_wishlist.update_wishlists_data&&localStorage.setItem(s,""),localStorage.getItem(s))){var t=c.parseJSON(localStorage.getItem(s));if("object"===_typeof(t)&&null!==t&&(t.hasOwnProperty("products")||t.hasOwnProperty("counter")))return void r(t)}tinvwl_add_to_wishlist.block_ajax_wishlists_data||o()}e();var t=new MutationObserver(function(t){n=[],t.forEach(function(t){var i=t.addedNodes;null!==i&&c(i).each(function(){var t=c(this).find(".tinvwl_add_to_wishlist_button");t.length&&t.each(function(){"undefined"!==c(this).data("tinv-wl-product")&&c(this).data("tinv-wl-product")&&n.push(c(this).data("tinv-wl-product"))})})}),n.length&&e()}),a=document.body;t.observe(a,{childList:!0,subtree:!0})});var l=!0,s=tinvwl_add_to_wishlist.hash_key;try{l="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("ti","test"),window.sessionStorage.removeItem("ti"),window.localStorage.setItem("ti","test"),window.localStorage.removeItem("ti")}catch(t){l=!1}function r(t){var l="1"==window.tinvwl_add_to_wishlist.simple_flow;l&&c("a.tinvwl_add_to_wishlist_button").each(function(){c(this).removeClass("tinvwl-product-make-remove").removeClass("tinvwl-product-already-on-wishlist").removeClass("tinvwl-product-in-list").attr("data-tinv-wl-action","addto").attr("data-tinv-wl-list","[]")}),c.each(t.products,function(t,e){var a=t;c("a.tinvwl_add_to_wishlist_button[data-tinv-wl-product='"+a+"']").each(function(){var t=parseInt(c(this).attr("data-tinv-wl-productvariation")),i=c(this).data("tinv-wl-productvariations")||[],n=!1;for(var o in e)e[o].hasOwnProperty("in")&&Array.isArray(e[o].in)&&(-1<(e[o].in||[]).indexOf(a)||-1<(e[o].in||[]).indexOf(t)||i.some(function(t){return 0<=(e[o].in||[]).indexOf(t)}))&&(n=!0);c(this).attr("data-tinv-wl-list",JSON.stringify(e)).toggleClass("tinvwl-product-in-list",n).toggleClass("tinvwl-product-make-remove",n&&l).attr("data-tinv-wl-action",n&&l?"remove":"addto")})}),function(t){"1"==window.tinvwl_add_to_wishlist.hide_zero_counter&&0===t&&(t="false");"false"!==t?jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html(t):jQuery(".wishlist_products_counter_number, body.theme-woostify .wishlist-item-count").html("").closest("span.wishlist-counter-with-products").removeClass("wishlist-counter-with-products");var i=!("0"==t||"false"==t);jQuery(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",i)}(t.counter)}function d(t){l&&(localStorage.setItem(s,t),sessionStorage.setItem(s,t),r(c.parseJSON(t)))}}(jQuery),function(o){o(document).ready(function(){if(o("#tinvwl_manage_actions, #tinvwl_product_actions").addClass("form-control").parent().wrapInner('<div class="tinvwl-input-group tinvwl-no-full">').find("button").wrap('<span class="tinvwl-input-group-btn">'),o(".tinv-lists-nav").each(function(){o.trim(o(this).html()).length||o(this).remove()}),o("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(o(this).attr("href"),o(this).attr("title"),"width=420,height=320,resizable=yes,scrollbars=yes,status=yes");i&&(i.focus(),t.preventDefault())}),"undefined"!=typeof ClipboardJS){new ClipboardJS(".social-buttons .social.social-clipboard",{text:function(t){return t.getAttribute("href")}}).on("success",function(t){showTooltip(t.trigger,tinvwl_add_to_wishlist.tinvwl_clipboard)});for(var t=document.querySelectorAll(".social-buttons .social.social-clipboard"),i=0;i<t.length;i++)t[i].addEventListener("mouseleave",clearTooltip),t[i].addEventListener("blur",clearTooltip)}o("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),o("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),o(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),o("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){o(this).data("url")&&(t.preventDefault(),window.location=o(this).data("url"))});var n=o(".tinv-wishlist .navigation-button");n.length&&n.each(function(){var t=o(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),o(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),o(this).closest(".tinv-login").find(".login").toggle()}),o(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){o(this).toggle(!!o(this).children().not(".look_in").length||!!o(this).children(".look_in").children().length)})})}(jQuery),function(o){o.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return o(this).val()},rule:function(){var t=o(this).parents("form").eq(0).find(n.selector),i=n.invert;return 0===t.length?n.ifempty:(t.each(function(){i&&!n.invert||!i&&n.invert||(i=Boolean(n.validate.call(o(this))))}),i)}},n=o.extend(!0,{},i,t);return o(this).each(function(){o(this).on("click",function(t){n.rule.call(o(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},o(document).ready(function(){o(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),o(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return o(this).is(":checked")}}),o(".global-cb").on("click",function(){o(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",o(this).is(":checked"))})})}(jQuery);
|
includes/activator.class.php
CHANGED
@@ -65,18 +65,6 @@ class TInvWL_Activator {
|
|
65 |
self::database();
|
66 |
self::load_data();
|
67 |
TInvWL_Public_TInvWL::update_rewrite_rules();
|
68 |
-
|
69 |
-
if ( ! file_exists( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ) ) {
|
70 |
-
$root_wpload = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
71 |
-
$handle = fopen( $root_wpload, 'w' ) or die( 'Could not create wp-load.php' );
|
72 |
-
$data =
|
73 |
-
"<?php //Added for Flywheel Cloud wp-load Fix \n"
|
74 |
-
. 'if ( file_exists( $_SERVER[\'DOCUMENT_ROOT\'] . \'/wp-config.php\' ) ) {' . "\n"
|
75 |
-
. ' require_once( $_SERVER[\'DOCUMENT_ROOT\'] . \'/wp-config.php\' );' . "\n"
|
76 |
-
. ' require_once( ABSPATH . \'/wp-load.php\' );'
|
77 |
-
. "} ?>";
|
78 |
-
file_put_contents( $root_wpload, $data );
|
79 |
-
}
|
80 |
}
|
81 |
|
82 |
/**
|
65 |
self::database();
|
66 |
self::load_data();
|
67 |
TInvWL_Public_TInvWL::update_rewrite_rules();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
/**
|
includes/api/ajax.php
CHANGED
@@ -7,28 +7,30 @@ define( 'SHORTINIT', true );
|
|
7 |
|
8 |
// WP Load
|
9 |
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
define( 'TINV_WP_ROOT', '../../../../../' );
|
12 |
-
|
13 |
-
require( '../../../../../wp-load.php' );
|
14 |
wp_plugin_directory_constants();
|
15 |
-
require_once(
|
16 |
-
require_once(
|
17 |
-
require_once(
|
18 |
-
require_once(
|
19 |
-
require_once(
|
20 |
-
require_once(
|
21 |
-
require_once(
|
22 |
-
//require_once (
|
23 |
-
require_once(
|
24 |
-
require_once(
|
25 |
|
26 |
wp_cookie_constants();
|
27 |
|
28 |
-
require_once(
|
29 |
-
require_once(
|
30 |
-
require_once(
|
31 |
-
require_once(
|
32 |
|
33 |
// Get the nonce.
|
34 |
if ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
|
7 |
|
8 |
// WP Load
|
9 |
// -----------------------------------------------------------------------
|
10 |
+
require( dirname( dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) ) . '/wp-config.php' );
|
11 |
+
require( ABSPATH . '/wp-load.php' );
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
+
exit;
|
14 |
+
}
|
15 |
|
|
|
|
|
|
|
16 |
wp_plugin_directory_constants();
|
17 |
+
require_once( ABSPATH . WPINC . '/class-wp-user.php' );
|
18 |
+
require_once( ABSPATH . WPINC . '/class-wp-roles.php' );
|
19 |
+
require_once( ABSPATH . WPINC . '/class-wp-role.php' );
|
20 |
+
require_once( ABSPATH . WPINC . '/class-wp-session-tokens.php' );
|
21 |
+
require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
|
22 |
+
require_once( ABSPATH . WPINC . '/formatting.php' );
|
23 |
+
require_once( ABSPATH . WPINC . '/capabilities.php' );
|
24 |
+
//require_once ( ABSPATH . WPINC . '/query.php' ); // - might be useful
|
25 |
+
require_once( ABSPATH . WPINC . '/user.php' );
|
26 |
+
require_once( ABSPATH . WPINC . '/meta.php' );
|
27 |
|
28 |
wp_cookie_constants();
|
29 |
|
30 |
+
require_once( ABSPATH . WPINC . '/vars.php' );
|
31 |
+
require_once( ABSPATH . WPINC . '/kses.php' );
|
32 |
+
require_once( ABSPATH . WPINC . '/rest-api.php' );
|
33 |
+
require_once( ABSPATH . WPINC . '/pluggable.php' );
|
34 |
|
35 |
// Get the nonce.
|
36 |
if ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
|
integrations/woo-product-bundle.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @name WPC Product Bundles for WooCommerce
|
6 |
*
|
7 |
-
* @version 5.
|
8 |
*
|
9 |
* @slug woo-product-bundle
|
10 |
*
|
@@ -59,6 +59,10 @@ if ( defined( 'WOOSB_VERSION' ) ) {
|
|
59 |
|
60 |
$bundled_item->product = wc_get_product( $data['id'] );
|
61 |
|
|
|
|
|
|
|
|
|
62 |
$bundled_product_qty = $data['qty'];
|
63 |
$product_url = ( get_option( '_woosb_bundled_link', 'yes' ) !== 'no' ) ? $product->get_permalink() : $bundled_item->product->get_permalink();
|
64 |
$product_image = $bundled_item->product->get_image();
|
4 |
*
|
5 |
* @name WPC Product Bundles for WooCommerce
|
6 |
*
|
7 |
+
* @version 5.3.1
|
8 |
*
|
9 |
* @slug woo-product-bundle
|
10 |
*
|
59 |
|
60 |
$bundled_item->product = wc_get_product( $data['id'] );
|
61 |
|
62 |
+
if ( ! $bundled_item->product ) {
|
63 |
+
continue;
|
64 |
+
}
|
65 |
+
|
66 |
$bundled_product_qty = $data['qty'];
|
67 |
$product_url = ( get_option( '_woosb_bundled_link', 'yes' ) !== 'no' ) ? $product->get_permalink() : $bundled_item->product->get_permalink();
|
68 |
$product_image = $bundled_item->product->get_image();
|
integrations/wp-fastest-cache.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @name WP Fastest Cache
|
6 |
*
|
7 |
-
* @version 0.9.0
|
8 |
*
|
9 |
* @slug wp-fastest-cache
|
10 |
*
|
@@ -53,6 +53,7 @@ if ( ! function_exists( 'tinvwl_wp_fastest_cache_reject' ) ) {
|
|
53 |
|
54 |
$rules_std = json_decode( $rules_json, true );
|
55 |
$ex_pages = array();
|
|
|
56 |
foreach ( $rules_std as $value ) {
|
57 |
$value['type'] = isset( $value['type'] ) ? $value['type'] : 'page';
|
58 |
if ( 'page' === $value['type'] ) {
|
4 |
*
|
5 |
* @name WP Fastest Cache
|
6 |
*
|
7 |
+
* @version 0.9.1.0
|
8 |
*
|
9 |
* @slug wp-fastest-cache
|
10 |
*
|
53 |
|
54 |
$rules_std = json_decode( $rules_json, true );
|
55 |
$ex_pages = array();
|
56 |
+
$rules_std = is_array( $rules_std ) ? $rules_std : array();
|
57 |
foreach ( $rules_std as $value ) {
|
58 |
$value['type'] = isset( $value['type'] ) ? $value['type'] : 'page';
|
59 |
if ( 'page' === $value['type'] ) {
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2020 TI WooCommerce Wishlist Plugin - 1.21.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.21.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.21.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -1052,7 +1052,7 @@ msgstr ""
|
|
1052 |
msgid "Flat rate cost"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
-
#: integrations/woo-product-bundle.php:
|
1056 |
msgid "In stock"
|
1057 |
msgstr ""
|
1058 |
|
@@ -1147,7 +1147,7 @@ msgstr ""
|
|
1147 |
msgid "Remove"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
-
#: public/wishlist/buttons.class.php:507, public/wishlist/view.class.php:
|
1151 |
msgid "“%s”"
|
1152 |
msgstr ""
|
1153 |
|
@@ -1181,27 +1181,27 @@ msgstr ""
|
|
1181 |
msgid "WhatsApp"
|
1182 |
msgstr ""
|
1183 |
|
1184 |
-
#: public/wishlist/view.class.php:
|
1185 |
msgid "%1$s by %2$s"
|
1186 |
msgstr ""
|
1187 |
|
1188 |
-
#: public/wishlist/view.class.php:
|
1189 |
msgid "%s has not been removed from wishlist."
|
1190 |
msgstr ""
|
1191 |
|
1192 |
-
#: public/wishlist/view.class.php:
|
1193 |
msgid "%s has been removed from wishlist."
|
1194 |
msgstr ""
|
1195 |
|
1196 |
-
#: public/wishlist/view.class.php:
|
1197 |
msgid "Return to Wishlist"
|
1198 |
msgstr ""
|
1199 |
|
1200 |
-
#: public/wishlist/view.class.php:
|
1201 |
msgid "Previous Page"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: public/wishlist/view.class.php:
|
1205 |
msgid "Next Page"
|
1206 |
msgstr ""
|
1207 |
|
1 |
+
# Copyright (C) 2020 TI WooCommerce Wishlist Plugin - 1.21.4
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.21.4 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.21.4\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
1052 |
msgid "Flat rate cost"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
+
#: integrations/woo-product-bundle.php:90, integrations/woocommerce-composite-products.php:116, integrations/woocommerce-mix-and-match-products.php:86, integrations/woocommerce-product-bundles.php:110, integrations/yith-woocommerce-product-bundles.php:138, templates/ti-wishlist-user.php:143, templates/ti-wishlist.php:151
|
1056 |
msgid "In stock"
|
1057 |
msgstr ""
|
1058 |
|
1147 |
msgid "Remove"
|
1148 |
msgstr ""
|
1149 |
|
1150 |
+
#: public/wishlist/buttons.class.php:507, public/wishlist/view.class.php:497
|
1151 |
msgid "“%s”"
|
1152 |
msgstr ""
|
1153 |
|
1181 |
msgid "WhatsApp"
|
1182 |
msgstr ""
|
1183 |
|
1184 |
+
#: public/wishlist/view.class.php:435
|
1185 |
msgid "%1$s by %2$s"
|
1186 |
msgstr ""
|
1187 |
|
1188 |
+
#: public/wishlist/view.class.php:512
|
1189 |
msgid "%s has not been removed from wishlist."
|
1190 |
msgstr ""
|
1191 |
|
1192 |
+
#: public/wishlist/view.class.php:510
|
1193 |
msgid "%s has been removed from wishlist."
|
1194 |
msgstr ""
|
1195 |
|
1196 |
+
#: public/wishlist/view.class.php:655
|
1197 |
msgid "Return to Wishlist"
|
1198 |
msgstr ""
|
1199 |
|
1200 |
+
#: public/wishlist/view.class.php:781
|
1201 |
msgid "Previous Page"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
+
#: public/wishlist/view.class.php:807
|
1205 |
msgid "Next Page"
|
1206 |
msgstr ""
|
1207 |
|
public/wishlist/view.class.php
CHANGED
@@ -1,845 +1,857 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Wishlist shortcode
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package TInvWishlist\Public
|
7 |
-
*/
|
8 |
-
|
9 |
-
// If this file is called directly, abort.
|
10 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
-
die;
|
12 |
-
}
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Wishlist shortcode
|
16 |
-
*/
|
17 |
-
class TInvWL_Public_Wishlist_View {
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Plugin name
|
21 |
-
*
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $_name;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* List per page
|
28 |
-
*
|
29 |
-
* @var integer
|
30 |
-
*/
|
31 |
-
private $lists_per_page;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Current wishlist
|
35 |
-
*
|
36 |
-
* @var array
|
37 |
-
*/
|
38 |
-
private $current_wishlist;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Current products
|
42 |
-
*
|
43 |
-
* @var array
|
44 |
-
*/
|
45 |
-
private $current_products_query;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Social image
|
49 |
-
*
|
50 |
-
* @var string
|
51 |
-
*/
|
52 |
-
public $social_image;
|
53 |
-
|
54 |
-
/**
|
55 |
-
*
|
56 |
-
*
|
57 |
-
* @var
|
58 |
-
*/
|
59 |
-
public $
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Wishlist
|
63 |
-
*
|
64 |
-
* @var
|
65 |
-
*/
|
66 |
-
public $
|
67 |
-
|
68 |
-
/**
|
69 |
-
*
|
70 |
-
*
|
71 |
-
* @var
|
72 |
-
*/
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
*
|
77 |
-
*
|
78 |
-
* @
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
add_action( '
|
112 |
-
|
113 |
-
add_action( '
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
add_action( '
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
*
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
$
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
}
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
$
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
do_action( '
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
} else {
|
401 |
-
$
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
$
|
426 |
-
'
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
'
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
if (
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
*
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
*
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
}
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
$
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
//
|
588 |
-
$product = $
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
)
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
$
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
$
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
$
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
if (
|
703 |
-
add_action( 'tinvwl_pagenation_wishlist', array( $this, '
|
704 |
-
}
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
tinv_wishlist_template( 'ti-wishlist
|
720 |
-
}
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
}
|
734 |
-
|
735 |
-
/**
|
736 |
-
*
|
737 |
-
*
|
738 |
-
* @param array $
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
*
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
);
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
*
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
$
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
*
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
$paged
|
807 |
-
$
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
}
|
845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Wishlist shortcode
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package TInvWishlist\Public
|
7 |
+
*/
|
8 |
+
|
9 |
+
// If this file is called directly, abort.
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
die;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Wishlist shortcode
|
16 |
+
*/
|
17 |
+
class TInvWL_Public_Wishlist_View {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Plugin name
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
private $_name;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* List per page
|
28 |
+
*
|
29 |
+
* @var integer
|
30 |
+
*/
|
31 |
+
private $lists_per_page;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Current wishlist
|
35 |
+
*
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
private $current_wishlist;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Current products
|
42 |
+
*
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
private $current_products_query;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Social image
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
public $social_image;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Total pages
|
56 |
+
*
|
57 |
+
* @var int
|
58 |
+
*/
|
59 |
+
public $pages;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Wishlist full URL
|
63 |
+
*
|
64 |
+
* @var string
|
65 |
+
*/
|
66 |
+
public $wishlist_url;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Wishlist product helper
|
70 |
+
*
|
71 |
+
* @var TInvWL_Product
|
72 |
+
*/
|
73 |
+
public $wishlist_products_helper;
|
74 |
+
|
75 |
+
/**
|
76 |
+
* This class
|
77 |
+
*
|
78 |
+
* @var \TInvWL_Public_Wishlist_View
|
79 |
+
*/
|
80 |
+
protected static $_instance = null;
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get this class object
|
84 |
+
*
|
85 |
+
* @param string $plugin_name Plugin name.
|
86 |
+
*
|
87 |
+
* @return \TInvWL_Public_Wishlist_View
|
88 |
+
*/
|
89 |
+
public static function instance( $plugin_name = TINVWL_PREFIX ) {
|
90 |
+
if ( is_null( self::$_instance ) ) {
|
91 |
+
self::$_instance = new self( $plugin_name );
|
92 |
+
}
|
93 |
+
|
94 |
+
return self::$_instance;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Constructor
|
99 |
+
*
|
100 |
+
* @param string $plugin_name Plugin name.
|
101 |
+
*/
|
102 |
+
function __construct( $plugin_name ) {
|
103 |
+
$this->_name = $plugin_name;
|
104 |
+
$this->define_hooks();
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Defined shortcode and hooks
|
109 |
+
*/
|
110 |
+
function define_hooks() {
|
111 |
+
add_action( 'template_redirect', array( $this, 'login_redirect' ) );
|
112 |
+
|
113 |
+
add_action( 'wp_loaded', array( $this, 'login_post_redirect' ), 19 );
|
114 |
+
|
115 |
+
add_action( 'wp', array( $this, 'wishlist_action' ), 0 );
|
116 |
+
add_action( 'wp_head', array( $this, 'add_meta_tags' ), 1 );
|
117 |
+
|
118 |
+
add_action( 'tinvwl_before_wishlist', array( $this, 'wishlist_header' ) );
|
119 |
+
|
120 |
+
add_action( 'tinvwl_after_wishlist', array( 'TInvWL_Public_Wishlist_Social', 'init' ) );
|
121 |
+
add_filter( 'tinvwl_wishlist_item_url', array( $this, 'add_argument' ), 10, 3 );
|
122 |
+
add_filter( 'tinvwl_wishlist_item_action_add_to_cart', array( $this, 'product_allow_add_to_cart' ), 10, 3 );
|
123 |
+
add_filter( 'tinvwl_wishlist_item_add_to_cart', array( $this, 'external_text' ), 10, 3 );
|
124 |
+
add_filter( 'tinvwl_wishlist_item_add_to_cart', array( $this, 'variable_text' ), 10, 3 );
|
125 |
+
add_action( 'tinvwl_after_wishlist_table', array( $this, 'get_per_page' ) );
|
126 |
+
|
127 |
+
TInvWL_Public_Wishlist_Buttons::init( $this->_name );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Redirect back after successful login.
|
132 |
+
*/
|
133 |
+
public function login_post_redirect() {
|
134 |
+
$nonce_value = isset( $_REQUEST['woocommerce-login-nonce'] ) ? $_REQUEST['woocommerce-login-nonce'] : ( isset( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : '' );
|
135 |
+
if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-login' ) && ! empty( $_GET['tinvwl_redirect'] ) ) {
|
136 |
+
$_POST['redirect'] = $_GET['tinvwl_redirect']; // Force WC Login form handler to do redirect.
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Redirect guests to login page.
|
142 |
+
*/
|
143 |
+
public function login_redirect() {
|
144 |
+
if ( ! wc_get_page_id( 'myaccount' ) && is_page( apply_filters( 'wpml_object_id', tinv_get_option( 'page', 'wishlist' ), 'page', true ) ) && ! is_user_logged_in() && tinv_get_option( 'general', 'require_login' ) ) {
|
145 |
+
$full_link = get_permalink();
|
146 |
+
$share_key = get_query_var( 'tinvwlID', null );
|
147 |
+
if ( ! empty( $share_key ) ) {
|
148 |
+
if ( get_option( 'permalink_structure' ) ) {
|
149 |
+
if ( ! preg_match( '/\/$/', $full_link ) ) {
|
150 |
+
$full_link .= '/';
|
151 |
+
}
|
152 |
+
$full_link .= $share_key . '/';
|
153 |
+
} else {
|
154 |
+
$full_link = add_query_arg( 'tinvwlID', $share_key, $full_link );
|
155 |
+
}
|
156 |
+
}
|
157 |
+
wp_safe_redirect( add_query_arg( 'tinvwl_redirect', rawurlencode( $full_link ), wc_get_page_permalink( 'myaccount' ) ) );
|
158 |
+
exit;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Change Text for external product
|
164 |
+
*
|
165 |
+
* @param string $text Text for button add to cart.
|
166 |
+
* @param array $wl_product Wishlist Product.
|
167 |
+
* @param WC_Product $_product Product.
|
168 |
+
*
|
169 |
+
* @return string
|
170 |
+
*/
|
171 |
+
function external_text( $text, $wl_product, $_product ) {
|
172 |
+
global $product;
|
173 |
+
// store global product data.
|
174 |
+
$_product_tmp = $product;
|
175 |
+
// override global product data.
|
176 |
+
$product = $_product;
|
177 |
+
|
178 |
+
if ( 'external' === ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->product_type : $product->get_type() ) ) {
|
179 |
+
|
180 |
+
$text = $product->single_add_to_cart_text();
|
181 |
+
|
182 |
+
// restore global product data.
|
183 |
+
$product = $_product_tmp;
|
184 |
+
}
|
185 |
+
|
186 |
+
return $text;
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Change Text for variable product that requires to select some variations.
|
191 |
+
*
|
192 |
+
* @param string $text Text for button add to cart.
|
193 |
+
* @param array $wl_product Wishlist Product.
|
194 |
+
* @param WC_Product $_product Product.
|
195 |
+
*
|
196 |
+
* @return string
|
197 |
+
*/
|
198 |
+
function variable_text( $text, $wl_product, $_product ) {
|
199 |
+
global $product;
|
200 |
+
// store global product data.
|
201 |
+
$_product_tmp = $product;
|
202 |
+
// override global product data.
|
203 |
+
$product = $_product;
|
204 |
+
if ( apply_filters( 'tinvwl_product_add_to_cart_need_redirect', false, $product, $product->get_permalink(), $wl_product )
|
205 |
+
&& in_array( ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->product_type : $product->get_type() ), array(
|
206 |
+
'variable',
|
207 |
+
'variable-subscription',
|
208 |
+
) ) ) {
|
209 |
+
|
210 |
+
$text = $product->add_to_cart_text();
|
211 |
+
|
212 |
+
// restore global product data.
|
213 |
+
$product = $_product_tmp;
|
214 |
+
}
|
215 |
+
|
216 |
+
return $text;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Add analytics argument for url
|
221 |
+
*
|
222 |
+
* @param string $url Product url.
|
223 |
+
* @param array $wl_product Wishlist product.
|
224 |
+
* @param object $product Product.
|
225 |
+
*
|
226 |
+
* @return type
|
227 |
+
*/
|
228 |
+
function add_argument( $url, $wl_product, $product ) {
|
229 |
+
return add_query_arg( 'tiwp', $wl_product['ID'], $url );
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Get current wishlist
|
234 |
+
*
|
235 |
+
* @return array
|
236 |
+
*/
|
237 |
+
function get_current_wishlist() {
|
238 |
+
if ( empty( $this->current_wishlist ) ) {
|
239 |
+
$this->current_wishlist = apply_filters( 'tinvwl_get_current_wishlist', tinv_wishlist_get() );
|
240 |
+
}
|
241 |
+
|
242 |
+
return $this->current_wishlist;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Get current products query
|
247 |
+
*
|
248 |
+
* @return array
|
249 |
+
*/
|
250 |
+
function get_current_products_query() {
|
251 |
+
if ( ! is_array( $this->current_products_query ) ) {
|
252 |
+
return false;
|
253 |
+
}
|
254 |
+
|
255 |
+
return $this->current_products_query;
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Get current products from wishlist
|
260 |
+
*
|
261 |
+
* @param array $wishlist Wishlist object.
|
262 |
+
* @param boolean $external Get woocommerce product info.
|
263 |
+
* @param integer $lists_per_page Count per page.
|
264 |
+
*
|
265 |
+
* @return array
|
266 |
+
*/
|
267 |
+
function get_current_products( $wishlist = null, $external = true, $lists_per_page = 10 ) {
|
268 |
+
if ( empty( $wishlist ) || $wishlist === $this->get_current_wishlist() ) {
|
269 |
+
$wishlist = $this->get_current_wishlist();
|
270 |
+
|
271 |
+
if ( ! $this->wishlist_products_helper ) {
|
272 |
+
$wlp = null;
|
273 |
+
if ( isset( $wishlist['ID'] ) && 0 === $wishlist['ID'] ) {
|
274 |
+
$wlp = TInvWL_Product_Local::instance();
|
275 |
+
} else {
|
276 |
+
$wlp = new TInvWL_Product( $wishlist );
|
277 |
+
}
|
278 |
+
$this->wishlist_products_helper = $wlp;
|
279 |
+
} else {
|
280 |
+
$wlp = $this->wishlist_products_helper;
|
281 |
+
}
|
282 |
+
|
283 |
+
} else {
|
284 |
+
$wlp = null;
|
285 |
+
if ( isset( $wishlist['ID'] ) && 0 === $wishlist['ID'] ) {
|
286 |
+
$wlp = TInvWL_Product_Local::instance();
|
287 |
+
} else {
|
288 |
+
$wlp = new TInvWL_Product( $wishlist );
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
if ( empty( $wlp ) ) {
|
293 |
+
return array();
|
294 |
+
}
|
295 |
+
|
296 |
+
$paged = get_query_var( 'wl_paged', 1 );
|
297 |
+
$paged = 1 < $paged ? $paged : 1;
|
298 |
+
|
299 |
+
$product_data = array(
|
300 |
+
'count' => $lists_per_page,
|
301 |
+
'offset' => $lists_per_page * ( $paged - 1 ),
|
302 |
+
'external' => $external,
|
303 |
+
'order_by' => 'date',
|
304 |
+
'order' => 'DESC',
|
305 |
+
);
|
306 |
+
|
307 |
+
$product_data = apply_filters( 'tinvwl_before_get_current_product', $product_data );
|
308 |
+
$products = $wlp->get_wishlist( $product_data );
|
309 |
+
$products = apply_filters( 'tinvwl_after_get_current_product', $products );
|
310 |
+
|
311 |
+
if ( 10 === absint( $lists_per_page ) ) {
|
312 |
+
$this->current_products_query = $products;
|
313 |
+
}
|
314 |
+
|
315 |
+
return $products;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Allow show button add to cart
|
320 |
+
*
|
321 |
+
* @param boolean $allow Settings flag.
|
322 |
+
* @param array $wlproduct Wishlist Product.
|
323 |
+
* @param WC_Product $product Product.
|
324 |
+
*
|
325 |
+
* @return boolean
|
326 |
+
*/
|
327 |
+
function product_allow_add_to_cart( $allow, $wlproduct, $product ) {
|
328 |
+
if ( ! $allow ) {
|
329 |
+
return false;
|
330 |
+
}
|
331 |
+
|
332 |
+
return ( $product->is_purchasable() || 'external' === ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->product_type : $product->get_type() ) ) && ( $product->is_in_stock() || $product->backorders_allowed() );
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Basic validation actions
|
337 |
+
*
|
338 |
+
* @return boolean
|
339 |
+
*/
|
340 |
+
function wishlist_action() {
|
341 |
+
|
342 |
+
$wishlist_page_id = apply_filters( 'wpml_object_id', tinv_get_option( 'page', 'wishlist' ), 'page', true );
|
343 |
+
|
344 |
+
if ( is_page( $wishlist_page_id )
|
345 |
+
|| ( is_home() && 'page' === get_option( 'show_on_front' ) && absint( get_option( 'page_on_front' ) ) === $wishlist_page_id )
|
346 |
+
|| ( is_shop() && wc_get_page_id( 'shop' ) === $wishlist_page_id ) ) {
|
347 |
+
$wishlist = $this->get_current_wishlist();
|
348 |
+
if ( empty( $wishlist ) ) {
|
349 |
+
return false;
|
350 |
+
}
|
351 |
+
|
352 |
+
if ( version_compare( WC_VERSION, '3.2.0', '<' ) ) {
|
353 |
+
if ( ! defined( 'DONOTCACHEPAGE' ) ) {
|
354 |
+
define( 'DONOTCACHEPAGE', true );
|
355 |
+
}
|
356 |
+
if ( ! defined( 'DONOTCACHEOBJECT' ) ) {
|
357 |
+
define( 'DONOTCACHEOBJECT', true );
|
358 |
+
}
|
359 |
+
if ( ! defined( 'DONOTCACHEDB' ) ) {
|
360 |
+
define( 'DONOTCACHEDB', true );
|
361 |
+
}
|
362 |
+
} else {
|
363 |
+
WC_Cache_Helper::set_nocache_constants( true );
|
364 |
+
nocache_headers();
|
365 |
+
}
|
366 |
+
|
367 |
+
$is_owner = is_user_logged_in() ? ( get_current_user_id() === $wishlist['author'] ) : $wishlist['is_owner'];
|
368 |
+
$nonce = filter_input( INPUT_POST, 'wishlist_nonce' );
|
369 |
+
if ( $nonce && wp_verify_nonce( $nonce, 'tinvwl_wishlist_owner' ) && $is_owner ) {
|
370 |
+
do_action( 'tinvwl_before_action_owner', $wishlist );
|
371 |
+
$this->wishlist_actions( $wishlist, true );
|
372 |
+
do_action( 'tinvwl_after_action_owner', $wishlist );
|
373 |
+
}
|
374 |
+
if ( $nonce && wp_verify_nonce( $nonce, 'tinvwl_wishlist_user' ) && ! $is_owner ) {
|
375 |
+
do_action( 'tinvwl_before_action_user', $wishlist );
|
376 |
+
$this->wishlist_actions( $wishlist, false );
|
377 |
+
do_action( 'tinvwl_after_action_user', $wishlist );
|
378 |
+
}
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Create social meta tags
|
384 |
+
*/
|
385 |
+
function add_meta_tags() {
|
386 |
+
if ( is_page( apply_filters( 'wpml_object_id', tinv_get_option( 'page', 'wishlist' ), 'page', true ) ) ) {
|
387 |
+
$wishlist = $this->get_current_wishlist();
|
388 |
+
if ( $wishlist && 0 < $wishlist['ID'] ) {
|
389 |
+
$this->wishlist_url = tinv_url_wishlist( $wishlist['share_key'] );
|
390 |
+
if ( 'private' !== $wishlist['status'] && tinv_get_option( 'social', 'facebook' ) ) {
|
391 |
+
if ( is_user_logged_in() ) {
|
392 |
+
$user = get_user_by( 'id', $wishlist['author'] );
|
393 |
+
if ( $user && $user->exists() ) {
|
394 |
+
$user_name = trim( sprintf( '%s %s', $user->user_firstname, $user->user_lastname ) );
|
395 |
+
$user = @$user->display_name; // @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors.Discouraged
|
396 |
+
} else {
|
397 |
+
$user_name = '';
|
398 |
+
$user = '';
|
399 |
+
}
|
400 |
+
} else {
|
401 |
+
$user_name = '';
|
402 |
+
$user = '';
|
403 |
+
}
|
404 |
+
|
405 |
+
if ( is_array( $this->get_current_products_query() ) ) {
|
406 |
+
$products = $this->current_products_query;
|
407 |
+
} else {
|
408 |
+
$products = $this->get_current_products( $wishlist, true );
|
409 |
+
}
|
410 |
+
|
411 |
+
$products_title = array();
|
412 |
+
foreach ( $products as $product ) {
|
413 |
+
if ( ! empty( $product ) && ! empty( $product['data'] ) ) {
|
414 |
+
$title = is_callable( array(
|
415 |
+
$product['data'],
|
416 |
+
'get_name'
|
417 |
+
) ) ? $product['data']->get_name() : $product['data']->get_title();
|
418 |
+
if ( ! in_array( $title, $products_title ) ) {
|
419 |
+
$products_title[] = $title;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
}
|
423 |
+
$product = array_shift( $products );
|
424 |
+
$image = '';
|
425 |
+
if ( ! empty( $product ) && ! empty( $product['data'] ) ) {
|
426 |
+
list( $image ) = wp_get_attachment_image_src( $product['data']->get_image_id(), 'full' );
|
427 |
+
}
|
428 |
+
|
429 |
+
$this->social_image = $image;
|
430 |
+
|
431 |
+
|
432 |
+
$meta = apply_filters( 'tinvwl_social_header_meta', array(
|
433 |
+
'url' => $this->wishlist_url,
|
434 |
+
'type' => 'product.group',
|
435 |
+
'title' => sprintf( __( '%1$s by %2$s', 'ti-woocommerce-wishlist' ), $wishlist['title'], ( empty( $user_name ) ? $user : $user_name ) ),
|
436 |
+
'description' => implode( ', ', $products_title ),
|
437 |
+
'image' => $image,
|
438 |
+
) );
|
439 |
+
|
440 |
+
foreach ( $meta as $name => $content ) {
|
441 |
+
echo sprintf( '<meta property="og:%s" content="%s" />', esc_attr( $name ), esc_attr( $content ) );
|
442 |
+
}
|
443 |
+
echo "\n";
|
444 |
+
}
|
445 |
+
} // End if().
|
446 |
+
} // End if().
|
447 |
+
}
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Basic actions
|
451 |
+
*
|
452 |
+
* @param array $wishlist Wishlist object.
|
453 |
+
* @param boolean $owner Is Owner.
|
454 |
+
*
|
455 |
+
* @return boolean
|
456 |
+
*/
|
457 |
+
function wishlist_actions( $wishlist, $owner = false ) {
|
458 |
+
$post = filter_input_array( INPUT_POST, array(
|
459 |
+
'wishlist_pr' => array(
|
460 |
+
'filter' => FILTER_VALIDATE_INT,
|
461 |
+
'flags' => FILTER_FORCE_ARRAY,
|
462 |
+
),
|
463 |
+
'wishlist_qty' => array(
|
464 |
+
'filter' => FILTER_VALIDATE_INT,
|
465 |
+
'flags' => FILTER_FORCE_ARRAY,
|
466 |
+
'options' => array( 'min_range' => 0, 'default' => 1 ),
|
467 |
+
),
|
468 |
+
'tinvwl-add-to-cart' => FILTER_VALIDATE_INT,
|
469 |
+
'tinvwl-remove' => FILTER_VALIDATE_INT,
|
470 |
+
'tinvwl-action' => FILTER_SANITIZE_STRING,
|
471 |
+
) );
|
472 |
+
|
473 |
+
if ( ! empty( $post['tinvwl-add-to-cart'] ) ) {
|
474 |
+
$product = $post['tinvwl-add-to-cart'];
|
475 |
+
$quantity = array_key_exists( $product, (array) $post['wishlist_qty'] ) ? $post['wishlist_qty'][ $product ] : 1;
|
476 |
+
|
477 |
+
return $this->button_addtocart( $wishlist, $product, $quantity, $owner );
|
478 |
+
}
|
479 |
+
if ( ! empty( $post['tinvwl-remove'] ) ) {
|
480 |
+
if ( ! $wishlist['is_owner'] ) {
|
481 |
+
return false;
|
482 |
+
}
|
483 |
+
$product = $post['tinvwl-remove'];
|
484 |
+
if ( 0 === $wishlist['ID'] ) {
|
485 |
+
$wlp = TInvWL_Product_Local::instance();
|
486 |
+
} else {
|
487 |
+
$wlp = new TInvWL_Product( $wishlist );
|
488 |
+
}
|
489 |
+
if ( empty( $wlp ) ) {
|
490 |
+
return false;
|
491 |
+
}
|
492 |
+
$product_data = $wlp->get_wishlist( array( 'ID' => $product ) );
|
493 |
+
$product_data = array_shift( $product_data );
|
494 |
+
if ( empty( $product_data ) ) {
|
495 |
+
return false;
|
496 |
+
}
|
497 |
+
$title = sprintf( __( '“%s”', 'ti-woocommerce-wishlist' ), is_callable( array(
|
498 |
+
$product_data['data'],
|
499 |
+
'get_name'
|
500 |
+
) ) ? $product_data['data']->get_name() : $product_data['data']->get_title() );
|
501 |
+
if ( $wlp->remove( $product_data ) ) {
|
502 |
+
add_action( 'tinvwl_before_wishlist', array(
|
503 |
+
'TInvWL_Public_Wishlist_View',
|
504 |
+
'check_cart_hash',
|
505 |
+
), 99, 1 );
|
506 |
+
add_action( 'woocommerce_set_cart_cookies', array(
|
507 |
+
'TInvWL_Public_Wishlist_View',
|
508 |
+
'reset_cart_hash',
|
509 |
+
), 99, 1 );
|
510 |
+
wc_add_notice( sprintf( __( '%s has been removed from wishlist.', 'ti-woocommerce-wishlist' ), $title ) );
|
511 |
+
} else {
|
512 |
+
wc_add_notice( sprintf( __( '%s has not been removed from wishlist.', 'ti-woocommerce-wishlist' ), $title ), 'error' );
|
513 |
+
}
|
514 |
+
|
515 |
+
return true;
|
516 |
+
}
|
517 |
+
do_action( 'tinvwl_action_' . $post['tinvwl-action'], $wishlist, $post['wishlist_pr'], $post['wishlist_qty'], $owner ); // @codingStandardsIgnoreLine WordPress.NamingConventions.ValidHookName.UseUnderscores
|
518 |
+
}
|
519 |
+
|
520 |
+
/**
|
521 |
+
* Check cart hash to trigger WC fragments refresh on wishlist update.
|
522 |
+
*
|
523 |
+
* @param $wishlist
|
524 |
+
*/
|
525 |
+
public static function check_cart_hash( $wishlist ) {
|
526 |
+
wp_add_inline_script( 'woocommerce', "
|
527 |
+
jQuery(document).ready(function($){
|
528 |
+
if ( typeof wc_cart_fragments_params === 'undefined' ) {
|
529 |
+
return false;
|
530 |
+
}
|
531 |
+
|
532 |
+
var cart_hash_key = wc_cart_fragments_params.cart_hash_key,
|
533 |
+
cart_hash = sessionStorage.getItem( cart_hash_key );
|
534 |
+
|
535 |
+
if ( cart_hash === null || cart_hash === undefined || cart_hash === '' ) {
|
536 |
+
sessionStorage.setItem( cart_hash_key, 'empty' );
|
537 |
+
}
|
538 |
+
});
|
539 |
+
" );
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Reset cart hash to trigger WC fragments refresh on wishlist update.
|
544 |
+
*
|
545 |
+
* @param bool $set
|
546 |
+
*/
|
547 |
+
public static function reset_cart_hash( $set ) {
|
548 |
+
wc_setcookie( 'woocommerce_cart_hash', 'reset', time() - HOUR_IN_SECONDS );
|
549 |
+
}
|
550 |
+
|
551 |
+
/**
|
552 |
+
* Apply action add to cart
|
553 |
+
*
|
554 |
+
* @param array $wishlist Wishlist object.
|
555 |
+
* @param integer $id Product id in wishlist.
|
556 |
+
* @param integer $quantity Product quantity.
|
557 |
+
* @param boolean $owner Is Owner.
|
558 |
+
*
|
559 |
+
* @return boolean
|
560 |
+
*/
|
561 |
+
function button_addtocart( $wishlist, $id, $quantity = 1, $owner = false ) {
|
562 |
+
$id = absint( $id );
|
563 |
+
$quantity = absint( $quantity );
|
564 |
+
if ( empty( $id ) || empty( $quantity ) ) {
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
|
568 |
+
$wlp = null;
|
569 |
+
if ( 0 === $wishlist['ID'] ) {
|
570 |
+
$wlp = TInvWL_Product_Local::instance();
|
571 |
+
} else {
|
572 |
+
$wlp = new TInvWL_Product( $wishlist );
|
573 |
+
}
|
574 |
+
if ( empty( $wlp ) ) {
|
575 |
+
return false;
|
576 |
+
}
|
577 |
+
|
578 |
+
$_product = $wlp->get_wishlist( array( 'ID' => $id ) );
|
579 |
+
$_product = array_shift( $_product );
|
580 |
+
if ( empty( $_product ) || empty( $_product['data'] ) ) {
|
581 |
+
return false;
|
582 |
+
}
|
583 |
+
|
584 |
+
global $product;
|
585 |
+
// store global product data.
|
586 |
+
$_product_tmp = $product;
|
587 |
+
// override global product data.
|
588 |
+
$product = $_product['data'];
|
589 |
+
|
590 |
+
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );
|
591 |
+
$redirect_url = $_product['data']->add_to_cart_url();
|
592 |
+
remove_filter( 'clean_url', 'tinvwl_clean_url', 10 );
|
593 |
+
|
594 |
+
// restore global product data.
|
595 |
+
$product = $_product_tmp;
|
596 |
+
|
597 |
+
$quantity = apply_filters( 'tinvwl_product_add_to_cart_quantity', $quantity, $_product['data'] );
|
598 |
+
|
599 |
+
if ( apply_filters( 'tinvwl_product_add_to_cart_need_redirect', false, $_product['data'], $redirect_url, $_product ) ) {
|
600 |
+
wp_redirect( apply_filters( 'tinvwl_product_add_to_cart_redirect_url', $redirect_url, $_product['data'], $_product ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.wp_redirect
|
601 |
+
exit;
|
602 |
+
} elseif ( apply_filters( 'tinvwl_allow_addtocart_in_wishlist', true, $wishlist, $owner ) ) {
|
603 |
+
$add = TInvWL_Public_Cart::add( $wishlist, $id, $quantity );
|
604 |
+
if ( $add ) {
|
605 |
+
wc_add_to_cart_message( $add, true );
|
606 |
+
|
607 |
+
if ( tinv_get_option( 'processing', 'redirect_checkout' ) ) {
|
608 |
+
wp_safe_redirect( wc_get_checkout_url() );
|
609 |
+
exit;
|
610 |
+
}
|
611 |
+
|
612 |
+
if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) {
|
613 |
+
wp_safe_redirect( wc_get_cart_url() );
|
614 |
+
exit;
|
615 |
+
}
|
616 |
+
|
617 |
+
return true;
|
618 |
+
}
|
619 |
+
}
|
620 |
+
|
621 |
+
return false;
|
622 |
+
}
|
623 |
+
|
624 |
+
/**
|
625 |
+
* Output page
|
626 |
+
*
|
627 |
+
* @param array $atts Array parameter for shortcode.
|
628 |
+
*
|
629 |
+
* @return mixed
|
630 |
+
*/
|
631 |
+
function htmloutput( $atts ) {
|
632 |
+
$wishlist = $this->get_current_wishlist();
|
633 |
+
|
634 |
+
if ( empty( $wishlist ) ) {
|
635 |
+
$id = get_query_var( 'tinvwlID', null );
|
636 |
+
if ( empty( $id ) && ( is_user_logged_in() || ! tinv_get_option( 'general', 'require_login' ) ) ) {
|
637 |
+
return $this->wishlist_empty( array(), array(
|
638 |
+
'ID' => '',
|
639 |
+
'author' => get_current_user_id(),
|
640 |
+
'title' => apply_filters( 'tinvwl_default_wishlist_title', tinv_get_option( 'general', 'default_title' ) ),
|
641 |
+
'status' => 'private',
|
642 |
+
'type' => 'default',
|
643 |
+
'share_key' => '',
|
644 |
+
) );
|
645 |
+
}
|
646 |
+
|
647 |
+
return $this->wishlist_null();
|
648 |
+
}
|
649 |
+
|
650 |
+
if ( 'private' === $wishlist['status'] && ! $wishlist['is_owner'] ) {
|
651 |
+
return $this->wishlist_null();
|
652 |
+
}
|
653 |
+
if ( 'default' !== $wishlist['type'] && ! tinv_get_option( 'general', 'multi' ) ) {
|
654 |
+
if ( $wishlist['is_owner'] ) {
|
655 |
+
printf( '<p><a href="%s">%s</p><script type="text/javascript">window.location.href="%s"</script>', esc_attr( tinv_url_wishlist_default() ), esc_html__( 'Return to Wishlist', 'ti-woocommerce-wishlist' ), esc_attr( tinv_url_wishlist_default() ) );
|
656 |
+
|
657 |
+
return false;
|
658 |
+
} else {
|
659 |
+
return $this->wishlist_null();
|
660 |
+
}
|
661 |
+
}
|
662 |
+
|
663 |
+
$this->lists_per_page = absint( $atts['lists_per_page'] );
|
664 |
+
|
665 |
+
if ( 10 === $this->lists_per_page && is_array( $this->get_current_products_query() ) ) {
|
666 |
+
$products = $this->current_products_query;
|
667 |
+
} else {
|
668 |
+
$products = $this->get_current_products( $wishlist, true, $this->lists_per_page );
|
669 |
+
}
|
670 |
+
|
671 |
+
$wla = new TInvWL_Analytics( $wishlist, $this->_name );
|
672 |
+
$wla->view_products( $wishlist, $wishlist['is_owner'] );
|
673 |
+
|
674 |
+
foreach ( $products as $key => $product ) {
|
675 |
+
if ( ! isset( $product['data'] ) ) {
|
676 |
+
unset( $products[ $key ] );
|
677 |
+
}
|
678 |
+
}
|
679 |
+
|
680 |
+
if ( empty( $products ) ) {
|
681 |
+
|
682 |
+
$this->pages = 0;
|
683 |
+
|
684 |
+
return $this->wishlist_empty( $products, $wishlist );
|
685 |
+
}
|
686 |
+
|
687 |
+
$this->pages = 1;
|
688 |
+
|
689 |
+
$wishlist_table_row = tinv_get_option( 'product_table' );
|
690 |
+
$wishlist_table_row['text_add_to_cart'] = apply_filters( 'tinvwl_add_to_cart_text', tinv_get_option( 'product_table', 'text_add_to_cart' ) );
|
691 |
+
|
692 |
+
$data = array(
|
693 |
+
'products' => $products,
|
694 |
+
'wishlist' => $wishlist,
|
695 |
+
'wishlist_table' => tinv_get_option( 'table' ),
|
696 |
+
'wishlist_table_row' => $wishlist_table_row,
|
697 |
+
);
|
698 |
+
|
699 |
+
$paged = get_query_var( 'wl_paged', 1 );
|
700 |
+
$paged = 1 < $paged ? $paged : 1;
|
701 |
+
|
702 |
+
if ( 1 < $paged ) {
|
703 |
+
add_action( 'tinvwl_pagenation_wishlist', array( $this, 'page_prev' ) );
|
704 |
+
}
|
705 |
+
$pages = ceil( absint( $this->wishlist_products_helper->get_wishlist( array(
|
706 |
+
'count' => 9999999,
|
707 |
+
'external' => false,
|
708 |
+
), true ) ) / absint( $this->lists_per_page ) );
|
709 |
+
|
710 |
+
if ( 1 < $pages ) {
|
711 |
+
$this->pages = $pages;
|
712 |
+
add_action( 'tinvwl_pagenation_wishlist', array( $this, 'pages' ) );
|
713 |
+
}
|
714 |
+
if ( $pages > $paged ) {
|
715 |
+
add_action( 'tinvwl_pagenation_wishlist', array( $this, 'page_next' ) );
|
716 |
+
}
|
717 |
+
|
718 |
+
if ( $wishlist['is_owner'] ) {
|
719 |
+
tinv_wishlist_template( 'ti-wishlist.php', $data );
|
720 |
+
} else {
|
721 |
+
if ( class_exists( 'WC_Catalog_Visibility_Options' ) ) {
|
722 |
+
global $wc_cvo;
|
723 |
+
if ( 'secured' === $wc_cvo->setting( 'wc_cvo_atc' && isset( $data['wishlist_table_row']['add_to_cart'] ) ) ) {
|
724 |
+
unset( $data['wishlist_table_row']['add_to_cart'] );
|
725 |
+
}
|
726 |
+
if ( 'secured' === $wc_cvo->setting( 'wc_cvo_prices' && isset( $data['wishlist_table_row']['colm_price'] ) ) ) {
|
727 |
+
unset( $data['wishlist_table_row']['colm_price'] );
|
728 |
+
}
|
729 |
+
}
|
730 |
+
|
731 |
+
tinv_wishlist_template( 'ti-wishlist-user.php', $data );
|
732 |
+
}
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* Not Found Wishlist
|
737 |
+
*
|
738 |
+
* @param array $wishlist Wishlist object.
|
739 |
+
*/
|
740 |
+
function wishlist_null( $wishlist = array() ) {
|
741 |
+
$data = array(
|
742 |
+
'wishlist' => $wishlist,
|
743 |
+
);
|
744 |
+
tinv_wishlist_template( 'ti-wishlist-null.php', $data );
|
745 |
+
}
|
746 |
+
|
747 |
+
/**
|
748 |
+
* Empty Wishlist
|
749 |
+
*
|
750 |
+
* @param array $products Products wishlist.
|
751 |
+
* @param array $wishlist Wishlist object.
|
752 |
+
*/
|
753 |
+
function wishlist_empty( $products = array(), $wishlist = array() ) {
|
754 |
+
$data = array(
|
755 |
+
'products' => $products,
|
756 |
+
'wishlist' => $wishlist,
|
757 |
+
'wishlist_table' => tinv_get_option( 'table' ),
|
758 |
+
);
|
759 |
+
tinv_wishlist_template( 'ti-wishlist-empty.php', $data );
|
760 |
+
}
|
761 |
+
|
762 |
+
/**
|
763 |
+
* Header Wishlist
|
764 |
+
*
|
765 |
+
* @param array $wishlist Wishlist object.
|
766 |
+
*/
|
767 |
+
function wishlist_header( $wishlist ) {
|
768 |
+
|
769 |
+
$data = array(
|
770 |
+
'wishlist' => $wishlist,
|
771 |
+
);
|
772 |
+
tinv_wishlist_template( 'ti-wishlist-header.php', $data );
|
773 |
+
}
|
774 |
+
|
775 |
+
/**
|
776 |
+
* Prev page button
|
777 |
+
*/
|
778 |
+
function page_prev() {
|
779 |
+
$paged = get_query_var( 'wl_paged', 1 );
|
780 |
+
$paged = 1 < $paged ? $paged - 1 : 0;
|
781 |
+
$this->page( $paged, sprintf( '<i class="ftinvwl ftinvwl-chevron-left"></i><span>%s</span>', __( 'Previous Page', 'ti-woocommerce-wishlist' ) ), array( 'class' => 'button tinv-prev' ) );
|
782 |
+
}
|
783 |
+
|
784 |
+
/**
|
785 |
+
* Pages
|
786 |
+
*/
|
787 |
+
function pages() {
|
788 |
+
|
789 |
+
$paged = get_query_var( 'wl_paged', 1 );
|
790 |
+
if ( 1 === (int) $paged ) {
|
791 |
+
echo '<span></span>';
|
792 |
+
}
|
793 |
+
|
794 |
+
echo '<span>' . $paged . '/' . $this->pages . '</span>';
|
795 |
+
|
796 |
+
if ( (int) $this->pages === (int) $paged ) {
|
797 |
+
echo '<span></span>';
|
798 |
+
}
|
799 |
+
}
|
800 |
+
|
801 |
+
/**
|
802 |
+
* Next page button
|
803 |
+
*/
|
804 |
+
function page_next() {
|
805 |
+
$paged = get_query_var( 'wl_paged', 1 );
|
806 |
+
$paged = 1 < $paged ? $paged + 1 : 2;
|
807 |
+
$this->page( $paged, sprintf( '<span>%s</span><i class="ftinvwl ftinvwl-chevron-right"></i>', __( 'Next Page', 'ti-woocommerce-wishlist' ) ), array( 'class' => 'button tinv-next' ) );
|
808 |
+
}
|
809 |
+
|
810 |
+
/**
|
811 |
+
* Page button
|
812 |
+
*
|
813 |
+
* @param integer $paged Index page.
|
814 |
+
* @param string $text Text button.
|
815 |
+
* @param style $style Style attribute.
|
816 |
+
*/
|
817 |
+
function page( $paged, $text, $style = array() ) {
|
818 |
+
$paged = absint( $paged );
|
819 |
+
$wishlist = $this->get_current_wishlist();
|
820 |
+
$link = tinv_url_wishlist( $wishlist['share_key'], $paged, true );
|
821 |
+
if ( is_array( $style ) ) {
|
822 |
+
$style = TInvWL_Form::__atrtostr( $style );
|
823 |
+
}
|
824 |
+
printf( '<a href="%s" %s>%s</a>', esc_url( $link ), $style, $text ); // WPCS: xss ok.
|
825 |
+
}
|
826 |
+
|
827 |
+
/**
|
828 |
+
* Shortcode basic function
|
829 |
+
*
|
830 |
+
* @param array $atts Array parameter from shortcode.
|
831 |
+
*
|
832 |
+
* @return string
|
833 |
+
*/
|
834 |
+
function shortcode( $atts = array() ) {
|
835 |
+
$default = array(
|
836 |
+
'lists_per_page' => 10,
|
837 |
+
);
|
838 |
+
$atts = shortcode_atts( $default, $atts );
|
839 |
+
|
840 |
+
ob_start();
|
841 |
+
$this->htmloutput( $atts );
|
842 |
+
|
843 |
+
return ob_get_clean();
|
844 |
+
}
|
845 |
+
|
846 |
+
/**
|
847 |
+
* Get per page items for buttons
|
848 |
+
*/
|
849 |
+
function get_per_page() {
|
850 |
+
if ( ! empty( $this->lists_per_page ) ) {
|
851 |
+
echo TInvWL_Form::_text( array( // WPCS: xss ok.
|
852 |
+
'type' => 'hidden',
|
853 |
+
'name' => 'lists_per_page',
|
854 |
+
), $this->lists_per_page );
|
855 |
+
}
|
856 |
+
}
|
857 |
+
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: templateinvaders
|
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.5
|
6 |
-
Stable tag: 1.21.
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
@@ -163,6 +163,13 @@ Yes, you can! Join in on our [GitHub repository](https://github.com/TemplateInva
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 1.21.3 =
|
167 |
*Release Date - 26 August 2020*
|
168 |
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.5
|
6 |
+
Stable tag: 1.21.4
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
163 |
|
164 |
|
165 |
== Changelog ==
|
166 |
+
= 1.21.4 =
|
167 |
+
*Release Date - 2 September 2020*
|
168 |
+
|
169 |
+
* Fixed issue with custom AJAX endpoint loading
|
170 |
+
* Updated integration with [WPC Product Bundles for WooCommerce](https://wordpress.org/plugins/woo-product-bundle/) plugin
|
171 |
+
* Updated integration with [WP Fastest Cache](https://wordpress.org/plugins/wp-fastest-cache/) plugin
|
172 |
+
|
173 |
= 1.21.3 =
|
174 |
*Release Date - 26 August 2020*
|
175 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.21.
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.5
|
10 |
* WC requires at least: 2.6
|
@@ -41,7 +41,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
|
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
-
define( 'TINVWL_FVERSION', '1.21.
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
@@ -141,17 +141,6 @@ if ( ! function_exists( 'deactivation_tinv_wishlist' ) ) {
|
|
141 |
* Deactivation plugin
|
142 |
*/
|
143 |
function deactivation_tinv_wishlist() {
|
144 |
-
$root_wpload = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
145 |
-
if ( file_exists( $root_wpload ) ) {
|
146 |
-
$file = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
147 |
-
$f = fopen( $file, 'r' );
|
148 |
-
$line = fgets( $f );
|
149 |
-
fclose( $f );
|
150 |
-
|
151 |
-
if ( strpos( esc_html( $line ), 'Added for Flywheel Cloud wp-load Fix' ) !== false ) {
|
152 |
-
unlink( $root_wpload );
|
153 |
-
}
|
154 |
-
}
|
155 |
flush_rewrite_rules();
|
156 |
}
|
157 |
}
|
@@ -167,18 +156,6 @@ if ( ! function_exists( 'uninstall_tinv_wishlist' ) ) {
|
|
167 |
flush_rewrite_rules();
|
168 |
wp_clear_scheduled_hook( 'tinvwl_remove_without_author_wishlist' );
|
169 |
}
|
170 |
-
|
171 |
-
$root_wpload = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
172 |
-
if ( file_exists( $root_wpload ) ) {
|
173 |
-
$file = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
174 |
-
$f = fopen( $file, 'r' );
|
175 |
-
$line = fgets( $f );
|
176 |
-
fclose( $f );
|
177 |
-
|
178 |
-
if ( strpos( esc_html( $line ), 'Added for Flywheel Cloud wp-load Fix' ) !== false ) {
|
179 |
-
unlink( $root_wpload );
|
180 |
-
}
|
181 |
-
}
|
182 |
}
|
183 |
}
|
184 |
|
4 |
* Plugin Name: TI WooCommerce Wishlist
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.21.4
|
8 |
* Requires at least: 4.7
|
9 |
* Tested up to: 5.5
|
10 |
* WC requires at least: 2.6
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
+
define( 'TINVWL_FVERSION', '1.21.4' );
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
141 |
* Deactivation plugin
|
142 |
*/
|
143 |
function deactivation_tinv_wishlist() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
flush_rewrite_rules();
|
145 |
}
|
146 |
}
|
156 |
flush_rewrite_rules();
|
157 |
wp_clear_scheduled_hook( 'tinvwl_remove_without_author_wishlist' );
|
158 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
}
|
160 |
}
|
161 |
|