Plugin Directory

Changeset 3473124


Ignore:
Timestamp:
03/02/2026 10:25:57 PM (5 days ago)
Author:
rermis
Message:

v3.0.44 = * Potential efficiency improvements

Location:
woo-auto-coupons/tags/3.0.44
Files:
3 copied

Legend:

Unmodified
Added
Removed
  • woo-auto-coupons/tags/3.0.44/readme.txt

    r3469825 r3473124  
    66Requires at least: 4.6
    77Tested up to: 6.9
    8 Stable tag: 3.0.43
     8Stable tag: 3.0.44
    99
    1010Apply WooCommerce Coupons automatically with a fast, lightweight plugin. Set minimum product quantities, apply coupons by URL or automatically.
     
    5050
    5151== Changelog ==
     52= 3.0.44 = * Potential efficiency improvements
    5253= 3.0.43 = * Minor php warning fixes
    5354= 3.0.42 = * Fallback when customer declines cookies
  • woo-auto-coupons/tags/3.0.44/wac_functions.php

    r3469825 r3473124  
    77Author URI: https://richardlerma.com/contact/
    88Requires Plugins: woocommerce
    9 Version: 3.0.43
     9Version: 3.0.44
    1010Text Domain: woo-auto-coupons
    1111Copyright: (c) 2019-2026 rldd.net - All Rights Reserved
     
    1616*/
    1717
    18 global $wp_version,$wac_version,$wac_pro_version,$wac_version_type; $wac_version='3.0.43';
     18global $wp_version,$wac_version,$wac_pro_version,$wac_version_type; $wac_version='3.0.44';
    1919$wac_version_type='GPL';
    2020$wac_pro_version=get_option('wac_pro_version');
     
    592592  if(isset($_POST['wac_reset_cache']) && intval($_POST['wac_reset_cache'])>0) wac_clear_cache();
    593593  $cart_items=$apply_indv=$disp_email_prompt=$email_match=0;
    594   $req=$req2=$coupon=$cart_email=$wac_email='';
     594  $reqs=$exp=$coupon=$cart_email=$wac_email='';
    595595  $meta='_wc_%_apply';
    596596  $cart_qty=$woocommerce->cart->get_cart_contents_count();
     
    617617
    618618  if($trb<1) {
    619     $req2.=" AND(individual='yes' OR apply IS NOT NULL OR c_email IS NOT NULL)";
    620     $req.=" AND exp=0";
     619    $reqs.=" AND(individual='yes' OR apply IS NOT NULL";
     620    if(function_exists('wac_email_prompt')&&$coupon_email>0)$reqs.=" OR c_email IS NOT NULL";
     621    $reqs.=")";
     622    $exp.=" AND IFNULL(FROM_UNIXTIME(x.meta_value),'9999-12-31')>'$now'";
    621623  }
    622624
     
    643645      FROM wp_posts p
    644646      LEFT JOIN wp_postmeta x ON x.post_id=p.ID AND x.meta_key='date_expires' AND LENGTH(x.meta_value)=10 AND x.meta_value REGEXP '[0-9]'
    645       LEFT JOIN wp_postmeta pm ON pm.post_id=p.ID
    646       AND (pm.meta_key IN ('product_ids','exclude_product_ids','product_categories','exclude_product_categories','individual_use','coupon_amount','customer_email','_wc_min_qty','_wc_max_qty','_wc_qty_ntf','_wc_min_qty_ntf','_wc_max_qty_ntf')
     647      LEFT JOIN wp_postmeta pm ON pm.post_id=p.ID AND (pm.meta_key IN ('product_ids','exclude_product_ids','product_categories','exclude_product_categories','individual_use','coupon_amount','customer_email','_wc_min_qty','_wc_max_qty','_wc_qty_ntf','_wc_min_qty_ntf','_wc_max_qty_ntf')
    647648      OR pm.meta_key LIKE '_wc_%_apply')
    648649      WHERE post_type='shop_coupon'
    649650      AND post_status='publish'
     651      $exp
    650652      GROUP BY p.ID
    651653    )a
    652654    WHERE 1=1
    653     $req2
    654     $req
     655    $reqs
    655656    ORDER BY individual DESC,exp,CAST(coupon_amount AS SIGNED) DESC;");
    656657  if(!$coupons)return;
Note: See TracChangeset for help on using the changeset viewer.