Plugin Directory

Changeset 2513961


Ignore:
Timestamp:
04/13/2021 09:32:59 AM (5 years ago)
Author:
delabon
Message:

Version 3.1.0

Location:
woomotiv
Files:
6 edited
11 copied

Legend:

Unmodified
Added
Removed
  • woomotiv/trunk/index.php

    r2513764 r2513961  
    44 * Plugin Name: Woomotiv - Live Sales Notification for Woocommerce
    55 * Description: Laverage social proof to increase trust, traffic and sales.
    6  * Version: 3.0.0
     6 * Version: 3.1.0
    77 * Author: Sabri Taieb
    88 * Author Uri: https://delabon.com
     
    1818
    1919# Defined
    20 define( 'WOOMOTIV_VERSION', '3.0.0' );
     20define( 'WOOMOTIV_VERSION', '3.1.0' );
    2121define( 'WOOMOTIV_URL', plugins_url( '', __FILE__ ) );
    2222define( 'WOOMOTIV_DIR', __DIR__ );
  • woomotiv/trunk/js/front.js

    r2513764 r2513961  
    2323        custom: [],
    2424    };
    25     var isNoRepeaEnabled = parseInt(woomotivObj.is_no_repeat_enabled);
     25    var isNoRepeatEnabled = parseInt(woomotivObj.is_no_repeat_enabled) === 1 && parseInt(woomotivObj.is_premium) === 1 ? 1 : 0;
    2626    var excludedOrdersKey = 'woomotiv_seen_orders_' + woomotivObj.site_hash;
    2727    var excludedReviewsKey = 'woomotiv_seen_reviews_' + woomotivObj.site_hash;
     
    168168        if( ! items.eq( cindex ).length ){
    169169           
    170             if( isNoRepeaEnabled ){
     170            if( isNoRepeatEnabled ){
    171171                excluded.orders = getExcludedOrdersFromStorage();
    172172                excluded.reviews = getExcludedReviewsFromStorage();
     
    236236        excluded.orders.push(orderId);
    237237
    238         if( ! isNoRepeaEnabled ) return;
     238        if( ! isNoRepeatEnabled ) return;
    239239
    240240        var orders = getExcludedOrdersFromStorage();
     
    266266        excluded.reviews.push(reviewId);
    267267
    268         if( ! isNoRepeaEnabled ) return;
     268        if( ! isNoRepeatEnabled ) return;
    269269
    270270        var reviews = getExcludedReviewsFromStorage();
     
    296296        excluded.custom.push( id );
    297297
    298         if( ! isNoRepeaEnabled ) return;
     298        if( ! isNoRepeatEnabled ) return;
    299299
    300300        var customPops = getExcludedCustomPopsFromStorage();
     
    392392            if( response.data.length === 0 ){
    393393
    394                 if( isNoRepeaEnabled ){
     394                if( isNoRepeatEnabled ){
    395395                    clearLocalStorage();
    396396                }
     
    504504
    505505    // No-repeat is disabled, lets clear the local storage
    506     if( ! isNoRepeaEnabled ){
     506    if( ! isNoRepeatEnabled ){
    507507        clearLocalStorage();
    508508    }
  • woomotiv/trunk/js/front.min.js

    r2513764 r2513961  
    1 !function(o){o(window);var i,a,n=o("body"),r=woomotivObj.nonce,s=woomotivObj.ajax_url,m=!0,c=!1,d=!1,l=1e3*parseInt(woomotivObj.interval),f=1e3*parseInt(woomotivObj.hide),u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,w=window.cancelAnimationFrame||window.mozCancelAnimationFrame,v={orders:[],reviews:[],custom:[]},p=parseInt(woomotivObj.is_no_repeat_enabled),h="woomotiv_seen_orders_"+woomotivObj.site_hash,b="woomotiv_seen_reviews_"+woomotivObj.site_hash,_="woomotiv_seen_custompop_"+woomotivObj.site_hash,t=function(){var t,e=document.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(void 0!==e.style[t])return o[t]}(),e=function(){var t,e=document.createElement("fakeelement"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in o)if(void 0!==e.style[t])return o[t]}(),g=(function(){var t,e=document.createElement("fakeelement"),o={transition:"transitionstart",OTransition:"oTransitionStart",MozTransition:"transitionstart",WebkitTransition:"webkitTransitionStart"};for(t in o)if(void 0!==e.style[t])return}(),function(){var t,e=document.createElement("fakeelement"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"animationstart",WebkitAnimation:"webkitAnimationStart"};for(t in o)if(void 0!==e.style[t])return}(),["fade","slideup","slidedown","slideright","slideleft"]),k=(g.indexOf(woomotivObj.animation),-1!=g.indexOf(woomotivObj.animation)?t:e);function T(t,e){return(e="object"==typeof e?e:{}).action="woomotiv_"+t,e.hasOwnProperty("nonce")||(e.nonce=r),o.ajax({type:"POST",url:s,data:e})}function O(m){m=parseInt(m),i.eq(m).length||(p&&(v.orders=j(),v.reviews=I(),v.custom=y()),A(v));var u=i.eq(m);u.addClass("wmt-current"),u.one(k,function(){var e,o,n,t,i,a,r,s;u.is('[data-type="order"]')?(a=parseInt(u.attr("data-order")),v.orders=v.orders.filter(function(t){return t!=a}),v.orders.push(a),p&&(r=j(),s=!1,r.map(function(t){t==a&&(s=!0)}),s||(r.push(a),localStorage.setItem(h,r.join(","))))):u.is('[data-type="review"]')?(n=parseInt(u.attr("data-review")),v.reviews=v.reviews.filter(function(t){return t!=n}),v.reviews.push(n),p&&(t=I(),i=!1,t.map(function(t){t==n&&(i=!0)}),i||(t.push(n),localStorage.setItem(b,t.join(","))))):u.is('[data-type="custom"]')&&(e=parseInt(u.attr("data-id")),v.custom=v.custom.filter(function(t){return t!=e}),v.custom.push(e),p&&(t=y(),o=!1,t.map(function(t){t==e&&(o=!0)}),o||(t.push(e),localStorage.setItem(_,t.join(","))))),d=setTimeout(function(){u.removeClass("wmt-current"),u.one(k,function(){c=setTimeout(function(){O(m+1)},l)})},f)})}function j(){var t=localStorage.getItem(h);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function I(){var t=localStorage.getItem(b);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function y(){var t=localStorage.getItem(_);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function S(){localStorage.removeItem(h),localStorage.removeItem(b),localStorage.removeItem(_)}function A(e){T("get_items",{excluded:e}).done(function(t){if(t.hasOwnProperty("data")&&(0!==t.data.length||!m)){if(m=!1,0===t.data.length&&(p&&S(),e.orders=[],e.reviews=[],e.custom=[],A(e)),localStorage.getItem("woomotiv_pause_date_"+woomotivObj.site_hash))if(new Date(localStorage.getItem("woomotiv_pause_date_"+woomotivObj.site_hash))>new Date)return;i&&i.remove(),t.data.map(function(t){n.append(t.markup)}),i=o(".woomotiv-popup"),setTimeout(function(){a=u(function(){O(0)})},parseInt(l/2)),i.on("mouseenter",function(t){o(this).off(k),clearTimeout(c),clearTimeout(d),w(a)}),i.on("mouseleave",function(t){var e=i.filter(".wmt-current"),o=e.data("index"),n=parseInt(f/2);void 0!==o&&(setTimeout(function(){e.removeClass("wmt-current")},n),setTimeout(function(){a=u(function(){O(e.data("index")+1)})},f+f))}),i.find(".woomotiv-close").on("click",function(t){i.remove(),localStorage.setItem("woomotiv_pause_date_"+woomotivObj.site_hash,function(t,e,o){function n(){i.getDate()!=t.getDate()&&i.setDate(0)}var i=new Date(t);switch(e.toLowerCase()){case"year":i.setFullYear(i.getFullYear()+o),n();break;case"quarter":i.setMonth(i.getMonth()+3*o),n();break;case"month":i.setMonth(i.getMonth()+o),n();break;case"week":i.setDate(i.getDate()+7*o);break;case"day":i.setDate(i.getDate()+o);break;case"hour":i.setTime(i.getTime()+36e5*o);break;case"minute":i.setTime(i.getTime()+6e4*o);break;case"second":i.setTime(i.getTime()+1e3*o);break;default:i=void 0}return i}(new Date,"minute",30))}),i.on("click",function(t){t.preventDefault();var e=o(this),t={};"order"===e.data("type")?(t.type="order",t.product_id=e.data("product")):"review"===e.data("type")?(t.type="review",t.product_id=e.data("product")):(t.type="custom",t.id=e.data("id")),T("update_stats",t).done(function(t){1!=woomotivObj.disable_link&&(location.href=e.find(".woomotiv-link").attr("href"))})})}})}p?(v.orders=j(),v.reviews=I(),v.custom=y()):S(),A(v)}(jQuery);
     1!function(o){o(window);var i,a,n=o("body"),r=woomotivObj.nonce,s=woomotivObj.ajax_url,m=!0,c=!1,d=!1,l=1e3*parseInt(woomotivObj.interval),f=1e3*parseInt(woomotivObj.hide),u=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,w=window.cancelAnimationFrame||window.mozCancelAnimationFrame,v={orders:[],reviews:[],custom:[]},p=1===parseInt(woomotivObj.is_no_repeat_enabled)&&1===parseInt(woomotivObj.is_premium)?1:0,b="woomotiv_seen_orders_"+woomotivObj.site_hash,h="woomotiv_seen_reviews_"+woomotivObj.site_hash,_="woomotiv_seen_custompop_"+woomotivObj.site_hash,t=function(){var t,e=document.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(void 0!==e.style[t])return o[t]}(),e=function(){var t,e=document.createElement("fakeelement"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in o)if(void 0!==e.style[t])return o[t]}(),g=(function(){var t,e=document.createElement("fakeelement"),o={transition:"transitionstart",OTransition:"oTransitionStart",MozTransition:"transitionstart",WebkitTransition:"webkitTransitionStart"};for(t in o)if(void 0!==e.style[t])return}(),function(){var t,e=document.createElement("fakeelement"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"animationstart",WebkitAnimation:"webkitAnimationStart"};for(t in o)if(void 0!==e.style[t])return}(),["fade","slideup","slidedown","slideright","slideleft"]),k=(g.indexOf(woomotivObj.animation),-1!=g.indexOf(woomotivObj.animation)?t:e);function O(t,e){return(e="object"==typeof e?e:{}).action="woomotiv_"+t,e.hasOwnProperty("nonce")||(e.nonce=r),o.ajax({type:"POST",url:s,data:e})}function T(m){m=parseInt(m),i.eq(m).length||(p&&(v.orders=j(),v.reviews=I(),v.custom=y()),A(v));var u=i.eq(m);u.addClass("wmt-current"),u.one(k,function(){var e,o,n,t,i,a,r,s;u.is('[data-type="order"]')?(a=parseInt(u.attr("data-order")),v.orders=v.orders.filter(function(t){return t!=a}),v.orders.push(a),p&&(r=j(),s=!1,r.map(function(t){t==a&&(s=!0)}),s||(r.push(a),localStorage.setItem(b,r.join(","))))):u.is('[data-type="review"]')?(n=parseInt(u.attr("data-review")),v.reviews=v.reviews.filter(function(t){return t!=n}),v.reviews.push(n),p&&(t=I(),i=!1,t.map(function(t){t==n&&(i=!0)}),i||(t.push(n),localStorage.setItem(h,t.join(","))))):u.is('[data-type="custom"]')&&(e=parseInt(u.attr("data-id")),v.custom=v.custom.filter(function(t){return t!=e}),v.custom.push(e),p&&(t=y(),o=!1,t.map(function(t){t==e&&(o=!0)}),o||(t.push(e),localStorage.setItem(_,t.join(","))))),d=setTimeout(function(){u.removeClass("wmt-current"),u.one(k,function(){c=setTimeout(function(){T(m+1)},l)})},f)})}function j(){var t=localStorage.getItem(b);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function I(){var t=localStorage.getItem(h);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function y(){var t=localStorage.getItem(_);return(t=t?t.split(","):[]).filter(function(t){return""!==t})}function S(){localStorage.removeItem(b),localStorage.removeItem(h),localStorage.removeItem(_)}function A(e){O("get_items",{excluded:e}).done(function(t){if(t.hasOwnProperty("data")&&(0!==t.data.length||!m)){if(m=!1,0===t.data.length&&(p&&S(),e.orders=[],e.reviews=[],e.custom=[],A(e)),localStorage.getItem("woomotiv_pause_date_"+woomotivObj.site_hash))if(new Date(localStorage.getItem("woomotiv_pause_date_"+woomotivObj.site_hash))>new Date)return;i&&i.remove(),t.data.map(function(t){n.append(t.markup)}),i=o(".woomotiv-popup"),setTimeout(function(){a=u(function(){T(0)})},parseInt(l/2)),i.on("mouseenter",function(t){o(this).off(k),clearTimeout(c),clearTimeout(d),w(a)}),i.on("mouseleave",function(t){var e=i.filter(".wmt-current"),o=e.data("index"),n=parseInt(f/2);void 0!==o&&(setTimeout(function(){e.removeClass("wmt-current")},n),setTimeout(function(){a=u(function(){T(e.data("index")+1)})},f+f))}),i.find(".woomotiv-close").on("click",function(t){i.remove(),localStorage.setItem("woomotiv_pause_date_"+woomotivObj.site_hash,function(t,e,o){function n(){i.getDate()!=t.getDate()&&i.setDate(0)}var i=new Date(t);switch(e.toLowerCase()){case"year":i.setFullYear(i.getFullYear()+o),n();break;case"quarter":i.setMonth(i.getMonth()+3*o),n();break;case"month":i.setMonth(i.getMonth()+o),n();break;case"week":i.setDate(i.getDate()+7*o);break;case"day":i.setDate(i.getDate()+o);break;case"hour":i.setTime(i.getTime()+36e5*o);break;case"minute":i.setTime(i.getTime()+6e4*o);break;case"second":i.setTime(i.getTime()+1e3*o);break;default:i=void 0}return i}(new Date,"minute",30))}),i.on("click",function(t){t.preventDefault();var e=o(this),t={};"order"===e.data("type")?(t.type="order",t.product_id=e.data("product")):"review"===e.data("type")?(t.type="review",t.product_id=e.data("product")):(t.type="custom",t.id=e.data("id")),O("update_stats",t).done(function(t){1!=woomotivObj.disable_link&&(location.href=e.find(".woomotiv-link").attr("href"))})})}})}p?(v.orders=j(),v.reviews=I(),v.custom=y()):S(),A(v)}(jQuery);
  • woomotiv/trunk/lib/class-popup.php

    r2199296 r2513961  
    3333    private function setProduct(){
    3434
     35        $thumbnail_size = apply_filters('woomotiv_product_image_size_filter', 'thumbnail');
    3536        $this->data[ 'product' ] = array();
    3637
     
    4243            'url' => get_permalink( $this->product->get_id() ),
    4344            'thumbnail_id' => get_post_thumbnail_id( $this->product->get_id() ),
    44             'thumbnail_src' => wp_get_attachment_image_src( get_post_thumbnail_id( $this->product->get_id() ), 'thumbnail' ),
    45             'thumbnail_img' => wp_get_attachment_image( get_post_thumbnail_id( $this->product->get_id() ), 'thumbnail' ),               
     45            'thumbnail_src' => wp_get_attachment_image_src( get_post_thumbnail_id( $this->product->get_id() ), $thumbnail_size ),
     46            'thumbnail_img' => wp_get_attachment_image( get_post_thumbnail_id( $this->product->get_id() ), $thumbnail_size ),               
    4647        );
    4748
     
    4950        if( $this->product->get_parent_id() ){
    5051            $product['thumbnail_id'] = get_post_thumbnail_id( $this->product->get_parent_id() );
    51             $product['thumbnail_src'] = wp_get_attachment_image_src( get_post_thumbnail_id( $this->product->get_parent_id() ), 'thumbnail' );
    52             $product['thumbnail_img'] = wp_get_attachment_image( get_post_thumbnail_id( $this->product->get_parent_id() ), 'thumbnail' );
     52            $product['thumbnail_src'] = wp_get_attachment_image_src( get_post_thumbnail_id( $this->product->get_parent_id() ), $thumbnail_size );
     53            $product['thumbnail_img'] = wp_get_attachment_image( get_post_thumbnail_id( $this->product->get_parent_id() ), $thumbnail_size );
    5354        }
    5455       
  • woomotiv/trunk/lib/functions.php

    r2513764 r2513961  
    187187        );
    188188    }
     189    // Mysql ORDER BY RAND() returns a cached query after the first time
     190    if ( $is_random ) {
     191        shuffle( $orders );
     192    }
    189193    return $orders;
    190194}
     
    199203{
    200204    $excluded_reviews = ( !is_array( $excluded_reviews ) ? [] : $excluded_reviews );
     205    $is_random = ( woomotiv()->config->woomotiv_display_order === 'random_sales' ? true : false );
    201206    /** Only Premium */
    202207    if ( wmv_fs()->is_free_plan() ) {
  • woomotiv/trunk/readme.txt

    r2513764 r2513961  
    33Requires at least: 4.6
    44Tested up to: 5.7.0
    5 Stable tag: 3.0.0
     5Stable tag: 3.1.0
    66Requires PHP: 5.6
    77Tags: woocommerce notification, woocommerce sales notification, woocommerce sales popup, marketing, boost sales, boost conversion
     
    101101== Changelog ==
    102102
     103= 3.1.0 =
     104
     105* Updated random sales/reviews functionality
     106
    103107= 3.0.0 =
    104108
Note: See TracChangeset for help on using the changeset viewer.