Advanced Woo Search - Version 1.33

Version Description

  • Fix re-index bug
  • Fix bug with search page
Download this release

Release Info

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

Code changes from version 1.32 to 1.33

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: 1.32
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'AWS_VERSION', '1.32' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.33
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '1.33' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/css/common.css CHANGED
@@ -31,6 +31,7 @@
31
  }
32
 
33
  .aws-container .aws-search-field {
 
34
  width: 100%;
35
  color: #313131;
36
  padding: 6px;
@@ -54,6 +55,7 @@
54
 
55
  .aws-search-result {
56
  position: absolute;
 
57
  z-index: 9999999999999;
58
  background: #fff;
59
  width: 100%;
31
  }
32
 
33
  .aws-container .aws-search-field {
34
+ height: 44px;
35
  width: 100%;
36
  color: #313131;
37
  padding: 6px;
55
 
56
  .aws-search-result {
57
  position: absolute;
58
+ text-align: left;
59
  z-index: 9999999999999;
60
  background: #fff;
61
  width: 100%;
assets/js/admin.js CHANGED
@@ -24,18 +24,19 @@ jQuery(document).ready(function ($) {
24
  $reindexBlock.addClass('loading');
25
  $reindexProgress.html ( processed + '%' );
26
 
27
- sync();
28
 
29
  });
30
 
31
 
32
- function sync() {
33
 
34
  $.ajax({
35
  type: 'POST',
36
  url: ajaxurl,
37
  data: {
38
- action: 'aws-reindex'
 
39
  },
40
  dataType: "json",
41
  success: function (response) {
@@ -64,18 +65,17 @@ jQuery(document).ready(function ($) {
64
 
65
  console.log( response.data );
66
 
67
- $reindexProgress.html ( processed + '%' );
68
 
69
  // We are starting a sync
70
  syncStatus = 'sync';
71
 
72
- sync();
73
  }
74
 
75
  },
76
  error : function( jqXHR, textStatus ) {
77
  console.log( "Request failed: " + textStatus );
78
- cancelSync();
79
  },
80
  complete: function () {
81
  }
@@ -83,17 +83,6 @@ jQuery(document).ready(function ($) {
83
 
84
  }
85
 
86
- function cancelSync() {
87
- $.ajax( {
88
- method: 'post',
89
- url: ajaxurl,
90
- data: {
91
- action: 'aws-cancel-index'
92
- }
93
- } );
94
- }
95
-
96
-
97
  // Clear cache
98
  $clearCacheBtn.on( 'click', function(e) {
99
 
24
  $reindexBlock.addClass('loading');
25
  $reindexProgress.html ( processed + '%' );
26
 
27
+ sync('start');
28
 
29
  });
30
 
31
 
32
+ function sync( data ) {
33
 
34
  $.ajax({
35
  type: 'POST',
36
  url: ajaxurl,
37
  data: {
38
+ action: 'aws-reindex',
39
+ data: data
40
  },
41
  dataType: "json",
42
  success: function (response) {
65
 
66
  console.log( response.data );
67
 
68
+ $reindexProgress.html( processed + '%' );
69
 
70
  // We are starting a sync
71
  syncStatus = 'sync';
72
 
73
+ sync( response.data );
74
  }
75
 
76
  },
77
  error : function( jqXHR, textStatus ) {
78
  console.log( "Request failed: " + textStatus );
 
79
  },
80
  complete: function () {
81
  }
83
 
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
86
  // Clear cache
87
  $clearCacheBtn.on( 'click', function(e) {
88
 
includes/class-aws-search-page.php CHANGED
@@ -71,14 +71,10 @@ if ( ! class_exists( 'AWS_Search_Page' ) ) :
71
  */
72
  private function aws_searchpage_enabled( $query ) {
73
  $enabled = true;
74
- $s = $query->get( 's' );
75
-
76
- if ( ( isset( $query->query_vars['s'] ) && ! isset( $_GET['type_aws'] ) ) || ! isset( $query->query_vars['s'] ) || empty( $s ) ) {
77
  $enabled = false;
78
  }
79
-
80
  return apply_filters( 'aws_searchpage_enabled', $enabled, $query );
81
-
82
  }
83
 
84
  /**
71
  */
72
  private function aws_searchpage_enabled( $query ) {
73
  $enabled = true;
74
+ if ( ( isset( $query->query_vars['s'] ) && ! isset( $_GET['type_aws'] ) ) || ! isset( $query->query_vars['s'] ) || ! $query->query_vars['s'] ) {
 
 
75
  $enabled = false;
76
  }
 
77
  return apply_filters( 'aws_searchpage_enabled', $enabled, $query );
 
78
  }
79
 
80
  /**
includes/class-aws-table.php CHANGED
@@ -43,8 +43,6 @@ if ( ! class_exists( 'AWS_Table' ) ) :
43
 
44
  add_action( 'aws_reindex_table', array( $this, 'reindex_table_job' ) );
45
 
46
- add_action( 'wp_ajax_aws-cancel-index', array( $this, 'cancel_reindex' ) );
47
-
48
  }
49
 
50
  /*
@@ -54,11 +52,11 @@ if ( ! class_exists( 'AWS_Table' ) ) :
54
 
55
  global $wpdb;
56
 
57
- $index_meta = get_option( 'aws_index_meta', false );
58
  $status = false;
59
 
60
  // No current index going on. Let's start over
61
- if ( false === $index_meta ) {
62
  $status = 'start';
63
  $index_meta = array(
64
  'offset' => 0,
@@ -82,7 +80,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
82
  }
83
 
84
  $index_meta = apply_filters( 'aws_index_meta', $index_meta );
85
- $posts_per_page = apply_filters( 'aws_index_posts_per_page', 30 );
86
 
87
 
88
  $args = array(
@@ -119,25 +117,17 @@ if ( ! class_exists( 'AWS_Table' ) ) :
119
  $index_meta['offset'] = $index_meta['found_posts'];
120
  }
121
 
122
- update_option( 'aws_index_meta', $index_meta );
123
-
124
  } else {
125
  // We are done (with this site)
126
 
127
  $index_meta['offset'] = (int) count( $posts );
128
 
129
- delete_option( 'aws_index_meta' );
130
-
131
  do_action('aws_cache_clear');
132
 
133
  update_option( 'aws_reindex_version', AWS_VERSION );
134
 
135
  }
136
 
137
- } else {
138
-
139
- update_option( 'aws_index_meta', $index_meta );
140
-
141
  }
142
 
143
  if ( $return ) {
@@ -551,16 +541,6 @@ if ( ! class_exists( 'AWS_Table' ) ) :
551
 
552
  }
553
 
554
- /*
555
- * Cancel index
556
- */
557
- public function cancel_reindex() {
558
-
559
- delete_option( 'aws_index_meta' );
560
-
561
- wp_send_json_success( 'Deleted!' );
562
- }
563
-
564
  /*
565
  * Strip shortcodes
566
  */
43
 
44
  add_action( 'aws_reindex_table', array( $this, 'reindex_table_job' ) );
45
 
 
 
46
  }
47
 
48
  /*
52
 
53
  global $wpdb;
54
 
55
+ $index_meta = $_POST['data'];
56
  $status = false;
57
 
58
  // No current index going on. Let's start over
59
+ if ( 'start' === $index_meta ) {
60
  $status = 'start';
61
  $index_meta = array(
62
  'offset' => 0,
80
  }
81
 
82
  $index_meta = apply_filters( 'aws_index_meta', $index_meta );
83
+ $posts_per_page = apply_filters( 'aws_index_posts_per_page', 10 );
84
 
85
 
86
  $args = array(
117
  $index_meta['offset'] = $index_meta['found_posts'];
118
  }
119
 
 
 
120
  } else {
121
  // We are done (with this site)
122
 
123
  $index_meta['offset'] = (int) count( $posts );
124
 
 
 
125
  do_action('aws_cache_clear');
126
 
127
  update_option( 'aws_reindex_version', AWS_VERSION );
128
 
129
  }
130
 
 
 
 
 
131
  }
132
 
133
  if ( $return ) {
541
 
542
  }
543
 
 
 
 
 
 
 
 
 
 
 
544
  /*
545
  * Strip shortcodes
546
  */
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Mihail Barinov
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GSE37FC4Y7CEY
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: 4.9.1
7
- Stable tag: 1.32
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
75
 
76
  == Changelog ==
77
 
 
 
 
 
78
  = 1.32 =
79
  * Fix shortcodes stripping from product content
80
  * Fix qTranslate plugin issue with product name
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GSE37FC4Y7CEY
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: 4.9.2
7
+ Stable tag: 1.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.33 =
79
+ * Fix re-index bug
80
+ * Fix bug with search page
81
+
82
  = 1.32 =
83
  * Fix shortcodes stripping from product content
84
  * Fix qTranslate plugin issue with product name