Pixel Caffeine - Version 2.0.2

Version Description

  • 2018-02-01 =
  • Add - Useful hooks for the feed items
  • Enhancement - Translate shortcodes in the product descriptions inside the feed
  • Fix - Invalid characters in feed
  • Fix - Strip HTML tags in the product description inside the feed
  • Fix - Woo query in the product feed fetched wrong products
  • Fix - Use short description/excerpt if no product description
  • Fix - Fatal error when only EDD is enabled
  • Fix - Include quantity in value parameter of AddToCart
  • Fix - NaN in value parameter when add to cart from WooCommerce
  • Fix - AddToCart tracking when using [product_page] shortcode
  • Fix - AddToCart tracking when using [add_to_cart] shortcode
Download this release

Release Info

Developer antoscarface
Plugin Icon 128x128 Pixel Caffeine
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

build/frontend.js CHANGED
@@ -1 +1 @@
1
- !function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=27)}([function(t,n,e){"use strict";var r=Array.isArray;t.exports=r},function(t,n,e){"use strict";function r(t,n){return o(t)?t:c(t,n)?[t]:i(u(t))}var o=e(0),c=e(33),i=e(38),u=e(67);t.exports=r},function(t,n,e){"use strict";var r=e(11),o=r.Symbol;t.exports=o},function(t,n,e){"use strict";var r=e(13),o=r(Object,"create");t.exports=o},function(t,n,e){"use strict";function r(t,n){for(var e=t.length;e--;)if(o(t[e][0],n))return e;return-1}var o=e(17);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=t.__data__;return o(n)?e["string"==typeof n?"string":"hash"]:e.map}var o=e(63);t.exports=r},,,,function(t,n,e){"use strict";function r(t){return"symbol"==(void 0===t?"undefined":o(t))||i(t)&&c(t)==u}var o="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},c=e(10),i=e(12),u="[object Symbol]";t.exports=r},function(t,n,e){"use strict";function r(t){return null==t?void 0===t?a:u:s&&s in Object(t)?c(t):i(t)}var o=e(2),c=e(36),i=e(37),u="[object Null]",a="[object Undefined]",s=o?o.toStringTag:void 0;t.exports=r},function(t,n,e){"use strict";var r="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},o=e(34),c="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,i=o||c||Function("return this")();t.exports=i},function(t,n,e){"use strict";function r(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))}var o="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.exports=r},function(t,n,e){"use strict";function r(t,n){var e=c(t,n);return o(e)?e:void 0}var o=e(45),c=e(50);t.exports=r},function(t,n,e){"use strict";function r(t){var n=void 0===t?"undefined":o(t);return null!=t&&("object"==n||"function"==n)}var o="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.exports=r},function(t,n,e){"use strict";function r(t){if("string"==typeof t||o(t))return t;var n=t+"";return"0"==n&&1/t==-c?"-0":n}var o=e(9),c=1/0;t.exports=r},,function(t,n,e){"use strict";function r(t,n){return t===n||t!==t&&n!==n}t.exports=r},function(t,n,e){"use strict";var r=e(13),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,n,e){"use strict";function r(t,n){return!!(n=null==n?o:n)&&("number"==typeof t||c.test(t))&&t>-1&&t%1==0&&t<n}var o=9007199254740991,c=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,n,e){"use strict";var r=e(76),o=e(12),c=Object.prototype,i=c.hasOwnProperty,u=c.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return o(t)&&i.call(t,"callee")&&!u.call(t,"callee")};t.exports=a},,,,,,,function(t,n,e){t.exports=e(28)},function(t,n,e){"use strict";var r=e(29),o=function(t){return t&&t.__esModule?t:{default:t}}(r);jQuery(document).ready(function(t){var n=(t(document.body),function(t){return aepc_extend_args(t)}),e=function(t,n){n?setTimeout(t,1e3*n):t()};aepc_pixel_events.standard_events&&t.each(aepc_pixel_events.standard_events,function(r,o){t.each(o,function(t,o){e(function(){o.params?fbq("track",r,n(o.params)):fbq("track",r)},o.delay)})}),void 0!==aepc_pixel_events.custom_events&&t.each(aepc_pixel_events.custom_events,function(r,o){t.each(o,function(t,o){e(function(){fbq("trackCustom",r,n(o.params))},o.delay)})}),void 0!==aepc_pixel_events.css_events&&t.each(aepc_pixel_events.css_events,function(e,r){t.each(r,function(r,o){t(e).on("click",function(){fbq(o.trackType,o.trackName,n(o.trackParams))})})}),void 0!==aepc_pixel_events.link_clicks&&t.each(aepc_pixel_events.link_clicks,function(e,r){e=e.replace(/\*/g,"[^/]+"),t("a").filter(function(){var n=t(this).attr("href");return void 0!==n&&n.match(new RegExp(e))}).on("click",function(e){t.each(r,function(t,e){fbq(e.trackType,e.trackName,n(e.trackParams))})})}),t(".product_type_simple.add_to_cart_button").on("click",function(e){if("no"===aepc_pixel.enable_addtocart)return e;var r=t(this),c=r.closest("li.product"),i=r.data("product_sku")?r.data("product_sku"):r.data("product_id");fbq("track","AddToCart",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find("h3, .woocommerce-loop-product__title").text(),content_category:c.find("span[data-content_category]").data("content_category"),value:parseFloat(c.find("span.amount").clone().children().remove().end().text()),currency:woocommerce_params.currency},aepc_pixel.allowed_params.AddToCart)))}),t(".add_to_wishlist, .wl-add-to").on("click",function(e){if("no"===aepc_pixel.enable_wishlist)return e;var r=t(this),c=r.closest("li.product"),i=r.data("product_sku")?r.data("product_sku"):r.data("product_id");fbq("track","AddToWishlist",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find("h3").text(),content_category:c.find("span[data-content_category]").data("content_category"),value:parseFloat(c.find("span.amount").clone().children().remove().end().text()),currency:woocommerce_params.currency},aepc_pixel.allowed_params.AddToWishlist)))}),t("body.woocommerce-page div.product").on("click",".single_add_to_cart_button",function(e){if("yes"===aepc_pixel.enable_addtocart){var r=t(this).closest("form"),o=r.find('[name="add-to-cart"]'),c=r.find('[name="variation_id"]'),i=c.length?c.val():o.val();fbq("track","AddToCart",n(aepc_wc_add_to_cart[i]))}}).on("click",".add_to_wishlist, .wl-add-to",function(e){if("no"===aepc_pixel.enable_wishlist){var r=t(this).closest("form"),o=r.find('[name="add-to-cart"]'),c=r.find('[name="variation_id"]'),i=c.length?c.val():o.val();fbq("track","AddToWishlist",n(aepc_wc_add_to_cart[i]))}}),t("body.woocommerce-page form.checkout").on("checkout_place_order",function(t){return"no"===aepc_pixel.enable_addpaymentinfo?t:(fbq("track","AddPaymentInfo",n(aepc_add_payment_info_params)),!0)}),t(".edd_download, .edd-download").on("click",".edd-add-to-cart",function(e){if("no"===aepc_pixel.enable_addtocart)return e;var r=t(this),c=r.closest("div.edd_download, article.type-download"),i=r.data("download-sku")?r.data("download-sku"):r.data("download-id"),u=c.find('meta[itemprop="priceCurrency"]').attr("content"),a=r.data("price");if("yes"===r.data("variable-price")){var s=t(".edd_price_options"),f=s.find('input[type="radio"]:checked'),p=f.closest("li");a=p.find('meta[itemprop="price"]').attr("content"),u=p.find('meta[itemprop="priceCurrency"]').attr("content")}fbq("track","AddToCart",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find('[itemprop="name"]').first().text(),content_category:r.data("download-categories"),value:parseFloat(a),currency:u},aepc_pixel.allowed_params.AddToCart)))}),t(".edd-checkout").on("click",'form#edd_purchase_form input[type="submit"]',function(t){return"no"===aepc_pixel.enable_addpaymentinfo?t:(fbq("track","AddPaymentInfo",n(aepc_add_payment_info_params)),!0)})})},function(t,n,e){"use strict";var r=e(30),o=e(78),c=o(function(t,n){return null==t?{}:r(t,n)});t.exports=c},function(t,n,e){"use strict";function r(t,n){return o(t,n,function(n,e){return c(t,e)})}var o=e(31),c=e(73);t.exports=r},function(t,n,e){"use strict";function r(t,n,e){for(var r=-1,u=n.length,a={};++r<u;){var s=n[r],f=o(t,s);e(f,s)&&c(a,i(s,t),f)}return a}var o=e(32),c=e(70),i=e(1);t.exports=r},function(t,n,e){"use strict";function r(t,n){n=o(n,t);for(var e=0,r=n.length;null!=t&&e<r;)t=t[c(n[e++])];return e&&e==r?t:void 0}var o=e(1),c=e(15);t.exports=r},function(t,n,e){"use strict";function r(t,n){if(c(t))return!1;var e=void 0===t?"undefined":o(t);return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!i(t))||(a.test(t)||!u.test(t)||null!=n&&t in Object(n))}var o="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},c=e(0),i=e(9),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=r},function(t,n,e){"use strict";(function(n){var e="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},r="object"==(void 0===n?"undefined":e(n))&&n&&n.Object===Object&&n;t.exports=r}).call(n,e(35))},function(t,n,e){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}t.exports=r},function(t,n,e){"use strict";function r(t){var n=i.call(t,a),e=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(n?t[a]=e:delete t[a]),o}var o=e(2),c=Object.prototype,i=c.hasOwnProperty,u=c.toString,a=o?o.toStringTag:void 0;t.exports=r},function(t,n,e){"use strict";function r(t){return c.call(t)}var o=Object.prototype,c=o.toString;t.exports=r},function(t,n,e){"use strict";var r=e(39),o=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,u=r(function(t){var n=[];return o.test(t)&&n.push(""),t.replace(c,function(t,e,r,o){n.push(r?o.replace(i,"$1"):e||t)}),n});t.exports=u},function(t,n,e){"use strict";function r(t){var n=o(t,function(t){return e.size===c&&e.clear(),t}),e=n.cache;return n}var o=e(40),c=500;t.exports=r},function(t,n,e){"use strict";function r(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new TypeError(c);var e=function e(){var r=arguments,o=n?n.apply(this,r):r[0],c=e.cache;if(c.has(o))return c.get(o);var i=t.apply(this,r);return e.cache=c.set(o,i)||c,i};return e.cache=new(r.Cache||o),e}var o=e(41),c="Expected a function";r.Cache=o,t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(42),c=e(62),i=e(64),u=e(65),a=e(66);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.size=0,this.__data__={hash:new o,map:new(i||c),string:new o}}var o=e(43),c=e(55),i=e(61);t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(44),c=e(51),i=e(52),u=e(53),a=e(54);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.__data__=o?o(null):{},this.size=0}var o=e(3);t.exports=r},function(t,n,e){"use strict";function r(t){return!(!i(t)||c(t))&&(o(t)?y:s).test(u(t))}var o=e(46),c=e(47),i=e(14),u=e(49),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,f=Function.prototype,p=Object.prototype,l=f.toString,d=p.hasOwnProperty,y=RegExp("^"+l.call(d).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,n,e){"use strict";function r(t){if(!c(t))return!1;var n=o(t);return n==u||n==a||n==i||n==s}var o=e(10),c=e(14),i="[object AsyncFunction]",u="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";t.exports=r},function(t,n,e){"use strict";function r(t){return!!c&&c in t}var o=e(48),c=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,n,e){"use strict";var r=e(11),o=r["__core-js_shared__"];t.exports=o},function(t,n,e){"use strict";function r(t){if(null!=t){try{return c.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var o=Function.prototype,c=o.toString;t.exports=r},function(t,n,e){"use strict";function r(t,n){return null==t?void 0:t[n]}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__;if(o){var e=n[t];return e===c?void 0:e}return u.call(n,t)?n[t]:void 0}var o=e(3),c="__lodash_hash_undefined__",i=Object.prototype,u=i.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__;return o?void 0!==n[t]:i.call(n,t)}var o=e(3),c=Object.prototype,i=c.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=o&&void 0===n?c:n,this}var o=e(3),c="__lodash_hash_undefined__";t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(56),c=e(57),i=e(58),u=e(59),a=e(60);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.__data__=[],this.size=0}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__,e=o(n,t);return!(e<0)&&(e==n.length-1?n.pop():i.call(n,e,1),--this.size,!0)}var o=e(4),c=Array.prototype,i=c.splice;t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__,e=o(n,t);return e<0?void 0:n[e][1]}var o=e(4);t.exports=r},function(t,n,e){"use strict";function r(t){return o(this.__data__,t)>-1}var o=e(4);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=this.__data__,r=o(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this}var o=e(4);t.exports=r},function(t,n,e){"use strict";var r=e(13),o=e(11),c=r(o,"Map");t.exports=c},function(t,n,e){"use strict";function r(t){var n=o(this,t).delete(t);return this.size-=n?1:0,n}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){var n=void 0===t?"undefined":o(t);return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}var o="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.exports=r},function(t,n,e){"use strict";function r(t){return o(this,t).get(t)}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){return o(this,t).has(t)}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=o(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){return null==t?"":o(t)}var o=e(68);t.exports=r},function(t,n,e){"use strict";function r(t){if("string"==typeof t)return t;if(i(t))return c(t,r)+"";if(u(t))return f?f.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}var o=e(2),c=e(69),i=e(0),u=e(9),a=1/0,s=o?o.prototype:void 0,f=s?s.toString:void 0;t.exports=r},function(t,n,e){"use strict";function r(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}t.exports=r},function(t,n,e){"use strict";function r(t,n,e,r){if(!u(t))return t;n=c(n,t);for(var s=-1,f=n.length,p=f-1,l=t;null!=l&&++s<f;){var d=a(n[s]),y=e;if(s!=p){var v=l[d];y=r?r(v,d,l):void 0,void 0===y&&(y=u(v)?v:i(n[s+1])?[]:{})}o(l,d,y),l=l[d]}return t}var o=e(71),c=e(1),i=e(19),u=e(14),a=e(15);t.exports=r},function(t,n,e){"use strict";function r(t,n,e){var r=t[n];u.call(t,n)&&c(r,e)&&(void 0!==e||n in t)||o(t,n,e)}var o=e(72),c=e(17),i=Object.prototype,u=i.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){"__proto__"==n&&o?o(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}var o=e(18);t.exports=r},function(t,n,e){"use strict";function r(t,n){return null!=t&&c(t,n,o)}var o=e(74),c=e(75);t.exports=r},function(t,n,e){"use strict";function r(t,n){return null!=t&&n in Object(t)}t.exports=r},function(t,n,e){"use strict";function r(t,n,e){n=o(n,t);for(var r=-1,f=n.length,p=!1;++r<f;){var l=s(n[r]);if(!(p=null!=t&&e(t,l)))break;t=t[l]}return p||++r!=f?p:!!(f=null==t?0:t.length)&&a(f)&&u(l,f)&&(i(t)||c(t))}var o=e(1),c=e(20),i=e(0),u=e(19),a=e(77),s=e(15);t.exports=r},function(t,n,e){"use strict";function r(t){return c(t)&&o(t)==i}var o=e(10),c=e(12),i="[object Arguments]";t.exports=r},function(t,n,e){"use strict";function r(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}var o=9007199254740991;t.exports=r},function(t,n,e){"use strict";function r(t){return i(c(t,void 0,o),t+"")}var o=e(79),c=e(83),i=e(85);t.exports=r},function(t,n,e){"use strict";function r(t){return(null==t?0:t.length)?o(t,1):[]}var o=e(80);t.exports=r},function(t,n,e){"use strict";function r(t,n,e,i,u){var a=-1,s=t.length;for(e||(e=c),u||(u=[]);++a<s;){var f=t[a];n>0&&e(f)?n>1?r(f,n-1,e,i,u):o(u,f):i||(u[u.length]=f)}return u}var o=e(81),c=e(82);t.exports=r},function(t,n,e){"use strict";function r(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}t.exports=r},function(t,n,e){"use strict";function r(t){return i(t)||c(t)||!!(u&&t&&t[u])}var o=e(2),c=e(20),i=e(0),u=o?o.isConcatSpreadable:void 0;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){return n=c(void 0===n?t.length-1:n,0),function(){for(var r=arguments,i=-1,u=c(r.length-n,0),a=Array(u);++i<u;)a[i]=r[n+i];i=-1;for(var s=Array(n+1);++i<n;)s[i]=r[i];return s[n]=e(a),o(t,this,s)}}var o=e(84),c=Math.max;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}t.exports=r},function(t,n,e){"use strict";var r=e(86),o=e(89),c=o(r);t.exports=c},function(t,n,e){"use strict";var r=e(87),o=e(18),c=e(88),i=o?function(t,n){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(n),writable:!0})}:c;t.exports=i},function(t,n,e){"use strict";function r(t){return function(){return t}}t.exports=r},function(t,n,e){"use strict";function r(t){return t}t.exports=r},function(t,n,e){"use strict";function r(t){var n=0,e=0;return function(){var r=i(),u=c-(r-e);if(e=r,u>0){if(++n>=o)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}var o=800,c=16,i=Date.now;t.exports=r}]);
1
+ !function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var e={};n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=27)}([function(t,n,e){"use strict";var r=Array.isArray;t.exports=r},function(t,n,e){"use strict";function r(t,n){return o(t)?t:c(t,n)?[t]:i(u(t))}var o=e(0),c=e(33),i=e(38),u=e(67);t.exports=r},function(t,n,e){"use strict";var r=e(11),o=r.Symbol;t.exports=o},function(t,n,e){"use strict";var r=e(13),o=r(Object,"create");t.exports=o},function(t,n,e){"use strict";function r(t,n){for(var e=t.length;e--;)if(o(t[e][0],n))return e;return-1}var o=e(17);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=t.__data__;return o(n)?e["string"==typeof n?"string":"hash"]:e.map}var o=e(63);t.exports=r},,,,function(t,n,e){"use strict";function r(t){return"symbol"==(void 0===t?"undefined":o(t))||i(t)&&c(t)==u}var o="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},c=e(10),i=e(12),u="[object Symbol]";t.exports=r},function(t,n,e){"use strict";function r(t){return null==t?void 0===t?a:u:s&&s in Object(t)?c(t):i(t)}var o=e(2),c=e(36),i=e(37),u="[object Null]",a="[object Undefined]",s=o?o.toStringTag:void 0;t.exports=r},function(t,n,e){"use strict";var r="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},o=e(34),c="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,i=o||c||Function("return this")();t.exports=i},function(t,n,e){"use strict";function r(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))}var o="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.exports=r},function(t,n,e){"use strict";function r(t,n){var e=c(t,n);return o(e)?e:void 0}var o=e(45),c=e(50);t.exports=r},function(t,n,e){"use strict";function r(t){var n=void 0===t?"undefined":o(t);return null!=t&&("object"==n||"function"==n)}var o="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.exports=r},function(t,n,e){"use strict";function r(t){if("string"==typeof t||o(t))return t;var n=t+"";return"0"==n&&1/t==-c?"-0":n}var o=e(9),c=1/0;t.exports=r},,function(t,n,e){"use strict";function r(t,n){return t===n||t!==t&&n!==n}t.exports=r},function(t,n,e){"use strict";var r=e(13),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,n,e){"use strict";function r(t,n){return!!(n=null==n?o:n)&&("number"==typeof t||c.test(t))&&t>-1&&t%1==0&&t<n}var o=9007199254740991,c=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,n,e){"use strict";var r=e(76),o=e(12),c=Object.prototype,i=c.hasOwnProperty,u=c.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return o(t)&&i.call(t,"callee")&&!u.call(t,"callee")};t.exports=a},,,,,,,function(t,n,e){t.exports=e(28)},function(t,n,e){"use strict";var r=e(29),o=function(t){return t&&t.__esModule?t:{default:t}}(r);jQuery(document).ready(function(t){var n=(t(document.body),function(t){return aepc_extend_args(t)}),e=function(t,n){n?setTimeout(t,1e3*n):t()};aepc_pixel_events.standard_events&&t.each(aepc_pixel_events.standard_events,function(r,o){t.each(o,function(t,o){e(function(){o.params?fbq("track",r,n(o.params)):fbq("track",r)},o.delay)})}),void 0!==aepc_pixel_events.custom_events&&t.each(aepc_pixel_events.custom_events,function(r,o){t.each(o,function(t,o){e(function(){fbq("trackCustom",r,n(o.params))},o.delay)})}),void 0!==aepc_pixel_events.css_events&&t.each(aepc_pixel_events.css_events,function(e,r){t.each(r,function(r,o){t(e).on("click",function(){fbq(o.trackType,o.trackName,n(o.trackParams))})})}),void 0!==aepc_pixel_events.link_clicks&&t.each(aepc_pixel_events.link_clicks,function(e,r){e=e.replace(/\*/g,"[^/]+"),t("a").filter(function(){var n=t(this).attr("href");return void 0!==n&&n.match(new RegExp(e))}).on("click",function(e){t.each(r,function(t,e){fbq(e.trackType,e.trackName,n(e.trackParams))})})}),t(".product_type_simple.add_to_cart_button").on("click",function(e){if("no"===aepc_pixel.enable_addtocart)return e;var r=t(this),c=r.closest(".product"),i=r.data("product_sku")?r.data("product_sku"):r.data("product_id"),u=c.find('input[name="quantity"]').length?c.find('input[name="quantity"]').val():1;fbq("track","AddToCart",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find("h3, .woocommerce-loop-product__title").text(),content_category:c.find("span[data-content_category]").data("content_category"),value:parseFloat(c.find("span.amount:last").clone().children().remove().end().text())*u,currency:woocommerce_params.currency},aepc_pixel.allowed_params.AddToCart)))}),t(".add_to_wishlist, .wl-add-to").on("click",function(e){if("no"===aepc_pixel.enable_wishlist)return e;var r=t(this),c=r.closest("li.product"),i=r.data("product_sku")?r.data("product_sku"):r.data("product_id");fbq("track","AddToWishlist",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find("h3").text(),content_category:c.find("span[data-content_category]").data("content_category"),value:parseFloat(c.find("span.amount:last").clone().children().remove().end().text()),currency:woocommerce_params.currency},aepc_pixel.allowed_params.AddToWishlist)))}),t(".woocommerce div.product").on("click",".single_add_to_cart_button",function(e){if("yes"===aepc_pixel.enable_addtocart){var r=t(this).closest("form"),o=r.find('[name="add-to-cart"]'),c=r.find('[name="variation_id"]'),i=c.length?c.val():o.val(),u=aepc_wc_add_to_cart[i],a=r.find('input[name="quantity"]').length?r.find('input[name="quantity"]').val():1;u.hasOwnProperty("value")&&(u.value*=a),fbq("track","AddToCart",n(u))}}).on("click",".add_to_wishlist, .wl-add-to",function(e){if("no"===aepc_pixel.enable_wishlist){var r=t(this).closest("form"),o=r.find('[name="add-to-cart"]'),c=r.find('[name="variation_id"]'),i=c.length?c.val():o.val();fbq("track","AddToWishlist",n(aepc_wc_add_to_cart[i]))}}),t("body.woocommerce-page form.checkout").on("checkout_place_order",function(t){return"no"===aepc_pixel.enable_addpaymentinfo?t:(fbq("track","AddPaymentInfo",n(aepc_add_payment_info_params)),!0)}),t(".edd_download, .edd-download").on("click",".edd-add-to-cart",function(e){if("no"===aepc_pixel.enable_addtocart)return e;var r=t(this),c=r.closest("div.edd_download, article.type-download"),i=r.data("download-sku")?r.data("download-sku"):r.data("download-id"),u=c.find('meta[itemprop="priceCurrency"]').attr("content"),a=r.data("price");if("yes"===r.data("variable-price")){var s=t(".edd_price_options"),f=s.find('input[type="radio"]:checked'),p=f.closest("li");a=p.find('meta[itemprop="price"]').attr("content"),u=p.find('meta[itemprop="priceCurrency"]').attr("content")}fbq("track","AddToCart",n((0,o.default)({content_ids:[i],content_type:"product",content_name:c.find('[itemprop="name"]').first().text(),content_category:r.data("download-categories"),value:parseFloat(a),currency:u},aepc_pixel.allowed_params.AddToCart)))}),t(".edd-checkout").on("click",'form#edd_purchase_form input[type="submit"]',function(t){return"no"===aepc_pixel.enable_addpaymentinfo?t:(fbq("track","AddPaymentInfo",n(aepc_add_payment_info_params)),!0)})})},function(t,n,e){"use strict";var r=e(30),o=e(78),c=o(function(t,n){return null==t?{}:r(t,n)});t.exports=c},function(t,n,e){"use strict";function r(t,n){return o(t,n,function(n,e){return c(t,e)})}var o=e(31),c=e(73);t.exports=r},function(t,n,e){"use strict";function r(t,n,e){for(var r=-1,u=n.length,a={};++r<u;){var s=n[r],f=o(t,s);e(f,s)&&c(a,i(s,t),f)}return a}var o=e(32),c=e(70),i=e(1);t.exports=r},function(t,n,e){"use strict";function r(t,n){n=o(n,t);for(var e=0,r=n.length;null!=t&&e<r;)t=t[c(n[e++])];return e&&e==r?t:void 0}var o=e(1),c=e(15);t.exports=r},function(t,n,e){"use strict";function r(t,n){if(c(t))return!1;var e=void 0===t?"undefined":o(t);return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!i(t))||(a.test(t)||!u.test(t)||null!=n&&t in Object(n))}var o="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},c=e(0),i=e(9),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=r},function(t,n,e){"use strict";(function(n){var e="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},r="object"==(void 0===n?"undefined":e(n))&&n&&n.Object===Object&&n;t.exports=r}).call(n,e(35))},function(t,n,e){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}t.exports=r},function(t,n,e){"use strict";function r(t){var n=i.call(t,a),e=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(n?t[a]=e:delete t[a]),o}var o=e(2),c=Object.prototype,i=c.hasOwnProperty,u=c.toString,a=o?o.toStringTag:void 0;t.exports=r},function(t,n,e){"use strict";function r(t){return c.call(t)}var o=Object.prototype,c=o.toString;t.exports=r},function(t,n,e){"use strict";var r=e(39),o=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,u=r(function(t){var n=[];return o.test(t)&&n.push(""),t.replace(c,function(t,e,r,o){n.push(r?o.replace(i,"$1"):e||t)}),n});t.exports=u},function(t,n,e){"use strict";function r(t){var n=o(t,function(t){return e.size===c&&e.clear(),t}),e=n.cache;return n}var o=e(40),c=500;t.exports=r},function(t,n,e){"use strict";function r(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new TypeError(c);var e=function e(){var r=arguments,o=n?n.apply(this,r):r[0],c=e.cache;if(c.has(o))return c.get(o);var i=t.apply(this,r);return e.cache=c.set(o,i)||c,i};return e.cache=new(r.Cache||o),e}var o=e(41),c="Expected a function";r.Cache=o,t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(42),c=e(62),i=e(64),u=e(65),a=e(66);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.size=0,this.__data__={hash:new o,map:new(i||c),string:new o}}var o=e(43),c=e(55),i=e(61);t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(44),c=e(51),i=e(52),u=e(53),a=e(54);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.__data__=o?o(null):{},this.size=0}var o=e(3);t.exports=r},function(t,n,e){"use strict";function r(t){return!(!i(t)||c(t))&&(o(t)?y:s).test(u(t))}var o=e(46),c=e(47),i=e(14),u=e(49),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,f=Function.prototype,p=Object.prototype,l=f.toString,d=p.hasOwnProperty,y=RegExp("^"+l.call(d).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,n,e){"use strict";function r(t){if(!c(t))return!1;var n=o(t);return n==u||n==a||n==i||n==s}var o=e(10),c=e(14),i="[object AsyncFunction]",u="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";t.exports=r},function(t,n,e){"use strict";function r(t){return!!c&&c in t}var o=e(48),c=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,n,e){"use strict";var r=e(11),o=r["__core-js_shared__"];t.exports=o},function(t,n,e){"use strict";function r(t){if(null!=t){try{return c.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var o=Function.prototype,c=o.toString;t.exports=r},function(t,n,e){"use strict";function r(t,n){return null==t?void 0:t[n]}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__;if(o){var e=n[t];return e===c?void 0:e}return u.call(n,t)?n[t]:void 0}var o=e(3),c="__lodash_hash_undefined__",i=Object.prototype,u=i.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__;return o?void 0!==n[t]:i.call(n,t)}var o=e(3),c=Object.prototype,i=c.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=o&&void 0===n?c:n,this}var o=e(3),c="__lodash_hash_undefined__";t.exports=r},function(t,n,e){"use strict";function r(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}var o=e(56),c=e(57),i=e(58),u=e(59),a=e(60);r.prototype.clear=o,r.prototype.delete=c,r.prototype.get=i,r.prototype.has=u,r.prototype.set=a,t.exports=r},function(t,n,e){"use strict";function r(){this.__data__=[],this.size=0}t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__,e=o(n,t);return!(e<0)&&(e==n.length-1?n.pop():i.call(n,e,1),--this.size,!0)}var o=e(4),c=Array.prototype,i=c.splice;t.exports=r},function(t,n,e){"use strict";function r(t){var n=this.__data__,e=o(n,t);return e<0?void 0:n[e][1]}var o=e(4);t.exports=r},function(t,n,e){"use strict";function r(t){return o(this.__data__,t)>-1}var o=e(4);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=this.__data__,r=o(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this}var o=e(4);t.exports=r},function(t,n,e){"use strict";var r=e(13),o=e(11),c=r(o,"Map");t.exports=c},function(t,n,e){"use strict";function r(t){var n=o(this,t).delete(t);return this.size-=n?1:0,n}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){var n=void 0===t?"undefined":o(t);return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}var o="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.exports=r},function(t,n,e){"use strict";function r(t){return o(this,t).get(t)}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){return o(this,t).has(t)}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t,n){var e=o(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this}var o=e(5);t.exports=r},function(t,n,e){"use strict";function r(t){return null==t?"":o(t)}var o=e(68);t.exports=r},function(t,n,e){"use strict";function r(t){if("string"==typeof t)return t;if(i(t))return c(t,r)+"";if(u(t))return f?f.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}var o=e(2),c=e(69),i=e(0),u=e(9),a=1/0,s=o?o.prototype:void 0,f=s?s.toString:void 0;t.exports=r},function(t,n,e){"use strict";function r(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}t.exports=r},function(t,n,e){"use strict";function r(t,n,e,r){if(!u(t))return t;n=c(n,t);for(var s=-1,f=n.length,p=f-1,l=t;null!=l&&++s<f;){var d=a(n[s]),y=e;if(s!=p){var v=l[d];y=r?r(v,d,l):void 0,void 0===y&&(y=u(v)?v:i(n[s+1])?[]:{})}o(l,d,y),l=l[d]}return t}var o=e(71),c=e(1),i=e(19),u=e(14),a=e(15);t.exports=r},function(t,n,e){"use strict";function r(t,n,e){var r=t[n];u.call(t,n)&&c(r,e)&&(void 0!==e||n in t)||o(t,n,e)}var o=e(72),c=e(17),i=Object.prototype,u=i.hasOwnProperty;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){"__proto__"==n&&o?o(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}var o=e(18);t.exports=r},function(t,n,e){"use strict";function r(t,n){return null!=t&&c(t,n,o)}var o=e(74),c=e(75);t.exports=r},function(t,n,e){"use strict";function r(t,n){return null!=t&&n in Object(t)}t.exports=r},function(t,n,e){"use strict";function r(t,n,e){n=o(n,t);for(var r=-1,f=n.length,p=!1;++r<f;){var l=s(n[r]);if(!(p=null!=t&&e(t,l)))break;t=t[l]}return p||++r!=f?p:!!(f=null==t?0:t.length)&&a(f)&&u(l,f)&&(i(t)||c(t))}var o=e(1),c=e(20),i=e(0),u=e(19),a=e(77),s=e(15);t.exports=r},function(t,n,e){"use strict";function r(t){return c(t)&&o(t)==i}var o=e(10),c=e(12),i="[object Arguments]";t.exports=r},function(t,n,e){"use strict";function r(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}var o=9007199254740991;t.exports=r},function(t,n,e){"use strict";function r(t){return i(c(t,void 0,o),t+"")}var o=e(79),c=e(83),i=e(85);t.exports=r},function(t,n,e){"use strict";function r(t){return(null==t?0:t.length)?o(t,1):[]}var o=e(80);t.exports=r},function(t,n,e){"use strict";function r(t,n,e,i,u){var a=-1,s=t.length;for(e||(e=c),u||(u=[]);++a<s;){var f=t[a];n>0&&e(f)?n>1?r(f,n-1,e,i,u):o(u,f):i||(u[u.length]=f)}return u}var o=e(81),c=e(82);t.exports=r},function(t,n,e){"use strict";function r(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}t.exports=r},function(t,n,e){"use strict";function r(t){return i(t)||c(t)||!!(u&&t&&t[u])}var o=e(2),c=e(20),i=e(0),u=o?o.isConcatSpreadable:void 0;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){return n=c(void 0===n?t.length-1:n,0),function(){for(var r=arguments,i=-1,u=c(r.length-n,0),a=Array(u);++i<u;)a[i]=r[n+i];i=-1;for(var s=Array(n+1);++i<n;)s[i]=r[i];return s[n]=e(a),o(t,this,s)}}var o=e(84),c=Math.max;t.exports=r},function(t,n,e){"use strict";function r(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}t.exports=r},function(t,n,e){"use strict";var r=e(86),o=e(89),c=o(r);t.exports=c},function(t,n,e){"use strict";var r=e(87),o=e(18),c=e(88),i=o?function(t,n){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(n),writable:!0})}:c;t.exports=i},function(t,n,e){"use strict";function r(t){return function(){return t}}t.exports=r},function(t,n,e){"use strict";function r(t){return t}t.exports=r},function(t,n,e){"use strict";function r(t){var n=0,e=0;return function(){var r=i(),u=c-(r-e);if(e=r,u>0){if(++n>=o)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}var o=800,c=16,i=Date.now;t.exports=r}]);
includes/admin/templates/parts/notices/fancy/product-catalog.php CHANGED
@@ -75,7 +75,7 @@ if ( ! $fb->is_logged_in() ) : ?>
75
  </div>
76
  </div>
77
 
78
- <?php elseif ( version_compare( WC()->version, AEPC_WOO_VERSION_REQUIREMENT, '<' ) ) : ?>
79
 
80
  <div class="alert alert-warning alert-fancy alert-connect" role="alert">
81
  <div class="alert-inner">
75
  </div>
76
  </div>
77
 
78
+ <?php elseif ( function_exists('WC') && version_compare( WC()->version, AEPC_WOO_VERSION_REQUIREMENT, '<' ) ) : ?>
79
 
80
  <div class="alert alert-warning alert-fancy alert-connect" role="alert">
81
  <div class="alert-inner">
includes/product-catalogs/class-feed-mapper.php CHANGED
@@ -113,7 +113,7 @@ class FeedMapper {
113
  * @throws FeedException
114
  */
115
  public function get_title() {
116
- $value = $this->item->get_title();
117
 
118
  if ( empty( $value ) ) {
119
  throw FeedException::mandatoryField( 'title', $this->item );
@@ -129,7 +129,7 @@ class FeedMapper {
129
  * @throws FeedException
130
  */
131
  public function get_description() {
132
- $value = $this->item->get_description();
133
 
134
  if ( empty( $value ) ) {
135
  throw FeedException::mandatoryField( 'description', $this->item );
@@ -163,7 +163,8 @@ class FeedMapper {
163
  * @throws FeedException
164
  */
165
  public function get_image_url() {
166
- $value = set_url_scheme( $this->item->get_image_url(), array( 'http', 'https' ) );
 
167
 
168
  if ( empty( $value ) ) {
169
  throw FeedException::mandatoryField( 'image_link', $this->item );
@@ -206,7 +207,7 @@ class FeedMapper {
206
  * @throws FeedException
207
  */
208
  public function get_google_category() {
209
- $cat = $this->item->get_google_category();
210
 
211
  if ( empty( $cat ) ) {
212
  $cat = $this->configuration->get( Configuration::OPTION_GOOGLE_CATEGORY );
113
  * @throws FeedException
114
  */
115
  public function get_title() {
116
+ $value = apply_filters( 'aepc_feed_item_title', $this->item->get_title(), $this );
117
 
118
  if ( empty( $value ) ) {
119
  throw FeedException::mandatoryField( 'title', $this->item );
129
  * @throws FeedException
130
  */
131
  public function get_description() {
132
+ $value = apply_filters( 'aepc_feed_item_description', $this->item->get_description(), $this );
133
 
134
  if ( empty( $value ) ) {
135
  throw FeedException::mandatoryField( 'description', $this->item );
163
  * @throws FeedException
164
  */
165
  public function get_image_url() {
166
+ $image_link = set_url_scheme( $this->item->get_image_url(), array( 'http', 'https' ) );
167
+ $value = apply_filters( 'aepc_feed_item_image_link', $image_link, $this );
168
 
169
  if ( empty( $value ) ) {
170
  throw FeedException::mandatoryField( 'image_link', $this->item );
207
  * @throws FeedException
208
  */
209
  public function get_google_category() {
210
+ $cat = apply_filters( 'aepc_feed_item_google_category', $this->item->get_google_category(), $this );
211
 
212
  if ( empty( $cat ) ) {
213
  $cat = $this->configuration->get( Configuration::OPTION_GOOGLE_CATEGORY );
includes/product-catalogs/feed/class-xml-writer.php CHANGED
@@ -147,7 +147,7 @@ class XMLWriter implements WriterInterface {
147
  $required_fields = array(
148
  'g:id' => $item->get_id(),
149
  'g:title' => $item->get_title(),
150
- 'g:description' => $item->get_description(),
151
  'g:link' => $item->get_link(),
152
  'g:brand' => $item->get_brand(),
153
  'g:condition' => $item->get_condition(),
@@ -158,7 +158,7 @@ class XMLWriter implements WriterInterface {
158
  $optional_fields = array(
159
  'g:checkout_url' => $item->get_checkout_url(),
160
  'g:item_group_id' => $item->get_item_group_id(),
161
- 'g:short_description' => $item->get_short_description(),
162
  'g:image_link' => $item->get_image_url(),
163
  'g:sale_price' => $item->get_sale_price(),
164
  'g:sale_price_effective_date' => $item->get_sale_price_effective_date(),
@@ -189,6 +189,7 @@ class XMLWriter implements WriterInterface {
189
 
190
  foreach ( $fields as $key => $value ) {
191
  $param = $entry->appendChild( $this->feedDOM->createElement( $key ) );
 
192
 
193
  if ( in_array( $key, $cdata_fields ) ) {
194
  $param->appendChild( $this->feedDOM->createCDATASection( $value ) );
@@ -407,4 +408,68 @@ class XMLWriter implements WriterInterface {
407
  $this->filesystem = $filesystem;
408
  }
409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  }
147
  $required_fields = array(
148
  'g:id' => $item->get_id(),
149
  'g:title' => $item->get_title(),
150
+ 'g:description' => $this->sanitize_content( $item->get_description() ),
151
  'g:link' => $item->get_link(),
152
  'g:brand' => $item->get_brand(),
153
  'g:condition' => $item->get_condition(),
158
  $optional_fields = array(
159
  'g:checkout_url' => $item->get_checkout_url(),
160
  'g:item_group_id' => $item->get_item_group_id(),
161
+ 'g:short_description' => $this->sanitize_content( $item->get_short_description() ),
162
  'g:image_link' => $item->get_image_url(),
163
  'g:sale_price' => $item->get_sale_price(),
164
  'g:sale_price_effective_date' => $item->get_sale_price_effective_date(),
189
 
190
  foreach ( $fields as $key => $value ) {
191
  $param = $entry->appendChild( $this->feedDOM->createElement( $key ) );
192
+ $value = $this->sanitizeXML($value);
193
 
194
  if ( in_array( $key, $cdata_fields ) ) {
195
  $param->appendChild( $this->feedDOM->createCDATASection( $value ) );
408
  $this->filesystem = $filesystem;
409
  }
410
 
411
+ /**
412
+ * Translate shortcodes and strip all HTML tags
413
+ *
414
+ * @param $content
415
+ *
416
+ * @return string
417
+ */
418
+ protected function sanitize_content( $content ) {
419
+ $content = do_shortcode( $content );
420
+ $content = wp_strip_all_tags( $content );
421
+
422
+ return $content;
423
+ }
424
+
425
+ /**
426
+ * Removes invalid characters from a UTF-8 XML string
427
+ *
428
+ * @access public
429
+ * @param string a XML string potentially containing invalid characters
430
+ * @return string
431
+ */
432
+ protected function sanitizeXML($string) {
433
+ if (!empty($string))
434
+ {
435
+ $regex = '/(
436
+ [\xC0-\xC1] # Invalid UTF-8 Bytes
437
+ | [\xF5-\xFF] # Invalid UTF-8 Bytes
438
+ | \xE0[\x80-\x9F] # Overlong encoding of prior code point
439
+ | \xF0[\x80-\x8F] # Overlong encoding of prior code point
440
+ | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start
441
+ | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start
442
+ | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start
443
+ | (?<=[\x0-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle
444
+ | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]|[\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
445
+ | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence
446
+ | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence
447
+ | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2)
448
+ )/x';
449
+ $string = preg_replace($regex, '', $string);
450
+
451
+ $result = "";
452
+ $length = strlen($string);
453
+ for ($i=0; $i < $length; $i++)
454
+ {
455
+ $current = ord($string{$i});
456
+ if (($current == 0x9) ||
457
+ ($current == 0xA) ||
458
+ ($current == 0xD) ||
459
+ (($current >= 0x20) && ($current <= 0xD7FF)) ||
460
+ (($current >= 0xE000) && ($current <= 0xFFFD)) ||
461
+ (($current >= 0x10000) && ($current <= 0x10FFFF)))
462
+ {
463
+ $result .= chr($current);
464
+ }
465
+ else
466
+ {
467
+ $result .= " "; // use this to replace them with spaces
468
+ }
469
+ }
470
+ $string = $result;
471
+ }
472
+ return $string;
473
+ }
474
+
475
  }
includes/supports/class-aepc-edd-addon-support.php CHANGED
@@ -372,7 +372,7 @@ class AEPC_Edd_Addon_Support extends AEPC_Addon_Factory implements ECommerceAddO
372
  // Backwards helper variables
373
  $product_id = $product->get_ID();
374
  $product_slug = $product->post_name;
375
- $product_description = $product->post_content;
376
  $product_price = ( $price_id = edd_get_default_variable_price( $product_id ) ) !== false ? edd_get_price_option_amount( $product_id, $price_id ) : $product->get_price();
377
 
378
  $product_item
372
  // Backwards helper variables
373
  $product_id = $product->get_ID();
374
  $product_slug = $product->post_name;
375
+ $product_description = $product->post_content ?: $product->post_excerpt;
376
  $product_price = ( $price_id = edd_get_default_variable_price( $product_id ) ) !== false ? edd_get_price_option_amount( $product_id, $price_id ) : $product->get_price();
377
 
378
  $product_item
includes/supports/class-aepc-woocommerce-addon-support.php CHANGED
@@ -52,6 +52,21 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
52
  */
53
  protected $events_support = array( 'ViewContent', 'AddToCart', 'Purchase', 'InitiateCheckout', 'AddPaymentInfo', 'CompleteRegistration' );
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * Method where set all necessary hooks launched from 'init' action
57
  */
@@ -129,37 +144,44 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
129
  * product is variable there are also info of all variations
130
  */
131
  public function register_add_to_cart_params() {
132
- if ( ! is_product() ) {
 
 
 
 
 
 
 
 
 
 
133
  return;
134
  }
135
 
136
  $args = array();
137
- $product = wc_get_product();
138
 
139
- if ( $product ) {
140
- $product_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $product->id;
141
- $args[ $product_id ] = AEPC_Track::check_event_parameters( 'AddToCart', array(
 
 
 
 
 
 
 
 
 
 
142
  'content_type' => 'product',
143
- 'content_ids' => array( $this->maybe_sku( $product_id ) ),
144
  'content_category' => AEPC_Pixel_Scripts::content_category_list( $product_id ),
145
- 'value' => floatval( $product->get_price() ),
146
  'currency' => get_woocommerce_currency()
147
  ) );
148
-
149
- foreach ( $product->get_children() as $child_id ) {
150
- $variation = wc_get_product( $child_id );
151
- $variation_id = method_exists( $variation, 'get_id' ) ? $variation->get_id() : $variation->id;
152
- $args[ $variation_id ] = AEPC_Track::check_event_parameters( 'AddToCart', array(
153
- 'content_type' => 'product',
154
- 'content_ids' => array( $this->maybe_sku( $variation_id ) ),
155
- 'content_category' => AEPC_Pixel_Scripts::content_category_list( $product_id ),
156
- 'value' => floatval( $variation->get_price() ),
157
- 'currency' => get_woocommerce_currency()
158
- ) );
159
- }
160
-
161
- wp_localize_script( 'aepc-pixel-events', 'aepc_wc_add_to_cart', $args );
162
  }
 
 
163
  }
164
 
165
  /**
@@ -444,6 +466,11 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
444
  $product_additional_image_ids = array_map( 'wp_get_attachment_url', method_exists( $product, 'get_gallery_image_ids' ) ? $product->get_gallery_image_ids() : $product->get_gallery_attachment_ids() );
445
  $product_parent_id = method_exists( $product, 'get_parent_id' ) ? $product->get_parent_id() : ( isset( $product->parent->id ) ? $product->parent->id : 0 );
446
 
 
 
 
 
 
447
  if ( method_exists( $product, 'get_date_on_sale_from' ) && method_exists( $product, 'get_date_on_sale_to' ) ) {
448
  $product_date_on_sale_from = $product->get_date_on_sale_from();
449
  $product_date_on_sale_to = $product->get_date_on_sale_to();
@@ -521,6 +548,47 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
521
  return $product_item;
522
  }
523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  /**
525
  * Get the arguments of the items query
526
  *
@@ -531,69 +599,46 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
531
  */
532
  protected function query_items_args( $filter, ProductCatalogManager $product_catalog ) {
533
  $products_query = array(
534
- 'post_type' => 'product',
535
- 'post_status' => array( 'publish' ),
536
- 'posts_per_page' => $product_catalog->configuration()->get( Configuration::OPTION_CHUNK_LIMIT ),
537
- 'orderby' => 'ID',
538
- 'order' => 'ASC',
539
- 'tax_query' => array(),
540
- 'meta_query' => array(),
 
541
  );
542
 
543
  // Collect the product types to use in the query
544
- $product_types = array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_TYPE ) );
545
- if ( empty( $product_types ) ) {
546
- $product_types = array_merge( array_keys( wc_get_product_types() ) );
547
- }
548
- if ( in_array( 'variable', $product_types ) && ! $product_catalog->configuration()->get( Configuration::OPTION_NO_VARIATIONS ) ) {
549
- $product_types[] = 'variation';
550
- }
551
-
552
- // Adjust the query in base of product types to include in the query
553
- if ( in_array( 'variation', $product_types ) ) {
554
- $products_query['post_type'] = array( 'product_variation', 'product' );
555
- $products_query['tax_query'][] = array(
556
- 'relation' => 'OR',
557
- array(
558
- 'taxonomy' => 'product_type',
559
- 'field' => 'slug',
560
- 'terms' => $product_types,
561
- ),
562
- array(
563
- 'taxonomy' => 'product_type',
564
- 'field' => 'id',
565
- 'operator' => 'NOT EXISTS',
566
- ),
567
- );
568
  } else {
569
- $products_query['post_type'] = 'product';
570
- $products_query['tax_query'][] = array(
571
- 'taxonomy' => 'product_type',
572
- 'field' => 'slug',
573
- 'terms' => $product_types,
574
- );
575
  }
576
 
577
  $filter_cat = array_map( 'intval', array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_CATEGORY ) ) );
578
  if ( ! empty( $filter_cat ) ) {
579
- $products_query['tax_query'][] = array(
580
- 'taxonomy' => 'product_cat',
581
- 'field' => 'term_id',
582
- 'terms' => $filter_cat,
583
- );
584
  }
585
 
586
  $filter_tag = array_map( 'intval', array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_TAG ) ) );
587
  if ( ! empty( $filter_tag ) ) {
588
- $products_query['tax_query'][] = array(
589
- 'taxonomy' => 'product_tag',
590
- 'field' => 'term_id',
591
- 'terms' => $filter_tag,
592
- );
593
  }
594
 
595
  if ( $product_catalog->configuration()->get( Configuration::OPTION_FILTER_ON_SALE ) ) {
596
- $products_query['post__in'] = wc_get_product_ids_on_sale();
597
  }
598
 
599
  $filter_stock = array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_STOCK ) );
@@ -606,10 +651,7 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
606
  return $stock_map[ $status ];
607
  }, $filter_stock );
608
 
609
- $products_query['meta_query'][] = array(
610
- 'key' => '_stock_status',
611
- 'value' => $filter_stock,
612
- );
613
  }
614
 
615
  return $this->filter_items_query( $filter, $products_query, $product_catalog );
@@ -626,16 +668,38 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
626
  */
627
  protected function query_items( $filter, ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) {
628
  $products_query = $this->query_items_args( $filter, $product_catalog );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
 
630
  // Map WC objects
631
- $products = new WP_Query( $products_query );
632
- $products = array_map( 'wc_get_product', $products->posts );
 
 
633
 
634
  // Map the product item object
635
  foreach ( $products as &$item ) {
636
  $item = $this->get_product_item( $item, $metaboxes, $product_catalog->configuration() );
637
  }
638
 
 
 
639
  return $products;
640
  }
641
 
@@ -650,35 +714,20 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
650
  * @return array
651
  */
652
  protected function filter_items_query( $filter, array $products_query, ProductCatalogManager $product_catalog ) {
 
 
653
  switch ( $filter ) {
654
 
655
  case 'not-saved' :
656
- ! isset( $products_query['meta_query'] ) && $products_query['meta_query'] = array();
657
-
658
- $products_query['meta_query'][] = array(
659
- 'key' => $this->get_feed_status_meta_key( $product_catalog ),
660
- 'compare' => 'NOT EXISTS'
661
- );
662
  break;
663
 
664
  case 'saved' :
665
- ! isset( $products_query['meta_query'] ) && $products_query['meta_query'] = array();
666
-
667
- $products_query['meta_query'][] = array(
668
- 'key' => $this->get_feed_status_meta_key( $product_catalog ),
669
- 'value' => DbProvider::FEED_STATUS_SAVED,
670
- 'compare' => '='
671
- );
672
  break;
673
 
674
  case 'edited' :
675
- ! isset( $products_query['meta_query'] ) && $products_query['meta_query'] = array();
676
-
677
- $products_query['meta_query'][] = array(
678
- 'key' => $this->get_feed_status_meta_key( $product_catalog ),
679
- 'value' => DbProvider::FEED_STATUS_EDITED,
680
- 'compare' => '='
681
- );
682
  break;
683
 
684
  }
@@ -819,11 +868,11 @@ class AEPC_Woocommerce_Addon_Support extends AEPC_Addon_Factory implements EComm
819
  $products_query = $this->query_items_args( ProductCatalogManager::FILTER_NOT_SAVED, $product_catalog );
820
 
821
  // Get only counter
822
- $products_query['posts_per_age'] = 1;
823
 
824
  // Query
825
- $products = new WP_Query( $products_query );
826
 
827
- return (bool) $products->found_posts;
828
  }
829
  }
52
  */
53
  protected $events_support = array( 'ViewContent', 'AddToCart', 'Purchase', 'InitiateCheckout', 'AddPaymentInfo', 'CompleteRegistration' );
54
 
55
+ /**
56
+ * Temporary save the product catalog for the current query, needed for the woocommerce filters
57
+ *
58
+ * @var ProductCatalogManager
59
+ */
60
+ private $_current_query_product_catalog = null;
61
+
62
+ /**
63
+ * Save temporary the product query in order to access to special parameters (like feed status key)
64
+ * from the WP_Query filter
65
+ *
66
+ * @var array
67
+ */
68
+ private $_current_query = null;
69
+
70
  /**
71
  * Method where set all necessary hooks launched from 'init' action
72
  */
144
  * product is variable there are also info of all variations
145
  */
146
  public function register_add_to_cart_params() {
147
+ global $post;
148
+
149
+ if ( is_product() ) {
150
+ $product = wc_get_product();
151
+ } elseif ( ! empty( $post->post_content ) && preg_match( '/\[product_page id=["]?([0-9]+)/', $post->post_content, $matches ) ) {
152
+ $product = wc_get_product( get_post( intval( $matches[1] ) ) );
153
+ } else {
154
+ $product = null;
155
+ }
156
+
157
+ if ( empty( $product ) ) {
158
  return;
159
  }
160
 
161
  $args = array();
 
162
 
163
+ $product_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $product->id;
164
+ $args[ $product_id ] = AEPC_Track::check_event_parameters( 'AddToCart', array(
165
+ 'content_type' => 'product',
166
+ 'content_ids' => array( $this->maybe_sku( $product_id ) ),
167
+ 'content_category' => AEPC_Pixel_Scripts::content_category_list( $product_id ),
168
+ 'value' => floatval( $product->get_price() ),
169
+ 'currency' => get_woocommerce_currency()
170
+ ) );
171
+
172
+ foreach ( $product->get_children() as $child_id ) {
173
+ $variation = wc_get_product( $child_id );
174
+ $variation_id = method_exists( $variation, 'get_id' ) ? $variation->get_id() : $variation->id;
175
+ $args[ $variation_id ] = AEPC_Track::check_event_parameters( 'AddToCart', array(
176
  'content_type' => 'product',
177
+ 'content_ids' => array( $this->maybe_sku( $variation_id ) ),
178
  'content_category' => AEPC_Pixel_Scripts::content_category_list( $product_id ),
179
+ 'value' => floatval( $variation->get_price() ),
180
  'currency' => get_woocommerce_currency()
181
  ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  }
183
+
184
+ wp_localize_script( 'aepc-pixel-events', 'aepc_wc_add_to_cart', $args );
185
  }
186
 
187
  /**
466
  $product_additional_image_ids = array_map( 'wp_get_attachment_url', method_exists( $product, 'get_gallery_image_ids' ) ? $product->get_gallery_image_ids() : $product->get_gallery_attachment_ids() );
467
  $product_parent_id = method_exists( $product, 'get_parent_id' ) ? $product->get_parent_id() : ( isset( $product->parent->id ) ? $product->parent->id : 0 );
468
 
469
+ // Get excerpt if description is empty
470
+ if ( empty( $product_description ) ) {
471
+ $product_description = $product_short_description;
472
+ }
473
+
474
  if ( method_exists( $product, 'get_date_on_sale_from' ) && method_exists( $product, 'get_date_on_sale_to' ) ) {
475
  $product_date_on_sale_from = $product->get_date_on_sale_from();
476
  $product_date_on_sale_to = $product->get_date_on_sale_to();
548
  return $product_item;
549
  }
550
 
551
+ /**
552
+ * Customize the WP Query in wc_get_products
553
+ *
554
+ * @param WP_Query $wp_query
555
+ */
556
+ public function customize_wp_query( \WP_Query &$wp_query ) {
557
+ $products_query = $this->_current_query;
558
+ $product_catalog = $this->_current_query_product_catalog;
559
+
560
+ // Add meta query manually for versions before of 3.1, when no 'stock_status' was available
561
+ if ( isset( $products_query['stock_status'] ) && version_compare( WC()->version, '3.1.0', '<' ) ) {
562
+ $wp_query->query_vars['meta_query'][] = array(
563
+ 'key' => '_stock_status',
564
+ 'compare' => 'IN',
565
+ 'value' => $products_query['stock_status']
566
+ );
567
+ }
568
+
569
+ // Change compare condition in _stock_status meta query for newest WOO versions that don't allow values in a array
570
+ foreach ( $wp_query->query_vars['meta_query'] as &$query ) {
571
+ if ( $query['key'] === '_stock_status' && is_array( $query['value'] ) ) {
572
+ $query['compare'] = 'IN';
573
+ }
574
+ }
575
+
576
+ // Include variation items manually for 3.0.x version of Woo
577
+ if ( in_array( 'variation', $products_query['type'] ) && ! is_array( $wp_query->query_vars['post_type'] ) ) {
578
+ $wp_query->query_vars['post_type'] = array( 'product', 'product_variation' );
579
+ }
580
+
581
+ // Add feed status meta query
582
+ $key = $this->get_feed_status_meta_key( $product_catalog );
583
+ if ( isset( $products_query[ $key ] ) ) {
584
+ $wp_query->query_vars['meta_query'][] = array(
585
+ 'key' => $this->get_feed_status_meta_key( $product_catalog ),
586
+ 'compare' => $products_query[ $key ] ? '=' : 'NOT EXISTS',
587
+ 'value' => $products_query[ $key ]
588
+ );
589
+ }
590
+ }
591
+
592
  /**
593
  * Get the arguments of the items query
594
  *
599
  */
600
  protected function query_items_args( $filter, ProductCatalogManager $product_catalog ) {
601
  $products_query = array(
602
+ 'status' => array( 'publish' ),
603
+ 'limit' => $product_catalog->configuration()->get( Configuration::OPTION_CHUNK_LIMIT ),
604
+ 'orderby' => 'ID',
605
+ 'order' => 'ASC',
606
+ 'category' => array(),
607
+ 'tag' => array(),
608
+ 'include' => array(),
609
+ 'exclude' => array(),
610
  );
611
 
612
  // Collect the product types to use in the query
613
+ if ( $product_types = array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_TYPE ) ) ) {
614
+ $products_query['type'] = $product_types;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  } else {
616
+ $products_query['type'] = array_merge( array_keys( wc_get_product_types() ) );
617
+ }
618
+
619
+ // Add variations if the option is disabled
620
+ if ( in_array( 'variable', $products_query['type'] ) && ! $product_catalog->configuration()->get( Configuration::OPTION_NO_VARIATIONS ) ) {
621
+ $products_query['type'][] = 'variation';
622
  }
623
 
624
  $filter_cat = array_map( 'intval', array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_CATEGORY ) ) );
625
  if ( ! empty( $filter_cat ) ) {
626
+ foreach ( $filter_cat as $cat_id ) {
627
+ $term = get_term( $cat_id );
628
+ $products_query['category'][] = $term->slug;
629
+ }
 
630
  }
631
 
632
  $filter_tag = array_map( 'intval', array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_TAG ) ) );
633
  if ( ! empty( $filter_tag ) ) {
634
+ foreach ( $filter_tag as $tag_id ) {
635
+ $term = get_term( $tag_id );
636
+ $products_query['tag'][] = $term->slug;
637
+ }
 
638
  }
639
 
640
  if ( $product_catalog->configuration()->get( Configuration::OPTION_FILTER_ON_SALE ) ) {
641
+ $products_query['include'] = wc_get_product_ids_on_sale();
642
  }
643
 
644
  $filter_stock = array_filter( (array) $product_catalog->configuration()->get( Configuration::OPTION_FILTER_BY_STOCK ) );
651
  return $stock_map[ $status ];
652
  }, $filter_stock );
653
 
654
+ $products_query['stock_status'] = $filter_stock;
 
 
 
655
  }
656
 
657
  return $this->filter_items_query( $filter, $products_query, $product_catalog );
668
  */
669
  protected function query_items( $filter, ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) {
670
  $products_query = $this->query_items_args( $filter, $product_catalog );
671
+ return $this->do_query( $products_query, $product_catalog, $metaboxes );
672
+ }
673
+
674
+ /**
675
+ * Perform the query from the array of arguments for wc_get_products()
676
+ *
677
+ * @param $products_query
678
+ * @param ProductCatalogManager $product_catalog
679
+ * @param Metaboxes $metaboxes
680
+ *
681
+ * @return AEPC_Addon_Product_Item[]
682
+ */
683
+ protected function do_query( $products_query, ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) {
684
+ $this->_current_query = $products_query;
685
+ $this->_current_query_product_catalog = $product_catalog;
686
+
687
+ // Add hook to customize the query
688
+ add_action( 'pre_get_posts', array( $this, 'customize_wp_query' ) );
689
 
690
  // Map WC objects
691
+ $products = wc_get_products( $products_query );
692
+
693
+ // Remove previous hook
694
+ remove_action( 'pre_get_posts', array( $this, 'customize_wp_query' ) );
695
 
696
  // Map the product item object
697
  foreach ( $products as &$item ) {
698
  $item = $this->get_product_item( $item, $metaboxes, $product_catalog->configuration() );
699
  }
700
 
701
+ $this->_current_query_product_catalog = null;
702
+ $this->_current_query = null;
703
  return $products;
704
  }
705
 
714
  * @return array
715
  */
716
  protected function filter_items_query( $filter, array $products_query, ProductCatalogManager $product_catalog ) {
717
+ $key = $this->get_feed_status_meta_key( $product_catalog );
718
+
719
  switch ( $filter ) {
720
 
721
  case 'not-saved' :
722
+ $products_query[ $key ] = false;
 
 
 
 
 
723
  break;
724
 
725
  case 'saved' :
726
+ $products_query[ $key ] = DbProvider::FEED_STATUS_SAVED;
 
 
 
 
 
 
727
  break;
728
 
729
  case 'edited' :
730
+ $products_query[ $key ] = DbProvider::FEED_STATUS_EDITED;
 
 
 
 
 
 
731
  break;
732
 
733
  }
868
  $products_query = $this->query_items_args( ProductCatalogManager::FILTER_NOT_SAVED, $product_catalog );
869
 
870
  // Get only counter
871
+ $products_query['limit'] = 1;
872
 
873
  // Query
874
+ $products = $this->do_query( $products_query, $product_catalog, new Metaboxes() );
875
 
876
+ return ! empty( $products );
877
  }
878
  }
languages/pixel-caffeine.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Pixel Caffeine 2.0.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pixel-caffeine\n"
7
- "POT-Creation-Date: 2018-01-11 13:46:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -22,7 +22,7 @@ msgstr ""
22
  "X-Poedit-SearchPath-0: .\n"
23
  "X-Poedit-Bookmarks: \n"
24
  "X-Textdomain-Support: yes\n"
25
- "X-Generator: grunt-wp-i18n1.0.0\n"
26
 
27
  #: includes/admin/class-aepc-admin-ajax.php:449
28
  #: includes/admin/class-aepc-admin-ca.php:837
4
  msgstr ""
5
  "Project-Id-Version: Pixel Caffeine 2.0.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pixel-caffeine\n"
7
+ "POT-Creation-Date: 2018-02-01 09:15:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
22
  "X-Poedit-SearchPath-0: .\n"
23
  "X-Poedit-Bookmarks: \n"
24
  "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n1.0.1\n"
26
 
27
  #: includes/admin/class-aepc-admin-ajax.php:449
28
  #: includes/admin/class-aepc-admin-ca.php:837
pixel-caffeine.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://adespresso.com/
8
  * Text Domain: pixel-caffeine
9
  * Domain Path: /languages
10
- * Version: 2.0.1
11
  * WC requires at least: 3.0.0
12
  * WC tested up to: 3.3.0
13
  *
@@ -24,12 +24,12 @@ if ( ! class_exists( 'PixelCaffeine' ) ) :
24
  * Main PixelCaffeine Class.
25
  *
26
  * @class PixelCaffeine
27
- * @version 2.0.1
28
  */
29
  final class PixelCaffeine {
30
 
31
  /** @var string PixelCaffeine version. */
32
- public $version = '2.0.1';
33
 
34
  /** @var PixelCaffeine The single instance of the class. */
35
  protected static $_instance = null;
7
  * Author URI: https://adespresso.com/
8
  * Text Domain: pixel-caffeine
9
  * Domain Path: /languages
10
+ * Version: 2.0.2
11
  * WC requires at least: 3.0.0
12
  * WC tested up to: 3.3.0
13
  *
24
  * Main PixelCaffeine Class.
25
  *
26
  * @class PixelCaffeine
27
+ * @version 2.0.2
28
  */
29
  final class PixelCaffeine {
30
 
31
  /** @var string PixelCaffeine version. */
32
+ public $version = '2.0.2';
33
 
34
  /** @var PixelCaffeine The single instance of the class. */
35
  protected static $_instance = null;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: facebook, facebook pixel, facebook ad, facebook insertions, custom audienc
5
  Requires at least: 4.4
6
  Requires PHP: 5.3.9
7
  Tested up to: 4.9.1
8
- Stable tag: 2.0.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -124,6 +124,19 @@ Unfortunately there isn’t any way at the moment to import custom audiences _fr
124
 
125
  == Changelog ==
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  = 2.0.1 - 2018-01-11 =
128
  * Compatibility - Tested plugin with new WooCommerce 3.3
129
  * Add - New log system: new "Logs" tab is added where are tracked all errors appears across the plugin
5
  Requires at least: 4.4
6
  Requires PHP: 5.3.9
7
  Tested up to: 4.9.1
8
+ Stable tag: 2.0.2
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
124
 
125
  == Changelog ==
126
 
127
+ = 2.0.2 - 2018-02-01 =
128
+ * Add - Useful hooks for the feed items
129
+ * Enhancement - Translate shortcodes in the product descriptions inside the feed
130
+ * Fix - Invalid characters in feed
131
+ * Fix - Strip HTML tags in the product description inside the feed
132
+ * Fix - Woo query in the product feed fetched wrong products
133
+ * Fix - Use short description/excerpt if no product description
134
+ * Fix - Fatal error when only EDD is enabled
135
+ * Fix - Include quantity in value parameter of AddToCart
136
+ * Fix - NaN in value parameter when add to cart from WooCommerce
137
+ * Fix - AddToCart tracking when using [product_page] shortcode
138
+ * Fix - AddToCart tracking when using [add_to_cart] shortcode
139
+
140
  = 2.0.1 - 2018-01-11 =
141
  * Compatibility - Tested plugin with new WooCommerce 3.3
142
  * Add - New log system: new "Logs" tab is added where are tracked all errors appears across the plugin
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit6de2c4b93be5d2d9441e5c11be7ed981::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit2ae3fc947ace3f3b4c626ecefdb5d4e4::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -379,9 +379,9 @@ class ClassLoader
379
  $subPath = substr($subPath, 0, $lastPos);
380
  $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
 
382
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
- $length = $this->prefixLengthsPsr4[$first][$search];
384
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
  return $file;
386
  }
387
  }
379
  $subPath = substr($subPath, 0, $lastPos);
380
  $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
+ if (file_exists($file = $dir . $pathEnd)) {
 
385
  return $file;
386
  }
387
  }
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit6de2c4b93be5d2d9441e5c11be7ed981
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit6de2c4b93be5d2d9441e5c11be7ed981
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit6de2c4b93be5d2d9441e5c11be7ed981', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit6de2c4b93be5d2d9441e5c11be7ed981', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit2ae3fc947ace3f3b4c626ecefdb5d4e4
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit2ae3fc947ace3f3b4c626ecefdb5d4e4', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit2ae3fc947ace3f3b4c626ecefdb5d4e4', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit2ae3fc947ace3f3b4c626ecefdb5d4e4::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -104,9 +104,9 @@ class ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981
104
  public static function getInitializer(ClassLoader $loader)
105
  {
106
  return \Closure::bind(function () use ($loader) {
107
- $loader->prefixLengthsPsr4 = ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981::$prefixLengthsPsr4;
108
- $loader->prefixDirsPsr4 = ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981::$prefixDirsPsr4;
109
- $loader->classMap = ComposerStaticInit6de2c4b93be5d2d9441e5c11be7ed981::$classMap;
110
 
111
  }, null, ClassLoader::class);
112
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit2ae3fc947ace3f3b4c626ecefdb5d4e4
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
104
  public static function getInitializer(ClassLoader $loader)
105
  {
106
  return \Closure::bind(function () use ($loader) {
107
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2ae3fc947ace3f3b4c626ecefdb5d4e4::$prefixLengthsPsr4;
108
+ $loader->prefixDirsPsr4 = ComposerStaticInit2ae3fc947ace3f3b4c626ecefdb5d4e4::$prefixDirsPsr4;
109
+ $loader->classMap = ComposerStaticInit2ae3fc947ace3f3b4c626ecefdb5d4e4::$classMap;
110
 
111
  }, null, ClassLoader::class);
112
  }
vendor/composer/installed.json CHANGED
@@ -82,55 +82,6 @@
82
  "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
83
  "homepage": "https://github.com/firebase/php-jwt"
84
  },
85
- {
86
- "name": "psr/log",
87
- "version": "1.0.2",
88
- "version_normalized": "1.0.2.0",
89
- "source": {
90
- "type": "git",
91
- "url": "https://github.com/php-fig/log.git",
92
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
93
- },
94
- "dist": {
95
- "type": "zip",
96
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
97
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
98
- "shasum": ""
99
- },
100
- "require": {
101
- "php": ">=5.3.0"
102
- },
103
- "time": "2016-10-10T12:19:37+00:00",
104
- "type": "library",
105
- "extra": {
106
- "branch-alias": {
107
- "dev-master": "1.0.x-dev"
108
- }
109
- },
110
- "installation-source": "dist",
111
- "autoload": {
112
- "psr-4": {
113
- "Psr\\Log\\": "Psr/Log/"
114
- }
115
- },
116
- "notification-url": "https://packagist.org/downloads/",
117
- "license": [
118
- "MIT"
119
- ],
120
- "authors": [
121
- {
122
- "name": "PHP-FIG",
123
- "homepage": "http://www.php-fig.org/"
124
- }
125
- ],
126
- "description": "Common interface for logging libraries",
127
- "homepage": "https://github.com/php-fig/log",
128
- "keywords": [
129
- "log",
130
- "psr",
131
- "psr-3"
132
- ]
133
- },
134
  {
135
  "name": "monolog/monolog",
136
  "version": "1.23.0",
@@ -211,6 +162,55 @@
211
  "psr-3"
212
  ]
213
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  {
215
  "name": "symfony/filesystem",
216
  "version": "v2.8.32",
82
  "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
83
  "homepage": "https://github.com/firebase/php-jwt"
84
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  {
86
  "name": "monolog/monolog",
87
  "version": "1.23.0",
162
  "psr-3"
163
  ]
164
  },
165
+ {
166
+ "name": "psr/log",
167
+ "version": "1.0.2",
168
+ "version_normalized": "1.0.2.0",
169
+ "source": {
170
+ "type": "git",
171
+ "url": "https://github.com/php-fig/log.git",
172
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
173
+ },
174
+ "dist": {
175
+ "type": "zip",
176
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
177
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
178
+ "shasum": ""
179
+ },
180
+ "require": {
181
+ "php": ">=5.3.0"
182
+ },
183
+ "time": "2016-10-10T12:19:37+00:00",
184
+ "type": "library",
185
+ "extra": {
186
+ "branch-alias": {
187
+ "dev-master": "1.0.x-dev"
188
+ }
189
+ },
190
+ "installation-source": "dist",
191
+ "autoload": {
192
+ "psr-4": {
193
+ "Psr\\Log\\": "Psr/Log/"
194
+ }
195
+ },
196
+ "notification-url": "https://packagist.org/downloads/",
197
+ "license": [
198
+ "MIT"
199
+ ],
200
+ "authors": [
201
+ {
202
+ "name": "PHP-FIG",
203
+ "homepage": "http://www.php-fig.org/"
204
+ }
205
+ ],
206
+ "description": "Common interface for logging libraries",
207
+ "homepage": "https://github.com/php-fig/log",
208
+ "keywords": [
209
+ "log",
210
+ "psr",
211
+ "psr-3"
212
+ ]
213
+ },
214
  {
215
  "name": "symfony/filesystem",
216
  "version": "v2.8.32",