Version Description
Release Date - 29 March 2020
- WordPress 5.4 support
- WooCommerce 4.0.x support
- Added tool for export and import plugin settings
- Added to share buttons translated title
- REST API tweak: empty wishlist returns 200 response code and empty array now
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.17.0 |
Comparing to | |
See all releases |
Code changes from version 1.16.2 to 1.17.0
- admin/settings/settings.class.php +63 -0
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.js +2 -2
- assets/js/public.min.js +2 -2
- includes/api/wishlist.class.php +0 -4
- includes/export.class.php +292 -0
- includes/tinvwl.class.php +1 -0
- languages/ti-woocommerce-wishlist.pot +114 -14
- public/wishlist/social.class.php +47 -9
- readme.txt +12 -2
- templates/ti-wishlist-social.php +4 -4
- ti-woocommerce-wishlist.php +4 -4
- views/admin/export-import-settings.php +93 -0
admin/settings/settings.class.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin settings class
|
4 |
+
*
|
5 |
+
* @since 1.17.0
|
6 |
+
* @package TInvWishlist\Admin
|
7 |
+
* @subpackage Settings
|
8 |
+
*/
|
9 |
+
|
10 |
+
// If this file is called directly, abort.
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
die;
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Admin settings class
|
17 |
+
*/
|
18 |
+
class TInvWL_Admin_Settings_Settings extends TInvWL_Admin_BaseSection {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Priority for admin menu
|
22 |
+
*
|
23 |
+
* @var integer
|
24 |
+
*/
|
25 |
+
public $priority = 150;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* This class
|
29 |
+
*
|
30 |
+
* @var \TInvWL_Admin_Settings_Settings
|
31 |
+
*/
|
32 |
+
protected static $_instance = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get this class object
|
36 |
+
*
|
37 |
+
* @param string $plugin_name Plugin name.
|
38 |
+
*
|
39 |
+
* @return \TInvWL_Admin_Settings_Settings
|
40 |
+
*/
|
41 |
+
public static function instance( $plugin_name = TINVWL_PREFIX, $plugin_version = TINVWL_FVERSION ) {
|
42 |
+
if ( is_null( self::$_instance ) ) {
|
43 |
+
self::$_instance = new self( $plugin_name, $plugin_version );
|
44 |
+
}
|
45 |
+
|
46 |
+
return self::$_instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Menu array
|
51 |
+
*
|
52 |
+
* @return array
|
53 |
+
*/
|
54 |
+
function menu() {
|
55 |
+
return array(
|
56 |
+
'title' => __( 'Export/Import Settings', 'ti-woocommerce-wishlist' ),
|
57 |
+
'page_title' => __( 'Export/Import Plugin Settings', 'ti-woocommerce-wishlist' ),
|
58 |
+
'method' => array( $this, '_print_' ),
|
59 |
+
'slug' => 'export-import-settings',
|
60 |
+
'capability' => 'tinvwl_export_import_settings',
|
61 |
+
);
|
62 |
+
}
|
63 |
+
}
|
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.
|
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.17.0
|
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-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.
|
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.17.0
|
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.
|
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.17.0
|
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.
|
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.17.0
|
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.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.
|
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.17.0
|
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.
|
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()?n.preventDefault():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.attr("type","checkbox").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(){var t=s(this),n=function(){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),e=c.isChecked.call(t),o=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&o(n,e),"string"==typeof i&&o(i,!e),t};return t.is("input")&&"checkbox"==t.attr("type")?(s(this).on("change",n),n.call(t)):t})},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(){var t=s(this),n=function(e){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),o=e.onClick.call(t),c=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&c(n,o),"string"==typeof i&&c(i,!o),t};return t.is("input")||t.is("select")?(s(this).on("change",function(){n.call(this,i)}),n.call(t,i)):t})};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.17.0
|
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()?n.preventDefault():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.attr("type","checkbox").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(){var t=s(this),n=function(){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),e=c.isChecked.call(t),o=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){c.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&o(n,e),"string"==typeof i&&o(i,!e),t};return t.is("input")&&"checkbox"==t.attr("type")?(s(this).on("change",n),n.call(t)):t})},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(){var t=s(this),n=function(e){var t=s(this),n=t.attr("tiwl-show"),i=t.attr("tiwl-hide"),o=e.onClick.call(t),c=function(t,i){t=t.match(/[\w\d-\>\.\#\:\=\[\]]+/gim)||[],s.each(t,function(t,n){e.onEachElm.call(s(n).toggle(i))})};return"string"==typeof n&&c(n,o),"string"==typeof i&&c(i,!o),t};return t.is("input")||t.is("select")?(s(this).on("change",function(){n.call(this,i)}),n.call(t,i)):t})};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.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"use strict";
|
2 |
|
3 |
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4 |
|
5 |
// Add to wishlist
|
6 |
(function ($) {
|
@@ -464,7 +464,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
|
|
464 |
$(this).remove();
|
465 |
}
|
466 |
});
|
467 |
-
$('body').on('click', '.social-buttons .social
|
468 |
var newWind = window.open($(this).attr('href'), $(this).attr('title'), "width=420,height=320,resizable=yes,scrollbars=yes,status=yes");
|
469 |
|
470 |
if (newWind) {
|
1 |
"use strict";
|
2 |
|
3 |
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4 |
|
5 |
// Add to wishlist
|
6 |
(function ($) {
|
464 |
$(this).remove();
|
465 |
}
|
466 |
});
|
467 |
+
$('body').on('click', '.social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)', function (e) {
|
468 |
var newWind = window.open($(this).attr('href'), $(this).attr('title'), "width=420,height=320,resizable=yes,scrollbars=yes,status=yes");
|
469 |
|
470 |
if (newWind) {
|
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.
|
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 update_cart_hash(){if(!tinvwl_add_to_wishlist.wc_cart_fragments_refresh)return!1;jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=wc_cart_fragments_params.cart_hash_key;localStorage.setItem(t,localStorage.getItem(t)+(new Date).getTime()),sessionStorage.setItem(t,sessionStorage.getItem(t)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}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(r){r.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(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(t,i){r("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){r("body").trigger("tinvwl_wishlist_added_status",[this,t]),t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).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(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function t(i,e){if("object"!==_typeof(e))return e;for(var n in void 0===i&&(i={}),e)if(""===n){var o=-1;for(o in i)o=o;i[o=parseInt(o)+1]=t(i[n],e[n])}else i[n]=t(i[n],e[n]);return i};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"===_typeof(e)||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"===_typeof(t))for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(document).on("hide_variation",".variations_form",function(t){var i=r(this).find(".tinvwl_add_to_wishlist_button");i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),r(document).on("show_variation",".variations_form",function(t,i,e){var n=r(this).find(".tinvwl_add_to_wishlist_button");if(n.length){var o=JSON.parse(n.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in o)o[s].hasOwnProperty("in")&&Array.isArray(o[s].in)&&-1<(o[s].in||[]).indexOf(i.variation_id)&&(a=!0);n.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto"),t.preventDefault(),n.removeClass("disabled-add-wishlist")}})})}(jQuery),function(n){n(document).ready(function(){if(n("#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">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social[title!=email][title!=whatsapp][title!=clipboard]",function(t){var i=window.open(n(this).attr("href"),n(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)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(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.17.0
|
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 update_cart_hash(){if(!tinvwl_add_to_wishlist.wc_cart_fragments_refresh)return!1;jQuery(document.body).on("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist",function(){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=wc_cart_fragments_params.cart_hash_key;localStorage.setItem(t,localStorage.getItem(t)+(new Date).getTime()),sessionStorage.setItem(t,sessionStorage.getItem(t)+(new Date).getTime()),jQuery(document.body).off("wc_fragments_loaded.wishlist wc_fragments_refreshed.wishlist")})}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(r){r.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(){r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r(this).appendTo("body > .tinv-wishlist")},onCreateWishList:function(t){r(this).append(r("<option>").html(t.title).val(t.ID).toggleClass("tinv_in_wishlist",t.in))},onSelectWishList:function(){},onDialogShow:function(t){r(t).addClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onDialogHide:function(t){r(t).removeClass("tinv-modal-open"),r(t).removeClass("ftinvwl-pulse")},onInited:function(){},onClick:function(){if(r(this).is(".disabled-add-wishlist"))return!1;r(this).is(".ftinvwl-animated")&&r(this).addClass("ftinvwl-pulse"),this.tinvwl_dialog?this.tinvwl_dialog.show_list.call(this):o.onActionProduct.call(this),update_cart_hash()},onPrepareDataAction:function(t,i){r("body").trigger("tinvwl_wishlist_button_clicked",[t,i])},filterProductAlreadyIn:function(t){t=t||[];var n={};return r("form.cart[method=post], .woocommerce-variation-add-to-cart, form.vtajaxform[method=post]").find("input, select").each(function(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val();"checkbox"===i||"radio"===i?r(this).is(":checked")&&(n["form"+t]=e):n["form"+t]=e}),n=n.formvariation_id,t.filter(function(t){if("object"!==_typeof(t.in)||"string"!=typeof n)return t.in;var i=parseInt(n);return 0<=t.in.indexOf(i)})},onMultiProductAlreadyIn:function(t){t=t||[];t=o.onPrepareList.call(t)||t,t=o.filterProductAlreadyIn.call(this,t)||t,r(this).parent().parent().find(".already-in").remove();var e="";switch(t.length){case 0:break;default:e=r("<ul>");r.each(t,function(t,i){e.append(r("<li>").html(r("<a>").html(i.title).attr({href:i.url})).val(i.ID))})}e.length&&r(this).closest(".tinv-modal-inner").find("img").after(r("<div>").addClass("already-in").html(o.text_already_in+" ").append(e))},onAction:{redirect:function(t){o.redirectTimer&&clearTimeout(o.redirectTimer),o.redirectTimer=window.setTimeout(function(){window.location.href=t},4e3)},force_redirect:function(t){window.location.href=t},wishlists:function(t){r(this).attr("data-tinv-wl-list",t)},msg:function(t){if(!t)return!1;var i=r(t).eq(0);r("body > .tinv-wishlist").length||r("body").append(r("<div>").addClass("tinv-wishlist")),r("body > .tinv-wishlist").append(i),i.on("click",".tinv-close-modal, .tinvwl_button_close, .tinv-overlay",function(t){t.preventDefault(),i.remove(),o.redirectTimer&&clearTimeout(o.redirectTimer)})},status:function(t){r("body").trigger("tinvwl_wishlist_added_status",[this,t]),t&&r(this).addClass("tinvwl-product-in-list")},removed:function(t){t&&r(this).removeClass("tinvwl-product-in-list").removeClass("tinvwl-product-make-remove").attr("data-tinv-wl-action","addto")},make_remove:function(t){r(this).toggleClass("tinvwl-product-make-remove",t).attr("data-tinv-wl-action",t?"remove":"addto")},fragments:function(t){if("undefined"==typeof wc_cart_fragments_params)return r.each(t,function(t,i){r(t).replaceWith(i)}),!1;var i;try{i="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(t){i=!1}if(i)try{var e=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),n=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash",o=sessionStorage.getItem(n),a=Cookies.get("woocommerce_cart_hash"),l=sessionStorage.getItem("wc_cart_created");if(null!=o&&""!==o||(o=""),null!=a&&""!==a||(a=""),o&&(null==l||""===l))throw"No cart_created";if(r.each(t,function(t,i){e[t]=i}),localStorage.setItem(n,localStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(n,sessionStorage.getItem(n)+(new Date).getTime()),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e)),!e||!e["div.widget_shopping_cart_content"]||o!==a)throw"No fragment";r.each(e,function(t,i){r(t).replaceWith(i)}),r(document.body).trigger("wc_fragments_loaded")}catch(t){r(document.body).trigger("wc_fragment_refresh")}}},onActionProduct:function(t,i){var s={form:{},tinv_wishlist_id:t||"",tinv_wishlist_name:i||"",product_type:r(this).attr("data-tinv-wl-producttype"),product_id:r(this).attr("data-tinv-wl-product")||0,product_variation:r(this).attr("data-tinv-wl-productvariation")||0,product_action:r(this).attr("data-tinv-wl-action")||"addto",redirect:window.location.href},e=this;r(e).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(){var t=r(this).attr("name"),i=r(this).attr("type"),e=r(this).val(),n=10,o=function t(i,e){if("object"!==_typeof(e))return e;for(var n in void 0===i&&(i={}),e)if(""===n){var o=-1;for(o in i)o=o;i[o=parseInt(o)+1]=t(i[n],e[n])}else i[n]=t(i[n],e[n]);return i};if("button"!==i&&void 0!==t&&"attribute_"!=t.substr(0,10)){for(;/^(.+)\[([^\[\]]*?)\]$/.test(t)&&0<n;){var a=t.match(/^(.+)\[([^\[\]]*?)\]$/);if(3===a.length){var l={};l[a[2]]=e,e=l}t=a[1],n--}"checkbox"===i||"radio"===i?r(this).is(":checked")&&(e.length||"object"===_typeof(e)||(e=!0),s.form[t]=o(s.form[t],e)):s.form[t]=o(s.form[t],e)}}),s=o.onPrepareDataAction.call(e,e,s)||s,r.post(o.api_url,s,function(t){if(o.onDialogHide.call(e.tinvwl_dialog,e),"object"===_typeof(t))for(var i in t)"function"==typeof o.onAction[i]&&o.onAction[i].call(e,t[i]);else"function"==typeof o.onAction.msg&&o.onAction.msg.call(e,t)})}},o=r.extend(!0,{},i,t);return r(this).each(function(){if(!r(this).attr("data-tinv-wl-list"))return!1;if(o.dialogbox&&o.dialogbox.length&&(this.tinvwl_dialog=o.dialogbox),this.tinvwl_dialog||(this.tinvwl_dialog=o.onGetDialogBox.call(this)),!this.tinvwl_dialog){var t=r(this).nextAll(o.class.dialogbox).eq(0);t.length&&(this.tinvwl_dialog=t)}if(this.tinvwl_dialog){o.onPrepareDialogBox.call(this.tinvwl_dialog),"function"!=typeof this.tinvwl_dialog.update_list&&(this.tinvwl_dialog.update_list=function(t){var e=r(this).find(o.class.select).eq(0);r(this).find(o.class.newtitle).hide().val(""),e.html(""),r.each(t,function(t,i){o.onCreateWishList.call(e,i)}),o.text_create&&o.onCreateWishList.call(e,{ID:"",title:o.text_create,in:!1}),o.onMultiProductAlreadyIn.call(e,t),o.onSelectWishList.call(e,t),r(this).find(o.class.newtitle).toggle(""===e.val())}),"function"!=typeof this.tinvwl_dialog.show_list&&(this.tinvwl_dialog.show_list=function(){var t=r.parseJSON(r(this).attr("data-tinv-wl-list"))||[];t.length?(t=o.onPrepareList.call(t)||t,this.tinvwl_dialog.update_list(t),o.onDialogShow.call(this.tinvwl_dialog,this)):o.onActionProduct.call(this)});var n=this;r(this.tinvwl_dialog).find(o.class.dialogbutton).off("click").on("click",function(){var t,i=r(n.tinvwl_dialog).find(o.class.select),e=r(n.tinvwl_dialog).find(o.class.newtitle);i.val()||e.val()?o.onActionProduct.call(n,i.val(),e.val()):((t=e.is(":visible")?e:i).addClass("empty-name-wishlist"),window.setTimeout(function(){t.removeClass("empty-name-wishlist")},1e3))})}r(this).off("click").on("click",o.onClick),o.onInited.call(this,o)})},r(document).ready(function(){r("body").on("click",".tinvwl_add_to_wishlist_button",function(t){if(r(this).is(".disabled-add-wishlist"))return t.preventDefault(),void window.alert(tinvwl_add_to_wishlist.i18n_make_a_selection_text);r(this).is(".inited-add-wishlist")||r(this).tinvwl_to_wishlist({onInited:function(t){r(this).addClass("inited-add-wishlist"),t.onClick.call(this)}})}),r(document).on("hide_variation",".variations_form",function(t){var i=r(this).find(".tinvwl_add_to_wishlist_button");i.length&&!tinvwl_add_to_wishlist.allow_parent_variable&&(t.preventDefault(),i.addClass("disabled-add-wishlist"))}),r(document).on("show_variation",".variations_form",function(t,i,e){var n=r(this).find(".tinvwl_add_to_wishlist_button");if(n.length){var o=JSON.parse(n.attr("data-tinv-wl-list")),a=!1,l="1"==window.tinvwl_add_to_wishlist.simple_flow;for(var s in o)o[s].hasOwnProperty("in")&&Array.isArray(o[s].in)&&-1<(o[s].in||[]).indexOf(i.variation_id)&&(a=!0);n.toggleClass("tinvwl-product-in-list",a).toggleClass("tinvwl-product-make-remove",a&&l).attr("data-tinv-wl-action",a&&l?"remove":"addto"),t.preventDefault(),n.removeClass("disabled-add-wishlist")}})})}(jQuery),function(n){n(document).ready(function(){if(n("#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">'),n(".tinv-lists-nav").each(function(){n.trim(n(this).html()).length||n(this).remove()}),n("body").on("click",".social-buttons .social:not(.social-email,.social-whatsapp,.social-clipboard)",function(t){var i=window.open(n(this).attr("href"),n(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)}n("body").on("click",".social-buttons .social.social-clipboard",function(t){t.preventDefault()}),n("body").on("click",".tinv-wishlist .tinv-overlay, .tinv-wishlist .tinv-close-modal, .tinv-wishlist .tinvwl_button_close",function(t){t.preventDefault(),n(this).parents(".tinv-modal:first").removeClass("tinv-modal-open")}),n("body").on("click",".tinv-wishlist .tinvwl-btn-onclick",function(t){n(this).data("url")&&(t.preventDefault(),window.location=n(this).data("url"))});var e=n(".tinv-wishlist .navigation-button");e.length&&e.each(function(){var t=n(this).find("> li");t.length<5&&t.parent().addClass("tinvwl-btns-count-"+t.length)}),n(".tinv-login .showlogin").unbind("click").on("click",function(t){t.preventDefault(),n(this).closest(".tinv-login").find(".login").toggle()}),n(".tinv-wishlist table.tinvwl-table-manage-list tfoot td").each(function(){n(this).toggle(!!n(this).children().not(".look_in").length||!!n(this).children(".look_in").children().length)})}),n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var t=!("0"==n(".wishlist_products_counter_number").html()||""==n(".wishlist_products_counter_number").html());n(".wishlist_products_counter").toggleClass("wishlist-counter-with-products",t)}),update_cart_hash()}(jQuery),function(n){n.fn.tinvwl_break_submit=function(t){var i={selector:"input, select, textarea",ifempty:!0,invert:!1,validate:function(){return n(this).val()},rule:function(){var t=n(this).parents("form").eq(0).find(e.selector),i=e.invert;return 0===t.length?e.ifempty:(t.each(function(){i&&!e.invert||!i&&e.invert||(i=Boolean(e.validate.call(n(this))))}),i)}},e=n.extend(!0,{},i,t);return n(this).each(function(){n(this).on("click",function(t){e.rule.call(n(this))||(alert(window.tinvwl_add_to_wishlist.tinvwl_break_submit),t.preventDefault())})})},n(document).ready(function(){n(".tinvwl-break-input").tinvwl_break_submit({selector:".tinvwl-break-input-filed"}),n(".tinvwl-break-checkbox").tinvwl_break_submit({selector:"table td input[type=checkbox]",validate:function(){return n(this).is(":checked")}}),n(".global-cb").on("click",function(){n(this).closest("table").eq(0).find(".product-cb input[type=checkbox], .wishlist-cb input[type=checkbox]").prop("checked",n(this).is(":checked"))})})}(jQuery);
|
includes/api/wishlist.class.php
CHANGED
@@ -231,10 +231,6 @@ class TInvWL_Includes_API_Wishlist {
|
|
231 |
|
232 |
$products = $wlp->get( $args );
|
233 |
|
234 |
-
if ( ! $products ) {
|
235 |
-
throw new WC_REST_Exception( 'ti_woocommerce_wishlist_api_wishlist_products_not_found', __( 'No products found for this wishlist.', 'ti-woocommerce-wishlist' ), 400 );
|
236 |
-
}
|
237 |
-
|
238 |
$response = array();
|
239 |
|
240 |
foreach ( $products as $product ) {
|
231 |
|
232 |
$products = $wlp->get( $args );
|
233 |
|
|
|
|
|
|
|
|
|
234 |
$response = array();
|
235 |
|
236 |
foreach ( $products as $product ) {
|
includes/export.class.php
ADDED
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Export/Import plugin settings class
|
4 |
+
*
|
5 |
+
* @since 1.17.0
|
6 |
+
* @package TInvWishlist
|
7 |
+
*/
|
8 |
+
|
9 |
+
// If this file is called directly, abort.
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
die;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Export/Import plugin settings class
|
16 |
+
*/
|
17 |
+
class TInvWL_Export {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Plugin name.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
public $_name;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Plugin version.
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
public $_version;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*
|
36 |
+
* @param string $plugin_name Plugin name.
|
37 |
+
* @param string $version Plugin version.
|
38 |
+
*/
|
39 |
+
function __construct( $plugin_name, $version ) {
|
40 |
+
$this->_name = $plugin_name;
|
41 |
+
$this->_version = $version;
|
42 |
+
$this->define_hooks();
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Define hooks.
|
48 |
+
*/
|
49 |
+
function define_hooks() {
|
50 |
+
add_action( 'admin_action_tinvwl_export_settings', array( $this, 'export_settings' ) );
|
51 |
+
add_action( 'admin_action_tinvwl_import_settings', array( $this, 'import_settings' ) );
|
52 |
+
|
53 |
+
if ( isset( $_REQUEST['error'] ) && isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'tinvwl-export-import-settings' ) {
|
54 |
+
add_action( 'admin_notices', array( $this, 'show_error' ) );
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Show error on the current page.
|
60 |
+
*/
|
61 |
+
public function show_error() {
|
62 |
+
printf(
|
63 |
+
'<div class="notice notice-error"><p><strong>%s</strong></p></div>',
|
64 |
+
sanitize_text_field( $_REQUEST['error'] )
|
65 |
+
);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get sanitized blog name.
|
70 |
+
*
|
71 |
+
* @return string|string[]|void
|
72 |
+
*/
|
73 |
+
private function blog_name() {
|
74 |
+
|
75 |
+
$name = get_bloginfo( 'name' );
|
76 |
+
|
77 |
+
// WordPress can have a blank site title, which will cause initial client creation to fail
|
78 |
+
if ( empty( $name ) ) {
|
79 |
+
$name = wp_parse_url( home_url(), PHP_URL_HOST );
|
80 |
+
|
81 |
+
if ( $port = wp_parse_url( home_url(), PHP_URL_PORT ) ) {
|
82 |
+
$name .= ':' . $port;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
$name = preg_replace( '/[^A-Za-z0-9 ]/', '', $name );
|
87 |
+
$name = preg_replace( '/\s+/', ' ', $name );
|
88 |
+
$name = str_replace( ' ', '-', $name );
|
89 |
+
|
90 |
+
return $name;
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Get all plugin settings.
|
96 |
+
*
|
97 |
+
* @return array|bool
|
98 |
+
*/
|
99 |
+
public function get_settings() {
|
100 |
+
$dir = TINVWL_PATH . 'admin/settings/';
|
101 |
+
if ( ! file_exists( $dir ) || ! is_dir( $dir ) ) {
|
102 |
+
return false;
|
103 |
+
}
|
104 |
+
$files = scandir( $dir );
|
105 |
+
$ids = array();
|
106 |
+
foreach ( $files as $value ) {
|
107 |
+
if ( preg_match( '/\.class\.php$/i', $value ) ) {
|
108 |
+
$file = preg_replace( '/\.class\.php$/i', '', $value );
|
109 |
+
$class = 'TInvWL_Admin_Settings_' . ucfirst( $file );
|
110 |
+
$options = $class::instance( $this->_name, $this->_version );
|
111 |
+
if ( method_exists( $options, 'constructor_data' ) && __FUNCTION__ != 'constructor_data' ) {
|
112 |
+
|
113 |
+
foreach ( $options->constructor_data() as $data ) {
|
114 |
+
$ids[] = $data['id'];
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
}
|
119 |
+
foreach ( array_keys( $ids, 'save_buttons', true ) as $key ) {
|
120 |
+
unset( $ids[ $key ] );
|
121 |
+
}
|
122 |
+
$ids = array_values( $ids );
|
123 |
+
|
124 |
+
$settings = array();
|
125 |
+
|
126 |
+
foreach ( $ids as $id ) {
|
127 |
+
$settings[ 'tinvwl-' . $id ] = get_option( 'tinvwl-' . $id );
|
128 |
+
}
|
129 |
+
|
130 |
+
return $settings;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Allow upload JSON extension.
|
135 |
+
*
|
136 |
+
* @param array $mimes
|
137 |
+
*
|
138 |
+
* @return array
|
139 |
+
*/
|
140 |
+
function json_mime_type( $mimes ) {
|
141 |
+
$mimes['json'] = 'application/json';
|
142 |
+
|
143 |
+
return $mimes;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* handle import settings upload and updating database.
|
148 |
+
*/
|
149 |
+
public function import_settings() {
|
150 |
+
|
151 |
+
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
152 |
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
153 |
+
}
|
154 |
+
|
155 |
+
if ( isset( $_FILES['settings-file'] ) && $_FILES['settings-file']['error'] !== 4 ) {
|
156 |
+
|
157 |
+
if ( $_FILES['settings-file']['error'] === 0 ) {
|
158 |
+
$uploadedfile = $_FILES['settings-file'];
|
159 |
+
$upload_overrides = array(
|
160 |
+
'test_form' => false,
|
161 |
+
'mimes' => array( 'json' => 'application/json' ),
|
162 |
+
);
|
163 |
+
|
164 |
+
add_filter( 'upload_mimes', array( $this, 'json_mime_type' ) );
|
165 |
+
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
|
166 |
+
remove_filter( 'upload_mimes', array( $this, 'json_mime_type' ) );
|
167 |
+
|
168 |
+
if ( $movefile && ! isset( $movefile['error'] ) ) {
|
169 |
+
|
170 |
+
$settings_json = file_get_contents( $movefile['file'] );
|
171 |
+
unlink( $movefile['file'] );
|
172 |
+
|
173 |
+
if ( empty( $settings_json ) ) {
|
174 |
+
exit(
|
175 |
+
wp_redirect(
|
176 |
+
admin_url(
|
177 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
178 |
+
rawurlencode( __( 'The settings file is empty.', 'ti-woocommerce-wishlist' ) )
|
179 |
+
)
|
180 |
+
)
|
181 |
+
);
|
182 |
+
}
|
183 |
+
|
184 |
+
$settings = json_decode( $settings_json, true );
|
185 |
+
|
186 |
+
if ( empty( $settings ) ) {
|
187 |
+
exit(
|
188 |
+
wp_redirect(
|
189 |
+
admin_url(
|
190 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
191 |
+
rawurlencode( __( 'The settings file is not valid.', 'ti-woocommerce-wishlist' ) )
|
192 |
+
)
|
193 |
+
)
|
194 |
+
);
|
195 |
+
}
|
196 |
+
} else {
|
197 |
+
exit(
|
198 |
+
wp_redirect(
|
199 |
+
admin_url(
|
200 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
201 |
+
rawurlencode( $movefile['error'] )
|
202 |
+
)
|
203 |
+
)
|
204 |
+
);
|
205 |
+
}
|
206 |
+
} else {
|
207 |
+
switch ( $_FILES['settings-file']['error'] ) {
|
208 |
+
case 1:
|
209 |
+
case 2:
|
210 |
+
exit(
|
211 |
+
wp_redirect(
|
212 |
+
admin_url(
|
213 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
214 |
+
rawurlencode( __( 'The file you are uploading is too big.', 'ti-woocommerce-wishlist' ) )
|
215 |
+
)
|
216 |
+
)
|
217 |
+
);
|
218 |
+
break;
|
219 |
+
case 3:
|
220 |
+
exit(
|
221 |
+
wp_redirect(
|
222 |
+
admin_url(
|
223 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
224 |
+
rawurlencode( __( 'There was an error uploading the file.', 'ti-woocommerce-wishlist' ) )
|
225 |
+
)
|
226 |
+
)
|
227 |
+
);
|
228 |
+
break;
|
229 |
+
case 6:
|
230 |
+
case 7:
|
231 |
+
case 8:
|
232 |
+
exit(
|
233 |
+
wp_redirect(
|
234 |
+
admin_url(
|
235 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
236 |
+
rawurlencode( __( 'There was an error importing your settings, please try again.', 'ti-woocommerce-wishlist' ) )
|
237 |
+
)
|
238 |
+
)
|
239 |
+
);
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
} else {
|
244 |
+
$settings_json = trim( stripslashes( $_POST['settings-json'] ) );
|
245 |
+
|
246 |
+
if ( empty( $settings_json ) ) {
|
247 |
+
exit(
|
248 |
+
wp_redirect(
|
249 |
+
admin_url(
|
250 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
251 |
+
rawurlencode( __( 'Please upload the TI WooCommerce Wishlist setting file or copy the content.', 'ti-woocommerce-wishlist' ) )
|
252 |
+
)
|
253 |
+
)
|
254 |
+
);
|
255 |
+
}
|
256 |
+
|
257 |
+
$settings = json_decode( $settings_json, true );
|
258 |
+
|
259 |
+
if ( empty( $settings ) ) {
|
260 |
+
exit(
|
261 |
+
wp_redirect(
|
262 |
+
admin_url(
|
263 |
+
'admin.php?page=tinvwl-export-import-settings&error=' .
|
264 |
+
rawurlencode( __( 'The settings json is not valid.', 'ti-woocommerce-wishlist' ) )
|
265 |
+
)
|
266 |
+
)
|
267 |
+
);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
foreach ( $settings as $key => $value ) {
|
272 |
+
update_option( $key, $value );
|
273 |
+
}
|
274 |
+
|
275 |
+
exit( wp_redirect( admin_url( 'admin.php?page=tinvwl' ) ) );
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Handle settings export in a JSON file.
|
280 |
+
*/
|
281 |
+
public function export_settings() {
|
282 |
+
header( 'Content-Type: application/json' );
|
283 |
+
$name = urlencode( $this->blog_name() );
|
284 |
+
header( "Content-Disposition: attachment; filename=ti_woocommerce_wishlist_settings-$name.json" );
|
285 |
+
header( 'Pragma: no-cache' );
|
286 |
+
|
287 |
+
$settings = $this->get_settings();
|
288 |
+
|
289 |
+
echo json_encode( $settings );
|
290 |
+
exit;
|
291 |
+
}
|
292 |
+
}
|
includes/tinvwl.class.php
CHANGED
@@ -80,6 +80,7 @@ class TInvWL {
|
|
80 |
|
81 |
if ( is_admin() ) {
|
82 |
new TInvWL_WizardSetup( $this->_name, $this->_version );
|
|
|
83 |
$this->object_admin->load_function();
|
84 |
} else {
|
85 |
// Allow to disable wishlist for frontend conditionally. Must be hooked on 'plugins_loaded' action.
|
80 |
|
81 |
if ( is_admin() ) {
|
82 |
new TInvWL_WizardSetup( $this->_name, $this->_version );
|
83 |
+
new TInvWL_Export( $this->_name, $this->_version );
|
84 |
$this->object_admin->load_function();
|
85 |
} else {
|
86 |
// Allow to disable wishlist for frontend conditionally. Must be hooked on 'plugins_loaded' action.
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2020 TI WooCommerce Wishlist Plugin - 1.
|
2 |
-
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -488,6 +488,14 @@ msgstr ""
|
|
488 |
msgid "Disable support chat"
|
489 |
msgstr ""
|
490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
#: admin/settings/style.class.php:56
|
492 |
msgid "Style Options"
|
493 |
msgstr ""
|
@@ -752,7 +760,7 @@ msgstr ""
|
|
752 |
msgid "<strong>Your theme (%1$s) contains outdated copies of some WooCommerce Wishlist Plugin template files.</strong><br> These files may need updating to ensure they are compatible with the current version of WooCommerce Wishlist Plugin.<br> You can see which files are affected from the <a href=\"%2$s\">system status page</a>.<br> If in doubt, check with the author of the theme."
|
753 |
msgstr ""
|
754 |
|
755 |
-
#: includes/api/wishlist.class.php:102, includes/api/wishlist.class.php:165, includes/api/wishlist.class.php:213, includes/api/wishlist.class.php:
|
756 |
msgid "Invalid wishlist share key."
|
757 |
msgstr ""
|
758 |
|
@@ -764,19 +772,15 @@ msgstr ""
|
|
764 |
msgid "Update wishlist data failed."
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: includes/api/wishlist.class.php:
|
768 |
-
msgid "No products found for this wishlist."
|
769 |
-
msgstr ""
|
770 |
-
|
771 |
-
#: includes/api/wishlist.class.php:291
|
772 |
msgid "Add product to wishlist failed."
|
773 |
msgstr ""
|
774 |
|
775 |
-
#: includes/api/wishlist.class.php:
|
776 |
msgid "Product not found."
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: includes/api/wishlist.class.php:
|
780 |
msgid "Product removed from a wishlist."
|
781 |
msgstr ""
|
782 |
|
@@ -800,6 +804,34 @@ msgstr ""
|
|
800 |
msgid "Register now »"
|
801 |
msgstr ""
|
802 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
803 |
#: includes/form.helper.php:508
|
804 |
msgid "Preview"
|
805 |
msgstr ""
|
@@ -832,15 +864,15 @@ msgstr ""
|
|
832 |
msgid "%1$s %3$s is required. Please activate it before activating this plugin."
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: includes/tinvwl.class.php:
|
836 |
msgid "Settings"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: includes/tinvwl.class.php:
|
840 |
msgid "Premium Version"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: includes/tinvwl.class.php:
|
844 |
msgid "Live Demo"
|
845 |
msgstr ""
|
846 |
|
@@ -1109,6 +1141,30 @@ msgid_plural "%s have been successfully removed from wishlist."
|
|
1109 |
msgstr[0] ""
|
1110 |
msgstr[1] ""
|
1111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
#: public/wishlist/view.class.php:428
|
1113 |
msgid "%1$s by %2$s"
|
1114 |
msgstr ""
|
@@ -1181,6 +1237,50 @@ msgstr ""
|
|
1181 |
msgid "Select for bulk action"
|
1182 |
msgstr ""
|
1183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1184 |
#: views/admin/premium-features.php:21
|
1185 |
msgid "Premium version"
|
1186 |
msgstr ""
|
1 |
+
# Copyright (C) 2020 TI WooCommerce Wishlist Plugin - 1.17.0
|
2 |
+
# This file is distributed under the same license as the TI WooCommerce Wishlist Plugin - 1.17.0 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: TI WooCommerce Wishlist Plugin - 1.17.0\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
488 |
msgid "Disable support chat"
|
489 |
msgstr ""
|
490 |
|
491 |
+
#: admin/settings/settings.class.php:56
|
492 |
+
msgid "Export/Import Settings"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
#: admin/settings/settings.class.php:57
|
496 |
+
msgid "Export/Import Plugin Settings"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
#: admin/settings/style.class.php:56
|
500 |
msgid "Style Options"
|
501 |
msgstr ""
|
760 |
msgid "<strong>Your theme (%1$s) contains outdated copies of some WooCommerce Wishlist Plugin template files.</strong><br> These files may need updating to ensure they are compatible with the current version of WooCommerce Wishlist Plugin.<br> You can see which files are affected from the <a href=\"%2$s\">system status page</a>.<br> If in doubt, check with the author of the theme."
|
761 |
msgstr ""
|
762 |
|
763 |
+
#: includes/api/wishlist.class.php:102, includes/api/wishlist.class.php:165, includes/api/wishlist.class.php:213, includes/api/wishlist.class.php:265
|
764 |
msgid "Invalid wishlist share key."
|
765 |
msgstr ""
|
766 |
|
772 |
msgid "Update wishlist data failed."
|
773 |
msgstr ""
|
774 |
|
775 |
+
#: includes/api/wishlist.class.php:287
|
|
|
|
|
|
|
|
|
776 |
msgid "Add product to wishlist failed."
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: includes/api/wishlist.class.php:323
|
780 |
msgid "Product not found."
|
781 |
msgstr ""
|
782 |
|
783 |
+
#: includes/api/wishlist.class.php:326
|
784 |
msgid "Product removed from a wishlist."
|
785 |
msgstr ""
|
786 |
|
804 |
msgid "Register now »"
|
805 |
msgstr ""
|
806 |
|
807 |
+
#: includes/export.class.php:178
|
808 |
+
msgid "The settings file is empty."
|
809 |
+
msgstr ""
|
810 |
+
|
811 |
+
#: includes/export.class.php:191
|
812 |
+
msgid "The settings file is not valid."
|
813 |
+
msgstr ""
|
814 |
+
|
815 |
+
#: includes/export.class.php:214
|
816 |
+
msgid "The file you are uploading is too big."
|
817 |
+
msgstr ""
|
818 |
+
|
819 |
+
#: includes/export.class.php:224
|
820 |
+
msgid "There was an error uploading the file."
|
821 |
+
msgstr ""
|
822 |
+
|
823 |
+
#: includes/export.class.php:236
|
824 |
+
msgid "There was an error importing your settings, please try again."
|
825 |
+
msgstr ""
|
826 |
+
|
827 |
+
#: includes/export.class.php:251
|
828 |
+
msgid "Please upload the TI WooCommerce Wishlist setting file or copy the content."
|
829 |
+
msgstr ""
|
830 |
+
|
831 |
+
#: includes/export.class.php:264
|
832 |
+
msgid "The settings json is not valid."
|
833 |
+
msgstr ""
|
834 |
+
|
835 |
#: includes/form.helper.php:508
|
836 |
msgid "Preview"
|
837 |
msgstr ""
|
864 |
msgid "%1$s %3$s is required. Please activate it before activating this plugin."
|
865 |
msgstr ""
|
866 |
|
867 |
+
#: includes/tinvwl.class.php:168
|
868 |
msgid "Settings"
|
869 |
msgstr ""
|
870 |
|
871 |
+
#: includes/tinvwl.class.php:169
|
872 |
msgid "Premium Version"
|
873 |
msgstr ""
|
874 |
|
875 |
+
#: includes/tinvwl.class.php:170
|
876 |
msgid "Live Demo"
|
877 |
msgstr ""
|
878 |
|
1141 |
msgstr[0] ""
|
1142 |
msgstr[1] ""
|
1143 |
|
1144 |
+
#: public/wishlist/social.class.php:100
|
1145 |
+
msgid "Facebook"
|
1146 |
+
msgstr ""
|
1147 |
+
|
1148 |
+
#: public/wishlist/social.class.php:119
|
1149 |
+
msgid "Twitter"
|
1150 |
+
msgstr ""
|
1151 |
+
|
1152 |
+
#: public/wishlist/social.class.php:138
|
1153 |
+
msgid "Pinterest"
|
1154 |
+
msgstr ""
|
1155 |
+
|
1156 |
+
#: public/wishlist/social.class.php:158
|
1157 |
+
msgid "Email"
|
1158 |
+
msgstr ""
|
1159 |
+
|
1160 |
+
#: public/wishlist/social.class.php:177
|
1161 |
+
msgid "Clipboard"
|
1162 |
+
msgstr ""
|
1163 |
+
|
1164 |
+
#: public/wishlist/social.class.php:192
|
1165 |
+
msgid "WhatsApp"
|
1166 |
+
msgstr ""
|
1167 |
+
|
1168 |
#: public/wishlist/view.class.php:428
|
1169 |
msgid "%1$s by %2$s"
|
1170 |
msgstr ""
|
1237 |
msgid "Select for bulk action"
|
1238 |
msgstr ""
|
1239 |
|
1240 |
+
#: views/admin/export-import-settings.php:21
|
1241 |
+
msgid "You can import and export your TI WooCommerce Wishlist plugin settings here. "
|
1242 |
+
msgstr ""
|
1243 |
+
|
1244 |
+
#: views/admin/export-import-settings.php:22
|
1245 |
+
msgid "This allows you to either backup the data, or to move your settings to a new WordPress instance."
|
1246 |
+
msgstr ""
|
1247 |
+
|
1248 |
+
#: views/admin/export-import-settings.php:33
|
1249 |
+
msgid "Import settings"
|
1250 |
+
msgstr ""
|
1251 |
+
|
1252 |
+
#: views/admin/export-import-settings.php:47
|
1253 |
+
msgid "Please upload the exported json file or"
|
1254 |
+
msgstr ""
|
1255 |
+
|
1256 |
+
#: views/admin/export-import-settings.php:49
|
1257 |
+
msgid "paste the entire json"
|
1258 |
+
msgstr ""
|
1259 |
+
|
1260 |
+
#: views/admin/export-import-settings.php:54
|
1261 |
+
msgid "Please paste the exported json file or"
|
1262 |
+
msgstr ""
|
1263 |
+
|
1264 |
+
#: views/admin/export-import-settings.php:56
|
1265 |
+
msgid "upload the exported file"
|
1266 |
+
msgstr ""
|
1267 |
+
|
1268 |
+
#: views/admin/export-import-settings.php:64
|
1269 |
+
msgid "Import"
|
1270 |
+
msgstr ""
|
1271 |
+
|
1272 |
+
#: views/admin/export-import-settings.php:78
|
1273 |
+
msgid "Export settings"
|
1274 |
+
msgstr ""
|
1275 |
+
|
1276 |
+
#: views/admin/export-import-settings.php:82
|
1277 |
+
msgid "Download the entire plugin configuration."
|
1278 |
+
msgstr ""
|
1279 |
+
|
1280 |
+
#: views/admin/export-import-settings.php:86
|
1281 |
+
msgid "Export"
|
1282 |
+
msgstr ""
|
1283 |
+
|
1284 |
#: views/admin/premium-features.php:21
|
1285 |
msgid "Premium version"
|
1286 |
msgstr ""
|
public/wishlist/social.class.php
CHANGED
@@ -61,7 +61,8 @@ class TInvWL_Public_Wishlist_Social {
|
|
61 |
|
62 |
foreach ( $social as $name => $soc_network ) {
|
63 |
if ( $soc_network && method_exists( __CLASS__, $name ) ) {
|
64 |
-
$social[ $name ]
|
|
|
65 |
if ( 'clipboard' === $name ) {
|
66 |
wp_enqueue_script( 'tinvwl-clipboard' );
|
67 |
}
|
@@ -80,8 +81,9 @@ class TInvWL_Public_Wishlist_Social {
|
|
80 |
return false;
|
81 |
}
|
82 |
$data = array(
|
83 |
-
'social'
|
84 |
-
'
|
|
|
85 |
);
|
86 |
tinv_wishlist_template( 'ti-wishlist-social.php', $data );
|
87 |
}
|
@@ -89,9 +91,15 @@ class TInvWL_Public_Wishlist_Social {
|
|
89 |
/**
|
90 |
* Create facebook share url
|
91 |
*
|
|
|
|
|
92 |
* @return string
|
93 |
*/
|
94 |
-
public static function facebook() {
|
|
|
|
|
|
|
|
|
95 |
$data = array(
|
96 |
'u' => self::$url,
|
97 |
);
|
@@ -102,9 +110,15 @@ class TInvWL_Public_Wishlist_Social {
|
|
102 |
/**
|
103 |
* Create twitter share url
|
104 |
*
|
|
|
|
|
105 |
* @return string
|
106 |
*/
|
107 |
-
public static function twitter() {
|
|
|
|
|
|
|
|
|
108 |
$data = array(
|
109 |
'url' => self::$url,
|
110 |
);
|
@@ -115,9 +129,15 @@ class TInvWL_Public_Wishlist_Social {
|
|
115 |
/**
|
116 |
* Create pinterest share url
|
117 |
*
|
|
|
|
|
118 |
* @return string
|
119 |
*/
|
120 |
-
public static function pinterest() {
|
|
|
|
|
|
|
|
|
121 |
$data = array(
|
122 |
'url' => self::$url,
|
123 |
'media' => self::$image,
|
@@ -129,9 +149,15 @@ class TInvWL_Public_Wishlist_Social {
|
|
129 |
/**
|
130 |
* Create email share url
|
131 |
*
|
|
|
|
|
132 |
* @return string
|
133 |
*/
|
134 |
-
public static function email() {
|
|
|
|
|
|
|
|
|
135 |
$data = array(
|
136 |
'body' => self::$url,
|
137 |
);
|
@@ -142,18 +168,30 @@ class TInvWL_Public_Wishlist_Social {
|
|
142 |
/**
|
143 |
* Create copy to clipboard url
|
144 |
*
|
|
|
|
|
145 |
* @return string
|
146 |
*/
|
147 |
-
public static function clipboard() {
|
|
|
|
|
|
|
|
|
148 |
return self::$url;
|
149 |
}
|
150 |
|
151 |
/**
|
152 |
* Create WhatsApp share url
|
153 |
*
|
|
|
|
|
154 |
* @return string
|
155 |
*/
|
156 |
-
public static function whatsapp() {
|
|
|
|
|
|
|
|
|
157 |
$data = array(
|
158 |
'text' => self::$url,
|
159 |
);
|
61 |
|
62 |
foreach ( $social as $name => $soc_network ) {
|
63 |
if ( $soc_network && method_exists( __CLASS__, $name ) ) {
|
64 |
+
$social[ $name ] = self::$name();
|
65 |
+
$social_titles[ $name ] = self::$name( true );
|
66 |
if ( 'clipboard' === $name ) {
|
67 |
wp_enqueue_script( 'tinvwl-clipboard' );
|
68 |
}
|
81 |
return false;
|
82 |
}
|
83 |
$data = array(
|
84 |
+
'social' => $social,
|
85 |
+
'social_titles' => $social_titles,
|
86 |
+
'share_on' => $share_on,
|
87 |
);
|
88 |
tinv_wishlist_template( 'ti-wishlist-social.php', $data );
|
89 |
}
|
91 |
/**
|
92 |
* Create facebook share url
|
93 |
*
|
94 |
+
* @param bool $title return title for translation.
|
95 |
+
*
|
96 |
* @return string
|
97 |
*/
|
98 |
+
public static function facebook( $title = false ) {
|
99 |
+
if ( $title ) {
|
100 |
+
return esc_html__( 'Facebook', 'ti-woocommerce-wishlist' );
|
101 |
+
}
|
102 |
+
|
103 |
$data = array(
|
104 |
'u' => self::$url,
|
105 |
);
|
110 |
/**
|
111 |
* Create twitter share url
|
112 |
*
|
113 |
+
* @param bool $title return title for translation.
|
114 |
+
*
|
115 |
* @return string
|
116 |
*/
|
117 |
+
public static function twitter( $title = false ) {
|
118 |
+
if ( $title ) {
|
119 |
+
return esc_html__( 'Twitter', 'ti-woocommerce-wishlist' );
|
120 |
+
}
|
121 |
+
|
122 |
$data = array(
|
123 |
'url' => self::$url,
|
124 |
);
|
129 |
/**
|
130 |
* Create pinterest share url
|
131 |
*
|
132 |
+
* @param bool $title return title for translation.
|
133 |
+
*
|
134 |
* @return string
|
135 |
*/
|
136 |
+
public static function pinterest( $title = false ) {
|
137 |
+
if ( $title ) {
|
138 |
+
return esc_html__( 'Pinterest', 'ti-woocommerce-wishlist' );
|
139 |
+
}
|
140 |
+
|
141 |
$data = array(
|
142 |
'url' => self::$url,
|
143 |
'media' => self::$image,
|
149 |
/**
|
150 |
* Create email share url
|
151 |
*
|
152 |
+
* @param bool $title return title for translation.
|
153 |
+
*
|
154 |
* @return string
|
155 |
*/
|
156 |
+
public static function email( $title = false ) {
|
157 |
+
if ( $title ) {
|
158 |
+
return esc_html__( 'Email', 'ti-woocommerce-wishlist' );
|
159 |
+
}
|
160 |
+
|
161 |
$data = array(
|
162 |
'body' => self::$url,
|
163 |
);
|
168 |
/**
|
169 |
* Create copy to clipboard url
|
170 |
*
|
171 |
+
* @param bool $title return title for translation.
|
172 |
+
*
|
173 |
* @return string
|
174 |
*/
|
175 |
+
public static function clipboard( $title = false ) {
|
176 |
+
if ( $title ) {
|
177 |
+
return esc_html__( 'Clipboard', 'ti-woocommerce-wishlist' );
|
178 |
+
}
|
179 |
+
|
180 |
return self::$url;
|
181 |
}
|
182 |
|
183 |
/**
|
184 |
* Create WhatsApp share url
|
185 |
*
|
186 |
+
* @param bool $title return title for translation.
|
187 |
+
*
|
188 |
* @return string
|
189 |
*/
|
190 |
+
public static function whatsapp( $title = false ) {
|
191 |
+
if ( $title ) {
|
192 |
+
return esc_html__( 'WhatsApp', 'ti-woocommerce-wishlist' );
|
193 |
+
}
|
194 |
+
|
195 |
$data = array(
|
196 |
'text' => self::$url,
|
197 |
);
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: templateinvaders
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.
|
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/
|
@@ -164,6 +164,16 @@ Yes you can! Join in on our [GitHub repository](https://github.com/TemplateInvad
|
|
164 |
|
165 |
|
166 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
= 1.16.2 =
|
168 |
*Release Date - 27 January 2020*
|
169 |
|
2 |
Contributors: templateinvaders
|
3 |
Tags: woocommerce, wishlist, woocommerce wishlist, e-commerce, ecommerce
|
4 |
Requires at least: 4.7
|
5 |
+
Tested up to: 5.4
|
6 |
+
Stable tag: 1.17.0
|
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/
|
164 |
|
165 |
|
166 |
== Changelog ==
|
167 |
+
= 1.17.0 =
|
168 |
+
*Release Date - 29 March 2020*
|
169 |
+
|
170 |
+
* WordPress 5.4 support
|
171 |
+
* WooCommerce 4.0.x support
|
172 |
+
* Added tool for export and import plugin settings
|
173 |
+
* Added to share buttons translated title
|
174 |
+
* REST API tweak: empty wishlist returns 200 response code and empty array now
|
175 |
+
|
176 |
+
|
177 |
= 1.16.2 =
|
178 |
*Release Date - 27 January 2020*
|
179 |
|
templates/ti-wishlist-social.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* The Template for displaying social buttons.
|
4 |
*
|
5 |
-
* @version 1.
|
6 |
* @package TInvWishlist\Template
|
7 |
*/
|
8 |
|
@@ -19,9 +19,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
19 |
<?php foreach ( $social as $social_name => $social_url ) {
|
20 |
?>
|
21 |
<li><a href="<?php echo esc_url( $social_url ); ?>"
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
<?php } ?>
|
26 |
</ul>
|
27 |
</div>
|
2 |
/**
|
3 |
* The Template for displaying social buttons.
|
4 |
*
|
5 |
+
* @version 1.17.0
|
6 |
* @package TInvWishlist\Template
|
7 |
*/
|
8 |
|
19 |
<?php foreach ( $social as $social_name => $social_url ) {
|
20 |
?>
|
21 |
<li><a href="<?php echo esc_url( $social_url ); ?>"
|
22 |
+
class="social social-<?php echo esc_attr( $social_name ) . ' ' . esc_attr( tinv_get_option( 'social', 'icon_style' ) ); ?>"
|
23 |
+
title="<?php echo( $social_titles[ $social_name ] ); ?>"><i
|
24 |
+
class="ftinvwl ftinvwl-<?php echo esc_attr( $social_name ); ?>"></i></a></li>
|
25 |
<?php } ?>
|
26 |
</ul>
|
27 |
</div>
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,11 +4,11 @@
|
|
4 |
* Plugin Name: TI WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.
|
8 |
* Requires at least: 4.7
|
9 |
-
* Tested up to: 5.
|
10 |
* WC requires at least: 2.6
|
11 |
-
* WC tested up to:
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
@@ -41,7 +41,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
|
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
-
define( 'TINVWL_FVERSION', '1.
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
4 |
* Plugin Name: TI WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.17.0
|
8 |
* Requires at least: 4.7
|
9 |
+
* Tested up to: 5.4
|
10 |
* WC requires at least: 2.6
|
11 |
+
* WC tested up to: 4.0.1
|
12 |
* Author: TemplateInvaders
|
13 |
* Author URI: https://templateinvaders.com/
|
14 |
* License: GPL-2.0+
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
+
define( 'TINVWL_FVERSION', '1.17.0' );
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
views/admin/export-import-settings.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The Template for displaying Export/Import settings content.
|
4 |
+
*
|
5 |
+
* @since 1.17.0
|
6 |
+
* @package TInvWishlist\Admin\Template
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly.
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
14 |
+
<section class="tinvwl-panel w-shadow w-bg">
|
15 |
+
<div class="container-fluid">
|
16 |
+
|
17 |
+
<div class="row">
|
18 |
+
<div style="text-align: left; padding:0 45px 20px;">
|
19 |
+
<h3 style="padding: 28px 0;
|
20 |
+
margin-bottom: 30px;
|
21 |
+
border-bottom: 2px solid rgba(219,219,219,0.522);"><?php _e( 'You can import and export your TI WooCommerce Wishlist plugin settings here. ', 'ti-woocommerce-wishlist' ); ?></h3>
|
22 |
+
<p style="font-size: 1.1em"><?php _e( 'This allows you to either backup the data, or to move your settings to a new WordPress instance.', 'ti-woocommerce-wishlist' ); ?></p>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
</div>
|
26 |
+
</section>
|
27 |
+
<section class="tinvwl-panel w-shadow w-bg">
|
28 |
+
<div class="container-fluid">
|
29 |
+
<div class="row">
|
30 |
+
<div style="text-align: left; padding:0 45px 30px;">
|
31 |
+
<h2 style="padding: 28px 0;
|
32 |
+
margin-bottom: 30px;
|
33 |
+
border-bottom: 2px solid rgba(219,219,219,0.522);"><?php _e( 'Import settings', 'ti-woocommerce-wishlist' ); ?></h2>
|
34 |
+
<script>
|
35 |
+
jQuery(document).ready(function ($) {
|
36 |
+
$('.js-tinvwl-upload-toggle').click(function () {
|
37 |
+
$('#js-tinvwl-upload-file').toggle();
|
38 |
+
$('#js-tinvwl-paste-json').toggle();
|
39 |
+
});
|
40 |
+
});
|
41 |
+
|
42 |
+
</script>
|
43 |
+
<form action="options.php" method="post" enctype="multipart/form-data">
|
44 |
+
<input type="hidden" name="action" value="tinvwl_import_settings"/>
|
45 |
+
|
46 |
+
<div id="js-tinvwl-upload-file">
|
47 |
+
<p><?php _e( 'Please upload the exported json file or', 'ti-woocommerce-wishlist' ); ?>
|
48 |
+
<span style="cursor: pointer;color: #ff5739;text-decoration: underline;"
|
49 |
+
class="js-tinvwl-upload-toggle"><?php _e( 'paste the entire json', 'ti-woocommerce-wishlist' ); ?></span>.
|
50 |
+
</p>
|
51 |
+
<div style="margin-bottom: 20px;"><input type="file" name="settings-file"/></div>
|
52 |
+
</div>
|
53 |
+
<div id="js-tinvwl-paste-json" style="display:none;">
|
54 |
+
<p><?php _e( 'Please paste the exported json file or', 'ti-woocommerce-wishlist' ); ?>
|
55 |
+
<span style="cursor: pointer;color: #ff5739;text-decoration: underline;"
|
56 |
+
class="js-tinvwl-upload-toggle"><?php _e( 'upload the exported file', 'ti-woocommerce-wishlist' ); ?></span>.
|
57 |
+
</p>
|
58 |
+
<div style="margin-bottom: 20px;"><textarea name="settings-json"
|
59 |
+
style="width: 100%;height: 200px;"></textarea></div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div>
|
63 |
+
<input type="submit" name="setup" class="tinvwl-btn"
|
64 |
+
value="<?php _e( 'Import', 'ti-woocommerce-wishlist' ); ?>"/>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
</form>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</section>
|
72 |
+
<section class="tinvwl-panel w-shadow w-bg">
|
73 |
+
<div class="container-fluid">
|
74 |
+
<div class="row">
|
75 |
+
<div style="text-align: left; padding:0 45px 30px;">
|
76 |
+
<h2 style="padding: 28px 0;
|
77 |
+
margin-bottom: 30px;
|
78 |
+
border-bottom: 2px solid rgba(219,219,219,0.522);"><?php _e( 'Export settings', 'ti-woocommerce-wishlist' ); ?></h2>
|
79 |
+
<form action="options.php" method="post">
|
80 |
+
<input type="hidden" name="action" value="tinvwl_export_settings"/>
|
81 |
+
|
82 |
+
<p><?php _e( 'Download the entire plugin configuration.', 'ti-woocommerce-wishlist' ); ?></p>
|
83 |
+
|
84 |
+
<div>
|
85 |
+
<input type="submit" name="setup" class="tinvwl-btn"
|
86 |
+
value="<?php _e( 'Export', 'ti-woocommerce-wishlist' ); ?>"/>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
</form>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</section>
|