Relevanssi – A Better Search - Version 4.0.2

Version Description

  • Removed couple of error notices in the code.
  • Improved the support for page builders.
  • Improvements to the Polylang setting.
Download this release

Release Info

Developer msaari
Plugin Icon 128x128 Relevanssi – A Better Search
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

lib/admin_ajax.php CHANGED
@@ -1,14 +1,10 @@
1
  <?php
2
 
3
  add_action( 'wp_ajax_relevanssi_truncate_index', 'relevanssi_truncate_index_ajax_wrapper' );
4
- add_action( 'wp_ajax_relevanssi_index_taxonomies', 'relevanssi_index_taxonomies_ajax_wrapper' );
5
- add_action( 'wp_ajax_relevanssi_index_users', 'relevanssi_index_users_ajax_wrapper' );
6
  add_action( 'wp_ajax_relevanssi_index_posts', 'relevanssi_index_posts_ajax_wrapper' );
7
  add_action( 'wp_ajax_relevanssi_count_posts', 'relevanssi_count_posts_ajax_wrapper' );
8
  add_action( 'wp_ajax_relevanssi_count_missing_posts', 'relevanssi_count_missing_posts_ajax_wrapper' );
9
- add_action( 'wp_ajax_relevanssi_count_taxonomies', 'relevanssi_count_taxonomies_ajax_wrapper' );
10
  add_action( 'wp_ajax_relevanssi_list_categories', 'relevanssi_list_categories' );
11
- add_action( 'wp_ajax_relevanssi_list_taxonomies', 'relevanssi_list_taxonomies_wrapper' );
12
 
13
  function relevanssi_truncate_index_ajax_wrapper() {
14
  $response = relevanssi_truncate_index();
@@ -16,54 +12,6 @@ function relevanssi_truncate_index_ajax_wrapper() {
16
  wp_die();
17
  }
18
 
19
- function relevanssi_list_taxonomies_wrapper() {
20
- $taxonomies = array();
21
- if (function_exists('relevanssi_list_taxonomies')) {
22
- $taxonomies = relevanssi_list_taxonomies();
23
- }
24
- echo json_encode($taxonomies);
25
- wp_die();
26
- }
27
-
28
- function relevanssi_index_taxonomies_ajax_wrapper() {
29
- $completed = absint( $_POST['completed'] );
30
- $total = absint( $_POST['total'] );
31
- $taxonomy = $_POST['taxonomy'];
32
-
33
- $response = array();
34
-
35
- $indexing_response = relevanssi_index_taxonomies_ajax($taxonomy);
36
-
37
- $completed += $indexing_response['indexed'];
38
- if ($completed === $total) {
39
- $response['completed'] = "done";
40
- $response['total_posts'] = $completed;
41
- $response['percentage'] = 100;
42
- $response['feedback'] = sprintf(_n("%d taxonomy term, total %d / %d.", "%d taxonomy terms, total %d / %d.", $indexing_response['indexed'], 'relevanssi'), $indexing_response['indexed'], $completed, $total) . "\n";
43
- }
44
- else {
45
- $response['completed'] = $completed;
46
- $response['feedback'] = sprintf(_n("%d taxonomy term, total %d / %d.", "%d taxonomy terms, total %d / %d.", $indexing_response['indexed'], 'relevanssi'), $indexing_response['indexed'], $completed, $total) . "\n";
47
- $total > 0 ? $response['percentage'] = $completed / $total * 100 : $response['percentage'] = 0;
48
- }
49
- $response['offset'] = $offset;
50
-
51
- echo json_encode($response);
52
- wp_die();
53
- }
54
-
55
- function relevanssi_index_users_ajax_wrapper() {
56
- $is_ajax = true;
57
- if (get_option('relevanssi_index_users') === 'on') {
58
- $response = relevanssi_index_users($is_ajax);
59
- }
60
- else {
61
- $response = __("User indexing is disabled.", "relevanssi");
62
- }
63
- echo json_encode($response);
64
- wp_die();
65
- }
66
-
67
  function relevanssi_index_posts_ajax_wrapper() {
68
  $completed = absint( $_POST['completed'] );
69
  $total = absint( $_POST['total'] );
@@ -105,22 +53,13 @@ function relevanssi_index_posts_ajax_wrapper() {
105
  $total > 0 ? $response['percentage'] = $processed / $total * 100 : $response['percentage'] = 0;
106
  }
107
 
108
- $response['feedback'] .= sprintf(_n("Indexed %d post (total %d), processed %d / %d.", "Indexed %d posts (total %d), processed %d / %d.", $indexing_response['indexed'], 'relevanssi'), $indexing_response['indexed'], $completed, $processed, $total) . "\n";
109
  $response['offset'] = $offset;
110
 
111
  echo json_encode($response);
112
  wp_die();
113
  }
114
 
115
- function relevanssi_count_taxonomies_ajax_wrapper() {
116
- $count = -1;
117
- if (function_exists('relevanssi_count_taxonomy_terms')) {
118
- $count = relevanssi_count_taxonomy_terms();
119
- }
120
- echo json_encode($count);
121
- wp_die();
122
- }
123
-
124
  function relevanssi_count_posts_ajax_wrapper() {
125
  $count = relevanssi_count_total_posts();
126
  echo json_encode($count);
1
  <?php
2
 
3
  add_action( 'wp_ajax_relevanssi_truncate_index', 'relevanssi_truncate_index_ajax_wrapper' );
 
 
4
  add_action( 'wp_ajax_relevanssi_index_posts', 'relevanssi_index_posts_ajax_wrapper' );
5
  add_action( 'wp_ajax_relevanssi_count_posts', 'relevanssi_count_posts_ajax_wrapper' );
6
  add_action( 'wp_ajax_relevanssi_count_missing_posts', 'relevanssi_count_missing_posts_ajax_wrapper' );
 
7
  add_action( 'wp_ajax_relevanssi_list_categories', 'relevanssi_list_categories' );
 
8
 
9
  function relevanssi_truncate_index_ajax_wrapper() {
10
  $response = relevanssi_truncate_index();
12
  wp_die();
13
  }
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  function relevanssi_index_posts_ajax_wrapper() {
16
  $completed = absint( $_POST['completed'] );
17
  $total = absint( $_POST['total'] );
53
  $total > 0 ? $response['percentage'] = $processed / $total * 100 : $response['percentage'] = 0;
54
  }
55
 
56
+ $response['feedback'] = sprintf(_n("Indexed %d post (total %d), processed %d / %d.", "Indexed %d posts (total %d), processed %d / %d.", $indexing_response['indexed'], 'relevanssi'), $indexing_response['indexed'], $completed, $processed, $total) . "\n";
57
  $response['offset'] = $offset;
58
 
59
  echo json_encode($response);
60
  wp_die();
61
  }
62
 
 
 
 
 
 
 
 
 
 
63
  function relevanssi_count_posts_ajax_wrapper() {
64
  $count = relevanssi_count_total_posts();
65
  echo json_encode($count);
lib/excerpts-highlights.php CHANGED
@@ -671,6 +671,7 @@ function relevanssi_remove_page_builder_shortcodes($content) {
671
  '/\[vc_raw_html.*?\].*\[\/vc_raw_html\]/', // Raw HTML: remove contents
672
  '/\[\/?vc.*?\]/',
673
  '/\[\/?mk.*?\]/',
 
674
  ));
675
  $content = preg_replace($search_array, '', $content);
676
  return $content;
671
  '/\[vc_raw_html.*?\].*\[\/vc_raw_html\]/', // Raw HTML: remove contents
672
  '/\[\/?vc.*?\]/',
673
  '/\[\/?mk.*?\]/',
674
+ '/\[\/?cs_.*?\]/',
675
  ));
676
  $content = preg_replace($search_array, '', $content);
677
  return $content;
lib/indexing.php CHANGED
@@ -197,6 +197,7 @@ function relevanssi_build_index($extend_offset = false, $verbose = true, $post_l
197
  $limit = "";
198
  }
199
 
 
200
  $q = relevanssi_generate_indexing_query($valid_status, $extend, $restriction, $limit);
201
  }
202
 
@@ -904,6 +905,7 @@ function relevanssi_get_comments($postID) {
904
  */
905
  function relevanssi_index_acf(&$insert_data, $post_id, $field_name, $field_value) {
906
  if (!is_admin() ) include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // otherwise is_plugin_active will cause a fatal error
 
907
  if (!is_plugin_active('advanced-custom-fields/acf.php') &&
908
  !is_plugin_active('advanced-custom-fields-pro/acf.php')) return;
909
 
197
  $limit = "";
198
  }
199
 
200
+ $extend = true;
201
  $q = relevanssi_generate_indexing_query($valid_status, $extend, $restriction, $limit);
202
  }
203
 
905
  */
906
  function relevanssi_index_acf(&$insert_data, $post_id, $field_name, $field_value) {
907
  if (!is_admin() ) include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // otherwise is_plugin_active will cause a fatal error
908
+ if (!function_exists('is_plugin_active')) return;
909
  if (!is_plugin_active('advanced-custom-fields/acf.php') &&
910
  !is_plugin_active('advanced-custom-fields-pro/acf.php')) return;
911
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: search, relevance, better search
5
  Requires at least: 4.0
6
  Tested up to: 4.9.1
7
  Requires PHP: 5.6
8
- Stable tag: 4.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -280,6 +280,11 @@ Each document database is full of useless words. All the little words that appea
280
 
281
  == Changelog ==
282
 
 
 
 
 
 
283
  = 4.0.1 =
284
  * The plugin can now be uninstalled.
285
 
@@ -1132,6 +1137,9 @@ Each document database is full of useless words. All the little words that appea
1132
 
1133
  == Upgrade notice ==
1134
 
 
 
 
1135
  = 4.0.1 =
1136
  * Fixes a bug in uninstalling the plugin.
1137
 
5
  Requires at least: 4.0
6
  Tested up to: 4.9.1
7
  Requires PHP: 5.6
8
+ Stable tag: 4.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
280
 
281
  == Changelog ==
282
 
283
+ = 4.0.2 =
284
+ * Removed couple of error notices in the code.
285
+ * Improved the support for page builders.
286
+ * Improvements to the Polylang setting.
287
+
288
  = 4.0.1 =
289
  * The plugin can now be uninstalled.
290
 
1137
 
1138
  == Upgrade notice ==
1139
 
1140
+ = 4.0.2 =
1141
+ * Minor bugfixes.
1142
+
1143
  = 4.0.1 =
1144
  * Fixes a bug in uninstalling the plugin.
1145
 
relevanssi.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Relevanssi
4
  Plugin URI: https://www.relevanssi.com/
5
  Description: This plugin replaces WordPress search with a relevance-sorting search.
6
- Version: 4.0.1
7
  Author: Mikko Saari
8
  Author URI: http://www.mikkosaari.fi/
9
  Text Domain: relevanssi
3
  Plugin Name: Relevanssi
4
  Plugin URI: https://www.relevanssi.com/
5
  Description: This plugin replaces WordPress search with a relevance-sorting search.
6
+ Version: 4.0.2
7
  Author: Mikko Saari
8
  Author URI: http://www.mikkosaari.fi/
9
  Text Domain: relevanssi
relevanssi.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Relevanssi\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2017-12-01 06:51+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Mikko Saari <mikko@mikkosaari.fi>\n"
8
  "Language-Team: \n"
@@ -14,7 +14,6 @@ msgstr ""
14
  "X-Poedit-Basepath: .\n"
15
  "X-Generator: Poedit 2.0.4\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
- "X-Poedit-SearchPath-1: lib\n"
18
 
19
  #: lib/admin_ajax.php:61
20
  msgid "User indexing is disabled."
2
  msgstr ""
3
  "Project-Id-Version: Relevanssi\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-11-30 11:49+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Mikko Saari <mikko@mikkosaari.fi>\n"
8
  "Language-Team: \n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Generator: Poedit 2.0.4\n"
16
  "X-Poedit-SearchPath-0: .\n"
 
17
 
18
  #: lib/admin_ajax.php:61
19
  msgid "User indexing is disabled."