Advanced Woo Search - Version 2.68

Version Description

( 2022-11-28 ) = * Update - Support for Perfect Brands for WooCommerce plugin * Update - Stop words list

Download this release

Release Info

Developer Mihail Barinov
Plugin Icon 128x128 Advanced Woo Search
Version 2.68
Comparing to
See all releases

Code changes from version 2.67 to 2.68

advanced-woo-search.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 2.67
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
@@ -96,7 +96,7 @@ final class AWS_Main {
96
  */
97
  private function define_constants() {
98
 
99
- $this->define( 'AWS_VERSION', '2.67' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.68
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
96
  */
97
  private function define_constants() {
98
 
99
+ $this->define( 'AWS_VERSION', '2.68' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
includes/class-aws-integrations.php CHANGED
@@ -382,6 +382,11 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
382
  include_once( AWS_DIR . '/includes/modules/class-aws-custom-tabs.php' );
383
  }
384
 
 
 
 
 
 
385
  // Astra theme
386
  if ( 'Astra' === $this->current_theme ) {
387
  include_once( AWS_DIR . '/includes/modules/class-aws-astra.php' );
382
  include_once( AWS_DIR . '/includes/modules/class-aws-custom-tabs.php' );
383
  }
384
 
385
+ // Perfect Brands for WooCommerce
386
+ if ( defined( 'PWB_PLUGIN_VERSION' ) ) {
387
+ include_once( AWS_DIR . '/includes/modules/class-aws-pwb.php' );
388
+ }
389
+
390
  // Astra theme
391
  if ( 'Astra' === $this->current_theme ) {
392
  include_once( AWS_DIR . '/includes/modules/class-aws-astra.php' );
includes/class-aws-versions.php CHANGED
@@ -98,7 +98,7 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
98
 
99
  if ( $settings ) {
100
  if ( ! isset( $settings['stopwords'] ) ) {
101
- $settings['stopwords'] = 'a, also, am, an, and, are, as, at, be, but, by, call, can, co, con, de, do, due, eg, eight, etc, even, ever, every, for, from, full, go, had, has, hasnt, have, he, hence, her, here, his, how, ie, if, in, inc, into, is, it, its, ltd, me, my, no, none, nor, not, now, of, off, on, once, one, only, onto, or, our, ours, out, over, own, part, per, put, re, see, so, some, ten, than, that, the, their, there, these, they, this, three, thru, thus, to, too, top, un, up, us, very, via, was, we, well, were, what, when, where, who, why, will';
102
  update_option( 'aws_settings', $settings );
103
  }
104
  }
98
 
99
  if ( $settings ) {
100
  if ( ! isset( $settings['stopwords'] ) ) {
101
+ $settings['stopwords'] = 'a, also, am, an, and, are, as, at, be, but, by, call, can, co, con, de, do, due, eg, eight, etc, even, ever, every, for, from, full, go, had, has, hasnt, have, he, hence, her, here, his, how, ie, if, in, inc, into, is, it, its, ltd, me, my, no, none, nor, not, now, of, off, on, once, one, only, onto, or, our, ours, out, over, own, part, per, put, re, see, so, some, ten, than, that, the, their, there, these, they, this, three, thru, thus, to, too, un, up, us, very, via, was, we, well, were, what, when, where, who, why, will';
102
  update_option( 'aws_settings', $settings );
103
  }
104
  }
includes/modules/class-aws-pwb.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Perfect Brands for WooCommerce support
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+ if ( ! class_exists( 'AWS_PWB' ) ) :
11
+
12
+ /**
13
+ * Class
14
+ */
15
+ class AWS_PWB {
16
+
17
+ /**
18
+ * Main AWS_PWB Instance
19
+ *
20
+ * Ensures only one instance of AWS_PWB is loaded or can be loaded.
21
+ *
22
+ * @static
23
+ * @return AWS_PWB - Main instance
24
+ */
25
+ protected static $_instance = null;
26
+
27
+ /**
28
+ * Main AWS_PWB Instance
29
+ *
30
+ * Ensures only one instance of AWS_PWB is loaded or can be loaded.
31
+ *
32
+ * @static
33
+ * @return AWS_PWB - Main instance
34
+ */
35
+ public static function instance() {
36
+ if ( is_null( self::$_instance ) ) {
37
+ self::$_instance = new self();
38
+ }
39
+ return self::$_instance;
40
+ }
41
+
42
+ /**
43
+ * Constructor
44
+ */
45
+ public function __construct() {
46
+
47
+ add_filter( 'aws_search_page_filters', array( $this, 'search_page_filters' ) );
48
+
49
+ }
50
+
51
+ /*
52
+ * Update filter widget for pwb-brand taxonomy
53
+ */
54
+ public function search_page_filters( $filters ) {
55
+
56
+ if ( isset( $_GET['pwb-brand-filter'] ) ) {
57
+
58
+ $terms_arr = explode( ',', $_GET['pwb-brand-filter'] );
59
+
60
+ if ( preg_match( '/[a-z]/', $_GET['pwb-brand-filter'] ) ) {
61
+ $new_terms_arr = array();
62
+ foreach ( $terms_arr as $term_slug ) {
63
+ $term = get_term_by('slug', $term_slug, 'pwb-brand' );
64
+ if ( $term ) {
65
+ $new_terms_arr[] = $term->term_id;
66
+ }
67
+ }
68
+ $terms_arr = $new_terms_arr;
69
+ }
70
+
71
+ $filters['tax']['pwb-brand'] = array(
72
+ 'terms' => $terms_arr,
73
+ 'operator' => 'OR'
74
+ );
75
+
76
+ }
77
+
78
+ return $filters;
79
+
80
+ }
81
+
82
+ }
83
+
84
+ endif;
85
+
86
+ AWS_PWB::instance();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 6.1
7
- Stable tag: 2.67
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -168,6 +168,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
168
 
169
  == Changelog ==
170
 
 
 
 
 
171
  = 2.67 ( 2022-11-14 ) =
172
  * Update - Tested with WC 7.1
173
  * Update - Flatsome theme support
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 6.1
7
+ Stable tag: 2.68
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
168
 
169
  == Changelog ==
170
 
171
+ = 2.68 ( 2022-11-28 ) =
172
+ * Update - Support for Perfect Brands for WooCommerce plugin
173
+ * Update - Stop words list
174
+
175
  = 2.67 ( 2022-11-14 ) =
176
  * Update - Tested with WC 7.1
177
  * Update - Flatsome theme support