Version Description
- Fix terms translation for multilingual plugins
- Update special chars filter
- Add diacritic chars filter
Download this release
Release Info
Developer | Mihail Barinov |
Plugin | Advanced Woo Search |
Version | 1.52 |
Comparing to | |
See all releases |
Code changes from version 1.51 to 1.52
- advanced-woo-search.php +2 -2
- includes/class-aws-helpers.php +304 -34
- includes/class-aws-search.php +9 -5
- includes/class-aws-table.php +6 -17
- readme.txt +11 -4
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.
|
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.
|
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.52
|
7 |
Author: ILLID
|
8 |
Author URI: https://advanced-woo-search.com/
|
9 |
Text Domain: aws
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
+
define( 'AWS_VERSION', '1.52' );
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
includes/class-aws-helpers.php
CHANGED
@@ -109,46 +109,316 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
|
|
109 |
static public function get_special_chars() {
|
110 |
|
111 |
$chars = array(
|
112 |
-
'
|
113 |
-
'
|
114 |
-
'
|
115 |
-
'
|
116 |
-
'
|
117 |
-
'
|
118 |
-
'
|
119 |
-
'
|
120 |
-
'
|
121 |
-
'
|
122 |
-
'
|
123 |
-
'
|
124 |
-
'
|
125 |
-
'
|
126 |
-
'
|
127 |
-
'
|
128 |
-
'
|
129 |
-
'
|
130 |
-
';',
|
131 |
-
'
|
132 |
-
|
133 |
-
'
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
);
|
147 |
|
148 |
return apply_filters( 'aws_special_chars', $chars );
|
149 |
|
150 |
}
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
/*
|
153 |
* Replace stopwords
|
154 |
*/
|
109 |
static public function get_special_chars() {
|
110 |
|
111 |
$chars = array(
|
112 |
+
'!', //exclamation point
|
113 |
+
'"', //double quotes
|
114 |
+
'"', //double quotes
|
115 |
+
'#', //number sign
|
116 |
+
'$', //dollar sign
|
117 |
+
'%', //percent sign
|
118 |
+
'&', //ampersand
|
119 |
+
'&', //ampersand
|
120 |
+
''', //single quote
|
121 |
+
''', //single quote
|
122 |
+
'(', //opening parenthesis
|
123 |
+
')', //closing parenthesis
|
124 |
+
'*', //asterisk
|
125 |
+
'+', //plus sign
|
126 |
+
',', //comma
|
127 |
+
'-', //minus sign - hyphen
|
128 |
+
'.', //period
|
129 |
+
'/', //slash
|
130 |
+
':', //colon
|
131 |
+
';', //semicolon
|
132 |
+
'<', //less than sign
|
133 |
+
'<', //less than sign
|
134 |
+
'=', //equal sign
|
135 |
+
'>', //greater than sign
|
136 |
+
'>', //greater than sign
|
137 |
+
'?', //question mark
|
138 |
+
'@', //at symbol
|
139 |
+
'[', //opening bracket
|
140 |
+
'\', //backslash
|
141 |
+
']', //closing bracket
|
142 |
+
'^', //caret - circumflex
|
143 |
+
'_', //underscore
|
144 |
+
'`', //grave accent
|
145 |
+
'{', //opening brace
|
146 |
+
'|', //vertical bar
|
147 |
+
'}', //closing brace
|
148 |
+
'~', //equivalency sign - tilde
|
149 |
+
'¡', //inverted exclamation mark
|
150 |
+
'¡', //inverted exclamation mark
|
151 |
+
'¢', //cent sign
|
152 |
+
'¢', //cent sign
|
153 |
+
'£', //pound sign
|
154 |
+
'£', //pound sign
|
155 |
+
'¤', //currency sign
|
156 |
+
'¤', //currency sign
|
157 |
+
'¥', //yen sign
|
158 |
+
'¥', //yen sign
|
159 |
+
'¦', //broken vertical bar
|
160 |
+
'¦', //broken vertical bar
|
161 |
+
'§', //section sign
|
162 |
+
'§', //section sign
|
163 |
+
'¨', //spacing diaeresis - umlaut
|
164 |
+
'¨', //spacing diaeresis - umlaut
|
165 |
+
'©', //copyright sign
|
166 |
+
'©', //copyright sign
|
167 |
+
'ª', //feminine ordinal indicator
|
168 |
+
'ª', //feminine ordinal indicator
|
169 |
+
'«', //left double angle quotes
|
170 |
+
'«', //left double angle quotes
|
171 |
+
'¬', //not sign
|
172 |
+
'¬', //not sign
|
173 |
+
'®', //registered trade mark sign
|
174 |
+
'®', //registered trade mark sign
|
175 |
+
'¯', //spacing macron - overline
|
176 |
+
'¯', //spacing macron - overline
|
177 |
+
'°', //degree sign
|
178 |
+
'°', //degree sign
|
179 |
+
'±', //plus-or-minus sign
|
180 |
+
'±', //plus-or-minus sign
|
181 |
+
'²', //superscript two - squared
|
182 |
+
'²', //superscript two - squared
|
183 |
+
'³', //superscript three - cubed
|
184 |
+
'³', //superscript three - cubed
|
185 |
+
'´', //acute accent - spacing acute
|
186 |
+
'´', //acute accent - spacing acute
|
187 |
+
'µ', //micro sign
|
188 |
+
'µ', //micro sign
|
189 |
+
'¶', //pilcrow sign - paragraph sign
|
190 |
+
'¶', //pilcrow sign - paragraph sign
|
191 |
+
'·', //middle dot - Georgian comma
|
192 |
+
'·', //middle dot - Georgian comma
|
193 |
+
'¸', //spacing cedilla
|
194 |
+
'¸', //spacing cedilla
|
195 |
+
'¹', //superscript one
|
196 |
+
'¹', //superscript one
|
197 |
+
'º', //masculine ordinal indicator
|
198 |
+
'º', //masculine ordinal indicator
|
199 |
+
'»', //right double angle quotes
|
200 |
+
'»', //right double angle quotes
|
201 |
+
'¼', //fraction one quarter
|
202 |
+
'¼', //fraction one quarter
|
203 |
+
'½', //fraction one half
|
204 |
+
'½', //fraction one half
|
205 |
+
'¾', //fraction three quarters
|
206 |
+
'¾', //fraction three quarters
|
207 |
+
'¿', //inverted question mark
|
208 |
+
'¿', //inverted question mark
|
209 |
+
'÷', //division sign
|
210 |
+
'÷', //division sign
|
211 |
+
'–', //en dash
|
212 |
+
'—', //em dash
|
213 |
+
'‘', //left single quotation mark
|
214 |
+
'’', //right single quotation mark
|
215 |
+
'‚', //single low-9 quotation mark
|
216 |
+
'“', //left double quotation mark
|
217 |
+
'”', //right double quotation mark
|
218 |
+
'„', //double low-9 quotation mark
|
219 |
+
'†', //dagger
|
220 |
+
'‡', //double dagger
|
221 |
+
'•', //bullet
|
222 |
+
'…', //horizontal ellipsis
|
223 |
+
'‰', //per thousand sign
|
224 |
+
'€', //euro sign
|
225 |
+
'€', //euro sign
|
226 |
+
'™', //trade mark sign
|
227 |
+
'!', //exclamation point
|
228 |
+
'"', //double quotes
|
229 |
+
'#', //number sign
|
230 |
+
'$', //dollar sign
|
231 |
+
'%', //percent sign
|
232 |
+
'&', //ampersand
|
233 |
+
"'", //single quote
|
234 |
+
'(', //opening parenthesis
|
235 |
+
')', //closing parenthesis
|
236 |
+
'*', //asterisk
|
237 |
+
'+', //plus sign
|
238 |
+
",", //comma
|
239 |
+
'-', //minus sign - hyphen
|
240 |
+
".", //period
|
241 |
+
"/", //slash
|
242 |
+
':', //colon
|
243 |
+
';', //semicolon
|
244 |
+
"<", //less than sign
|
245 |
+
"=", //equal sign
|
246 |
+
">", //greater than sign
|
247 |
+
'?', //question mark
|
248 |
+
'@', //at symbol
|
249 |
+
"[", //opening bracket
|
250 |
+
'\\', //backslash
|
251 |
+
"]", //closing bracket
|
252 |
+
'^', //caret - circumflex
|
253 |
+
'_', //underscore
|
254 |
+
'`', //grave accent
|
255 |
+
"{", //opening brace
|
256 |
+
'|', //vertical bar
|
257 |
+
"}", //closing brace
|
258 |
+
'~', //equivalency sign - tilde
|
259 |
+
'¡', //inverted exclamation mark
|
260 |
+
'¢', //cent sign
|
261 |
+
'£', //pound sign
|
262 |
+
'¤', //currency sign
|
263 |
+
'¥', //yen sign
|
264 |
+
'¦', //broken vertical bar
|
265 |
+
'§', //section sign
|
266 |
+
'¨', //spacing diaeresis - umlaut
|
267 |
+
'©', //copyright sign
|
268 |
+
'ª', //feminine ordinal indicator
|
269 |
+
'«', //left double angle quotes
|
270 |
+
'¬', //not sign
|
271 |
+
'®', //registered trade mark sign
|
272 |
+
'¯', //spacing macron - overline
|
273 |
+
'°', //degree sign
|
274 |
+
'±', //plus-or-minus sign
|
275 |
+
'²', //superscript two - squared
|
276 |
+
'³', //superscript three - cubed
|
277 |
+
'´', //acute accent - spacing acute
|
278 |
+
'µ', //micro sign
|
279 |
+
'¶', //pilcrow sign - paragraph sign
|
280 |
+
'·', //middle dot - Georgian comma
|
281 |
+
'¸', //spacing cedilla
|
282 |
+
'¹', //superscript one
|
283 |
+
'º', //masculine ordinal indicator
|
284 |
+
'»', //right double angle quotes
|
285 |
+
'¼', //fraction one quarter
|
286 |
+
'½', //fraction one half
|
287 |
+
'¾', //fraction three quarters
|
288 |
+
'¿', //inverted question mark
|
289 |
+
'÷', //division sign
|
290 |
+
'–', //en dash
|
291 |
+
'—', //em dash
|
292 |
+
'‘', //left single quotation mark
|
293 |
+
"’", //right single quotation mark
|
294 |
+
'‚', //single low-9 quotation mark
|
295 |
+
"“", //left double quotation mark
|
296 |
+
"”", //right double quotation mark
|
297 |
+
'„', //double low-9 quotation mark
|
298 |
+
'†', //dagger
|
299 |
+
'‡', //double dagger
|
300 |
+
'•', //bullet
|
301 |
+
'…', //horizontal ellipsis
|
302 |
+
'‰', //per thousand sign
|
303 |
+
'€', //euro sign
|
304 |
+
'™', //trade mark sign
|
305 |
);
|
306 |
|
307 |
return apply_filters( 'aws_special_chars', $chars );
|
308 |
|
309 |
}
|
310 |
|
311 |
+
/*
|
312 |
+
* Get diacritical marks
|
313 |
+
*/
|
314 |
+
static public function get_diacritic_chars() {
|
315 |
+
|
316 |
+
$chars = array(
|
317 |
+
'Š'=>'S',
|
318 |
+
'š'=>'s',
|
319 |
+
'Ž'=>'Z',
|
320 |
+
'ž'=>'z',
|
321 |
+
'À'=>'A',
|
322 |
+
'Á'=>'A',
|
323 |
+
'Â'=>'A',
|
324 |
+
'Ã'=>'A',
|
325 |
+
'Ä'=>'A',
|
326 |
+
'Å'=>'A',
|
327 |
+
'Æ'=>'A',
|
328 |
+
'Ç'=>'C',
|
329 |
+
'È'=>'E',
|
330 |
+
'É'=>'E',
|
331 |
+
'Ê'=>'E',
|
332 |
+
'Ë'=>'E',
|
333 |
+
'Ì'=>'I',
|
334 |
+
'Í'=>'I',
|
335 |
+
'Î'=>'I',
|
336 |
+
'Ï'=>'I',
|
337 |
+
'Ñ'=>'N',
|
338 |
+
'Ò'=>'O',
|
339 |
+
'Ó'=>'O',
|
340 |
+
'Ô'=>'O',
|
341 |
+
'Õ'=>'O',
|
342 |
+
'Ö'=>'O',
|
343 |
+
'Ø'=>'O',
|
344 |
+
'Ù'=>'U',
|
345 |
+
'Ú'=>'U',
|
346 |
+
'Û'=>'U',
|
347 |
+
'Ü'=>'U',
|
348 |
+
'Ý'=>'Y',
|
349 |
+
'à'=>'a',
|
350 |
+
'á'=>'a',
|
351 |
+
'â'=>'a',
|
352 |
+
'ã'=>'a',
|
353 |
+
'ä'=>'a',
|
354 |
+
'å'=>'a',
|
355 |
+
'ç'=>'c',
|
356 |
+
'è'=>'e',
|
357 |
+
'é'=>'e',
|
358 |
+
'ê'=>'e',
|
359 |
+
'ë'=>'e',
|
360 |
+
'ì'=>'i',
|
361 |
+
'í'=>'i',
|
362 |
+
'î'=>'i',
|
363 |
+
'ï'=>'i',
|
364 |
+
'ð'=>'o',
|
365 |
+
'ñ'=>'n',
|
366 |
+
'ò'=>'o',
|
367 |
+
'ó'=>'o',
|
368 |
+
'ô'=>'o',
|
369 |
+
'õ'=>'o',
|
370 |
+
'ö'=>'o',
|
371 |
+
'ø'=>'o',
|
372 |
+
'ù'=>'u',
|
373 |
+
'ú'=>'u',
|
374 |
+
'û'=>'u',
|
375 |
+
'ý'=>'y',
|
376 |
+
'þ'=>'b',
|
377 |
+
'ÿ'=>'y',
|
378 |
+
);
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Filters array of diacritic chars
|
382 |
+
*
|
383 |
+
* @since 1.52
|
384 |
+
*/
|
385 |
+
return apply_filters( 'aws_diacritic_chars', $chars );
|
386 |
+
|
387 |
+
}
|
388 |
+
|
389 |
+
/*
|
390 |
+
* Normalize string
|
391 |
+
*/
|
392 |
+
static public function normalize_string( $string ) {
|
393 |
+
|
394 |
+
$special_chars = AWS_Helpers::get_special_chars();
|
395 |
+
|
396 |
+
$string = AWS_Helpers::html2txt( $string );
|
397 |
+
$string = str_replace( $special_chars, '', $string );
|
398 |
+
$string = str_replace( array( ' ', ' ' ), ' ', $string );
|
399 |
+
$string = trim( $string );
|
400 |
+
|
401 |
+
//$str = preg_replace( '/[[:punct:]]+/u', ' ', $str );
|
402 |
+
$string = preg_replace( '/[[:space:]]+/', ' ', $string );
|
403 |
+
|
404 |
+
// Most objects except unicode characters
|
405 |
+
$string = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', '', $string );
|
406 |
+
|
407 |
+
// Line feeds, carriage returns, tabs
|
408 |
+
$string = preg_replace( '/[\x00-\x1F\x80-\x9F]/u', '', $string );
|
409 |
+
|
410 |
+
// Diacritical marks
|
411 |
+
$string = strtr( $string, AWS_Helpers::get_diacritic_chars() );
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Filters normalized string
|
415 |
+
*
|
416 |
+
* @since 1.52
|
417 |
+
*/
|
418 |
+
return apply_filters( 'aws_normalize_string', $string );
|
419 |
+
|
420 |
+
}
|
421 |
+
|
422 |
/*
|
423 |
* Replace stopwords
|
424 |
*/
|
includes/class-aws-search.php
CHANGED
@@ -78,15 +78,18 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
78 |
|
79 |
$this->lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : '';
|
80 |
|
|
|
|
|
|
|
|
|
81 |
$cache = AWS()->get_settings( 'cache' );
|
82 |
-
$special_chars = AWS_Helpers::get_special_chars();
|
83 |
|
84 |
$s = $keyword ? esc_attr( $keyword ) : esc_attr( $_POST['keyword'] );
|
85 |
$s = htmlspecialchars_decode( $s );
|
86 |
-
|
87 |
-
$s =
|
88 |
-
|
89 |
-
|
90 |
//$s = strtolower( $s );
|
91 |
|
92 |
$cache_option_name = '';
|
@@ -366,6 +369,7 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
366 |
LIMIT 0, {$results_num}
|
367 |
";
|
368 |
|
|
|
369 |
$posts_ids = $this->get_posts_ids( $sql );
|
370 |
|
371 |
return $posts_ids;
|
78 |
|
79 |
$this->lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : '';
|
80 |
|
81 |
+
if ( $this->lang ) {
|
82 |
+
do_action( 'wpml_switch_language', $this->lang );
|
83 |
+
}
|
84 |
+
|
85 |
$cache = AWS()->get_settings( 'cache' );
|
|
|
86 |
|
87 |
$s = $keyword ? esc_attr( $keyword ) : esc_attr( $_POST['keyword'] );
|
88 |
$s = htmlspecialchars_decode( $s );
|
89 |
+
|
90 |
+
$s = AWS_Helpers::normalize_string( $s );
|
91 |
+
|
92 |
+
|
93 |
//$s = strtolower( $s );
|
94 |
|
95 |
$cache_option_name = '';
|
369 |
LIMIT 0, {$results_num}
|
370 |
";
|
371 |
|
372 |
+
|
373 |
$posts_ids = $this->get_posts_ids( $sql );
|
374 |
|
375 |
return $posts_ids;
|
includes/class-aws-table.php
CHANGED
@@ -255,6 +255,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
255 |
$sku = $product->get_sku();
|
256 |
|
257 |
$title = apply_filters( 'the_title', get_the_title( $data['id'] ), $data['id'] );
|
|
|
258 |
$content = apply_filters( 'the_content', get_post_field( 'post_content', $data['id'] ), $data['id'] );
|
259 |
$excerpt = get_post_field( 'post_excerpt', $data['id'] );
|
260 |
$cat_array = $this->get_terms_array( $data['id'], 'product_cat' );
|
@@ -402,7 +403,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
402 |
$translated_post_data['terms']['excerpt'] = $this->extract_terms( $translated_excerpt );
|
403 |
$translated_post_data['terms']['sku'] = $this->extract_terms( $sku );
|
404 |
|
405 |
-
|
406 |
//Insert translated product data into table
|
407 |
$this->insert_into_table( $translated_post_data );
|
408 |
|
@@ -660,13 +661,10 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
660 |
*/
|
661 |
private function extract_terms( $str ) {
|
662 |
|
663 |
-
$str = AWS_Helpers::html2txt( $str );
|
664 |
-
|
665 |
// Avoid single A-Z.
|
666 |
//$str = preg_replace( '/\b\w{1}\b/i', " ", $str );
|
667 |
-
|
668 |
-
$
|
669 |
-
$str = str_replace( $special_cars, "", $str );
|
670 |
|
671 |
$str = str_replace( array(
|
672 |
"ˇ",
|
@@ -693,15 +691,6 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
693 |
|
694 |
$str = str_replace( 'Ăź', 'ss', $str );
|
695 |
|
696 |
-
//$str = preg_replace( '/[[:punct:]]+/u', ' ', $str );
|
697 |
-
$str = preg_replace( '/[[:space:]]+/', ' ', $str );
|
698 |
-
|
699 |
-
// Most objects except unicode characters
|
700 |
-
$str = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', '', $str );
|
701 |
-
|
702 |
-
// Line feeds, carriage returns, tabs
|
703 |
-
$str = preg_replace( '/[\x00-\x1F\x80-\x9F]/u', '', $str );
|
704 |
-
|
705 |
if ( function_exists( 'mb_strtolower' ) ) {
|
706 |
$str = mb_strtolower( $str );
|
707 |
} else {
|
@@ -710,7 +699,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
710 |
|
711 |
$str = preg_replace( '/^[a-z]$/i', "", $str );
|
712 |
|
713 |
-
$str =
|
714 |
|
715 |
/**
|
716 |
* Filters extracted string
|
@@ -744,7 +733,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
744 |
*/
|
745 |
private function get_terms_array( $id, $taxonomy ) {
|
746 |
|
747 |
-
$terms =
|
748 |
|
749 |
if ( is_wp_error( $terms ) ) {
|
750 |
return '';
|
255 |
$sku = $product->get_sku();
|
256 |
|
257 |
$title = apply_filters( 'the_title', get_the_title( $data['id'] ), $data['id'] );
|
258 |
+
|
259 |
$content = apply_filters( 'the_content', get_post_field( 'post_content', $data['id'] ), $data['id'] );
|
260 |
$excerpt = get_post_field( 'post_excerpt', $data['id'] );
|
261 |
$cat_array = $this->get_terms_array( $data['id'], 'product_cat' );
|
403 |
$translated_post_data['terms']['excerpt'] = $this->extract_terms( $translated_excerpt );
|
404 |
$translated_post_data['terms']['sku'] = $this->extract_terms( $sku );
|
405 |
|
406 |
+
|
407 |
//Insert translated product data into table
|
408 |
$this->insert_into_table( $translated_post_data );
|
409 |
|
661 |
*/
|
662 |
private function extract_terms( $str ) {
|
663 |
|
|
|
|
|
664 |
// Avoid single A-Z.
|
665 |
//$str = preg_replace( '/\b\w{1}\b/i', " ", $str );
|
666 |
+
|
667 |
+
$str = AWS_Helpers::normalize_string( $str );
|
|
|
668 |
|
669 |
$str = str_replace( array(
|
670 |
"ˇ",
|
691 |
|
692 |
$str = str_replace( 'Ăź', 'ss', $str );
|
693 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
694 |
if ( function_exists( 'mb_strtolower' ) ) {
|
695 |
$str = mb_strtolower( $str );
|
696 |
} else {
|
699 |
|
700 |
$str = preg_replace( '/^[a-z]$/i', "", $str );
|
701 |
|
702 |
+
$str = preg_replace( '/\s+/', ' ', $str );
|
703 |
|
704 |
/**
|
705 |
* Filters extracted string
|
733 |
*/
|
734 |
private function get_terms_array( $id, $taxonomy ) {
|
735 |
|
736 |
+
$terms = wp_get_object_terms( $id, $taxonomy );
|
737 |
|
738 |
if ( is_wp_error( $terms ) ) {
|
739 |
return '';
|
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: 4.9.8
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -30,6 +30,7 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
|
|
30 |
* Support for your current **search page**. Plugin search results will be integrated to your current page layout.
|
31 |
* Automatically synchronize all products data. No need to re-index all content manually after avery change.
|
32 |
* Plurals support
|
|
|
33 |
* Google Analytics support
|
34 |
* **WPML**, **Polylang**, **WooCommerce Multilingual**, **qTranslate** support
|
35 |
* **WPML multi-currency** support
|
@@ -38,7 +39,7 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
|
|
38 |
|
39 |
= Premium Features =
|
40 |
|
41 |
-
[Premium Version Demo](https://advanced-woo-search.com
|
42 |
|
43 |
* Search **results layouts**
|
44 |
* Search **form layouts**
|
@@ -53,10 +54,11 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
|
|
53 |
* **Visibility/stock status option** - choose what catalog visibility and stock status must be for product to displayed in search results
|
54 |
* Show product **categories** and **variations** in search results
|
55 |
* AND or OR search logic
|
|
|
56 |
* Support for [WooCommerce Brands plugin](https://woocommerce.com/products/brands/)
|
57 |
* Support for Advanced Custom Fields plugin
|
58 |
|
59 |
-
[Features list](https://advanced-woo-search.com/features
|
60 |
|
61 |
== Installation ==
|
62 |
|
@@ -68,7 +70,7 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
|
|
68 |
|
69 |
= Knowledge Base =
|
70 |
|
71 |
-
You can find solutions and answers at the [Advanced Woo Search guide](https://advanced-woo-search.com/guide
|
72 |
|
73 |
= How to insert search form? =
|
74 |
|
@@ -96,6 +98,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
|
|
96 |
|
97 |
== Changelog ==
|
98 |
|
|
|
|
|
|
|
|
|
|
|
99 |
= 1.51 =
|
100 |
* Update seamless integration filter hook
|
101 |
* Fix WPML language select
|
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.8
|
7 |
+
Stable tag: 1.52
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
30 |
* Support for your current **search page**. Plugin search results will be integrated to your current page layout.
|
31 |
* Automatically synchronize all products data. No need to re-index all content manually after avery change.
|
32 |
* Plurals support
|
33 |
+
* Diacritical marks support
|
34 |
* Google Analytics support
|
35 |
* **WPML**, **Polylang**, **WooCommerce Multilingual**, **qTranslate** support
|
36 |
* **WPML multi-currency** support
|
39 |
|
40 |
= Premium Features =
|
41 |
|
42 |
+
[Premium Version Demo](https://advanced-woo-search.com/?utm_source=wp-repo&utm_medium=listing&utm_campaign=aws-repo)
|
43 |
|
44 |
* Search **results layouts**
|
45 |
* Search **form layouts**
|
54 |
* **Visibility/stock status option** - choose what catalog visibility and stock status must be for product to displayed in search results
|
55 |
* Show product **categories** and **variations** in search results
|
56 |
* AND or OR search logic
|
57 |
+
* **Add to cart** button in search results
|
58 |
* Support for [WooCommerce Brands plugin](https://woocommerce.com/products/brands/)
|
59 |
* Support for Advanced Custom Fields plugin
|
60 |
|
61 |
+
[Features list](https://advanced-woo-search.com/features/?utm_source=wp-repo&utm_medium=listing&utm_campaign=aws-repo)
|
62 |
|
63 |
== Installation ==
|
64 |
|
70 |
|
71 |
= Knowledge Base =
|
72 |
|
73 |
+
You can find solutions and answers at the [Advanced Woo Search guide](https://advanced-woo-search.com/guide/?utm_source=wp-repo&utm_medium=listing&utm_campaign=aws-repo).
|
74 |
|
75 |
= How to insert search form? =
|
76 |
|
98 |
|
99 |
== Changelog ==
|
100 |
|
101 |
+
= 1.52 =
|
102 |
+
* Fix terms translation for multilingual plugins
|
103 |
+
* Update special chars filter
|
104 |
+
* Add diacritic chars filter
|
105 |
+
|
106 |
= 1.51 =
|
107 |
* Update seamless integration filter hook
|
108 |
* Fix WPML language select
|