\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{__(\"Reason this post is not indexed:\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t{relevanssiSees.reason}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"If any of these keywords are present in the search query, this post will be moved on top of the search results.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"You can add weights to pinned keywords like this: 'keyword (100)'. The post with the highest weight will be sorted first if there are multiple posts pinned to the same keyword.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"If any of these keywords are present in the search query, this post will be removed from the search results.\", \"relevanssi\" )}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"Anything entered here will used when searching for related posts. Using phrases with quotes is allowed, but will restrict the related posts to posts including that phrase.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\t\"The most common search terms used to find this post:\",\n\t\t\t\t\t\t\t\t\t\"relevanssi\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\t\"Low-ranking search terms used to find this post:\",\n\t\t\t\t\t\t\t\t\t\"relevanssi\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
",
- esc_html__( "There was a problem, and content stopwords couldn't be removed.", 'relevanssi' )
- );
- }
-}
-
-/**
- * Updates the current language content stopwords in the stopwords option.
- *
- * Fetches the stopwords option, replaces the current language stopwords with
- * the parameter array and updates the option.
- *
- * @param array $stopwords An array of stopwords.
- *
- * @return boolean The return value from update_option().
- */
-function relevanssi_update_body_stopwords( $stopwords ) {
- $current_language = relevanssi_get_current_language();
- $stopwords_option = get_option( 'relevanssi_body_stopwords', array() );
-
- $stopwords_option[ $current_language ] = implode( ',', array_filter( $stopwords ) );
- return update_option(
- 'relevanssi_body_stopwords',
- $stopwords_option
- );
-}
-
-/**
- * Removes a single content stopword.
- *
- * @param string $term The stopword to remove.
- * @param boolean $verbose If true, print out a notice. Default true.
- *
- * @return boolean True if success, false if not.
- */
-function relevanssi_remove_body_stopword( $term, $verbose = true ) {
- $stopwords = relevanssi_fetch_body_stopwords();
- $term = stripslashes( $term );
- $stopwords = array_filter(
- $stopwords,
- function ( $stopword ) use ( $term ) {
- return $stopword !== $term;
- }
- );
-
- $success = relevanssi_update_body_stopwords( $stopwords );
-
- if ( $success ) {
- if ( $verbose ) {
- printf(
- "
%s
",
- sprintf(
- // Translators: %s is the stopword.
- esc_html__(
- "Term '%s' removed from content stopwords! Re-index to get it back to index.",
- 'relevanssi'
- ),
- esc_html( stripslashes( $term ) )
- )
- );
- }
- return true;
- } else {
- if ( $verbose ) {
- printf(
- "
%s
",
- sprintf(
- // Translators: %s is the stopword.
- esc_html__(
- "Couldn't remove term '%s' from content stopwords!",
- 'relevanssi'
- ),
- esc_html( stripslashes( $term ) )
- )
- );
- }
- return false;
- }
-}
-
-/**
- * Fetches the list of content stopwords.
- *
- * Gets the list of content stopwords from the options.
- *
- * @return array An array of stopwords.
- */
-function relevanssi_fetch_body_stopwords() {
- $current_language = relevanssi_get_current_language();
- $stopwords_array = get_option( 'relevanssi_body_stopwords', array() );
- $stopwords = isset( $stopwords_array[ $current_language ] ) ? $stopwords_array[ $current_language ] : '';
- $stopword_list = $stopwords ? explode( ',', $stopwords ) : array();
-
- return $stopword_list;
-}
-
-/**
- * Displays a list of body stopwords.
- *
- * Displays the list of body stopwords and gives the controls for adding new stopwords.
- */
-function relevanssi_show_body_stopwords() {
- printf(
- '
%s
',
- esc_html__( 'Post content stopwords are like stopwords, but they are only applied to the post content. These words can be used for searching and will be found in post titles, custom fields and other indexed content – just not in the post body content. Sometimes a word can be very common, but also have a more specific meaning and use on your site, and making it a content stopword will make it easier to find the specific use cases.', 'relevanssi' )
- );
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ', esc_attr( $term ) );
- }
- );
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- content
- + $match_object->title
- + $match_object->comment
- + $match_object->link
- + $match_object->author
- + $match_object->excerpt
- + $match_object->customfield
- + $match_object->mysqlcolumn
- + $match_object->tag
- + $match_object->taxonomy
- + $match_object->category;
- if ( (int) $match_object->content === (int) $sum ) {
- $match_object->weight = 0;
- }
- }
- return $match_object;
-}
diff --git a/relevanssi-premium/premium/class-relevanssi-language-packs.php b/relevanssi-premium/premium/class-relevanssi-language-packs.php
deleted file mode 100644
index c54bad3b..00000000
--- a/relevanssi-premium/premium/class-relevanssi-language-packs.php
+++ /dev/null
@@ -1,211 +0,0 @@
-type = $type;
- $this->slug = $slug;
- $this->api_url = $api_url;
- }
-
- /**
- * Adds a new project to load translations for.
- *
- * @since 1.0.0
- */
- public function add_project() {
- if ( ! has_action( 'init', array( $this, 'register_clean_translations_cache' ) ) ) {
- add_action( 'init', array( $this, 'register_clean_translations_cache' ), 9999 );
- }
-
- /**
- * Short-circuits translations API requests for private projects.
- */
- add_filter(
- 'translations_api',
- function ( $result, $requested_type, $args ) {
- if ( $this->type . 's' === $requested_type && $this->slug === $args['slug'] ) {
- return $this->get_translations( $this->type, $args['slug'], $this->api_url );
- }
-
- return $result;
- },
- 10,
- 3
- );
-
- /**
- * Filters the translations transients to include the private plugin or theme.
- *
- * @see wp_get_translation_updates()
- */
- add_filter(
- 'site_transient_update_' . $this->type . 's',
- function ( $value ) {
- if ( ! $value ) {
- $value = new \stdClass();
- }
-
- if ( ! isset( $value->translations ) ) {
- $value->translations = array();
- }
-
- $translations = $this->get_translations( $this->type, $this->slug, $this->api_url );
-
- if ( ! isset( $translations['translations'] ) ) {
- return $value;
- }
-
- $installed_translations = wp_get_installed_translations( $this->type . 's' );
-
- foreach ( (array) $translations['translations'] as $translation ) {
- if ( in_array( $translation['language'], get_available_languages(), true ) ) {
- if ( isset( $installed_translations[ $this->slug ][ $translation['language'] ] ) && $translation['updated'] ) {
- $local = new DateTime( $installed_translations[ $this->slug ][ $translation['language'] ]['PO-Revision-Date'] );
- $remote = new DateTime( $translation['updated'] );
-
- if ( $local >= $remote ) {
- continue;
- }
- }
-
- $translation['type'] = $this->type;
- $translation['slug'] = $this->slug;
-
- $value->translations[] = $translation;
- }
- }
-
- return $value;
- }
- );
- }
-
- /**
- * Registers actions for clearing translation caches.
- *
- * @since 1.1.0
- */
- public function register_clean_translations_cache() {
- $clear_plugin_translations = function () {
- $this->clean_translations_cache( 'plugin' );
- };
- $clear_theme_translations = function () {
- $this->clean_translations_cache( 'theme' );
- };
-
- add_action( 'set_site_transient_update_plugins', $clear_plugin_translations );
- add_action( 'delete_site_transient_update_plugins', $clear_plugin_translations );
-
- add_action( 'set_site_transient_update_themes', $clear_theme_translations );
- add_action( 'delete_site_transient_update_themes', $clear_theme_translations );
- }
-
- /**
- * Clears existing translation cache for a given type.
- *
- * @since 1.1.0
- *
- * @param string $type Project type. Either plugin or theme.
- */
- public function clean_translations_cache( $type ) {
- $transient_key = 't15s-registry-' . $this->slug . '-' . $type;
- $translations = get_site_transient( $transient_key );
-
- if ( ! is_object( $translations ) ) {
- return;
- }
-
- /*
- * Don't delete the cache if the transient gets changed multiple times
- * during a single request. Set cache lifetime to maximum 15 seconds.
- */
- $cache_lifespan = 15;
- $time_not_changed = isset( $translations->_last_checked ) && ( time() - $translations->_last_checked ) > $cache_lifespan;
-
- if ( ! $time_not_changed ) {
- return;
- }
-
- delete_site_transient( $transient_key );
- }
-
- /**
- * Gets the translations for a given project.
- *
- * @since 1.0.0
- *
- * @param string $type Project type. Either plugin or theme.
- * @param string $slug Project directory slug.
- * @param string $url Full GlotPress API URL for the project.
- *
- * @return array Translation data.
- */
- public function get_translations( $type, $slug, $url ) {
- $transient_key = 't15s-registry-' . $slug . '-' . $type;
- $translations = get_site_transient( $transient_key );
-
- if ( ! is_object( $translations ) ) {
- $translations = new \stdClass();
- }
-
- if ( isset( $translations->{$slug} ) && is_array( $translations->{$slug} ) ) {
- return $translations->{$slug};
- }
-
- $result = json_decode(
- wp_remote_retrieve_body(
- wp_remote_get( $url, array( 'timeout' => 2 ) )
- ),
- true
- );
- if ( is_array( $result ) ) {
- $translations->{$slug} = $result;
- $translations->_last_checked = time();
-
- set_site_transient( $transient_key, $translations );
- return $result;
- }
-
- // Nothing found.
- return array();
- }
-}
diff --git a/relevanssi-premium/premium/class-relevanssi-spellcorrector.php b/relevanssi-premium/premium/class-relevanssi-spellcorrector.php
deleted file mode 100644
index 191a45f9..00000000
--- a/relevanssi-premium/premium/class-relevanssi-spellcorrector.php
+++ /dev/null
@@ -1,221 +0,0 @@
- with modifications by Mikko Saari
- * @see https://www.relevanssi.com/
- */
-
-/*
-***************************************************************************
-* Copyright (C) 2008 by Felipe Ribeiro *
-* felipernb@gmail.com *
-* http://www.feliperibeiro.com *
-* *
-* Permission is hereby granted, free of charge, to any person obtaining *
-* a copy of this software and associated documentation files (the *
-* "Software"), to deal in the Software without restriction, including *
-* without limitation the rights to use, copy, modify, merge, publish, *
-* distribute, sublicense, and/or sell copies of the Software, and to *
-* permit persons to whom the Software is furnished to do so, subject to *
-* the following conditions: *
-* *
-* The above copyright notice and this permission notice shall be *
-* included in all copies or substantial portions of the Software. *
-* *
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
-* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR *
-* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
-* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
-* OTHER DEALINGS IN THE SOFTWARE. *
-***************************************************************************
-*/
-
-/**
- * Spell correcting feature.
- *
- * This class implements the Spell correcting feature, useful for the
- * "Did you mean" functionality on the search engine. Using a dictionary of
- * words extracted from the product catalog.
- *
- * Based on the concepts of Peter Norvig: http://norvig.com/spell-correct.html
- *
- * @author Felipe Ribeiro
- * @date September 18th, 2008
- */
-class Relevanssi_SpellCorrector {
- /**
- * Dictionary of words.
- *
- * @var array $dictionary Array of words, containing the dictionary.
- */
- private static $dictionary;
-
- /**
- * Reads a text and extracts the list of words.
- *
- * @param string $text Source text for the words.
- * @return array The list of words
- */
- private static function words( $text ) {
- $matches = array();
- $text = relevanssi_strtolower( $text );
- preg_match_all( '/[a-z]+/', $text, $matches );
- return $matches[0];
- }
-
- /**
- * Generates a list of possible "disturbances" on the passed string.
- *
- * @param string $word Word to disturb.
- *
- * @return array A list of variations.
- */
- private static function edits1( $word ) {
- /**
- * Filters the alphabet used for Did you mean suggestions.
- *
- * In order to use the Did you mean suggestions with non-Latin alphabets
- * (or even European languages with a wider range of characters than
- * English), Relevanssi needs to be provided with the alphabet used.
- *
- * @param string A string containing the alphabet as a string of
- * characters without spaces.
- */
- $alphabet = apply_filters(
- 'relevanssi_didyoumean_alphabet',
- 'abcdefghijklmnopqrstuvwxyzäöåü'
- );
- $alphabet = preg_split( '/(? $max ) {
- $max = $value;
- $word = $c;
- }
- }
- return $word;
- }
-}
diff --git a/relevanssi-premium/premium/class-relevanssi-wp-auto-update.php b/relevanssi-premium/premium/class-relevanssi-wp-auto-update.php
deleted file mode 100644
index 78a8ac82..00000000
--- a/relevanssi-premium/premium/class-relevanssi-wp-auto-update.php
+++ /dev/null
@@ -1,222 +0,0 @@
-current_version = $current_version;
- $this->update_path = $update_path;
- $this->plugin_slug = $plugin_slug;
- list ($t1, $t2) = explode( '/', $plugin_slug );
- $this->slug = str_replace( '.php', '', $t2 );
-
- if ( 'on' !== get_option( 'relevanssi_do_not_call_home' ) ) {
- // define the alternative API for updating checking.
- add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
-
- // Define the alternative response for information checking.
- add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
- }
- }
-
- /**
- * Adds our self-hosted autoupdate plugin to the filter transient.
- *
- * @param object $transient The filtered transient.
- *
- * @return object $transient
- */
- public function check_update( $transient ) {
- if ( ! is_object( $transient ) ) {
- return $transient;
- }
-
- // Get the remote version.
- $info = $this->get_remote_information();
- $remote_version = 0;
- if ( isset( $info->new_version ) ) {
- $remote_version = $info->new_version;
- }
-
- // If a newer version is available, add the update.
- if ( version_compare( $this->current_version, $remote_version, '<' ) ) {
- $obj = new stdClass();
- $obj->slug = $this->slug;
- $obj->new_version = $remote_version;
- $obj->url = $info->package;
- $obj->package = $info->package;
- $obj->icons = $info->icons;
- $obj->banners = $info->banners;
-
- $transient->response[ $this->plugin_slug ] = $obj;
- } else {
- global $relevanssi_variables;
- // No update is available.
- $item = (object) array(
- 'id' => 'relevanssi-premium/relevanssi.php',
- 'slug' => 'relevanssi-premium',
- 'plugin' => 'relevanssi-premium/relevanssi.php',
- 'new_version' => $relevanssi_variables['plugin_version'],
- 'url' => '',
- 'package' => '',
- 'icons' => array(),
- 'banners' => array(),
- 'banners_rtl' => array(),
- 'tested' => '',
- 'requires_php' => '',
- 'compatibility' => new stdClass(),
- );
- $transient->no_update['relevanssi-premium/relevanssi.php'] = $item;
- }
-
- return $transient;
- }
-
- /**
- * Adds our self-hosted description to the filter.
- *
- * @param object $api Result object or array, should return false.
- * @param array $action Type of information request.
- * @param object $args Plugin API arguments.
- *
- * @return object $api New stdClass with plugin information on success, default response on failure.
- */
- public function check_info( $api, $action, $args ) {
- $plugin = ( 'plugin_information' === $action ) && isset( $args->slug ) && ( $this->slug === $args->slug );
-
- if ( $plugin ) {
- if ( $args->slug === $this->slug ) {
- $information = $this->get_remote_information();
- return $information;
- }
- }
- return $api;
- }
-
- /**
- * Returns the remote version.
- *
- * @return string $remote_version Version number at the remote end.
- */
- public function get_remote_version() {
- $api_key = get_network_option( null, 'relevanssi_api_key' );
- if ( ! $api_key ) {
- $api_key = get_option( 'relevanssi_api_key' );
- }
- $request = wp_remote_post(
- $this->update_path,
- array(
- 'body' => array(
- 'api_key' => $api_key,
- 'action' => 'version',
- ),
- )
- );
- if ( ! is_wp_error( $request ) || 200 === wp_remote_retrieve_response_code( $request ) ) {
- return $request['body'];
- }
- return false;
- }
-
- /**
- * Get information about the remote version.
- *
- * @return bool|object
- */
- public function get_remote_information() {
- $api_key = get_network_option( null, 'relevanssi_api_key' );
- if ( ! $api_key ) {
- $api_key = get_option( 'relevanssi_api_key' );
- }
- $request = wp_remote_post(
- $this->update_path,
- array(
- 'body' => array(
- 'api_key' => $api_key,
- 'action' => 'info',
- ),
- )
- );
- if ( ! is_wp_error( $request ) || 200 === wp_remote_retrieve_response_code( $request ) ) {
- if ( is_serialized( $request['body'] ) ) {
- return unserialize( $request['body'] ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
- }
- }
- return false;
- }
-
- /**
- * Returns the status of the plugin licensing.
- *
- * @return boolean $remote_license
- */
- public function get_remote_license() {
- $api_key = get_network_option( null, 'relevanssi_api_key' );
- if ( ! $api_key ) {
- $api_key = get_option( 'relevanssi_api_key' );
- }
- $request = wp_remote_post(
- $this->update_path,
- array(
- 'body' => array(
- 'api_key' => $api_key,
- 'action' => 'license',
- ),
- )
- );
- if ( ! is_wp_error( $request ) || 200 === wp_remote_retrieve_response_code( $request ) ) {
- if ( 'false' === $request['body'] ) {
- return false;
- }
- return $request['body'];
- }
- return false;
- }
-}
diff --git a/relevanssi-premium/premium/class-relevanssi-wp-cli-command.php b/relevanssi-premium/premium/class-relevanssi-wp-cli-command.php
deleted file mode 100644
index cb8f68b4..00000000
--- a/relevanssi-premium/premium/class-relevanssi-wp-cli-command.php
+++ /dev/null
@@ -1,714 +0,0 @@
-]
- * : What to index. No value means everything. Valid values are
- * "taxonomies" and "users" to index taxonomy terms and user profiles
- * respectively.
- * ---
- * options:
- * - post_types
- * - taxonomies
- * - users
- * ---
- *
- * [--post=]
- * : Post ID, if you only want to reindex one post.
- *
- * [--limit=]
- * : Number of posts you want to index at one go.
- *
- * [--extend=]
- * : If true, do not truncate the index or index users and taxonomies.
- * If false, first truncate the index, then index user profiles and
- * taxonomy terms.
- * ---
- * default: false
- * options:
- * - true
- * - false
- * ---
- *
- * [--index_debug=]
- * : If true, display debugging information when indexing a single post.
- * ---
- * default: false
- * options:
- * - true
- * - false
- * ---
- *
- * ## EXAMPLES
- *
- * wp relevanssi index
- * wp relevanssi index --post=1
- * wp relevanssi index --target=taxonomies
- * wp relevanssi index --target=users
- * wp relevanssi index --post=1 --index_debug=true
- * wp relevanssi index --limit=100
- * wp relevanssi index --extend=true --limit=100
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function index( $args, $assoc_args ) {
- remove_filter( 'relevanssi_search_ok', '__return_true' );
-
- $post_id = null;
- if ( isset( $assoc_args['post'] ) ) {
- $post_id = $assoc_args['post'];
- }
-
- $limit = null;
- if ( isset( $assoc_args['limit'] ) ) {
- $limit = $assoc_args['limit'];
- }
-
- $extend = false;
- if ( isset( $assoc_args['extend'] ) ) {
- $extend = $assoc_args['extend'];
- }
-
- $debug = false;
- if ( isset( $assoc_args['index_debug'] ) ) {
- $debug = $assoc_args['index_debug'];
- }
-
- $target = null;
- if ( isset( $assoc_args['target'] ) ) {
- $target = $assoc_args['target'];
- }
-
- if ( 'taxonomies' === $target ) {
- relevanssi_index_taxonomies();
- WP_CLI::success( 'Done!' );
- } elseif ( 'users' === $target ) {
- relevanssi_index_users();
- WP_CLI::success( 'Done!' );
- } elseif ( 'post_types' === $target ) {
- relevanssi_index_post_type_archives();
- WP_CLI::success( 'Done!' );
- } elseif ( isset( $post_id ) ) {
- $n = relevanssi_index_doc( $post_id, true, relevanssi_get_custom_fields(), true, $debug );
- switch ( $n ) {
- case -1:
- WP_CLI::error( "No such post: $post_id!" );
- break;
- case 'hide':
- WP_CLI::error( "Post $post_id is excluded from indexing." );
- break;
- case 'donotindex':
- WP_CLI::error( "Post $post_id is excluded from indexing by the relevanssi_do_not_index filter." );
- break;
- default:
- WP_CLI::success( "Reindexed post $post_id!" );
- }
- } else {
- $verbose = false;
- list( $complete, $n ) = relevanssi_build_index( $extend, $verbose, $limit );
-
- $completion = 'Index is not complete yet.';
- if ( $complete ) {
- $completion = 'Index is complete.';
- }
-
- WP_CLI::success( "$n posts indexed. $completion" );
- }
- }
-
- /**
- * Refreshes the Relevanssi index.
- *
- * ## EXAMPLES
- *
- * wp relevanssi refresh
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function refresh( $args, $assoc_args ) {
- $index_post_types = get_option( 'relevanssi_index_post_types', '' );
- $index_statuses = apply_filters(
- 'relevanssi_valid_status',
- array( 'publish', 'private', 'draft', 'pending', 'future' )
- );
- $all_indexed_posts = get_posts(
- array(
- 'post_type' => $index_post_types,
- 'fields' => 'ids',
- 'numberposts' => -1,
- 'post_status' => $index_statuses,
- )
- );
-
- $found_posts = count( $all_indexed_posts );
- $progress = $this->relevanssi_generate_progress_bar( 'Indexing posts', $found_posts );
-
- WP_CLI::log( 'Found ' . $found_posts . ' posts to refresh.' );
- foreach ( $all_indexed_posts as $post_id ) {
- relevanssi_index_doc( $post_id, true, relevanssi_get_custom_fields(), true, false );
- $progress->tick();
- }
- $progress->finish();
-
- WP_CLI::success( 'Index refresh done!' );
- }
-
- /**
- * Empties the Relevanssi index.
- *
- * ## EXAMPLES
- *
- * wp relevanssi truncate_index
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function truncate_index( $args, $assoc_args ) {
- $result = relevanssi_truncate_index();
- switch ( $result ) {
- case false:
- WP_CLI::error( "Couldn't truncate the Relevanssi database!" );
- break;
- default:
- WP_CLI::success( 'Relevanssi database truncated.' );
- }
- }
-
- /**
- * Adds a stopword to the list of stopwords and removes it from the index.
- *
- * ## OPTIONS
- *
- * ...
- * : Stopwords to add.
- *
- * ## EXAMPLES
- *
- * wp relevanssi add_stopword stop halt seis
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function add_stopword( $args, $assoc_args ) {
- if ( is_array( $args ) ) {
- foreach ( $args as $stopword ) {
- if ( relevanssi_add_single_stopword( $stopword ) ) {
- WP_CLI::success( "Stopword added: $stopword" );
- } else {
- WP_CLI::error( "Couldn't add stopword: $stopword!" );
- }
- }
- } else {
- WP_CLI::error( 'No stopwords listed.' );
- }
- }
-
- /**
- * Removes a stopword from the list of stopwords. Reindex to get it back to the index.
- *
- * ## OPTIONS
- *
- * ...
- * : Stopwords to remove.
- *
- * ## EXAMPLES
- *
- * wp relevanssi remove_stopword stop halt seis
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function remove_stopword( $args, $assoc_args ) {
- $verbose = false;
- if ( is_array( $args ) ) {
- foreach ( $args as $stopword ) {
- if ( relevanssi_remove_stopword( $stopword, $verbose ) ) {
- WP_CLI::success( "Stopword removed: $stopword" );
- } else {
- WP_CLI::error( "Couldn't remove stopword: $stopword!" );
- }
- }
- } else {
- WP_CLI::error( 'No stopwords listed.' );
- }
- }
-
- /**
- * Empties the Relevanssi logs.
- *
- * ## EXAMPLES
- *
- * wp relevanssi reset_log
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function reset_log( $args, $assoc_args ) {
- $verbose = false;
- $result = relevanssi_truncate_logs( $verbose );
- switch ( $result ) {
- case false:
- WP_CLI::error( "Couldn't reset the logs!" );
- break;
- default:
- WP_CLI::success( 'Relevanssi log truncated.' );
- }
- }
-
- /**
- * Shows common words in the index.
- *
- * ## OPTIONS
- *
- * [--limit=]
- * : How many words to show. Defaults to 25.
- *
- * ## EXAMPLES
- *
- * wp relevanssi common
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function common( $args, $assoc_args ) {
- $wp_cli = true;
- $limit = 25;
- if ( isset( $assoc_args['limit'] ) && is_numeric( $assoc_args['limit'] ) ) {
- $limit = $assoc_args['limit'];
- }
-
- $words = relevanssi_common_words( $limit, $wp_cli );
- if ( is_array( $words ) ) {
- foreach ( $words as $word ) {
- WP_CLI::log( sprintf( '%s (%d)', $word->term, $word->cnt ) );
- }
- } else {
- WP_CLI::error( 'No words returned.' );
- }
- }
-
- /**
- * Reads the attachment content for all attachments that haven't been read
- * yet.
- *
- * ## EXAMPLES
- *
- * wp relevanssi read_attachments
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function read_attachments( $args, $assoc_args ) {
- $attachment_posts = relevanssi_get_posts_with_attachments( 0 );
- WP_CLI::log( 'Found ' . count( $attachment_posts ) . ' attachments to read.' );
- foreach ( $attachment_posts as $post_id ) {
- $exit_and_die = false;
- WP_CLI::log( 'Reading attachment ' . $post_id . '...' );
- $response = relevanssi_index_pdf( $post_id, $exit_and_die );
- if ( $response['success'] ) {
- WP_CLI::log( "Successfully read the content for post $post_id." );
- } else {
- WP_CLI::log( "Couldn't read the post $post_id: " . $response['error'] );
- }
- }
- }
-
- /**
- * Removes all attachment content for all posts. Use with care! Does not
- * reindex the posts or remove them from the index.
- *
- * ## EXAMPLES
- *
- * wp relevanssi remove_attachment_content
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array (not
- * used).
- */
- public function remove_attachment_content( $args, $assoc_args ) {
- delete_post_meta_by_key( '_relevanssi_pdf_content' );
- delete_post_meta_by_key( '_relevanssi_pdf_error' );
-
- WP_CLI::log( 'Removed all attachment content.' );
- }
-
- /**
- * Removes all attachment errors for all posts.
- *
- * ## EXAMPLES
- *
- * wp relevanssi remove_attachment_errors
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array (not
- * used).
- */
- public function remove_attachment_errors( $args, $assoc_args ) {
- delete_post_meta_by_key( '_relevanssi_pdf_error' );
-
- WP_CLI::log( 'Removed all attachment errors.' );
- }
-
- /**
- * Regenerates the related posts for all posts.
- *
- * ## OPTIONS
- *
- * [--post_type=]
- * : A comma-separated list of post types to cover. If empty, generate the post
- * types chosen in the Related posts options, or if that's empty, all public post
- * types.
- *
- * [--post_objects=]
- * : If true, doesn't generate the related posts HTML code and instead stores the
- * post objects of the related posts in the transient. If false, the transient
- * will contain the generated related posts HTML code. Default false.
- * ---
- * default: false
- * options:
- * - true
- * - false
- * ---
- *
- * ## EXAMPLES
- *
- * wp relevanssi regenerate_related
- * wp relevanssi regenerate_related --post_type=post,page
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function regenerate_related( $args, $assoc_args ) {
- relevanssi_flush_related_cache();
-
- $settings = get_option( 'relevanssi_related_settings', relevanssi_related_default_settings() );
-
- if ( isset( $settings['enabled'] ) && 'off' === $settings['enabled'] ) {
- WP_CLI::error( 'Related posts feature is disabled.' );
- }
-
- $post_types = array();
- if ( isset( $settings['append'] ) && ! empty( $settings['append'] ) ) {
- // Related posts are automatically appended to certain post types, so
- // regenerate the related posts for those post types.
- $post_types = explode( ',', $settings['append'] );
- } else {
- // Nothing set, so regenerate for all public post types.
- $pt_args = array(
- 'public' => true,
- );
- $post_types = get_post_types( $pt_args, 'names' );
- }
-
- if ( isset( $assoc_args['post_type'] ) ) {
- $post_types = explode( ',', $assoc_args['post_type'] );
- }
-
- $post_objects = false;
- if ( isset( $assoc_args['post_objects'] ) ) {
- if ( filter_var( $assoc_args['post_objects'], FILTER_VALIDATE_BOOLEAN ) ) {
- $post_objects = true;
- }
- }
-
- $post_args = array(
- 'post_type' => $post_types,
- 'fields' => 'ids',
- 'posts_per_page' => -1,
- );
- $posts = get_posts( $post_args ); // Get all posts for the wanted post types.
- $count = count( $posts );
- WP_CLI::log( 'Regenerating related posts for post types ' . implode( ', ', $post_types ) . ", total $count posts." );
-
- $progress = $this->relevanssi_generate_progress_bar( 'Regenerating', $count );
-
- foreach ( $posts as $post_id ) {
- relevanssi_related_posts( $post_id, $post_objects );
- $progress->tick();
- }
-
- $progress->finish();
- WP_CLI::success( 'Done!' );
- }
-
- /**
- * Lists pinned posts.
- *
- * ## OPTIONS
- *
- * [--format=]
- * : Format of the results. Possible values are "table", "json", "csv",
- * "yaml" and "count". Default: "table".
- *
- * [--type=]
- * : Type of the results. Possible values are "pinned", "unpinned", and
- * "both". Default: "both".
- *
- * ## EXAMPLES
- *
- * wp relevanssi list_pinned_posts
- * wp relevanssi list_pinned_posts --format=csv --type=pinned
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function list_pinned_posts( $args, $assoc_args ) {
- global $wpdb;
-
- $posts = $wpdb->get_results(
- "SELECT p.ID, p.post_title, pm.meta_key, pm.meta_value FROM $wpdb->posts AS p, $wpdb->postmeta AS pm
- WHERE p.ID = pm.post_id
- AND (
- pm.meta_key = '_relevanssi_pin'
- OR pm.meta_key = '_relevanssi_unpin'
- OR (
- pm.meta_key = '_relevanssi_pin_for_all' AND pm.meta_value = 'on'
- )
- )
- ORDER BY p.ID ASC"
- );
-
- $pinned = array();
- $unpinned = array();
-
- $format = $assoc_args['format'] ?? 'table';
- if ( 'ids' === $format ) {
- $format = 'table';
- }
-
- $include_pinned = true;
- $include_unpinned = true;
- if ( isset( $assoc_args['type'] ) ) {
- if ( 'pinned' === $assoc_args['type'] ) {
- $include_unpinned = false;
- } elseif ( 'unpinned' === $assoc_args['type'] ) {
- $include_pinned = false;
- }
- }
-
- foreach ( $posts as $post ) {
- if ( $include_pinned && '_relevanssi_pin_for_all' === $post->meta_key ) {
- $pinned[] = array(
- 'ID' => $post->ID,
- 'Title' => $post->post_title,
- 'Pinned keywords' => __( 'all keywords' ),
- );
- } elseif ( $include_pinned && '_relevanssi_pin' === $post->meta_key ) {
- $pinned[] = array(
- 'ID' => $post->ID,
- 'Title' => $post->post_title,
- 'Pinned keywords' => $post->meta_value,
- );
- } elseif ( $include_unpinned && '_relevanssi_unpin' === $post->meta_key ) {
- $unpinned[] = array(
- 'ID' => $post->ID,
- 'Title' => $post->post_title,
- 'Unpinned keywords' => $post->meta_value,
- );
- }
- }
-
- if ( $pinned ) {
- if ( 'table' === $format || 'count' === $format ) {
- $header = "\n" . __( 'Pinned posts' ) . ':';
- WP_CLI::log( $header );
- WP_CLI::log( str_pad( '', strlen( $header ), '=' ) );
- }
- WP_CLI\Utils\format_items( $format, $pinned, array( 'ID', 'Title', 'Pinned keywords' ) );
- }
-
- if ( $unpinned ) {
- if ( 'table' === $format || 'count' === $format ) {
- $header = "\n" . __( 'Unpinned posts' ) . ':';
- WP_CLI::log( $header );
- WP_CLI::log( str_pad( '', strlen( $header ), '=' ) );
- }
- WP_CLI\Utils\format_items( $format, $unpinned, array( 'ID', 'Title', 'Unpinned keywords' ) );
- }
-
- if ( ! $pinned && ! $unpinned ) {
- WP_CLI::log( __( 'No pinned posts found.' ) );
- }
- }
-
- /**
- * Lists posts in or not in the index.
- *
- * ## OPTIONS
- *
- * [--format=]
- * : Format of the results. Possible values are "table", "json", "csv",
- * "yaml", and "count". Default: "table".
- *
- * [--post_type=]
- * : Post type. Default: none, show all post types.
- *
- * [--type=]
- * : Type of the results. Possible values are "post", "term", and "user".
- * Default: "post".
- *
- * [--status=]
- * : Status of the results. Possible values are "indexed" and "unindexed".
- * Default: "indexed".
- *
- * ## EXAMPLES
- *
- * wp relevanssi list
- *
- * @param array $args Command arguments (not used).
- * @param array $assoc_args Command arguments as associative array.
- */
- public function list( $args, $assoc_args ) {
- global $wpdb, $relevanssi_variables;
-
- $status = $assoc_args['status'] ?? 'indexed';
- $post_type = $assoc_args['post_type'] ?? '';
- $type = $assoc_args['type'] ?? 'post';
-
- if ( 'indexed' === $status ) {
- if ( 'post' === $type ) {
- if ( $post_type ) {
- $post_type = "AND post_type = '" . esc_sql( $post_type ) . "'";
- }
- $posts = $wpdb->get_results(
- "SELECT DISTINCT(p.ID), p.post_title AS Title, p.post_type AS 'Type' FROM $wpdb->posts AS p, " .
- "{$relevanssi_variables['relevanssi_table']} AS r WHERE p.ID = r.doc $post_type " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'ORDER BY p.ID ASC'
- );
- } elseif ( 'term' === $type ) {
- $posts = $wpdb->get_results(
- "SELECT DISTINCT(t.term_id) AS ID, t.name AS 'Name', tt.taxonomy AS 'Taxonomy', tt.count AS 'Count' FROM $wpdb->terms AS t, $wpdb->term_taxonomy AS tt, " .
- "{$relevanssi_variables['relevanssi_table']} AS r " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'WHERE tt.term_id = t.term_id AND t.term_id = r.item AND tt.taxonomy = r.type
- ORDER BY t.term_id ASC'
- );
- } elseif ( 'user' === $type ) {
- $users_in_index = $wpdb->get_col(
- "SELECT DISTINCT(r.item) FROM {$relevanssi_variables['relevanssi_table']} AS r " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- "WHERE r.type = 'user'"
- );
- $users = relevanssi_get_users(
- array(
- 'number' => -1,
- 'orderby' => 'ID',
- 'order' => 'ASC',
- 'include' => array_map( 'intval', $users_in_index ),
- )
- );
- foreach ( $users as $user ) {
- $posts[] = array(
- 'ID' => $user->ID,
- 'Name' => $user->display_name,
- 'Login' => $user->user_login,
- 'Roles' => implode( ', ', $user->roles ),
- );
- }
- }
- } elseif ( 'unindexed' === $status ) {
- if ( 'post' === $type ) {
- $indexed_post_types = str_replace( 'post.', 'p.', relevanssi_post_type_restriction() );
- if ( $post_type ) {
- $post_type = "AND post_type = '" . esc_sql( $post_type ) . "'";
- $indexed_post_types = '';
- }
-
- $posts = $wpdb->get_results(
- "SELECT DISTINCT(p.ID), p.post_title AS Title, p.post_type AS 'Type' FROM $wpdb->posts AS p " .
- "LEFT JOIN {$relevanssi_variables['relevanssi_table']} AS r ON p.ID = r.doc " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'WHERE r.doc IS NULL ' .
- "$indexed_post_types $post_type " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'ORDER BY p.ID ASC'
- );
- } elseif ( 'term' === $type ) {
- $taxonomies = get_option( 'relevanssi_index_terms' );
- if ( ! is_array( $taxonomies ) ) {
- $taxonomies = array();
- }
- $taxonomies = "'" . implode( "', '", $taxonomies ) . "'";
-
- $posts = $wpdb->get_results(
- "SELECT DISTINCT(t.term_id) AS ID, t.name AS 'Name', tt.taxonomy AS 'Taxonomy', tt.count AS 'Count' " .
- "FROM $wpdb->term_taxonomy AS tt, $wpdb->terms AS t " .
- "LEFT JOIN {$relevanssi_variables['relevanssi_table']} AS r " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'ON t.term_id = r.item
- WHERE r.item IS NULL AND tt.term_id = t.term_id AND tt.taxonomy IN (' . $taxonomies . ') ' . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'ORDER BY t.term_id ASC'
- );
- } elseif ( 'user' === $type ) {
- $users_in_index = $wpdb->get_col(
- "SELECT DISTINCT(r.item) FROM {$relevanssi_variables['relevanssi_table']} AS r " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- "WHERE r.type = 'user'"
- );
- $users = relevanssi_get_users(
- array(
- 'number' => -1,
- 'orderby' => 'ID',
- 'order' => 'ASC',
- 'exclude' => $users_in_index,
- )
- );
- foreach ( $users as $user ) {
- $posts[] = array(
- 'ID' => $user->ID,
- 'Name' => $user->display_name,
- 'Login' => $user->user_login,
- 'Roles' => implode( ', ', $user->roles ),
- );
- }
- }
- }
-
- $format = $assoc_args['format'] ?? 'table';
- if ( 'ids' === $format ) {
- $format = 'table';
- }
-
- if ( 'post' === $type ) {
- WP_CLI\Utils\format_items( $format, $posts, array( 'ID', 'Title', 'Type' ) );
- } elseif ( 'term' === $type ) {
- WP_CLI\Utils\format_items( $format, $posts, array( 'ID', 'Name', 'Taxonomy', 'Count' ) );
- } elseif ( 'user' === $type ) {
- WP_CLI\Utils\format_items( $format, $posts, array( 'ID', 'Name', 'Login', 'Roles' ) );
- } elseif ( 'post_type' === $type ) {
- WP_CLI\Utils\format_items( $format, $posts, array( 'Title', 'Type' ) );
- }
- }
-
- /**
- * Generates a WP CLI progress bar.
- *
- * If WP CLI is enabled, creates a progress bar using WP_CLI\Utils\make_progress_bar().
- *
- * @param string $title Title of the progress bar.
- * @param int $count Total count for the bar.
- */
- public static function relevanssi_generate_progress_bar( $title, $count ) {
- $progress = null;
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress = WP_CLI\Utils\make_progress_bar( $title, $count );
- }
- return $progress;
- }
-}
-
-WP_CLI::add_command( 'relevanssi', 'Relevanssi_WP_Cli_Command' );
diff --git a/relevanssi-premium/premium/click-tracking.php b/relevanssi-premium/premium/click-tracking.php
deleted file mode 100644
index 8444e017..00000000
--- a/relevanssi-premium/premium/click-tracking.php
+++ /dev/null
@@ -1,1035 +0,0 @@
-query(
- $wpdb->prepare(
- "INSERT IGNORE INTO {$relevanssi_variables['tracking_table']} " . // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared
- '(`post_id`, `query`, `rank`, `page`, `timestamp`) VALUES (%d, %s, %d, %d, %s)',
- $post->ID,
- $rt['query'],
- $rt['rank'],
- $rt['page'],
- gmdate( 'c', $rt['time'] )
- )
- );
-}
-
-/**
- * Extracts the values from the _rt URL parameter.
- *
- * @param string $rt The URL parameter.
- *
- * @return array|WP_Error An array of values: 'rank', 'page', 'query', and
- * 'time'. Returns a WP_Error if the value doesn't explode into right number of
- * parts.
- */
-function relevanssi_extract_rt( string $rt ) {
- $rt_values = explode( '|', $rt );
- if ( count( $rt_values ) !== 4 ) {
- return new WP_Error( 'invalid-rt', __( 'Invalid click tracking value format.', 'relevanssi' ) );
- }
- $rank = intval( $rt_values[0] );
- $page = intval( $rt_values[1] );
- $time = intval( $rt_values[3] );
- if ( 0 === $rank || 0 === $page || 0 === $time ) {
- return new WP_Error( 'invalid-rt', __( 'Invalid click tracking value format.', 'relevanssi' ) );
- }
- return array(
- 'rank' => $rank,
- 'page' => $page,
- 'query' => $rt_values[2],
- 'time' => $time,
- );
-}
-
-/**
- * Adds tracking information to a permalink.
- *
- * Called from the `relevanssi_permalink` filter function to add the tracking
- * data to the link.
- *
- * @param string $permalink The permalink to modify.
- * @param object $link_post A post object, default null in which case the global
- * $post is used.
- *
- * @global $relevanssi_tracking_positions An array of post ID => rank pairs used
- * to get the post rankings. If a post does not appear in this array, the
- * tracking data is not added to the permalink.
- * @global $relevanssi_tracking_permalink A cache of permalinks to avoid doing
- * work that is already done.
- *
- * @return string The modified permalink.
- */
-function relevanssi_add_tracking( string $permalink, $link_post = null ): string {
- if ( 'on' !== get_option( 'relevanssi_click_tracking', 'off' ) ) {
- return $permalink;
- }
- if ( empty( get_search_query() ) ) {
- return $permalink;
- }
- if ( ! relevanssi_is_ok_to_log() ) {
- return $permalink;
- }
- if ( ! $link_post ) {
- global $post;
- $link_post = $post;
- }
- $id = relevanssi_get_post_identifier( $link_post );
- if ( ! isset( $link_post->blog_id ) || get_current_blog_id() === $link_post->blog_id ) {
- if ( relevanssi_is_front_page_id( $link_post->ID ) ) {
- return $permalink;
- }
- }
-
- global $relevanssi_tracking_positions, $relevanssi_tracking_permalink;
- $position = $relevanssi_tracking_positions[ $id ] ?? null;
-
- if ( ! $position ) {
- return $permalink;
- }
-
- if ( isset( $relevanssi_tracking_permalink[ $id ] ) ) {
- return $relevanssi_tracking_permalink[ $id ];
- }
-
- $page = get_query_var( 'paged' ) > 0 ? get_query_var( 'paged' ) : 1;
- $nonce = wp_create_nonce( 'relevanssi_click_tracking_' . $id );
- $query = relevanssi_strtolower( str_replace( '|', ' ', get_search_query() ) );
- $time = time();
- $value = "$position|$page|$query|$time";
-
- $permalink = esc_attr(
- add_query_arg(
- array(
- '_rt' => relevanssi_base64url_encode( $value ),
- '_rt_nonce' => $nonce,
- ),
- $permalink
- )
- );
-
- $relevanssi_tracking_permalink[ $id ] = $permalink;
-
- return $permalink;
-}
-
-/**
- * URL-friendly base64 encode.
- *
- * @param string $data String to encode.
- * @return string Encoded string.
- */
-function relevanssi_base64url_encode( string $data ): string {
- return rtrim(
- strtr(
- base64_encode( $data ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
- '+/',
- '-_'
- ),
- '='
- );
-}
-
-/**
- * URL-friendly base64 decode.
- *
- * @param string $data String to decode.
- * @return string Decoded string.
- */
-function relevanssi_base64url_decode( string $data ): string {
- return base64_decode( // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
- strtr( $data, '-_', '+/' )
- );
-}
-
-/**
- * Records the ranking positions for the posts found.
- *
- * Runs as the last thing (at PHP_INT_MAX) on the `relevanssi_hits_filter` hook
- * to record the ranking positions of each post.
- *
- * @global array $relevanssi_tracking_positions An array of post ID => rank
- * pairs.
- *
- * @param array $hits The hits found.
- *
- * @return array The hits found, unmodified.
- */
-function relevanssi_record_positions( array $hits ): array {
- global $relevanssi_tracking_positions;
-
- $position = 0;
- foreach ( $hits[0] as $hit ) {
- ++$position;
- $hit = relevanssi_get_an_object( $hit )['object'];
- if ( ! $hit ) {
- continue;
- }
- if ( $hit->ID > 0 ) {
- $id = relevanssi_get_post_identifier( $hit );
-
- $relevanssi_tracking_positions[ $id ] = $position;
- } elseif ( isset( $hit->term_id ) ) {
- $relevanssi_tracking_positions[ $hit->post_type . '_' . $hit->term_id ] = $position;
- } elseif ( isset( $hit->user_id ) ) {
- $relevanssi_tracking_positions[ 'user_' . $hit->user_id ] = $position;
- }
- }
-
- return $hits;
-}
-
-/**
- * Removes the undisplayed posts from the $relevanssi_tracking_positions array.
- *
- * Goes through the $relevanssi_tracking_positions array and only keeps the
- * posts that appear on the current page of results.
- *
- * @global array $relevanssi_tracking_positions An array of post ID => rank
- * pairs.
- *
- * @param array $hits The hits displayed.
- *
- * @return array The hits displayed, unmodified.
- */
-function relevanssi_current_page_hits( array $hits ): array {
- global $relevanssi_tracking_positions;
-
- $all_positions = $relevanssi_tracking_positions;
- $relevanssi_tracking_positions = array();
-
- foreach ( $hits as $hit ) {
- $hit = relevanssi_get_an_object( $hit )['object'];
- $id = relevanssi_get_post_identifier( $hit );
-
- if ( $hit->ID > 0 ) {
- $relevanssi_tracking_positions[ $id ] = $all_positions[ $id ];
- } elseif ( isset( $hit->term_id ) ) {
- $id = $hit->post_type . '_' . $hit->term_id;
-
- $relevanssi_tracking_positions[ $id ] = $all_positions[ $id ];
- } elseif ( isset( $hit->user_id ) ) {
- $id = 'user_' . $hit->user_id;
-
- $relevanssi_tracking_positions[ $id ] = $all_positions[ $id ];
- }
- }
-
- return $hits;
-}
-
-/**
- * Creates the tracking table.
- *
- * @param string $charset_collate Character set collation.
- *
- * @return void
- */
-function relevanssi_create_tracking_table( string $charset_collate ) {
- global $wpdb;
-
- $sql = 'CREATE TABLE ' . $wpdb->prefix . 'relevanssi_tracking ' .
- "(`id` int(11) NOT NULL AUTO_INCREMENT,
- `post_id` int(11) NOT NULL DEFAULT '0',
- `query` varchar(200) NOT NULL,
- `rank` int(11) NOT NULL DEFAULT '0',
- `page` int(11) NOT NULL DEFAULT '0',
- `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY id (id),
- UNIQUE INDEX post_id_timestamp (post_id, timestamp)) $charset_collate";
-
- dbDelta( $sql );
-}
-
-/**
- * Generates an array with date indices and 0 values for each date.
- *
- * Uses the `relevanssi_trim_click_logs` option to determine the length of the
- * date range.
- *
- * @param string $type The type of date count: 'clicks', 'log' or 'both'.
- *
- * @return array An array of 'Y-m-d' date indices.
- */
-function relevanssi_default_date_count( string $type ): array {
- global $wpdb, $relevanssi_variables;
-
- if ( 'clicks' === $type ) {
- $amount_of_days = get_option( 'relevanssi_trim_click_logs', 90 );
- }
- if ( 'log' === $type ) {
- $amount_of_days = get_option( 'relevanssi_trim_logs', 30 );
- if ( 0 === $amount_of_days ) {
- $amount_of_days = abs( $wpdb->get_var( "SELECT TIMESTAMPDIFF(DAY, NOW(), time) FROM {$relevanssi_variables['log_table']} ORDER BY time ASC LIMIT 1" ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared.
- }
- }
- if ( 'both' === $type ) {
- $click_days = get_option( 'relevanssi_trim_click_logs', 90 );
- $log_days = get_option( 'relevanssi_trim_logs', 30 );
-
- if ( '0' === $log_days ) {
- $log_days = abs( $wpdb->get_var( "SELECT TIMESTAMPDIFF(DAY, NOW(), time) FROM {$relevanssi_variables['log_table']} ORDER BY time ASC LIMIT 1" ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared.
- }
- $amount_of_days = max( $click_days, $log_days );
- }
- $date_counts = array();
- $start_date = gmdate( 'Y-m-d', strtotime( intval( $amount_of_days ) . ' days ago' ) );
- $end_date = gmdate( 'Y-m-d' );
-
- while ( strtotime( $start_date ) <= strtotime( $end_date ) ) {
- $date_counts[ $start_date ] = 0;
-
- $start_date = gmdate(
- 'Y-m-d',
- strtotime( '+1 days', strtotime( $start_date ) )
- );
- }
-
- return $date_counts;
-}
-
-/**
- * Determines what happens when a request for a post insights screen is made.
- *
- * @param array $request The $_REQUEST array to dig for parameters.
- *
- * @return bool True, if a screen was displayed and false if not.
- */
-function relevanssi_handle_insights_screens( array $request ): bool {
- if ( isset( $request['insights'] ) ) {
- if ( isset( $request['action'] ) && isset( $request['query'] ) && 'delete_query' === $request['action'] ) {
- check_admin_referer( 'relevanssi_delete_query' );
- relevanssi_delete_query( $request['query'] );
- }
- if ( isset( $request['action'] ) && isset( $request['query'] ) && 'delete_query_from_log' === $request['action'] ) {
- check_admin_referer( 'relevanssi_delete_query' );
- relevanssi_delete_query_from_log( $request['query'] );
- }
- relevanssi_show_insights( stripslashes( $request['insights'] ) );
- return true;
- }
-
- if ( isset( $request['post_insights'] ) ) {
- relevanssi_show_post_insights( $request['post_insights'] );
- return true;
- }
-
- return false;
-}
-
-/**
- * Deletes a query from the click tracking database.
- *
- * @param string $query The query to delete.
- */
-function relevanssi_delete_query( string $query ) {
- global $wpdb, $relevanssi_variables;
-
- $deleted = $wpdb->query(
- $wpdb->prepare(
- "DELETE FROM {$relevanssi_variables['tracking_table']} WHERE query = %s", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared
- stripslashes( $query )
- )
- );
-
- if ( $deleted ) {
- printf(
- "
%s
",
- sprintf(
- // Translators: %s is the stopword.
- esc_html__(
- "The query '%s' deleted from the click tracking log.",
- 'relevanssi'
- ),
- esc_html( stripslashes( $query ) )
- )
- );
- } else {
- printf(
- "
-
-
- ';
- // Translators: %d is the setting for no trim (probably 0).
- printf( esc_html__( 'Set to %d for no trimming. The click tracking logs will be smaller than the search logs, so this value can be bigger than the value for regular logs.', 'relevanssi' ), 0 );
- echo '';
- ?>
-
- get_results(
- $wpdb->prepare(
- "SELECT query, COUNT(DISTINCT(post_id)) AS posts
- FROM $click_table " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'WHERE timestamp >= %s AND timestamp <= %s
- GROUP BY query ORDER BY posts DESC LIMIT 10',
- $from . ' 00:00:00',
- $to . ' 23:59:59'
- )
- );
-
- $list = array();
- foreach ( $results as $result ) {
- if ( $result->posts < 3 ) {
- continue;
- }
- $insights_url = relevanssi_get_insights_url( $result->query );
-
- $list[] = '
'
- . esc_html( $result->query ) . ' ('
- // Translators: %1$s is the number of posts.
- . sprintf( __( '%1$s posts', 'relevanssi' ), intval( $result->posts ) )
- . ')
';
- }
- if ( count( $list ) > 0 ) {
- ?>
-
- ' . implode( "\n", $list ) . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- $something_printed = true;
- }
-
- if ( ! $something_printed ) {
- ?>
-
-
-
- query.
- *
- * @return string The HTML link tag to link to the insights page.
- */
-function relevanssi_insights_link( $query ): string {
- global $relevanssi_variables;
- $insights_url = admin_url( 'admin.php?page=' . rawurlencode( $relevanssi_variables['plugin_basename'] ) )
- . '&insights=' . rawurlencode( $query->query );
- $insights = sprintf( "%s", esc_url( $insights_url ), esc_html( relevanssi_hyphenate( $query->query ) ) );
- return $insights;
-}
-
-/**
- * Trims Relevanssi click tracking table.
- *
- * Trims Relevanssi click tracking table, using the day interval setting from
- * 'relevanssi_trim_click_logs'.
- *
- * @global object $wpdb The WordPress database interface.
- * @global array $relevanssi_variables The global Relevanssi variables, used
- * for database table names.
- *
- * @return int|bool Number of rows deleted, or false on error.
- */
-function relevanssi_trim_click_logs() {
- global $wpdb, $relevanssi_variables;
- $interval = intval( get_option( 'relevanssi_trim_click_logs' ) );
- return $wpdb->query(
- $wpdb->prepare(
- 'DELETE FROM ' . $relevanssi_variables['tracking_table'] . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- ' WHERE timestamp < TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))',
- $interval
- )
- );
-}
-
-/**
- * Sets up the Relevanssi click tracking log trimming action.
- */
-function relevanssi_schedule_click_tracking_trim() {
- if ( get_option( 'relevanssi_trim_click_logs' ) > 0 ) {
- if ( ! wp_next_scheduled( 'relevanssi_trim_click_logs' ) ) {
- wp_schedule_event( time(), 'daily', 'relevanssi_trim_click_logs' );
- }
- } elseif ( wp_next_scheduled( 'relevanssi_trim_click_logs' ) ) {
- wp_clear_scheduled_hook( 'relevanssi_trim_click_logs' );
- }
-}
-
-/**
- * Prints out the Relevanssi click tracking log as a CSV file.
- *
- * Exports the whole Relevanssi click tracking log as a CSV file.
- *
- * @uses relevanssi_output_exported_log
- */
-function relevanssi_export_click_log() {
- global $wpdb, $relevanssi_variables;
-
- $data = $wpdb->get_results( 'SELECT * FROM ' . $relevanssi_variables['tracking_table'], ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- relevanssi_output_exported_log(
- 'relevanssi_click_log.csv',
- $data,
- __( 'No search clicks logged.', 'relevanssi' )
- );
-}
-
-/**
- * Returns the post ID prefixed with the blog ID.
- *
- * @param object $post_object The post object.
- *
- * @return string Post ID or "blog ID-post ID".
- */
-function relevanssi_get_post_identifier( $post_object ) {
- if ( is_multisite() ) {
- if ( isset( $post_object->blog_id ) ) {
- return $post_object->blog_id . '-' . $post_object->ID;
- } else {
- return get_current_blog_id() . '-' . $post_object->ID;
- }
- } else {
- return $post_object->ID;
- }
-}
diff --git a/relevanssi-premium/premium/common.php b/relevanssi-premium/premium/common.php
deleted file mode 100644
index fe28df91..00000000
--- a/relevanssi-premium/premium/common.php
+++ /dev/null
@@ -1,1268 +0,0 @@
-Related Searches:
', '
', '
' );
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param string $query The search query (get_search_query() is a good way to get the current query).
- * @param string $pre What is printed before the results, default '
'.
- * @param string $sep The separator between individual results, default '
'.
- * @param string $post What is printed after the results, default '
'.
- * @param int $number Number of related searches to show, default 5.
- *
- * @author John Blackbourn
- */
-function relevanssi_related( $query, $pre = '
', $sep = '
', $post = '
', $number = 5 ) {
- global $wpdb, $relevanssi_variables;
-
- $output = array();
- $related = array();
- $tokens = relevanssi_tokenize( $query, true, -1, 'search_query' );
- if ( empty( $tokens ) ) {
- return;
- }
-
- $query_slug = sanitize_title( $query );
- $related = get_transient( 'related-' . $query_slug );
- if ( ! $related ) {
- $related = array();
- /**
- * Loop over each token in the query and return logged queries which:
- *
- * - Contain a matching token
- * - Don't match the query or the token exactly
- * - Have at least 2 hits
- * - Have been queried at least twice
- *
- * then order by most queried with a max of $number results.
- */
- foreach ( $tokens as $token => $count ) {
- $escaped_token = '%' . $wpdb->esc_like( "$token" ) . '%';
- $log_table = $relevanssi_variables['log_table'];
- $results = $wpdb->get_results(
- $wpdb->prepare(
- 'SELECT query ' .
- "FROM $log_table " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- 'WHERE query LIKE %s
- AND query NOT IN (%s, %s)
- AND hits > 1
- GROUP BY query
- HAVING count(query) > 1
- ORDER BY count(query) DESC
- LIMIT %d',
- $escaped_token,
- $token,
- $query,
- $number
- )
- );
- if ( is_array( $results ) ) {
- foreach ( $results as $result ) {
- $related[] = $result->query;
- }
- }
- }
- if ( empty( $related ) ) {
- return;
- } else {
- set_transient( 'related-' . $query_slug, $related, 60 * 60 * 24 * 7 );
- }
- }
-
- // Order results by most matching tokens then slice to a maximum of $number results.
- $related = array_keys( array_count_values( $related ) );
- $related = array_slice( $related, 0, $number );
- foreach ( $related as $rel ) {
- $url = add_query_arg(
- array(
- 's' => rawurlencode( $rel ),
- ),
- home_url()
- );
- $rel = esc_attr( $rel );
- $output[] = "$rel";
- }
-
- echo $pre . implode( $sep, $output ) . $post; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-}
-
-/**
- * Replaces get_posts() in a way that handles users and taxonomy terms.
- *
- * Custom-made get_posts() replacement that creates post objects for users and
- * taxonomy terms. For regular posts, the function uses get_posts() and a
- * caching mechanism.
- *
- * @global array $relevanssi_post_array The global Relevanssi post array used as
- * a cache.
- *
- * @param int|string $id The post ID to fetch. If the ID is a string and
- * begins with 'u_', it's considered a user ID and if it begins with '**', it's
- * considered a taxonomy term.
- * @param int $blog_id The blog ID, used to make caching work in
- * multisite environment. Defaults to -1, which means the blog id is not used.
- *
- * @return object|WP_Error $post The post object for the post ID or a WP_Error
- * object if the post ID is not found.
- */
-function relevanssi_premium_get_post( $id, int $blog_id = -1 ) {
- global $relevanssi_post_array;
- $type = substr( $id, 0, 2 );
- switch ( $type ) {
- case 'u_':
- list( , $id ) = explode( '_', $id );
-
- $user = get_userdata( $id );
- $post = new stdClass();
- $post->post_title = $user->display_name;
- $post->post_content = $user->description;
- $post->post_type = 'user';
- $post->ID = $id;
- $post->relevanssi_link = get_author_posts_url( $id );
- $post->post_status = 'publish';
- $post->post_date = gmdate( 'Y-m-d H:i:s' );
- $post->post_author = 0;
- $post->post_name = '';
- $post->post_excerpt = '';
- $post->comment_status = '';
- $post->ping_status = '';
- $post->user_id = $id;
-
- /**
- * Filters the user profile post object.
- *
- * After a post object is created from the user profile, it is
- * passed through this filter so it can be modified.
- *
- * @param object $post The post object.
- */
- $post = apply_filters( 'relevanssi_user_profile_to_post', $post );
- break;
- case 'p_':
- list( , $id ) = explode( '_', $id );
-
- $post_type_name = relevanssi_get_post_type_by_id( $id );
- $post_type = get_post_type_object( $post_type_name );
- $post = new stdClass();
- $post->post_title = $post_type->label;
- $post->post_content = $post_type->description;
- $post->post_type = 'post_type';
- $post->ID = $id;
- $post->relevanssi_link = get_post_type_archive_link( $post_type_name );
- $post->post_status = 'publish';
- $post->post_date = gmdate( 'Y-m-d H:i:s' );
- $post->post_author = 0;
- $post->post_name = '';
- $post->post_excerpt = '';
- $post->comment_status = '';
- $post->ping_status = '';
- $post->post_type_id = $post_type_name;
-
- /**
- * Filters the post type post object.
- *
- * After a post object is created from a post type, it is passed
- * through this filter so it can be modified.
- *
- * @param stdClass $post The post object.
- */
- $post = apply_filters( 'relevanssi_post_type_to_post', $post );
- break;
- case '**':
- list( , $taxonomy, $id ) = explode( '**', $id );
-
- $term = get_term( $id, $taxonomy );
- if ( is_wp_error( $term ) ) {
- return new WP_Error( 'term_not_found', "Taxonomy term wasn't found." );
- }
- $post = new stdClass();
- $post->post_title = $term->name;
- $post->post_content = $term->description;
- $post->post_type = $taxonomy;
- $post->ID = -1;
- $post->post_status = 'publish';
- $post->post_date = gmdate( 'Y-m-d H:i:s' );
- $post->relevanssi_link = get_term_link( $term, $taxonomy );
- $post->post_author = 0;
- $post->post_name = '';
- $post->post_excerpt = '';
- $post->comment_status = '';
- $post->ping_status = '';
- $post->term_id = $id;
- $post->post_parent = $term->parent;
-
- /**
- * Filters the taxonomy term post object.
- *
- * After a post object is created from the taxonomy term, it is
- * passed through this filter so it can be modified.
- *
- * @param Object $post The post object.
- */
- $post = apply_filters( 'relevanssi_taxonomy_term_to_post', $post );
- break;
- default:
- $cache_id = $id;
- if ( -1 !== $blog_id ) {
- $cache_id = $blog_id . '|' . $id;
- }
- if ( isset( $relevanssi_post_array[ $cache_id ] ) ) {
- // Post exists in the cache.
- $post = $relevanssi_post_array[ $cache_id ];
- } else {
- $post = get_post( $id );
-
- $relevanssi_post_array[ $cache_id ] = $post;
- }
- if (
- 'on' === get_option( 'relevanssi_link_pdf_files' )
- && ! empty( $post->post_mime_type )
- ) {
- /**
- * Filters the URL to the attachment file.
- *
- * If you set the attachment indexing to index attachments that
- * are stored outside the WP attachment system, use this filter
- * to provide a link to the attachment.
- *
- * @param string The URL to the attachment file.
- * @param int The attachment post ID number.
- */
- $post->relevanssi_link = apply_filters(
- 'relevanssi_get_attachment_url',
- wp_get_attachment_url( $post->ID ),
- $post->ID
- );
- }
- }
-
- if ( ! $post ) {
- $post = new WP_Error( 'post_not_found', __( 'The requested post does not exist.' ) );
- }
-
- return $post;
-}
-
-/**
- * Returns a list of indexed taxonomies.
- *
- * This will also include "user", if user profiles are indexed, and "post_type", if
- * post type archives are indexed.
- *
- * @return array $non_post_post_types_array An array of taxonomies Relevanssi is set
- * to index (and "user" or "post_type").
- */
-function relevanssi_get_non_post_post_types() {
- // These post types are not posts, ie. they are taxonomy terms and user profiles.
- $non_post_post_types_array = array();
- if ( get_option( 'relevanssi_index_taxonomies' ) ) {
- $taxonomies = get_option( 'relevanssi_index_terms' );
- if ( is_array( $taxonomies ) ) {
- $non_post_post_types_array = $taxonomies;
- }
- }
- if ( get_option( 'relevanssi_index_users' ) ) {
- $non_post_post_types_array[] = 'user';
- }
- if ( get_option( 'relevanssi_index_post_type_archives' ) ) {
- $non_post_post_types_array[] = 'post_type';
- }
- return $non_post_post_types_array;
-}
-
-/**
- * Gets the PDF content for the child posts of the post.
- *
- * @global $wpdb The WordPress database interface.
- *
- * @param int $post_id The post ID of the parent post.
- *
- * @return array $pdf_content The PDF content of the child posts.
- */
-function relevanssi_get_child_pdf_content( $post_id ): array {
- global $wpdb;
-
- $post_id = intval( $post_id );
- $pdf_content = '';
-
- if ( $post_id > 0 ) {
- /**
- * Filters the custom field value before indexing.
- *
- * @param array Custom field values.
- * @param string $field The custom field name.
- * @param int $post_id The post ID.
- */
- return apply_filters(
- 'relevanssi_custom_field_value',
- $wpdb->get_col( "SELECT meta_value FROM $wpdb->postmeta AS pm, $wpdb->posts AS p WHERE pm.post_id = p.ID AND p.post_parent = $post_id AND meta_key = '_relevanssi_pdf_content'" ), // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- '_relevanssi_pdf_content',
- $post_id
- );
- // Only user-provided variable is $post_id, and that's from Relevanssi and sanitized as an int.
- }
-
- return array();
-}
-
-/**
- * Provides the Premium version "Did you mean" recommendations.
- *
- * Provides a better version of "Did you mean" recommendations, using the
- * spelling corrector class to generate a correct spelling.
- *
- * @global WP_Query $wp_query The query object, used to check the number of
- * posts found.
- *
- * @param string $query The search query to correct.
- * @param string $pre Text printed out before the suggestion.
- * @param string $post Text printed out after the suggestion.
- * @param int $n Maximum number of hits before the suggestions are shown,
- * default 5.
- *
- * @return string Empty string if there's nothing to correct; otherwise a string
- * with the HTML link to the corrected search.
- */
-function relevanssi_premium_didyoumean( $query, $pre, $post, $n = 5 ) {
- global $wp_query;
-
- $total_results = $wp_query->found_posts;
- $result = '';
-
- if ( $total_results > $n ) {
- return $result;
- }
-
- $suggestion = relevanssi_premium_generate_suggestion( $query );
- if ( true === $suggestion ) {
- return $result;
- }
- if ( empty( $suggestion ) ) {
- $suggestion = relevanssi_simple_generate_suggestion( $query );
- }
-
- $result = null;
- if ( $suggestion ) {
- $url = trailingslashit( get_bloginfo( 'url' ) );
- $url = esc_attr(
- add_query_arg(
- array(
- 's' => rawurlencode( $suggestion ),
- ),
- $url
- )
- );
- /** This filter is documented in lib/didyoumean.php */
- $url = apply_filters( 'relevanssi_didyoumean_url', $url, $query, $suggestion );
-
- // Escape the suggestion to avoid XSS attacks.
- $suggestion = htmlspecialchars( $suggestion );
-
- /** This filter is documented in lib/didyoumean.php */
- $result = apply_filters( 'relevanssi_didyoumean_suggestion', "$pre$suggestion$post" );
- }
- return $result;
-}
-
-/**
- * Generates the "Did you mean" suggestion.
- *
- * Generates "Did you mean" suggestions given a query to correct, using the
- * spelling corrector method.
- *
- * @param string $query The search query to correct.
- *
- * @return string $query Corrected query, empty string if there are no
- * corrections available and true if the query was already correct.
- */
-function relevanssi_premium_generate_suggestion( $query ) {
- $corrected_query = '';
-
- if ( class_exists( 'Relevanssi_SpellCorrector' ) ) {
- $query = htmlspecialchars_decode( $query, ENT_QUOTES );
- $tokens = relevanssi_tokenize( $query, true, -1, 'search_query' );
-
- $sc = new Relevanssi_SpellCorrector();
-
- $correct = array();
- $exact_matches = 0;
- foreach ( array_keys( $tokens ) as $token ) {
- /**
- * Filters the tokens for Did you mean suggestions.
- *
- * You can use this filter hook to modify the tokens before Relevanssi
- * tries to come up with Did you mean suggestions for them. If you
- * return an empty string, the token will be skipped and no suggestion
- * will be made for the token.
- *
- * @param string $token An individual word from the search query.
- *
- * @return string The token.
- */
- $token = apply_filters( 'relevanssi_didyoumean_token', trim( $token ) );
- if ( ! $token ) {
- continue;
- }
- $c = $sc->correct( $token );
- if ( true === $c ) {
- ++$exact_matches;
- } elseif ( ! empty( $c ) && strval( $token ) !== $c ) {
- array_push( $correct, $c );
- $query = str_ireplace( $token, $c, $query ); // Replace misspelled word in query with suggestion.
- }
- }
- if ( count( $tokens ) === $exact_matches ) {
- // All tokens are correct.
- return true;
- }
- if ( count( $correct ) > 0 ) {
- // Strip quotes, because they are likely incorrect.
- $query = str_replace( '"', '', $query );
- $corrected_query = $query;
- }
- }
-
- return $corrected_query;
-}
-
-/**
- * Multisite-friendly get_post().
- *
- * Gets a post using relevanssi_get_post() from the specified subsite.
- *
- * @param int $blogid The blog ID.
- * @param int $id The post ID.
- *
- * @return object|WP_Error $post The post object or a WP_Error if the post
- * cannot be found.
- */
-function relevanssi_get_multisite_post( $blogid, $id ) {
- switch_to_blog( $blogid );
- if ( ! is_numeric( mb_substr( $id, 0, 1 ) ) ) {
- // The post ID does not start with a number; this is a user or a
- // taxonomy term, so suspend cache addition to avoid getting garbage in
- // the cache.
- wp_suspend_cache_addition( true );
- }
- $post = relevanssi_get_post( $id, $blogid );
- restore_current_blog();
- return $post;
-}
-
-/**
- * Initializes things for Relevanssi Premium.
- *
- * Adds metaboxes, depending on settings; adds synonym indexing filter if
- * necessary and removes an unnecessary action.
- */
-function relevanssi_premium_init() {
- $show_post_controls = true;
- if ( 'on' === get_option( 'relevanssi_hide_post_controls' ) ) {
- $show_post_controls = false;
- /**
- * Adjusts the capability required to show the Relevanssi post controls
- * for admins.
- *
- * @param string $capability The minimum capability required, default
- * 'manage_options'.
- */
- if (
- 'on' === get_option( 'relevanssi_show_post_controls' ) &&
- current_user_can( apply_filters( 'relevanssi_options_capability', 'manage_options' ) )
- ) {
- $show_post_controls = true;
- }
- }
- if ( $show_post_controls ) {
- add_action( 'add_meta_boxes', 'relevanssi_add_metaboxes' );
- }
-
- if ( 'on' === get_option( 'relevanssi_index_synonyms' ) ) {
- add_filter( 'relevanssi_indexing_tokens', 'relevanssi_add_indexing_synonyms', 10 );
- }
-
- // If the relevanssi_save_postdata is not disabled, scheduled publication
- // will swipe out the Relevanssi post controls settings.
- add_action(
- 'future_to_publish',
- function () {
- remove_action( 'save_post', 'relevanssi_save_postdata' );
- }
- );
-
- if ( function_exists( 'do_blocks' ) ) {
- add_action( 'init', 'relevanssi_register_gutenberg_actions', 11 );
- }
-
- global $pagenow, $relevanssi_variables;
- $on_relevanssi_page = false;
- if ( isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
- $page = sanitize_file_name( wp_unslash( $_GET['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification
- $base = sanitize_file_name( wp_unslash( plugin_basename( $relevanssi_variables['file'] ) ) );
- if ( $base === $page ) {
- $on_relevanssi_page = true;
- }
- }
-
- if ( function_exists( 'is_multisite' ) && is_multisite() && function_exists( 'get_blog_status' ) ) {
- $public = (bool) get_blog_status( get_current_blog_id(), 'public' );
- if ( ! $public && 'options-general.php' === $pagenow && $on_relevanssi_page ) {
- add_action(
- 'admin_notices',
- function () {
- printf(
- "
%s
",
- esc_html__( 'Your site is not public. By default, Relevanssi does not search private sites. If you want to be able to search on this site, either make it public or add a filter function that returns true on \'relevanssi_multisite_public_status\' filter hook.', 'relevanssi' )
- );
- }
- );
- }
- }
-
- add_filter( 'relevanssi_remove_punctuation', 'relevanssi_wildcards_pre', 8 );
- add_filter( 'relevanssi_remove_punctuation', 'relevanssi_wildcards_post', 12 );
- add_filter( 'relevanssi_term_where', 'relevanssi_query_wildcards', 10, 2 );
-
- add_filter( 'relevanssi_indexing_restriction', 'relevanssi_hide_post_restriction' );
-
- if ( defined( 'RELEVANSSI_API_KEY' ) ) {
- add_filter(
- 'pre_option_relevanssi_api_key',
- function () {
- return RELEVANSSI_API_KEY;
- }
- );
- add_filter(
- 'pre_site_option_relevanssi_api_key',
- function () {
- return RELEVANSSI_API_KEY;
- }
- );
- }
-
- $update_translations = false;
- if ( 'on' === get_option( 'relevanssi_update_translations' ) ) {
- $update_translations = true;
- }
- if ( 'on' === get_option( 'relevanssi_do_not_call_home' ) ) {
- $update_translations = false;
- }
- /**
- * Filters whether to update the Relevanssi translations.
- *
- * @param boolean $update_translations If false, don't update translations.
- */
- $update_translations = apply_filters( 'relevanssi_update_translations', $update_translations );
-
- if ( $update_translations ) {
- $t15s_updater = new Relevanssi_Language_Packs(
- 'plugin',
- 'relevanssi',
- 'https://packages.translationspress.com/relevanssi/relevanssi/packages.json'
- );
- $t15s_updater->add_project();
- }
-
- add_action(
- 'in_plugin_update_message-' . $relevanssi_variables['plugin_basename'],
- 'relevanssi_premium_modify_plugin_update_message'
- );
-
- // Add the related posts filters if necessary.
- relevanssi_related_init();
-}
-
-/**
- * Adds the Relevanssi Premium hide post filter to the indexing restrictions.
- *
- * @global object $wpdb The WP database interface.
- *
- * @param array $restrictions The current set of restrictions.
- *
- * @return array The updated restrictions.
- */
-function relevanssi_hide_post_restriction( $restrictions ) {
- global $wpdb;
-
- $restrictions['mysql'] .= " AND post.ID NOT IN (SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_hide_post' AND meta_value = 'on')";
- $restrictions['reason'] .= ' ' . __( 'Relevanssi index exclude', 'relevanssi' );
-
- return $restrictions;
-}
-
-/**
- * Replaces the standard permalink with $post->relevanssi_link if it exists.
- *
- * Relevanssi adds a link to the user profile or taxonomy term page to
- * $post->relevanssi_link. This function replaces permalink with that link, if
- * it exists.
- *
- * @param string $permalink The permalink to filter.
- * @param int $post_id The post ID.
- *
- * @return string $permalink Modified permalink.
- */
-function relevanssi_post_link_replace( $permalink, $post_id ) {
- $post = relevanssi_get_post( $post_id );
- if ( property_exists( $post, 'relevanssi_link' ) ) {
- $permalink = $post->relevanssi_link;
- }
- return $permalink;
-}
-
-/**
- * Fetches a list of words from the Relevanssi database for spelling corrector.
- *
- * A helper function for the spelling corrector. Gets the word list from the
- * 'relevanssi_words' option. If the data is expired (more than a month old),
- * this function triggers an asynchronous refresh action that fetches new words
- * from the Relevanssi database to use as a source material for spelling
- * suggestions.
- *
- * @return array $words An array of words, with the word as the key and number
- * of occurrances as the value.
- */
-function relevanssi_get_words() {
- $data = get_option(
- 'relevanssi_words',
- array(
- 'expire' => 0,
- 'words' => array(),
- )
- );
-
- if ( time() > $data['expire'] ) {
- relevanssi_launch_ajax_action( 'relevanssi_get_words' );
- }
-
- return $data['words'];
-}
-
-/**
- * Adds the Premium options.
- *
- * @global array $relevanssi_variables The global Relevanssi variables, used to set the link boost default.
- */
-function relevanssi_premium_install() {
- global $relevanssi_variables;
-
- add_option( 'relevanssi_api_key', '' );
- add_option( 'relevanssi_click_tracking', 'on' );
- add_option( 'relevanssi_disable_shortcodes', '' );
- add_option( 'relevanssi_do_not_call_home', 'off' );
- add_option( 'relevanssi_hide_post_controls', 'off' );
- add_option( 'relevanssi_index_pdf_parent', 'off' );
- add_option( 'relevanssi_index_post_type_archives', 'off' );
- add_option( 'relevanssi_index_subscribers', 'off' );
- add_option( 'relevanssi_index_synonyms', 'off' );
- add_option( 'relevanssi_index_taxonomies', 'off' );
- add_option( 'relevanssi_index_terms', array() );
- add_option( 'relevanssi_index_users', 'off' );
- add_option( 'relevanssi_internal_links', 'noindex' );
- add_option( 'relevanssi_link_boost', $relevanssi_variables['link_boost_default'] );
- add_option( 'relevanssi_link_pdf_files', 'on' );
- add_option( 'relevanssi_max_excerpts', 1 );
- add_option( 'relevanssi_mysql_columns', '' );
- add_option( 'relevanssi_post_type_weights', '' );
- add_option( 'relevanssi_read_new_files', 'off' );
- add_option( 'relevanssi_redirects', array() );
- add_option( 'relevanssi_related_settings', relevanssi_related_default_settings() );
- add_option( 'relevanssi_related_style', relevanssi_related_default_styles() );
- add_option( 'relevanssi_send_pdf_files', 'off' );
- add_option( 'relevanssi_server_location', relevanssi_default_server_location() );
- add_option( 'relevanssi_show_post_controls', 'off' );
- add_option( 'relevanssi_spamblock', array() );
- add_option( 'relevanssi_thousand_separator', '' );
- add_option( 'relevanssi_trim_click_logs', '180' );
- add_option( 'relevanssi_update_translations', 'off' );
- add_option(
- 'relevanssi_recency_bonus',
- array(
- 'bonus' => '',
- 'days' => '',
- )
- );
-}
-
-/**
- * Makes an educated guess whether the default attachment server location should
- * be US or EU, based on the site locale setting.
- *
- * @uses get_locale()
- *
- * @return string 'eu' or 'us', depending on the locale.
- */
-function relevanssi_default_server_location(): string {
- $server = 'us';
- $locale = get_locale();
-
- if ( strpos( $locale, '_' ) === false ) {
- $language = $locale;
- } else {
- list( $language, $country ) = explode( '_', $locale );
- }
-
- $eu_languages = array( 'ast', 'bel', 'ca', 'cy', 'el', 'et', 'eu', 'fi', 'fur', 'gd', 'hr', 'hsb', 'lv', 'oci', 'roh', 'sq', 'uk' );
- $eu_countries = array( 'AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CY', 'DE', 'EE', 'ES', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IL', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MD', 'ME', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'SE', 'SI', 'SK', 'UA' );
-
- if ( in_array( strtolower( $language ), $eu_languages, true ) ||
- in_array( strtoupper( $country ), $eu_countries, true ) ) {
- $server = 'eu';
- }
-
- return $server;
-}
-
-/**
- * Returns the attachment reading server URL.
- *
- * Checks the correct server from 'relevanssi_server_location' option and returns the
- * correct URL from the constants.
- *
- * @return string The attachment reading server URL.
- */
-function relevanssi_get_server_url() {
- $server = RELEVANSSI_US_SERVICES_URL;
- if ( 'eu' === get_option( 'relevanssi_server_location' ) ) {
- $server = RELEVANSSI_EU_SERVICES_URL;
- }
- /**
- * Allows changing the attachment reading server URL.
- *
- * @param string The server URL.
- */
- return apply_filters( 'relevanssi_attachment_server_url', $server );
-}
-
-/**
- * Extracts taxonomy specifiers from the search query.
- *
- * Finds all {taxonomy:search term} specifiers from the query. If any are
- * found, they are stored in $relevanssi_variables global variable and the
- * filtering function is activated.
- *
- * @global array $relevanssi_variables Used to store the target data.
- *
- * @param string $query The query.
- *
- * @return string The query with the specifier tags removed.
- */
-function relevanssi_extract_specifier( $query ) {
- global $relevanssi_variables;
-
- $targets = array();
-
- if ( preg_match_all( '/{(.*?):(.*?)}/', $query, $matches, PREG_SET_ORDER ) ) {
- foreach ( $matches as $match ) {
- list( $whole, $target, $keyword ) = $match;
-
- $phrases = relevanssi_extract_phrases( $keyword );
- if ( ! empty( $phrases ) ) {
- foreach ( $phrases as $phrase ) {
- $relevanssi_variables['phrase_targets'][ $phrase ] = $target;
- }
- } else {
- if ( is_numeric( $keyword ) ) {
- $keyword = ' ' . $keyword;
- }
- $targets[ $keyword ][] = $target;
- }
-
- $query = str_replace( $whole, $keyword, $query );
- }
- }
-
- if ( ! empty( $targets ) ) {
- $relevanssi_variables['targets'] = $targets;
- add_filter( 'relevanssi_match', 'relevanssi_target_matches' );
- }
-
- return $query;
-}
-
-/**
- * Filters posts by taxonomy specifiers.
- *
- * If taxonomy specifiers are found in the query, this filtering function is
- * activated and will set the post weight to 0 in the cases where the post
- * matches the search term, but not the specifiers.
- *
- * @global array $relevanssi_variables Used to store the target data.
- *
- * @param object $match_object The Relevanssi match object.
- *
- * @return object The match object, with the weight modified if necessary.
- */
-function relevanssi_target_matches( $match_object ) {
- global $relevanssi_variables;
-
- if ( is_numeric( $match_object->term ) ) {
- $match_object->term = ' ' . $match_object->term;
- }
-
- $fuzzy = get_option( 'relevanssi_fuzzy' );
- if ( 'always' === $fuzzy || 'sometimes' === $fuzzy ) {
- foreach ( $relevanssi_variables['targets'] as $term => $target ) {
- if (
- substr( $match_object->term, 0, strlen( $term ) ) === $term ||
- substr( strrev( $match_object->term ), 0, strlen( $term ) ) === strrev( $term )
- ) {
- $relevanssi_variables['targets'][ $match_object->term ] =
- $relevanssi_variables['targets'][ $term ];
- }
- }
- }
-
- $no_matches = false;
- if ( isset( $relevanssi_variables['targets'][ $match_object->term ] ) ) {
- $no_matches = true;
- foreach ( $relevanssi_variables['targets'][ $match_object->term ] as $target ) {
- if ( isset( $match_object->$target ) && '0' !== $match_object->$target ) {
- $no_matches = false;
- break;
- }
- if ( $match_object->customfield_detail && ! is_object( $match_object->customfield_detail ) ) {
- $match_object->customfield_detail = json_decode( $match_object->customfield_detail );
- }
- if (
- ! empty( $match_object->customfield_detail ) &&
- isset( $match_object->customfield_detail->$target ) &&
- '0' !== $match_object->customfield_detail->$target
- ) {
- $no_matches = false;
- break;
- }
- if ( ! is_object( $match_object->taxonomy_detail ) ) {
- $match_object->taxonomy_detail = json_decode( $match_object->taxonomy_detail );
- }
- if (
- ! empty( $match_object->taxonomy_detail ) &&
- isset( $match_object->taxonomy_detail->$target ) &&
- '0' !== $match_object->taxonomy_detail->$target
- ) {
- $no_matches = false;
- break;
- }
- if ( ! is_object( $match_object->mysqlcolumn_detail ) ) {
- $match_object->mysqlcolumn_detail = json_decode( $match_object->mysqlcolumn_detail );
- }
- if (
- ! empty( $match_object->mysqlcolumn_detail ) &&
- isset( $match_object->mysqlcolumn_detail->$target ) &&
- '0' !== $match_object->mysqlcolumn_detail->$target
- ) {
- $no_matches = false;
- break;
- }
- }
- }
- if ( $no_matches ) {
- $match_object->weight = 0;
- }
-
- if ( is_object( $match_object->customfield_detail ) ) {
- $match_object->customfield_detail = wp_json_encode( $match_object->customfield_detail );
- }
- if ( is_object( $match_object->taxonomy_detail ) ) {
- $match_object->taxonomy_detail = wp_json_encode( $match_object->taxonomy_detail );
- }
- if ( is_object( $match_object->mysqlcolumn_detail ) ) {
- $match_object->mysqlcolumn_detail = wp_json_encode( $match_object->mysqlcolumn_detail );
- }
-
- return $match_object;
-}
-
-/**
- * Generates queries for targeted phrases.
- *
- * Goes through the targeted phrases from the Relevanssi global variable
- * $relevanssi_variables['phrase_targets'] and generates the queries for the
- * phrases taking note of the target restrictions. Some of this is slightly
- * hacky, as some default inclusions generated by the
- * relevanssi_generate_phrase_queries() are simply removed.
- *
- * @see relevanssi_generate_phrase_queries()
- *
- * @global array $relevanssi_variables The global Relevanssi variables.
- *
- * @param string $phrase The source phrase for the queries.
- *
- * @return array An array of queries per phrase.
- */
-function relevanssi_targeted_phrases( $phrase ) {
- global $relevanssi_variables;
-
- $target = $relevanssi_variables['phrase_targets'][ $phrase ];
-
- $taxonomies = array();
- $excerpt = 'off';
- $fields = array();
-
- if ( 'excerpt' === $target ) {
- $excerpt = 'on';
- }
- if ( 'tag' === $target ) {
- $target = 'post_tag';
- }
- if ( taxonomy_exists( $target ) ) {
- $taxonomies = array( $target );
- } else {
- $fields = array( $target );
- }
-
- $queries = relevanssi_generate_phrase_queries(
- array( $phrase ),
- $taxonomies,
- $fields,
- $excerpt
- );
-
- if ( 'excerpt' === $target ) {
- $find = array(
- "post_content LIKE '%$phrase%' OR ",
- "post_title LIKE '%$phrase%' OR ",
- );
- $queries[ $phrase ][0] = str_replace( $find, '', $queries[ $phrase ][0] );
- } elseif ( 'title' === $target ) {
- $find = array(
- "post_content LIKE '%$phrase%' OR ",
- );
- $queries[ $phrase ][0] = str_replace( $find, '', $queries[ $phrase ][0] );
- } else {
- unset( $queries[ $phrase ][0] ); // Remove the generic post content or title query.
- }
- if ( $fields ) {
- // Custom field targeting, remove PDF content custom frield from the list.
- $queries[ $phrase ][1] = str_replace(
- ",'_relevanssi_pdf_content'",
- '',
- $queries[ $phrase ][1]
- );
- }
-
- return $queries;
-}
-
-/**
- * Adds the Relevanssi Premium phrase filters for PDF content, terms and users.
- *
- * Hooks on to `relevanssi_phrase_queries` to include the phrase queries for
- * Relevanssi Premium features: looking for phrases in PDF content, taxonomy
- * term names and user fields.
- *
- * @param array $queries The array of queries where the new queries are added.
- * @param string $phrase The current phrase, already MySQL escaped.
- * @param string $status MySQL escaped post status value to use in queries.
- *
- * @return array The queries, with new queries added.
- */
-function relevanssi_premium_phrase_queries( $queries, $phrase, $status ) {
- global $wpdb;
-
- $index_post_types = get_option( 'relevanssi_index_post_types', array() );
- if ( in_array( 'attachment', $index_post_types, true ) ) {
- $query = "(SELECT ID
- FROM $wpdb->posts AS p, $wpdb->postmeta AS m
- WHERE p.ID = m.post_id
- AND m.meta_key = '_relevanssi_pdf_content'
- AND m.meta_value LIKE '%$phrase%'
- AND p.post_status IN ($status))";
-
- $queries[] = array(
- 'query' => $query,
- 'target' => 'doc',
- );
- }
-
- if ( 'on' === get_option( 'relevanssi_index_pdf_parent' ) ) {
- $query = "(SELECT parent.ID
- FROM $wpdb->posts AS p, $wpdb->postmeta AS m, $wpdb->posts AS parent
- WHERE p.ID = m.post_id
- AND p.post_parent = parent.ID
- AND m.meta_key = '_relevanssi_pdf_content'
- AND m.meta_value LIKE '%$phrase%'
- AND p.post_status = 'inherit')";
-
- $queries[] = array(
- 'query' => $query,
- 'target' => 'doc',
- );
- }
-
- $index_taxonomies = get_option( 'relevanssi_index_terms', array() );
- if ( ! empty( $index_taxonomies ) ) {
- $taxonomies_escaped = implode( "','", array_map( 'esc_sql', $index_taxonomies ) );
- $taxonomies_sql = "AND tt.taxonomy IN ('$taxonomies_escaped')";
-
- $query = "(SELECT t.term_id
- FROM $wpdb->terms AS t, $wpdb->term_taxonomy AS tt
- WHERE t.term_id = tt.term_id
- AND t.name LIKE '%$phrase%'
- $taxonomies_sql)";
-
- $queries[] = array(
- 'query' => $query,
- 'target' => 'item',
- );
- }
-
- $index_users = get_option( 'relevanssi_index_users', 'off' );
- if ( 'on' === $index_users ) {
- $extra_fields = get_option( 'relevanssi_index_user_fields' );
- $meta_keys = array( 'description', 'first_name', 'last_name' );
- if ( $extra_fields ) {
- $meta_keys = array_merge( $meta_keys, explode( ',', $extra_fields ) );
- }
- $meta_keys_escaped = implode( "','", array_map( 'esc_sql', $meta_keys ) );
- $meta_keys_sql = "um.meta_key IN ('$meta_keys_escaped')";
-
- $query = "(SELECT DISTINCT(u.ID)
- FROM $wpdb->users AS u LEFT JOIN $wpdb->usermeta AS um
- ON u.ID = um.user_id
- WHERE ($meta_keys_sql AND meta_value LIKE '%$phrase%')
- OR u.display_name LIKE '%$phrase%')";
-
- $queries[] = array(
- 'query' => $query,
- 'target' => 'item',
- );
- }
-
- return $queries;
-}
-
-/**
- * Fetches database words to the relevanssi_words option.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the
- * database table names.
- */
-function relevanssi_update_words_option() {
- global $wpdb, $relevanssi_variables;
-
- /**
- * The minimum limit of occurrances to include a word.
- *
- * To save resources, only words with more than this many occurrances are
- * fed to the spelling corrector. If there are problems with the spelling
- * corrector, increasing this value may fix those problems.
- *
- * @param int $number The number of occurrances must be more than this
- * value, default 2.
- */
- $count = apply_filters( 'relevanssi_get_words_having', 2 );
- if ( ! is_numeric( $count ) ) {
- $count = 2;
- }
- $q = 'SELECT term,
- SUM(title + content + comment + tag + link + author + category + excerpt + taxonomy + customfield)
- AS c FROM ' . $relevanssi_variables['relevanssi_table'] .
- " GROUP BY term HAVING c > $count"; // Safe: $count is numeric.
-
- $results = $wpdb->get_results( $q ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- $words = array();
- foreach ( $results as $result ) {
- $words[ $result->term ] = $result->c;
- }
-
- $expire = time() + MONTH_IN_SECONDS;
- $data = array(
- 'expire' => $expire,
- 'words' => $words,
- );
-
- update_option( 'relevanssi_words', $data, false );
-}
-
-/**
- * Adds the "Must have" part for the missing terms list.
- *
- * Assumes there's just one missing term (this is checked outside this
- * function).
- *
- * @param WP_Post $post The post object.
- *
- * @return string A string containing the "Must have" link.
- */
-function relevanssi_add_must_have( $post ) {
- $query_string = $GLOBALS['wp']->query_string ?? '';
- $request = $GLOBALS['request'] ?? '/';
- $search_term = implode( '', $post->relevanssi_hits['missing_terms'] );
- $search_page_url = add_query_arg( $query_string, '', home_url( $request ) );
- $search_page_url = str_replace( rawurlencode( $search_term ), '%2B' . $search_term, $search_page_url );
-
- return apply_filters(
- 'relevanssi_missing_terms_must_have',
- ' | ' . __( 'Must have', 'relevanssi' ) . ': ' . $search_term . ''
- );
-}
-
-/**
- * Updates the $term_hits array used for showing how many hits were found for
- * each term.
- *
- * @param array $term_hits The term hits array (passed as reference).
- * @param array $match_arrays The matches array (passed as reference).
- * @param stdClass $match_object The match object.
- * @param string $term The search term.
- */
-function relevanssi_premium_update_term_hits( &$term_hits, &$match_arrays, $match_object, $term ) {
- relevanssi_increase_value( $match_arrays['mysqlcolumn'][ $match_object->doc ], $match_object->mysqlcolumn );
-
- $match_arrays['customfield_detail'][ $match_object->doc ] = array();
- $match_arrays['taxonomy_detail'][ $match_object->doc ] = array();
- $match_arrays['mysqlcolumn_detail'][ $match_object->doc ] = array();
-
- if ( ! empty( $match_object->customfield_detail ) ) {
- $match_arrays['customfield_detail'][ $match_object->doc ][ $term ] = $match_object->customfield_detail;
- }
- if ( ! empty( $match_object->taxonomy_detail ) ) {
- $match_arrays['taxonomy_detail'][ $match_object->doc ][ $term ] = $match_object->taxonomy_detail;
- }
- if ( ! empty( $match_object->mysqlcolumn_detail ) ) {
- $match_arrays['mysqlcolumn_detail'][ $match_object->doc ][ $term ] = $match_object->mysqlcolumn_detail;
- }
-}
-
-/**
- * Adds Premium features to the $return array from $match_arrays.
- *
- * @param array $return_value The search return value array, passed as a
- * reference.
- * @param array $match_arrays The match array for source data.
- */
-function relevanssi_premium_update_return_array( &$return_value, $match_arrays ) {
- $match_arrays['mysqlcolumn_matches'] = $match_arrays['mysqlcolumn_matches'] ?? '';
- $match_arrays['customfield_detail'] = $match_arrays['customfield_detail'] ?? '';
- $match_arrays['taxonomy_detail'] = $match_arrays['taxonomy_detail'] ?? '';
- $match_arrays['mysqlcolumn_detail'] = $match_arrays['mysqlcolumn_detail'] ?? '';
-
- $additions = array(
- 'mysqlcolumn' => $match_arrays['mysqlcolumn_matches'],
- 'customfield_detail' => $match_arrays['customfield_detail'],
- 'taxonomy_detail' => $match_arrays['taxonomy_detail'],
- 'mysqlcolumn_detail' => $match_arrays['mysqlcolumn_detail'],
- );
-
- $return_value = array_merge( $return_value, $additions );
-}
-
-/**
- * Adds Premium features to the $post->relevanssi_hits source array.
- *
- * @param array $hits The search hits array.
- * @param array $data The source data.
- * @param int $post_id The post ID.
- */
-function relevanssi_premium_add_matches( &$hits, $data, $post_id ) {
- $hits['mysqlcolumn'] = $data['mysqlcolumn_matches'][ $post_id ] ?? 0;
- $hits['customfield_detail'] = $data['customfield_detail'][ $post_id ] ?? array();
- $hits['taxonomy_detail'] = $data['taxonomy_detail'][ $post_id ] ?? array();
- $hits['mysqlcolumn_detail'] = $data['mysqlcolumn_detail'][ $post_id ] ?? array();
-
- $hits['customfield_detail'] = array_map(
- function ( $value ) {
- return (array) json_decode( $value );
- },
- $hits['customfield_detail']
- );
-}
-
-/**
- * Returns a string of custom field content for the user.
- *
- * Fetches the user custom field content based on the field indexing settings
- * and concatenates it as a single space-separated string.
- *
- * @uses relevanssi_get_user_field_content
- *
- * @param string $user_id The ID of the user.
- *
- * @return string The custom field content.
- */
-function relevanssi_get_user_custom_field_content( $user_id ): string {
- $custom_field_content = '';
-
- $fields = relevanssi_get_user_field_content( $user_id );
- if ( ! empty( $fields ) ) {
- $custom_field_content = implode( ' ', array_values( $fields ) );
- }
-
- return $custom_field_content;
-}
-
-/**
- * Returns an array of user custom field names.
- *
- * Gets the indexed user field names from relevanssi_index_user_fields and
- * relevanssi_index_user_meta options and returns an array of field names.
- *
- * @return array Array of user custom field names.
- */
-function relevanssi_generate_list_of_user_fields(): array {
- $user_fields = array();
-
- $user_fields_option = get_option( 'relevanssi_index_user_fields' );
- if ( $user_fields_option ) {
- $user_fields = explode( ',', $user_fields_option );
- }
-
- $user_meta = get_option( 'relevanssi_index_user_meta' );
- if ( $user_meta ) {
- $user_fields = array_merge( $user_fields, explode( ',', $user_meta ) );
- }
-
- $user_fields = array_map( 'trim', $user_fields );
-
- return $user_fields;
-}
-
-/**
- * Returns an array of user custom field content.
- *
- * Gets the indexed user field content from the fields specified in the user
- * field indexing options.
- *
- * @uses relevanssi_generate_list_of_user_fields
- *
- * @param string $user_id The ID of the user.
- *
- * @return array An array of (field, value) pairs.
- */
-function relevanssi_get_user_field_content( $user_id ): array {
- $fields = relevanssi_generate_list_of_user_fields();
- $user = get_user_by( 'id', $user_id );
- $user_vars = get_object_vars( $user );
- $values = array();
- foreach ( $fields as $field ) {
- $field_value = '';
- if ( isset( $user_vars[ $field ] ) ) {
- $field_value = $user_vars[ $field ];
- }
- if ( empty( $field_value ) && isset( $user_vars['data']->$field ) ) {
- $field_value = $user_vars['data']->$field;
- }
- if ( empty( $field_value ) ) {
- $field_value = get_user_meta( $user_id, $field, true );
- }
- $values[ $field ] = $field_value;
- }
- return $values;
-}
diff --git a/relevanssi-premium/premium/contextual-help.php b/relevanssi-premium/premium/contextual-help.php
deleted file mode 100644
index 1e47e9ad..00000000
--- a/relevanssi-premium/premium/contextual-help.php
+++ /dev/null
@@ -1,103 +0,0 @@
-add_help_tab(
- array(
- 'id' => 'relevanssi-boolean',
- 'title' => __( 'Boolean operators', 'relevanssi' ),
- 'content' => '
' .
- '
' . __( 'Relevanssi Premium offers limited support for Boolean logic. In addition of setting the default operator from Relevanssi settings, you can use AND and NOT operators in searches.', 'relevanssi' ) . '
' .
- '
' . __( 'To use the NOT operator, prefix the search term with a minus sign:', 'relevanssi' ) .
- sprintf( '
%s
', __( 'cats -dogs', 'relevanssi' ) ) .
- __( "This would only show posts that have the word 'cats' but not the word 'dogs'.", 'relevanssi' ) . '
' .
- '
' . __( 'To use the AND operator, set the default operator to OR and prefix the search term with a plus sign:', 'relevanssi' ) .
- sprintf( '
%s
', __( '+cats dogs mice', 'relevanssi' ) ) .
- __( "This would show posts that have the word 'cats' and either 'dogs' or 'mice' or both, and would prioritize posts that have all three.", 'relevanssi' ) . '
' .
- '
',
- )
- );
-
- /* Translators: first placeholder is the_permalink(), the second is relevanssi_the_permalink() */
- $permalinks_to_users = sprintf( esc_html__( "Permalinks to user profiles may not always work on search results templates. %1\$s should work, but if it doesn't, you can replace it with %2\$s.", 'relevanssi' ), 'the_permalink()', 'relevanssi_the_permalink()' );
- /* Translators: the placeholder is the name of the relevanssi_index_user_fields option */
- $index_user_fields = sprintf( esc_html__( 'To control which user meta fields are indexed, you can use the %s option. It should have a comma-separated list of user meta fields. It can be set like this (you only need to run this code once):', 'relevanssi' ), 'relevanssi_index_user_fields' );
- /* Translators: the first placeholder opens the link, the second closes the link */
- $knowledge_base = sprintf( esc_html__( 'For more details on user profiles and search results templates, see %1$sthis knowledge base entry%2$s.', 'relevanssi' ), "", '' );
-
- $screen->add_help_tab(
- array(
- 'id' => 'relevanssi-title-user-profiles',
- 'title' => __( 'User profiles', 'relevanssi' ),
- 'content' => '
' . __( 'This option sets how Relevanssi handles internal links that point to your own site.', 'relevanssi' ) . '
' .
- '
' . __( "If you choose 'No special processing', Relevanssi doesn’t care about links and indexes the link anchor (the text of the link) like it is any other text.", 'relevanssi' ) . '
' .
- '
' . __( "If you choose 'Index internal links for target documents only', then the link is indexed like the link anchor text were the part of the link target, not the post where the link is.", 'relevanssi' ) . '
' .
- '
' . __( "If you choose 'Index internal links for target and source', the link anchor text will count for both posts.", 'relevanssi' ) . '
' . __( "By default Relevanssi doesn't understand anything about singular word forms, plurals or anything else. You can, however, add a stemmer that will stem all the words to their basic form, making all different forms equal in searching.", 'relevanssi' ) . '
' .
- '
' . __( 'To enable the English-language stemmer, add this to the theme functions.php:', 'relevanssi' ) .
- "
' . __( 'After you add the code, rebuild the index to get correct results.', 'relevanssi' ) . '
' .
- '
',
- )
- );
-
- /* Translators: the placeholder has the WP CLI command */
- $wp_cli_command = sprintf( esc_html__( 'If you have WP CLI installed, Relevanssi Premium has some helpful commands. Use %s to get a list of available commands.', 'relevanssi' ), 'wp help relevanssi' );
- /* Translators: the first placeholder opens the link, the second closes the link */
- $wp_cli_manual = sprintf( esc_html__( 'You can also see %1$sthe user manual page%2$s.', 'relevanssi' ), "", '' );
-
- $screen->add_help_tab(
- array(
- 'id' => 'relevanssi-wpcli',
- 'title' => __( 'WP CLI', 'relevanssi' ),
- 'content' => "
-
$wp_cli_command
-
$wp_cli_manual
-
",
- )
- );
-
- $screen->set_help_sidebar(
- '
' . __( 'For more information:', 'relevanssi' ) . '
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{__(\"Reason this post is not indexed:\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t{relevanssiSees.reason}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"If any of these keywords are present in the search query, this post will be moved on top of the search results.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"You can add weights to pinned keywords like this: 'keyword (100)'. The post with the highest weight will be sorted first if there are multiple posts pinned to the same keyword.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"If any of these keywords are present in the search query, this post will be removed from the search results.\", \"relevanssi\" )}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{__(\"Anything entered here will used when searching for related posts. Using phrases with quotes is allowed, but will restrict the related posts to posts including that phrase.\", \"relevanssi\")}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\t\"The most common search terms used to find this post:\",\n\t\t\t\t\t\t\t\t\t\"relevanssi\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{__(\n\t\t\t\t\t\t\t\t\t\"Low-ranking search terms used to find this post:\",\n\t\t\t\t\t\t\t\t\t\"relevanssi\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{relevanssiLowRankingTerms}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t)\n\t},\n})\n","(function() { module.exports = window[\"wp\"][\"components\"]; }());","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","(function() { module.exports = window[\"wp\"][\"data\"]; }());","(function() { module.exports = window[\"wp\"][\"editPost\"]; }());","(function() { module.exports = window[\"wp\"][\"element\"]; }());","(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"plugins\"]; }());"],"sourceRoot":""}
\ No newline at end of file
diff --git a/relevanssi-premium/premium/indexing.php b/relevanssi-premium/premium/indexing.php
deleted file mode 100644
index e537ead6..00000000
--- a/relevanssi-premium/premium/indexing.php
+++ /dev/null
@@ -1,1833 +0,0 @@
-ID );
- }
- }
-}
-
-/**
- * Indexes taxonomy terms when term is updated.
- *
- * @param string $term The term.
- * @param int $taxonomy_term_id The term taxonomy ID (not used here).
- * @param string $taxonomy The taxonomy.
- */
-function relevanssi_edit_term( $term, $taxonomy_term_id, $taxonomy ) {
- $update = true;
- relevanssi_do_term_indexing( $term, $taxonomy, $update );
-}
-
-/**
- * Indexes taxonomy terms when term is added.
- *
- * @param string $term The term.
- * @param int $taxonomy_term_id The term taxonomy ID (not used here).
- * @param string $taxonomy The taxonomy.
- */
-function relevanssi_add_term( $term, $taxonomy_term_id, $taxonomy ) {
- $update = false;
- relevanssi_do_term_indexing( $term, $taxonomy, $update );
-}
-
-/**
- * Indexes taxonomy term, if taxonomy term indexing is enabled.
- *
- * @param string $term The term.
- * @param string $taxonomy The taxonomy.
- * @param boolean $update If true, term is updated; if false, it is added.
- */
-function relevanssi_do_term_indexing( $term, $taxonomy, $update ) {
- if ( 'on' === get_option( 'relevanssi_index_taxonomies' ) ) {
- $taxonomies = get_option( 'relevanssi_index_terms' );
- if ( in_array( $taxonomy, $taxonomies, true ) ) {
- relevanssi_index_taxonomy_term( $term, $taxonomy, $update );
- }
- }
-}
-
-/**
- * Deletes an user from Relevanssi index.
- *
- * Deletes an user from the Relevanssi index. Attached to the 'delete_user' action.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param int $user User ID to delete.
- */
-function relevanssi_delete_user( int $user ) {
- global $wpdb, $relevanssi_variables;
- $user = intval( $user );
- $wpdb->query( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . " WHERE item = $user AND type = 'user'" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-}
-
-/**
- * Deletes a taxonomy term from Relevanssi index.
- *
- * Deletes a taxonomy term from the Relevanssi index. Attached to the 'delete_term' action.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param int $term Term ID to remove.
- * @param int $term_taxonomy_id Term taxonomy ID (not used).
- * @param string $taxonomy The taxonomy.
- */
-function relevanssi_delete_taxonomy_term( $term, $term_taxonomy_id, $taxonomy ) {
- global $wpdb, $relevanssi_variables;
- $wpdb->query(
- $wpdb->prepare(
- 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . ' WHERE item = %d AND type = %s', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- $term,
- $taxonomy
- )
- );
-}
-
-/**
- * Generates the custom field detail field for indexing.
- *
- * Premium stores more detail about custom field indexing. This function
- * generates the custom field detail.
- *
- * @param array $insert_data Data used to generate the INSERT queries.
- * @param string $token The indexed token.
- * @param int $count The number of matches.
- * @param string $field Name of the custom field.
- *
- * @return array $insert_data New source data for the INSERT queries added.
- */
-function relevanssi_customfield_detail( $insert_data, $token, $count, $field ) {
- if ( isset( $insert_data[ $token ]['customfield_detail'] ) ) {
- // Custom field detail for this token already exists.
- $custom_field_detail = json_decode( $insert_data[ $token ]['customfield_detail'], true );
- } else {
- // Nothing yet, create new.
- $custom_field_detail = array();
- }
-
- relevanssi_increase_value( $custom_field_detail[ $field ], $count );
-
- $insert_data[ $token ]['customfield_detail'] = wp_json_encode( $custom_field_detail );
- return $insert_data;
-}
-
-/**
- * Indexes custom MySQL column content.
- *
- * Generates the INSERT query base data for MySQL column content.
- *
- * @global $wpdb The WordPress database interface.
- *
- * @param array $insert_data Data used to generate the INSERT queries.
- * @param string $post_id Post ID.
- *
- * @return array $insert_data New source data for the INSERT queries added.
- */
-function relevanssi_index_mysql_columns( $insert_data, $post_id ) {
- $custom_columns = get_option( 'relevanssi_mysql_columns' );
- if ( ! empty( $custom_columns ) ) {
- global $wpdb;
-
- // Get a list of possible column names.
- $column_list = wp_cache_get( 'relevanssi_column_list' );
- if ( false === $column_list ) {
- $column_list = $wpdb->get_results( "SHOW COLUMNS FROM $wpdb->posts" );
- wp_cache_set( 'relevanssi_column_list', $column_list );
- }
- $valid_columns = array();
- foreach ( $column_list as $column ) {
- array_push( $valid_columns, $column->Field ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
- }
-
- // This is to remove problems where the list ends in a comma.
- $custom_column_array = explode( ',', $custom_columns );
- $custom_column_list_array = array();
- foreach ( $custom_column_array as $column ) {
- $column = trim( $column );
- if ( in_array( $column, $valid_columns, true ) ) {
- $custom_column_list_array[] = $column;
- }
- }
- $custom_column_list = implode( ', ', $custom_column_list_array );
-
- $custom_column_data = $wpdb->get_row( "SELECT $custom_column_list FROM $wpdb->posts WHERE ID=$post_id", ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- $remove_stopwords = true;
- $minimum_word_length = get_option( 'relevanssi_min_word_length', 3 );
- if ( is_array( $custom_column_data ) ) {
- foreach ( $custom_column_data as $column => $data ) {
- /** This filter is documented in common/indexing.php */
- $data = apply_filters(
- 'relevanssi_indexing_tokens',
- relevanssi_tokenize( $data, $remove_stopwords, $minimum_word_length, 'indexing' ),
- 'mysql-content'
- );
- if ( count( $data ) > 0 ) {
- foreach ( $data as $term => $count ) {
- if ( isset( $insert_data[ $term ]['mysqlcolumn'] ) ) {
- $insert_data[ $term ]['mysqlcolumn'] += $count;
- } else {
- $insert_data[ $term ]['mysqlcolumn'] = $count;
- }
- $insert_data = relevanssi_mysqlcolumn_detail( $insert_data, $term, $count, $column );
- }
- }
- }
- }
- }
- return $insert_data;
-}
-
-/**
- * Generates the MySQL column detail field for indexing.
- *
- * This function generates the MySQL column detail.
- *
- * @param array $insert_data Data used to generate the INSERT queries.
- * @param string $token The indexed token.
- * @param int $count The number of matches.
- * @param string $column Name of the column.
- *
- * @return array $insert_data New source data for the INSERT queries added.
- */
-function relevanssi_mysqlcolumn_detail( $insert_data, $token, $count, $column ) {
- if ( isset( $insert_data[ $token ]['mysqlcolumn_detail'] ) ) {
- // Custom field detail for this token already exists.
- $mysqlcolumn_detail = json_decode( $insert_data[ $token ]['mysqlcolumn_detail'], true );
- } else {
- // Nothing yet, create new.
- $mysqlcolumn_detail = array();
- }
-
- relevanssi_increase_value( $mysqlcolumn_detail[ $column ], $count );
-
- $insert_data[ $token ]['mysqlcolumn_detail'] = wp_json_encode( $mysqlcolumn_detail );
-
- return $insert_data;
-}
-
-/**
- * Processes internal links.
- *
- * Process the internal links the way user wants: no indexing, indexing, or stripping.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param string $contents Post content.
- * @param int $post_id Post ID.
- *
- * @return string $contents Contents, modified.
- */
-function relevanssi_process_internal_links( $contents, $post_id ) {
- $internal_links_behaviour = get_option( 'relevanssi_internal_links', 'noindex' );
-
- if ( 'noindex' !== $internal_links_behaviour ) {
- global $relevanssi_variables, $wpdb;
- $min_word_length = get_option( 'relevanssi_min_word_length', 3 );
-
- // Index internal links.
- $internal_links = relevanssi_get_internal_links( $contents );
-
- if ( ! empty( $internal_links ) ) {
- foreach ( $internal_links as $link => $text ) {
- $link_id = url_to_postid( $link );
- if ( ! empty( $link_id ) ) {
- /** This filter is documented in common/indexing.php */
- $link_words = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $text, true, $min_word_length, 'indexing' ), 'internal-links' );
- if ( count( $link_words ) > 0 ) {
- foreach ( $link_words as $word => $count ) {
- $wpdb->query(
- $wpdb->prepare(
- 'INSERT IGNORE INTO ' . $relevanssi_variables['relevanssi_table'] . ' (doc, term, term_reverse, link, item) VALUES (%d, %s, REVERSE(%s), %d, %d)', // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- $link_id,
- $word,
- $word,
- $count,
- $post_id
- )
- );
- }
- }
- }
- }
-
- if ( 'strip' === $internal_links_behaviour ) {
- $contents = relevanssi_strip_internal_links( $contents );
- }
- }
- }
-
- return $contents;
-}
-
-/**
- * Finds internal links.
- *
- * A function to find all internal links in the parameter text.
- *
- * @param string $text Text where the links are extracted from.
- *
- * @return array $links All links in the post, or false if fails.
- */
-function relevanssi_get_internal_links( $text ) {
- $links = array();
- if ( preg_match_all( '@]*?href="(' . home_url() . '[^"]*?)"[^>]*?>(.*?)@siu', $text, $m ) ) {
- foreach ( $m[1] as $i => $link ) {
- if ( ! isset( $links[ $link ] ) ) {
- $links[ $link ] = '';
- }
- $links[ $link ] .= ' ' . $m[2][ $i ];
- }
- }
- if ( preg_match_all( '@]*?href="(/[^"]*?)"[^>]*?>(.*?)@siu', $text, $m ) ) {
- foreach ( $m[1] as $i => $link ) {
- if ( ! isset( $links[ $link ] ) ) {
- $links[ $link ] = '';
- }
- $links[ $link ] .= ' ' . $m[2][ $i ];
- }
- }
- if ( count( $links ) > 0 ) {
- return $links;
- }
- return false;
-}
-
-/**
- * Strips internal links.
- *
- * A function to strip all internal links from the parameter text.
- *
- * @param string $text Text where the links are extracted from.
- *
- * @return array $links The text without the links.
- */
-function relevanssi_strip_internal_links( $text ) {
- $text = preg_replace(
- array(
- '@]*?href="' . home_url() . '[^>]*?>.*?@siu',
- ),
- ' ',
- $text
- );
- $text = preg_replace(
- array(
- '@]*?href="/[^>]*?>.*?@siu',
- ),
- ' ',
- $text
- );
- return $text;
-}
-
-/**
- * Applies the thousands separator rule to text.
- *
- * Finds numbers separated by the chosen thousand separator and combine them.
- *
- * @param string $str The string to fix.
- *
- * @return string $str The fixed string.
- */
-function relevanssi_apply_thousands_separator( $str ) {
- $thousands_separator = get_option( 'relevanssi_thousand_separator', '' );
- if ( ! empty( $thousands_separator ) ) {
- $pattern = '/(\d+)' . preg_quote( $thousands_separator, '/' ) . '(\d+)/u';
- $str = preg_replace( $pattern, '$1$2', $str );
- }
- return $str;
-}
-
-/**
- * Adds a stemmer-enabling filter.
- *
- * This filter introduces a new filter hook that runs the stemmers.
- *
- * @param string $str The string that is stemmed.
- *
- * @return string $str The string after stemming.
- */
-function relevanssi_enable_stemmer( $str ) {
- add_filter( 'pre_option_relevanssi_implicit_operator', 'relevanssi_return_or' );
- /**
- * Applies stemmer to document content and search terms.
- *
- * @param string $str The string that is stemmed.
- *
- * @return string $str The string after stemming.
- */
- $str = apply_filters( 'relevanssi_stemmer', $str );
- remove_filter( 'pre_option_relevanssi_implicit_operator', 'relevanssi_return_or' );
- return $str;
-}
-
-/**
- * Does simple English stemming.
- *
- * A simple suffix stripper that can be used to stem English texts.
- *
- * @param string $term Search term to stem.
- *
- * @return string $term The stemmed term.
- */
-function relevanssi_simple_english_stemmer( $term ) {
- $len = strlen( $term );
-
- $end1 = substr( $term, -1, 1 );
- if ( 's' === $end1 && $len > 3 ) {
- $term = substr( $term, 0, -1 );
- --$len;
- }
- $end = substr( $term, -3, 3 );
-
- if ( 'ing' === $end && $len > 5 ) {
- return substr( $term, 0, -3 );
- }
- if ( 'est' === $end && $len > 5 ) {
- return substr( $term, 0, -3 );
- }
-
- $end = substr( $end, 1 );
- if ( 'es' === $end && $len > 3 ) {
- return substr( $term, 0, -2 );
- }
- if ( 'ie' === $end && $len > 3 ) {
- return substr( $term, 0, -1 );
- }
- if ( 'ed' === $end && $len > 3 ) {
- return substr( $term, 0, -2 );
- }
- if ( 'en' === $end && $len > 3 ) {
- return substr( $term, 0, -2 );
- }
- if ( 'er' === $end && $len > 3 ) {
- return substr( $term, 0, -2 );
- }
- if ( 'ly' === $end && $len > 4 ) {
- return substr( $term, 0, -2 );
- }
-
- $end = substr( $end, -1 );
- if ( 'y' === $end && $len > 3 ) {
- return substr( $term, 0, -1 ) . 'i';
- }
-
- return $term;
-}
-
-/**
- * Creates the synonym replacement array.
- *
- * A helper function that generates a synonym replacement array. The array
- * is then stored in a global variable, so that it only needs to generated
- * once per running the script.
- *
- * @global $relevanssi_variables The global Relevanssi variables, used to
- * store the synonym database.
- */
-function relevanssi_create_synonym_replacement_array() {
- global $relevanssi_variables;
-
- $synonym_data = get_option( 'relevanssi_synonyms' );
- $current_language = relevanssi_get_current_language();
- $synonyms = array();
-
- if ( isset( $synonym_data[ $current_language ] ) ) {
- $synonym_data = relevanssi_strtolower( $synonym_data[ $current_language ] );
- $pairs = explode( ';', $synonym_data );
-
- foreach ( $pairs as $pair ) {
- if ( empty( $pair ) ) {
- continue;
- }
- $parts = explode( '=', $pair );
- $key = strval( trim( $parts[0] ) );
- $value = trim( $parts[1] );
- if ( ! isset( $synonyms[ $value ] ) ) {
- $synonyms[ $value ] = "$value $key";
- } else {
- $synonyms[ $value ] .= " $key";
- }
- }
- }
- $relevanssi_variables['synonyms'] = $synonyms;
-}
-
-/**
- * Adds synonyms to post content and titles for indexing.
- *
- * In order to use synonyms in AND searches, the synonyms must be indexed within the posts.
- * This function adds synonyms for post content and titles when indexing posts.
- *
- * @global $relevanssi_variables The global Relevanssi variables, used for the synonym database.
- *
- * @param array $tokens An array of tokens and their frequencies.
- *
- * @return array An array of filtered token-frequency pairs.
- */
-function relevanssi_add_indexing_synonyms( $tokens ) {
- global $relevanssi_variables;
-
- if ( ! isset( $relevanssi_variables['synonyms'] ) ) {
- relevanssi_create_synonym_replacement_array();
- }
-
- $new_tokens = array();
- $synonyms = $relevanssi_variables['synonyms'];
-
- foreach ( $tokens as $token => $tf ) {
- if ( isset( $synonyms[ $token ] ) ) {
- $token_and_the_synonyms = explode( ' ', $synonyms[ $token ] );
- foreach ( $token_and_the_synonyms as $new_token ) {
- $new_tokens[ $new_token ] = $tf;
- }
- } else {
- $new_tokens[ $token ] = $tf;
- }
- }
-
- return $new_tokens;
-}
-
-/**
- * Adds synonyms to a content.
- *
- * @global $relevanssi_variables The global Relevanssi variables, used for the synonym database.
- *
- * @param string $content The content to add synonyms to.
- *
- * @return string $content The content with synonyms.
- */
-function relevanssi_prepare_indexing_content( $content ) {
- global $relevanssi_variables;
-
- if ( ! isset( $relevanssi_variables['synonyms'] ) ) {
- relevanssi_create_synonym_replacement_array();
- }
-
- $synonyms = $relevanssi_variables['synonyms'];
- $content = relevanssi_strtolower( $content );
- $content = preg_split( '/[\s,.()!?]/', $content );
- $ret = array();
- $len = count( $content );
- for ( $i = 0; $i < $len; ++$i ) {
- $val = $content[ $i ];
- if ( 0 === strlen( $val ) ) {
- continue;
- }
-
- if ( isset( $synonyms[ $val ] ) ) {
- $ret[] = $synonyms[ $val ];
- } else {
- $ret[] = $val;
- }
- }
-
- return implode( ' ', $ret );
-}
-
-
-/**
- * Adds ACF repeater fields to the list of custom fields.
- *
- * Goes through custom fields, finds fields that match the fieldname_%_subfieldname
- * pattern, finds the number of fields from the fieldname custom field and then
- * adds the fieldname_0_subfieldname... fields to the list of custom fields. Only
- * works one level deep.
- *
- * @param array $custom_fields The list of custom fields, used as a reference.
- * @param int $post_id The post ID of the current post.
- */
-function relevanssi_add_repeater_fields( &$custom_fields, $post_id ) {
- global $wpdb;
-
- /**
- * Filters the list of custom fields to index before the repeater fields
- * are expanded. If you want to add repeater fields using the
- * field_%_subfield notation from code, you can use this filter hook.
- *
- * @param array $custom_fields The list of custom fields. This array
- * includes all custom fields that are to be indexed, so make sure you add
- * new fields here and don't remove anything you want included in the index.
- */
- $custom_fields = apply_filters( 'relevanssi_custom_fields_before_repeaters', $custom_fields );
- $repeater_fields = array();
- foreach ( $custom_fields as $field ) {
- $number_of_levels = substr_count( $field, '%' );
- if ( $number_of_levels > 0 ) {
- $field = str_replace( '\%', '%', $wpdb->esc_like( $field ) );
- $fields = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key LIKE %s AND post_id = %d", $field, $post_id ) );
-
- $repeater_fields = array_merge( $repeater_fields, $fields );
- } else {
- continue;
- }
- }
-
- $custom_fields = array_merge( $custom_fields, $repeater_fields );
-}
-
-/**
- * Adds the PDF data from child posts to parent posts.
- *
- * Takes the PDF content data from child posts for indexing purposes.
- *
- * @global $wpdb The WordPress database interface.
- *
- * @param array $insert_data The base data for INSERT queries.
- * @param int $post_id The post ID.
- *
- * @return array $insert_data The INSERT data with new content added.
- */
-function relevanssi_index_pdf_for_parent( $insert_data, $post_id ) {
- $option = get_option( 'relevanssi_index_pdf_parent', '' );
- if ( empty( $option ) || 'off' === $option ) {
- return $insert_data;
- }
-
- global $wpdb;
-
- $post_id = intval( $post_id );
- $query = "SELECT meta_value FROM $wpdb->postmeta AS pm, $wpdb->posts AS p WHERE pm.post_id = p.ID AND p.post_parent = $post_id AND meta_key = '_relevanssi_pdf_content'";
- /**
- * Filters the database query that fetches the PDF content for the parent post.
- *
- * @param string $query The MySQL query.
- * @param int $post_id The parent post ID.
- */
- $query = apply_filters( 'relevanssi_pdf_for_parent_query', $query, $post_id );
- $pdf_content = $wpdb->get_col( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- if ( is_array( $pdf_content ) ) {
- /**
- * Filters the custom field value before indexing.
- *
- * @param array Custom field values.
- * @param string $field The custom field name.
- * @param int $post_id The post ID.
- */
- $pdf_content = apply_filters( 'relevanssi_custom_field_value', $pdf_content, '_relevanssi_pdf_content', $post_id );
- foreach ( $pdf_content as $row ) {
- /** This filter is documented in common/indexing.php */
- $data = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $row, true, get_option( 'relevanssi_min_word_length', 3 ), 'indexing' ), 'pdf-content' );
- if ( count( $data ) > 0 ) {
- foreach ( $data as $term => $count ) {
- if ( isset( $insert_data[ $term ]['customfield'] ) ) {
- $insert_data[ $term ]['customfield'] += $count;
- } else {
- $insert_data[ $term ]['customfield'] = $count;
- }
- $insert_data = relevanssi_customfield_detail( $insert_data, $term, $count, '_relevanssi_pdf_content' );
- }
- }
- }
- }
-
- /**
- * Filters the index data for the PDF contents.
- *
- * @param array $insert_data The data for INSERT clauses, format is
- * $insert_data[ term ][ column ] = frequency.
- * @param int $post_id The parent post ID.
- */
- return apply_filters( 'relevanssi_pdf_for_parent_insert_data', $insert_data, $post_id );
-}
-
-/**
- * Indexes all users.
- *
- * Runs indexing on all users.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- */
-function relevanssi_index_users() {
- global $wpdb, $relevanssi_variables;
-
- // Delete all users from the Relevanssi index first.
- $wpdb->query( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . " WHERE type = 'user'" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- $users = relevanssi_get_users( array() );
-
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress = WP_CLI\Utils\make_progress_bar( 'Indexing users', count( $users ) );
- }
-
- $update = false;
- foreach ( $users as $user ) {
- /**
- * Checks if the user can be indexed.
- *
- * @param boolean $index Should the user be indexed, default true.
- * @param object $user The user object.
- *
- * @return boolean $index If false, do not index the user.
- */
- $index_this_user = apply_filters( 'relevanssi_user_index_ok', true, $user );
-
- if ( $index_this_user ) {
- relevanssi_index_user( $user, $update );
- }
-
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->tick();
- }
- }
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->finish();
- }
-}
-
-/**
- * Indexes users in AJAX context.
- *
- * Runs indexing on all users in AJAX context.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param int $limit Number of users to index on one go.
- * @param int $offset Indexing offset.
- *
- * @return array $response AJAX response, number of users indexed in the $response['indexed'].
- */
-function relevanssi_index_users_ajax( $limit, $offset ) {
- $args = array(
- 'number' => intval( $limit ),
- 'offset' => intval( $offset ),
- );
-
- $users = relevanssi_get_users( $args );
-
- $indexed_users = 0;
- $update = false;
- foreach ( $users as $user ) {
- /**
- * Checks if the user can be indexed.
- *
- * @param boolean $index Should the user be indexed, default true.
- * @param object $user The user object.
- *
- * @return boolean $index If false, do not index the user.
- */
- $index_this_user = apply_filters( 'relevanssi_user_index_ok', true, $user );
- if ( $index_this_user ) {
- relevanssi_index_user( $user, $update );
- ++$indexed_users;
- }
- }
-
- $response = array(
- 'indexed' => $indexed_users,
- );
-
- return $response;
-}
-
-/**
- * Gets the list of users.
- *
- * @param array $args The user indexing arguments.
- *
- * @return array An array of user profiles.
- */
-function relevanssi_get_users( array $args ) {
- $index_subscribers = get_option( 'relevanssi_index_subscribers' );
- if ( 'on' !== $index_subscribers ) {
- $args['role__not_in'] = array( 'subscriber' );
- }
-
- /**
- * Filters the user fetching arguments.
- *
- * Useful to control the user role, for example: just set 'role__in' to whatever
- * you need.
- *
- * @param array User fetching arguments.
- */
- $users_list = get_users( apply_filters( 'relevanssi_user_indexing_args', $args ) );
- $users = array();
- foreach ( $users_list as $user ) {
- $users[] = get_userdata( $user->ID );
- }
-
- return $users;
-}
-
-/**
- * Indexes one user.
- *
- * Indexes one user profile.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param object|int $user The user object or user ID.
- * @param boolean $remove_first Should the user be deleted first or not, default false.
- */
-function relevanssi_index_user( $user, $remove_first = false ) {
- global $wpdb, $relevanssi_variables;
-
- if ( is_numeric( $user ) ) {
- // Not an object, make it an object.
- $user = get_userdata( $user );
- if ( false === $user ) {
- // Invalid user ID given, no user found. Exit.
- return;
- }
- }
-
- if ( $remove_first ) {
- relevanssi_delete_user( $user->ID );
- }
-
- /**
- * Allows manipulating the user object before indexing.
- *
- * This filter can be used to manipulate the user object before it is
- * processed for indexing. It's possible to add extra data (for example to
- * user description field) or to change the existing data.
- *
- * @param object $user The user object.
- */
- $user = apply_filters( 'relevanssi_user_add_data', $user );
-
- $insert_data = array();
- $min_length = get_option( 'relevanssi_min_word_length', 3 );
- $remove_stopwords = true;
-
- $values = relevanssi_get_user_field_content( $user->ID );
- foreach ( $values as $field => $value ) {
- /** This filter is documented in common/indexing.php */
- $tokens = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $value, $remove_stopwords, $min_length, 'indexing' ), 'user-fields' );
- foreach ( $tokens as $term => $tf ) {
- if ( isset( $insert_data[ $term ]['customfield'] ) ) {
- $insert_data[ $term ]['customfield'] += $tf;
- } else {
- $insert_data[ $term ]['customfield'] = $tf;
- }
- $insert_data = relevanssi_customfield_detail( $insert_data, $term, $tf, $field );
- }
- }
-
- if ( isset( $user->description ) && '' !== $user->description ) {
- /** This filter is documented in common/indexing.php */
- $tokens = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $user->description, $remove_stopwords, $min_length, 'indexing' ), 'user-description' );
- foreach ( $tokens as $term => $tf ) {
- if ( isset( $insert_data[ $term ]['content'] ) ) {
- $insert_data[ $term ]['content'] += $tf;
- } else {
- $insert_data[ $term ]['content'] = $tf;
- }
- }
- }
-
- if ( isset( $user->first_name ) && '' !== $user->first_name ) {
- $parts = explode( ' ', strtolower( $user->first_name ) );
- foreach ( $parts as $part ) {
- if ( empty( $part ) ) {
- continue;
- }
- if ( isset( $insert_data[ $part ]['title'] ) ) {
- ++$insert_data[ $part ]['title'];
- } else {
- $insert_data[ $part ]['title'] = 1;
- }
- }
- }
-
- if ( isset( $user->last_name ) && ' ' !== $user->last_name ) {
- $parts = explode( ' ', strtolower( $user->last_name ) );
- foreach ( $parts as $part ) {
- if ( empty( $part ) ) {
- continue;
- }
- if ( isset( $insert_data[ $part ]['title'] ) ) {
- ++$insert_data[ $part ]['title'];
- } else {
- $insert_data[ $part ]['title'] = 1;
- }
- }
- }
-
- if ( isset( $user->display_name ) && ' ' !== $user->display_name ) {
- $parts = explode( ' ', strtolower( $user->display_name ) );
- foreach ( $parts as $part ) {
- if ( empty( $part ) ) {
- continue;
- }
- if ( isset( $insert_data[ $part ]['title'] ) ) {
- ++$insert_data[ $part ]['title'];
- } else {
- $insert_data[ $part ]['title'] = 1;
- }
- }
- }
-
- /**
- * Allows the user insert data to be manipulated.
- *
- * This function manipulates the user insert data used to create the INSERT queries.
- *
- * @param array $insert_data The source data for the INSERT queries.
- * @param object $user The user object.
- */
- $insert_data = apply_filters( 'relevanssi_user_data_to_index', $insert_data, $user );
-
- foreach ( $insert_data as $term => $data ) {
- $fields = array( 'content', 'title', 'comment', 'tag', 'link', 'author', 'category', 'excerpt', 'taxonomy', 'customfield', 'customfield_detail' );
- foreach ( $fields as $field ) {
- if ( ! isset( $data[ $field ] ) ) {
- $data[ $field ] = 0;
- }
- }
-
- $content = $data['content'];
- $title = $data['title'];
- $comment = $data['comment'];
- $tag = $data['tag'];
- $link = $data['link'];
- $author = $data['author'];
- $category = $data['category'];
- $excerpt = $data['excerpt'];
- $taxonomy = $data['taxonomy'];
- $customfield = $data['customfield'];
- $cf_detail = $data['customfield_detail'];
-
- $wpdb->query(
- $wpdb->prepare(
- 'INSERT IGNORE INTO ' . $relevanssi_variables['relevanssi_table'] . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- ' (item, doc, term, term_reverse, content, title, comment, tag, link, author, category, excerpt, taxonomy, customfield, type, customfield_detail, taxonomy_detail, mysqlcolumn_detail)
- VALUES (%d, %d, %s, REVERSE(%s), %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %s)',
- $user->ID,
- -1,
- $term,
- $term,
- $content,
- $title,
- $comment,
- $tag,
- $link,
- $author,
- $category,
- $excerpt,
- $taxonomy,
- $customfield,
- 'user',
- $cf_detail,
- '',
- ''
- )
- );
- }
-}
-
-/**
- * Counts users.
- *
- * Figures out how many users there are to index.
- *
- * @global $wpdb The WordPress database interface.
- *
- * @return int $count_users Number of users, -1 if user indexing is disabled.
- */
-function relevanssi_count_users() {
- $index_users = get_option( 'relevanssi_index_users' );
- if ( empty( $index_users ) || 'off' === $index_users ) {
- return -1;
- }
-
- $args = array(
- 'fields' => 'ID',
- );
-
- $index_subscribers = get_option( 'relevanssi_index_subscribers' );
- if ( 'on' !== $index_subscribers ) {
- $args['role__not_in'] = array( 'subscriber' );
- }
-
- $users = get_users(
- /**
- * Documented in /premium/indexing.php.
- */
- apply_filters( 'relevanssi_user_indexing_args', $args )
- );
- $count_users = count( $users );
-
- return $count_users;
-}
-
-/**
- * Counts taxonomy terms.
- *
- * Figures out how many taxonomy terms there are to index.
- *
- * @global $wpdb The WordPress database interface.
- *
- * @return int $count_terms Number of taxonomy terms, -1 if taxonomy term indexing is disabled.
- */
-function relevanssi_count_taxonomy_terms() {
- $index_taxonomies = get_option( 'relevanssi_index_taxonomies' );
- if ( empty( $index_taxonomies ) || 'off' === $index_taxonomies ) {
- return -1;
- }
-
- global $wpdb;
-
- $taxonomies = get_option( 'relevanssi_index_terms' );
- if ( empty( $taxonomies ) ) {
- // No taxonomies chosen for indexing.
- return -1;
- }
- $count_terms = 0;
- foreach ( $taxonomies as $taxonomy ) {
- if ( ! taxonomy_exists( $taxonomy ) ) {
- // Non-existing taxonomy. Shouldn't be possible, but better be sure.
- continue;
- }
-
- /**
- * Determines whether empty terms are indexed or not.
- *
- * @param boolean $hide_empty_terms If true, empty terms are not indexed. Default true.
- */
- $hide_empty = apply_filters( 'relevanssi_hide_empty_terms', true );
-
- $count = '';
- if ( $hide_empty ) {
- $count = 'AND tt.count > 0';
- }
-
- $terms = $wpdb->get_col( "SELECT t.term_id FROM $wpdb->terms AS t, $wpdb->term_taxonomy AS tt WHERE t.term_id = tt.term_id $count AND tt.taxonomy = '$taxonomy'" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- $count_terms += count( $terms );
- }
- return $count_terms;
-}
-
-/**
- * Returns the list of taxonomies chosen for indexing.
- *
- * Returns the list of taxonomies chosen for indexing from the 'relevanssi_index_terms' option.
- *
- * @return array $taxonomies A list of taxonomies chosen to be indexed.
- */
-function relevanssi_list_taxonomies() {
- return get_option( 'relevanssi_index_terms' );
-}
-
-/**
- * Indexes taxonomy terms in AJAX context.
- *
- * Runs indexing on taxonomy terms in one taxonomy in AJAX context.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param string $taxonomy The taxonomy to index.
- * @param int $limit Number of users to index on one go.
- * @param int $offset Indexing offset.
- *
- * @return array $response AJAX response, number of taxonomy terms indexed in the
- * $response['indexed'] and a boolean value in $response['taxonomy_completed'] that
- * tells whether the taxonomy is indexed completely or not.
- */
-function relevanssi_index_taxonomies_ajax( $taxonomy, $limit, $offset ) {
- global $wpdb;
-
- $indexed_terms = 0;
- $end_reached = false;
-
- $terms = relevanssi_get_terms( $taxonomy, intval( $limit ), intval( $offset ) );
-
- if ( count( $terms ) < $limit ) {
- $end_reached = true;
- }
-
- do_action( 'relevanssi_pre_index_taxonomies' );
-
- foreach ( $terms as $term_id ) {
- $update = false;
- $term = get_term( $term_id, $taxonomy );
- relevanssi_index_taxonomy_term( $term, $taxonomy, $update );
- ++$indexed_terms;
- }
-
- do_action( 'relevanssi_post_index_taxonomies' );
-
- $response = array(
- 'indexed' => $indexed_terms,
- 'taxonomy_completed' => 'not',
- );
- if ( $end_reached ) {
- $response['taxonomy_completed'] = 'done';
- }
-
- return $response;
-}
-
-/**
- * Indexes all taxonomies.
- *
- * Runs indexing on all taxonomies.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param boolean $is_ajax Whether indexing is done in the AJAX context, default false.
- *
- * @return array $response If $is_ajax is true, the function returns indexing status in an array.
- */
-function relevanssi_index_taxonomies( $is_ajax = false ) {
- global $wpdb, $relevanssi_variables;
-
- $wpdb->query( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . " WHERE doc = -1 AND type NOT IN ('user', 'post_type')" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- do_action( 'relevanssi_pre_index_taxonomies' );
-
- $taxonomies = get_option( 'relevanssi_index_terms' );
- $indexed_terms = 0;
- foreach ( $taxonomies as $taxonomy ) {
- $terms = relevanssi_get_terms( $taxonomy, 0, 0 );
-
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress = WP_CLI\Utils\make_progress_bar( "Indexing $taxonomy", count( $terms ) );
- }
-
- $update = false;
- foreach ( $terms as $term ) {
- relevanssi_index_taxonomy_term( $term, $taxonomy, $update );
- ++$indexed_terms;
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->tick();
- }
- }
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->finish();
- }
- }
-
- do_action( 'relevanssi_post_index_taxonomies' );
-
- if ( $is_ajax ) {
- if ( $indexed_terms > 0 ) {
- // translators: the number of taxonomy terms.
- return sprintf( __( 'Indexed %d taxonomy terms.', 'relevanssi' ), $indexed_terms );
- } else {
- return __( 'No taxonomies to index.', 'relevanssi' );
- }
- }
-}
-
-/**
- * Gets a list of taxonomy terms.
- *
- * @param string $taxonomy The taxonomy to index.
- * @param int $limit Number of users to index on one go.
- * @param int $offset Indexing offset.
- *
- * @return array A list of taxonomy terms.
- */
-function relevanssi_get_terms( string $taxonomy, int $limit = 0, int $offset = 0 ): array {
- global $wpdb;
-
- /**
- * Determines whether empty terms are indexed or not.
- *
- * @param boolean $hide_empty_terms If true, empty terms are not indexed. Default true.
- */
- $hide_empty = apply_filters( 'relevanssi_hide_empty_terms', true );
- $count = '';
- if ( $hide_empty ) {
- $count = 'AND tt.count > 0';
- }
-
- $limit_sql = '';
- if ( $limit && $offset ) {
- $limit_sql = $wpdb->prepare( 'LIMIT %d OFFSET %d', $limit, $offset );
- }
-
- $terms = $wpdb->get_col(
- $wpdb->prepare(
- "SELECT t.term_id FROM $wpdb->terms AS t, $wpdb->term_taxonomy AS tt
- WHERE t.term_id = tt.term_id $count AND tt.taxonomy = %s $limit_sql ", // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- $taxonomy
- )
- );
-
- return $terms;
-}
-
-/**
- * Indexes one taxonomy term.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param object|int $term The term object or term ID.
- * @param string $taxonomy The name of the taxonomy.
- * @param boolean $remove_first Should the term be deleted first or not, default false.
- * @param boolean $debug If true, print out debug information, default false.
- */
-function relevanssi_index_taxonomy_term( $term, $taxonomy, $remove_first = false, $debug = false ) {
- global $wpdb, $relevanssi_variables;
-
- if ( is_numeric( $term ) ) {
- // Not an object, so let's get the object.
- $term = get_term( $term, $taxonomy );
- }
-
- /**
- * Allows the term object to be handled before indexing.
- *
- * This filter can be used to add data to term objects before indexing, or to manipulate the object somehow.
- *
- * @param object $term The term object.
- * @param string $taxonomy The taxonomy.
- */
- $term = apply_filters( 'relevanssi_term_add_data', $term, $taxonomy );
-
- $temp_post = new stdClass();
- $temp_post->post_content = $term->description;
- $temp_post->post_title = $term->name;
-
- /**
- * Allows modifying the fake post for the taxonomy term.
- *
- * In order to index taxonomy terms, Relevanssi generates fake posts from the
- * terms. This filter lets you modify the post object. The term description
- * is in the post_content and the term name in the post_title.
- *
- * @param object $temp_post The post object.
- * @param object $term The term object.
- */
- $temp_post = apply_filters( 'relevanssi_post_to_index', $temp_post, $term );
-
- $term->description = $temp_post->post_content;
- $term->name = $temp_post->post_title;
-
- $index_this_post = true;
-
- /**
- * Determines whether a term is indexed or not.
- *
- * If this filter returns true, this term should not be indexed.
- *
- * @param boolean $block If true, do not index this post. Default false.
- * @param WP_Term $term The term object.
- * @param string $taxonomy The term taxonomy.
- */
- if ( true === apply_filters( 'relevanssi_do_not_index_term', false, $term, $taxonomy ) ) {
- // Filter says no.
- if ( $debug ) {
- relevanssi_debug_echo( 'relevanssi_do_not_index_term returned true.' );
- }
- $index_this_post = false;
- }
-
- if ( $remove_first ) {
- // The 0 doesn't mean anything, but because of WP hook parameters, it needs to be there
- // so the taxonomy can be passed as the third parameter.
- relevanssi_delete_taxonomy_term( $term->term_id, 0, $taxonomy );
- }
-
- // This needs to be here, after the call to relevanssi_delete_taxonomy_term(), because otherwise
- // a post that's in the index but shouldn't be there won't get removed.
- if ( ! $index_this_post ) {
- return 'donotindex';
- }
-
- $insert_data = array();
- $remove_stopwords = true;
-
- $min_length = get_option( 'relevanssi_min_word_length', 3 );
- if ( ! isset( $term->description ) ) {
- $term->description = '';
- }
- /**
- * Allows adding extra content to the term before indexing.
- *
- * The term description is passed through this filter, so if you want to add
- * extra content to the description, you can use this filter.
- *
- * @param string $term->description The term description.
- * @param object $term The term object.
- */
- $description = apply_filters( 'relevanssi_tax_term_additional_content', $term->description, $term );
- if ( ! empty( $description ) ) {
- /** This filter is documented in common/indexing.php */
- $tokens = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $description, $remove_stopwords, $min_length, 'indexing' ), 'term-description' );
- foreach ( $tokens as $t_term => $tf ) {
- if ( ! isset( $insert_data[ $t_term ]['content'] ) ) {
- $insert_data[ $t_term ]['content'] = 0;
- }
- $insert_data[ $t_term ]['content'] += $tf;
- }
- }
-
- if ( isset( $term->name ) && ! empty( $term->name ) ) {
- /** This filter is documented in common/indexing.php */
- $tokens = apply_filters( 'relevanssi_indexing_tokens', relevanssi_tokenize( $term->name, $remove_stopwords, $min_length, 'indexing' ), 'term-name' );
- foreach ( $tokens as $t_term => $tf ) {
- if ( ! isset( $insert_data[ $t_term ]['title'] ) ) {
- $insert_data[ $t_term ]['title'] = 0;
- }
- $insert_data[ $t_term ]['title'] += $tf;
- }
- }
-
- foreach ( $insert_data as $t_term => $data ) {
- $fields = array( 'content', 'title', 'comment', 'tag', 'link', 'author', 'category', 'excerpt', 'taxonomy', 'customfield' );
- foreach ( $fields as $field ) {
- if ( ! isset( $data[ $field ] ) ) {
- $data[ $field ] = 0;
- }
- }
-
- $content = $data['content'];
- $title = $data['title'];
- $comment = $data['comment'];
- $tag = $data['tag'];
- $link = $data['link'];
- $author = $data['author'];
- $category = $data['category'];
- $excerpt = $data['excerpt'];
- $customfield = $data['customfield'];
- $t_term = trim( $t_term ); // Numeric terms start with a space.
-
- $wpdb->query(
- $wpdb->prepare(
- 'INSERT IGNORE INTO ' . $relevanssi_variables['relevanssi_table'] . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- ' (item, doc, term, term_reverse, content, title, comment, tag, link, author, category, excerpt, taxonomy, customfield, type, customfield_detail, taxonomy_detail, mysqlcolumn_detail)
- VALUES (%d, %d, %s, REVERSE(%s), %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %s)',
- $term->term_id,
- -1,
- $t_term,
- $t_term,
- $content,
- $title,
- $comment,
- $tag,
- $link,
- $author,
- $category,
- $excerpt,
- '',
- $customfield,
- $taxonomy,
- '',
- '',
- ''
- )
- );
- }
-}
-
-/**
- * Removes a document from the index.
- *
- * This Premium version also takes care of internal linking keywords, either keeping them (in case of
- * an update) or removing them (if the post is removed).
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param int $post_id The post ID.
- * @param boolean $keep_internal_linking If true, do not remove internal link keywords from this post.
- */
-function relevanssi_premium_remove_doc( $post_id, $keep_internal_linking ) {
- global $wpdb, $relevanssi_variables;
-
- $post_id = intval( $post_id );
- if ( empty( $post_id ) ) {
- // No post ID specified.
- return;
- }
-
- $internal_links = '';
- if ( $keep_internal_linking ) {
- $internal_links = 'AND link = 0';
- }
-
- $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . " WHERE doc=%s $internal_links", $post_id ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-
- if ( ! $keep_internal_linking ) {
- $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . ' WHERE link > 0 AND doc=%s', $post_id ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- }
-}
-
-/**
- * Deletes an item (user or taxonomy term) from the index.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the database table names.
- *
- * @param int $item_id The item ID number.
- * @param string $type The item type.
- */
-function relevanssi_remove_item( $item_id, $type ) {
- global $wpdb, $relevanssi_variables;
-
- $item_id = intval( $item_id );
-
- if ( 0 === $item_id && 'post' === $type ) {
- // Security measures.
- return;
- }
-
- $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . ' WHERE item = %d AND type = %s', $item_id, $type ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
-}
-
-/**
- * Checks if post is hidden.
- *
- * Used in indexing process to check if post is hidden. Checks the
- * '_relevanssi_hide_post' custom field.
- *
- * @param int $post_id The post ID to check.
- *
- * @return boolean $hidden Is the post hidden?
- */
-function relevanssi_hide_post( $post_id ) {
- $hidden = false;
- $field_value = get_post_meta( $post_id, '_relevanssi_hide_post', true );
- if ( 'on' === $field_value ) {
- $hidden = true;
- }
- return $hidden;
-}
-
-/**
- * Indexes post type archive pages.
- *
- * Goes through all the post type archive pages and indexes them using
- * relevanssi_index_post_type_archive().
- *
- * @see relevanssi_index_post_type_archive()
- * @since 2.2
- *
- * @global object $wpdb The WordPress database object.
- */
-function relevanssi_index_post_type_archives() {
- if ( 'on' === get_option( 'relevanssi_index_post_type_archives' ) ) {
- global $wpdb, $relevanssi_variables;
-
- // Delete all post types from the Relevanssi index first.
- $wpdb->query(
- 'DELETE FROM ' . $relevanssi_variables['relevanssi_table'] . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- " WHERE type = 'post_type'"
- );
-
- $post_types = relevanssi_get_indexed_post_type_archives();
- if ( ! empty( $post_types ) ) {
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress = WP_CLI\Utils\make_progress_bar(
- 'Indexing post type archives',
- count( $post_types )
- );
- }
- foreach ( $post_types as $post_type ) {
- relevanssi_index_post_type_archive( $post_type );
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->tick();
- }
- }
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
- $progress->finish();
- }
- } elseif ( defined( 'WP_CLI' ) && WP_CLI ) {
- WP_CLI::log( 'No post types available for post type archive indexing.' );
- }
- } elseif ( defined( 'WP_CLI' ) && WP_CLI ) {
- WP_CLI::error( 'Post type archive indexing disabled.' );
- }
-}
-
-/**
- * Indexes post type archive pages in AJAX context.
- *
- * Runs indexing on all post type archives in AJAX context.
- *
- * @return array $response AJAX response, number of post type archives indexed
- * in the$response['indexed'].
- */
-function relevanssi_index_post_type_archives_ajax() {
- $post_types = relevanssi_get_indexed_post_type_archives();
-
- if ( empty( $post_types ) ) {
- $response = array(
- 'indexed' => 0,
- );
- return $response;
- }
-
- $indexed_post_types = 0;
- foreach ( $post_types as $post_type ) {
- relevanssi_index_post_type_archive( $post_type );
- ++$indexed_post_types;
- }
-
- $response = array(
- 'indexed' => $indexed_post_types,
- );
-
- return $response;
-}
-
-/**
- * Assigns numeric IDs for post types.
- *
- * Relevanssi requires numeric IDs for post types for indexing purposes. This
- * function assigns numbers for each post type, in alphabetical order. This is a
- * bit of a hack, and fails if new post types are added, but hopefully that
- * doesn't happen too often. The assigned numbers are stored in the option
- * relevanssi_post_type_ids.
- *
- * @since 2.2
- *
- * @return array The post type ID arrays (by ID and by name).
- */
-function relevanssi_assign_post_type_ids() {
- $post_types = relevanssi_get_indexed_post_type_archives();
- sort( $post_types );
-
- $post_type_ids_by_id = array();
- $post_type_ids_by_name = array();
-
- $id = 1;
- foreach ( $post_types as $post_type ) {
- $post_type_ids_by_id[ $id ] = $post_type;
- $post_type_ids_by_name[ $post_type ] = $id;
- ++$id;
- }
- update_option(
- 'relevanssi_post_type_ids',
- array(
- 'by_id' => $post_type_ids_by_id,
- 'by_name' => $post_type_ids_by_name,
- )
- );
-
- return array(
- 'by_id' => $post_type_ids_by_id,
- 'by_name' => $post_type_ids_by_name,
- );
-}
-
-/**
- * Gets the post type ID by post type name.
- *
- * Fetches the post type ID from the relevanssi_post_type_ids option by the post
- * type name. If the option is empty, will populate it with values. If the post
- * type can't be found in the list, the function tries to regenerate the list in
- * case there's a new post type Relevanssi doesn't know.
- *
- * @see relevanssi_assign_post_type_ids()
- * @see relevanssi_get_post_type_by_id()
- * @since 2.2
- *
- * @param string $post_type The name of the post type.
- *
- * @return integer|null The post type ID number or null if not a valid post
- * type.
- */
-function relevanssi_get_post_type_by_name( $post_type ) {
- $post_type_ids = get_option( 'relevanssi_post_type_ids', false );
- if ( empty( $post_type_ids ) ) {
- $post_type_ids = relevanssi_assign_post_type_ids();
- }
- if ( ! isset( $post_type_ids['by_name'][ $post_type ] ) ) {
- $post_type_ids = relevanssi_assign_post_type_ids();
- }
- if ( isset( $post_type_ids['by_name'][ $post_type ] ) ) {
- return $post_type_ids['by_name'][ $post_type ];
- } else {
- return null;
- }
-}
-
-/**
- * Gets the post type name by post type ID.
- *
- * Fetches the post type name from the relevanssi_post_type_ids option by the
- * post type ID. If the option is empty, will populate it with values. If the
- * post type can't be found in the list, the function tries to regenerate the
- * list in case there's a new post type Relevanssi doesn't know.
- *
- * @see relevanssi_assign_post_type_ids()
- * @see relevanssi_get_post_type_by_name()
- * @since 2.2
- *
- * @param integer $id The ID number of the post type.
- *
- * @return string|null The post type name or null if not a valid post type.
- */
-function relevanssi_get_post_type_by_id( $id ) {
- $post_type_ids = get_option( 'relevanssi_post_type_ids', false );
- if ( empty( $post_type_ids ) ) {
- $post_type_ids = relevanssi_assign_post_type_ids();
- }
- if ( ! isset( $post_type_ids['by_id'][ $id ] ) ) {
- $post_type_ids = relevanssi_assign_post_type_ids();
- }
- if ( isset( $post_type_ids['by_id'][ $id ] ) ) {
- return $post_type_ids['by_id'][ $id ];
- } else {
- return null;
- }
-}
-
-/**
- * Indexes a post type archive page.
- *
- * Indexes a post type archive page, indexing the archive label and the
- * description which can be set when the post type is registered. The filter
- * hook relevanssi_post_type_additional_content can be used to add additional
- * content to the post type archive description.
- *
- * @since 2.2
- *
- * @param string $post_type The name of the post type.
- * @param boolean $remove_first Should the post type be removed first from the
- * index.
- *
- * @global object $wpdb The WordPress database object.
- * @global array $relevanssi_variables The Relevanssi global variables.
- */
-function relevanssi_index_post_type_archive( $post_type, $remove_first = true ) {
- $post_type_object = get_post_type_object( $post_type );
- global $wpdb, $relevanssi_variables;
-
- /**
- * Allows excluding post type archives from the index.
- *
- * If this filter hook returns false, the post type archive won't be
- * indexed and if it's already indexed, it will be removed from the index.
- *
- * @param boolean If true, index the archive. Default true.
- * @param object The post type object.
- */
- if ( ! apply_filters( 'relevanssi_post_type_archive_ok', true, $post_type ) ) {
- relevanssi_delete_post_type_object( $post_type );
- return;
- }
-
- $temp_post = new stdClass();
- $temp_post->post_content = $post_type_object->description;
- $temp_post->post_title = $post_type_object->name;
-
- /**
- * Allows modifying the fake post for the post type archive.
- *
- * In order to index post type archives, Relevanssi generates fake posts
- * from the post types. This filter lets you modify the post object. The
- * post type description is in the post_content and the post type name in
- * the post_title.
- *
- * @param object $temp_post The post object.
- * @param object $post_type The post type object.
- */
- $temp_post = apply_filters(
- 'relevanssi_post_to_index',
- $temp_post,
- $post_type_object
- );
-
- $post_type_object->description = $temp_post->post_content;
- $post_type_object->name = $temp_post->post_title;
-
- if ( $remove_first ) {
- relevanssi_delete_post_type_object( $post_type );
- }
-
- $insert_data = array();
- $remove_stopwords = true;
-
- $min_length = get_option( 'relevanssi_min_word_length', 3 );
- if ( ! isset( $post_type_object->description ) ) {
- $post_type_object->description = '';
- }
- /**
- * Allows adding extra content to the post type before indexing.
- *
- * The post type description is passed through this filter, so if you want
- * to add extra content to the description, you can use this filter.
- *
- * @param string $post_type_object->description The post type description.
- * @param object $post_type_object The post type object.
- */
- $description = apply_filters(
- 'relevanssi_post_type_additional_content',
- $post_type_object->description,
- $post_type_object
- );
- if ( ! empty( $description ) ) {
- /** This filter is documented in lib/indexing.php */
- $tokens = apply_filters(
- 'relevanssi_indexing_tokens',
- relevanssi_tokenize( $description, $remove_stopwords, $min_length, 'indexing' ),
- 'posttype-description'
- );
- foreach ( $tokens as $t_term => $tf ) {
- if ( ! isset( $insert_data[ $t_term ]['content'] ) ) {
- $insert_data[ $t_term ]['content'] = 0;
- }
- $insert_data[ $t_term ]['content'] += $tf;
- }
- }
-
- if ( isset( $post_type_object->name ) && ! empty( $post_type_object->name ) ) {
- /** This filter is documented in lib/indexing.php */
- $tokens = apply_filters(
- 'relevanssi_indexing_tokens',
- relevanssi_tokenize( $post_type_object->label, $remove_stopwords, $min_length, 'indexing' ),
- 'posttype-name'
- );
- foreach ( $tokens as $t_term => $tf ) {
- if ( ! isset( $insert_data[ $t_term ]['title'] ) ) {
- $insert_data[ $t_term ]['title'] = 0;
- }
- $insert_data[ $t_term ]['title'] += $tf;
- }
- }
-
- $post_type_id = relevanssi_get_post_type_by_name( $post_type );
- foreach ( $insert_data as $t_term => $data ) {
- $fields = array( 'content', 'title', 'comment', 'tag', 'link', 'author', 'category', 'excerpt', 'taxonomy', 'customfield' );
- foreach ( $fields as $field ) {
- if ( ! isset( $data[ $field ] ) ) {
- $data[ $field ] = 0;
- }
- }
-
- $content = $data['content'];
- $title = $data['title'];
- $comment = $data['comment'];
- $tag = $data['tag'];
- $link = $data['link'];
- $author = $data['author'];
- $category = $data['category'];
- $excerpt = $data['excerpt'];
- $customfield = $data['customfield'];
- $t_term = trim( $t_term ); // Numeric terms start with a space.
-
- $wpdb->query(
- $wpdb->prepare(
- 'INSERT IGNORE INTO ' . $relevanssi_variables['relevanssi_table'] . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- ' (item, doc, term, term_reverse, content, title, comment, tag, link, author, category, excerpt, taxonomy, customfield, type, customfield_detail, taxonomy_detail, mysqlcolumn_detail)
- VALUES (%d, %d, %s, REVERSE(%s), %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %s)',
- $post_type_id,
- -1,
- $t_term,
- $t_term,
- $content,
- $title,
- $comment,
- $tag,
- $link,
- $author,
- $category,
- $excerpt,
- '',
- $customfield,
- 'post_type',
- '',
- '',
- ''
- )
- );
- }
-}
-
-/**
- * Deletes a post type archive from Relevanssi index.
- *
- * @global $wpdb The WordPress database interface.
- * @global $relevanssi_variables The global Relevanssi variables, used for the
- * database table names.
- *
- * @param string $post_type Name of the post type to remove.
- */
-function relevanssi_delete_post_type_object( $post_type ) {
- global $wpdb, $relevanssi_variables;
- $id = relevanssi_get_post_type_by_name( $post_type );
- if ( $id ) {
- $wpdb->query(
- 'DELETE FROM ' .
- $relevanssi_variables['relevanssi_table'] . " WHERE item = $id " . // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
- "AND type = 'post_type'"
- );
- }
-}
-
-/**
- * Returns the list of post type archives indexed.
- *
- * Returns a list of post types that have _builtin set to false and has_archive
- * set to true. The list can be adjusted with the
- * relevanssi_indexed_post_type_archives filter hook.
- *
- * @return array An array of post types.
- */
-function relevanssi_get_indexed_post_type_archives() {
- $args = array(
- '_builtin' => false,
- 'has_archive' => true,
- );
- $post_types = get_post_types( $args );
- /**
- * Filters the list of post type archives that are indexed by Relevanssi.
- *
- * @param array An array of post types.
- *
- * @return array An array of post types.
- */
- return apply_filters( 'relevanssi_indexed_post_type_archives', $post_types );
-}
-
-/**
- * Runs taxonomy, user and post type archive indexing if necessary.
- */
-function relevanssi_premium_indexing() {
- if ( 'on' === get_option( 'relevanssi_index_taxonomies' ) ) {
- relevanssi_index_taxonomies();
- }
- if ( 'on' === get_option( 'relevanssi_index_users' ) ) {
- relevanssi_index_users();
- }
- if ( 'on' === get_option( 'relevanssi_index_post_type_archives' ) ) {
- relevanssi_index_post_type_archives();
- }
-}
diff --git a/relevanssi-premium/premium/interface.php b/relevanssi-premium/premium/interface.php
deleted file mode 100644
index e3c5abcc..00000000
--- a/relevanssi-premium/premium/interface.php
+++ /dev/null
@@ -1,1612 +0,0 @@
-
-
-
-
-
-
- .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Deutsch (de_DE), español (es_ES), français (fr_FR), suomi (fi)
- dog = hound to the synonym list and enable this feature, every time the indexer sees hound in post content or post title, it will index it as hound dog. Thus, the post will be found when searching with either word. This makes it possible to use synonyms with AND searches, but will slow down indexing, especially with large databases and large lists of synonyms. You can use multi-word values, but phrases do not work.', 'relevanssi' ); // phpcs:ignore WordPress.Security.EscapeOutput.UnsafePrintingFunction
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
attachment' ); ?>
-
-
-
attachment' ); ?>
-
-
-
-
attachment' ); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
>
-
-
-
-
-
-
-
-
-
-
-
-
- name, relevanssi_get_forbidden_taxonomies(), true ) ) {
- continue;
- }
- if ( in_array( $taxonomy->name, $index_these_taxonomies, true ) ) {
- $checked = 'checked';
- } else {
- $checked = '';
- }
-
- if ( $taxonomy->public ) {
- $public = __( 'yes', 'relevanssi' );
- } else {
- $public = __( 'no', 'relevanssi' );
- }
-
- // Translators: %s is the post type name.
- $screen_reader_label = sprintf( __( 'Index terms for taxonomy %s', 'relevanssi' ), $taxonomy->name );
- $public = __( 'no', 'relevanssi' );
- // Translators: %s is the post type name.
- $screen_reader_public = sprintf( __( 'Taxonomy %s is not public', 'relevanssi' ), $taxonomy->name );
- if ( $taxonomy->public ) {
- $public = __( 'yes', 'relevanssi' );
- // Translators: %s is the post type name.
- $screen_reader_public = sprintf( __( 'Taxonomy %s is public', 'relevanssi' ), $taxonomy->name );
- }
- ?>
-
' . esc_html__( "Couldn't reset the option, reload the page to try again.", 'relevanssi' ) . '
';
- }
- }
-
- $words = get_option( 'relevanssi_words', false );
- if ( ! $words ) {
- $word_text = sprintf(
- // Translators: %1$s is relevanssi_words.
- esc_html__( 'The %1$s option doesn\'t exist. You can\'t reset it; it should be regenerated when you search for something.', 'relevanssi' ),
- 'relevanssi_words'
- );
- } elseif ( isset( $words['words'] ) && isset( $words['expire'] ) ) {
- $word_count = count( $words['words'] );
- $word_text = sprintf(
- // Translators: %1$s is relevanssi_words, %2$d is the number of words in the option, %3$s is the expiration date of the option.
- esc_html__( 'The %1$s option has %2$d words in it and the cache expires on %3$s.', 'relevanssi' ),
- 'relevanssi_words',
- $word_count,
- date_i18n( get_option( 'date_format' ), $words['expire'] )
- );
- } else {
- $word_text = sprintf(
- // Translators: %1$s is relevanssi_words.
- esc_html__( 'The %1$s option is empty.', 'relevanssi' ),
- 'relevanssi_words'
- );
- }
-
- ?>
-
-
-
-
-
-
-
- relevanssi_words.
- esc_html__(
- 'If you are having problems with the Did you mean? feature, you can reset the %1$s option that keeps a cache. Next time the Did you mean? suggestions are needed the option is regenerated.',
- 'relevanssi'
- ),
- 'relevanssi_words'
- );
- ?>
-
-
- ' . $message; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-}
-
-/**
- * Generates a message giving the reason for API key and license problems.
- *
- * @return string The message.
- */
-function relevanssi_get_api_key_notification() {
- global $relevanssi_variables;
-
- $api_key = get_network_option( null, 'relevanssi_api_key' );
- if ( ! $api_key ) {
- $api_key = get_option( 'relevanssi_api_key' );
- }
-
- if ( ! $api_key ) {
- $url = add_query_arg(
- 'page',
- 'relevanssi-premium%2Frelevanssi.php',
- get_admin_url() . 'options-general.php'
- );
- if ( is_plugin_active_for_network( plugin_basename( $relevanssi_variables['file'] ) ) ) {
- $url = network_admin_url( 'admin.php?page=relevanssi-premium%2Frelevanssi.php' );
- }
- $message = sprintf(
- // Translators: %1$s opens the link to the Relevanssi Premium settings page, %3$s opens the link to the Relevanssi Premium license purchase page. %2$s closes the links.
- esc_html__( "The API key is not set. Please enter your API key in the %1\$sthe Relevanssi settings%2\$s. If you don't have one, %3\$syou can buy a new license here%2\$s.", 'relevanssi' ),
- '',
- '',
- ''
- );
- } else {
- $message = sprintf(
- // Translators: %1$s opens the link to the Relevanssi Premium license purchase page. %2$s closes the link.
- esc_html__( "Your API key is set, but it looks like you don't have a valid license. %1\$sYou can buy a new license here%2\$s.", 'relevanssi' ),
- '',
- ''
- );
- }
- return $message;
-}
-
-/**
- * Adds the Relevanssi columns to the post list.
- *
- * @param array $columns The columns.
- * @param string $post_type The post type.
- */
-function relevanssi_manage_columns( $columns, $post_type = 'page' ) {
- $post_types = get_option( 'relevanssi_index_post_types', array() );
- if ( ! in_array( $post_type, $post_types, true ) ) {
- return $columns;
- }
-
- $columns['pinned_keywords'] = __( 'Pinned keywords', 'relevanssi' );
- $columns['unpinned_keywords'] = __( 'Excluded keywords', 'relevanssi' );
- $columns['pin_for_all'] = __( 'Pin for all searches', 'relevanssi' );
- $columns['exclude_post'] = __( 'Exclude post', 'relevanssi' );
- $columns['ignore_content'] = __( 'Ignore post content', 'relevanssi' );
- return $columns;
-}
-
-/**
- * Adds the Relevanssi Premium columns to the post list.
- *
- * @param array $column The column name.
- * @param int $post_id The post ID.
- */
-function relevanssi_manage_custom_column( $column, $post_id ) {
- switch ( $column ) {
- case 'pinned_keywords':
- $keywords = get_post_meta( $post_id, '_relevanssi_pin_keywords', true );
- if ( ! empty( $keywords ) ) {
- echo esc_html( $keywords );
- }
- break;
- case 'unpinned_keywords':
- $keywords = get_post_meta( $post_id, '_relevanssi_unpin_keywords', true );
- if ( ! empty( $keywords ) ) {
- echo esc_html( $keywords );
- }
- break;
- case 'pin_for_all':
- $pin_for_all = get_post_meta( $post_id, '_relevanssi_pin_for_all', true );
- if ( ! empty( $pin_for_all ) ) {
- echo '✓';
- } else {
- echo '✗';
- }
- break;
- case 'exclude_post':
- $hide_post = get_post_meta( $post_id, '_relevanssi_hide_post', true );
- if ( ! empty( $hide_post ) ) {
- echo '✓';
- } else {
- echo '✗';
- }
- break;
- case 'ignore_content':
- $hide_content = get_post_meta( $post_id, '_relevanssi_hide_content', true );
- if ( ! empty( $hide_content ) ) {
- echo '✓';
- } else {
- echo '✗';
- }
- break;
- }
-}
-
-/**
- * Adds the Relevanssi custom fields to the quick edit box.
- *
- * @param string $column The column name.
- */
-function relevanssi_quick_edit_custom_box( $column ) {
- switch ( $column ) {
- case 'pinned_keywords':
- ?>
-
-
-
- 0 ) {
- $width = $style['width'];
- }
-
- ?>
-
- posts ).
diff --git a/relevanssi-premium/premium/uninstall.php b/relevanssi-premium/premium/uninstall.php
deleted file mode 100644
index 81a3e346..00000000
--- a/relevanssi-premium/premium/uninstall.php
+++ /dev/null
@@ -1,159 +0,0 @@
-query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_hide_post'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_hide_content'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pin_for_all'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pin'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pin_weights'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_unpin'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pdf_content'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pdf_error'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_pdf_modified'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_keywords'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_posts'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_include_ids'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_exclude_ids'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_no_append'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_related_not_related'" );
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_relevanssi_noindex_reason'" );
-
- // Unused options, removed in case they are still left.
- delete_option( 'relevanssi_cache_seconds' );
- delete_option( 'relevanssi_custom_types' );
- delete_option( 'relevanssi_enable_cache' );
- delete_option( 'relevanssi_hidesponsor' );
- delete_option( 'relevanssi_index_attachments' );
- delete_option( 'relevanssi_index_drafts' );
- delete_option( 'relevanssi_index_limit' );
- delete_option( 'relevanssi_index_type' );
- delete_option( 'relevanssi_show_matches_txt' );
- delete_option( 'relevanssi_tag_boost' );
- delete_option( 'relevanssi_include_cats' );
- delete_option( 'relevanssi_include_tags' );
- delete_option( 'relevanssi_custom_taxonomies' );
- delete_option( 'relevanssi_taxonomies_to_index' );
- delete_option( 'relevanssi_highlight_docs_external' );
- delete_option( 'relevanssi_word_boundaries' );
-
- if ( ! defined( 'UNINSTALLING_RELEVANSSI_PREMIUM' ) ) {
- // The if clause is required to avoid nagging from testing.
- define( 'UNINSTALLING_RELEVANSSI_PREMIUM', true );
- }
-
- wp_clear_scheduled_hook( 'relevanssi_update_counts' );
-
- relevanssi_drop_database_tables();
-}
diff --git a/relevanssi-premium/readme.txt b/relevanssi-premium/readme.txt
deleted file mode 100644
index e6880ac9..00000000
--- a/relevanssi-premium/readme.txt
+++ /dev/null
@@ -1,437 +0,0 @@
-=== Relevanssi Premium - A Better Search ===
-Contributors: msaari
-Donate link: https://www.relevanssi.com/
-Tags: search, relevance, better search
-Requires at least: 4.9
-Requires PHP: 7.0
-Tested up to: 6.5
-Stable tag: 2.25.2
-
-Relevanssi Premium replaces the default search with a partial-match search that sorts results by relevance. It also indexes comments and shortcode content.
-
-== Description ==
-
-Relevanssi replaces the standard WordPress search with a better search engine, with lots of features and configurable options. You'll get better results, better presentation of results - your users will thank you.
-
-= Key features =
-* Search results sorted in the order of relevance, not by date.
-* Fuzzy matching: match partial words, if complete words don't match.
-* Find documents matching either just one search term (OR query) or require all words to appear (AND query).
-* Search for phrases with quotes, for example "search phrase".
-* Create custom excerpts that show where the hit was made, with the search terms highlighted.
-* Highlight search terms in the documents when user clicks through search results.
-* Search comments, tags, categories and custom fields.
-
-= Advanced features =
-* Adjust the weighting for titles, tags and comments.
-* Log queries, show most popular queries and recent queries with no hits.
-* Restrict searches to categories and tags using a hidden variable or plugin settings.
-* Index custom post types and custom taxonomies.
-* Index the contents of shortcodes.
-* Google-style "Did you mean?" suggestions based on successful user searches.
-* Automatic support for [WPML multi-language plugin](http://wpml.org/).
-* Automatic support for various membership plugins.
-* Advanced filtering to help hacking the search results the way you want.
-* Search result throttling to improve performance on large databases.
-* Disable indexing of post content and post titles with a simple filter hook.
-* Multisite support.
-
-= Premium features (only in Relevanssi Premium) =
-* PDF content indexing.
-* Search result throttling to improve performance on large databases.
-* Improved spelling correction in "Did you mean?" suggestions.
-* Searching over multiple subsites in one multisite installation.
-* Indexing and searching user profiles.
-* Weights for post types, including custom post types.
-* Limit searches with custom fields.
-* Index internal links for the target document (sort of what Google does).
-* Search using multiple taxonomies at the same time.
-
-Relevanssi is available in two versions, regular and Premium. Regular Relevanssi is and will remain free to download and use. Relevanssi Premium comes with a cost, but will get all the new features. Standard Relevanssi will be updated to fix bugs, but new features will mostly appear in Premium. Also, support for standard Relevanssi depends very much on my mood and available time. Premium pricing includes support.
-
-= Other search plugins =
-Relevanssi owes a lot to [wpSearch](https://wordpress.org/extend/plugins/wpsearch/) by Kenny Katzgrau. Relevanssi was built to replace wpSearch, when it started to fail.
-
-
-== Installation ==
-
-1. Extract all files from the ZIP file, and then upload the plugin's folder to /wp-content/plugins/.
-1. If your blog is in English, skip to the next step. If your blog is in other language, rename the file *stopwords* in the plugin directory as something else or remove it. If there is *stopwords.yourlanguage*, rename it to *stopwords*.
-1. Activate the plugin through the 'Plugins' menu in WordPress.
-1. Go to the plugin settings and build the index following the instructions there.
-
-To update your installation, simply overwrite the old files with the new, activate the new version and if the new version has changes in the indexing, rebuild the index.
-
-= Note on updates =
-If it seems the plugin doesn't work after an update, the first thing to try is deactivating and reactivating the plugin. If there are changes in the database structure, those changes do not happen without a deactivation, for some reason.
-
-= Changes to templates =
-None necessary! Relevanssi uses the standard search form and doesn't usually need any changes in the search results template.
-
-If the search does not bring any results, your theme probably has a query_posts() call in the search results template. That throws Relevanssi off. For more information, see [The most important Relevanssi debugging trick](http://www.relevanssi.com/knowledge-base/query_posts/).
-
-= How to index =
-Check the options to make sure they're to your liking, then click "Save indexing options and build the index". If everything's fine, you'll see the Relevanssi options screen again with a message "Indexing successful!"
-
-If something fails, usually the result is a blank screen. The most common problem is a timeout: server ran out of time while indexing. The solution to that is simple: just return to Relevanssi screen (do not just try to reload the blank page) and click "Continue indexing". Indexing will continue. Most databases will get indexed in just few clicks of "Continue indexing". You can follow the process in the "State of the Index": if the amount of documents is growing, the indexing is moving along.
-
-If the indexing gets stuck, something's wrong. I've had trouble with some plugins, for example Flowplayer video player stopped indexing. I had to disable the plugin, index and then activate the plugin again. Try disabling plugins, especially those that use shortcodes, to see if that helps. Relevanssi shows the highest post ID in the index - start troubleshooting from the post or page with the next highest ID. Server error logs may be useful, too.
-
-= Using custom search results =
-If you want to use the custom search results, make sure your search results template uses `the_excerpt()` to display the entries, because the plugin creates the custom snippet by replacing the post excerpt.
-
-If you're using a plugin that affects excerpts (like Advanced Excerpt), you may run into some problems. For those cases, I've included the function `relevanssi_the_excerpt()`, which you can use instead of `the_excerpt()`. It prints out the excerpt, but doesn't apply `wp_trim_excerpt()` filters (it does apply `the_content()`, `the_excerpt()`, and `get_the_excerpt()` filters).
-
-To avoid trouble, use the function like this:
-
-``
-
-See Frequently Asked Questions for more instructions on what you can do with Relevanssi.
-
-= The advanced hacker option =
-If you're doing something unusual with your search and Relevanssi doesn't work, try using `relevanssi_do_query()`. See [Knowledge Base](http://www.relevanssi.com/knowledge-base/relevanssi_do_query/).
-
-= Uninstalling =
-To uninstall the plugin remove the plugin using the normal WordPress plugin management tools (from the Plugins page, first Deactivate, then Delete). If you remove the plugin files manually, the database tables and options will remain.
-
-= Combining with other plugins =
-Relevanssi doesn't work with plugins that rely on standard WP search. Those plugins want to access the MySQL queries, for example. That won't do with Relevanssi. [Search Light](http://wordpress.org/extend/plugins/search-light/), for example, won't work with Relevanssi.
-
-Some plugins cause problems when indexing documents. These are generally plugins that use shortcodes to do something somewhat complicated. One such plugin is [MapPress Easy Google Maps](http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/). When indexing, you'll get a white screen. To fix the problem, disable either the offending plugin or shortcode expansion in Relevanssi while indexing. After indexing, you can activate the plugin again.
-
-== Frequently Asked Questions ==
-
-= Where is the Relevanssi search box widget? =
-There is no Relevanssi search box widget.
-
-Just use the standard search box.
-
-= Where are the user search logs? =
-See the top of the admin menu. There's 'User searches'. There. If the logs are empty, please note showing the results needs at least MySQL 5.
-
-= Displaying the number of search results found =
-
-The typical solution to showing the number of search results found does not work with Relevanssi. However, there's a solution that's much easier: the number of search results is stored in a variable within $wp_query. Just add the following code to your search results template:
-
-`found_posts . ' hits'; ?>`
-
-= Advanced search result filtering =
-
-If you want to add extra filters to the search results, you can add them using a hook. Relevanssi searches for results in the _relevanssi table, where terms and post_ids are listed. The various filtering methods work by listing either allowed or forbidden post ids in the query WHERE clause. Using the `relevanssi_where` hook you can add your own restrictions to the WHERE clause.
-
-These restrictions must be in the general format of ` AND doc IN (' . {a list of post ids, which could be a subquery} . ')`
-
-For more details, see where the filter is applied in the `relevanssi_search()` function. This is stricly an advanced hacker option for those people who're used to using filters and MySQL WHERE clauses and it is possible to break the search results completely by doing something wrong here.
-
-There's another filter hook, `relevanssi_hits_filter`, which lets you modify the hits directly. The filter passes an array, where index 0 gives the list of hits in the form of an array of post objects and index 1 has the search query as a string. The filter expects you to return an array containing the array of post objects in index 0 (`return array($your_processed_hit_array)`).
-
-= Direct access to query engine =
-Relevanssi can't be used in any situation, because it checks the presence of search with the `is_search()` function. This causes some unfortunate limitations and reduces the general usability of the plugin.
-
-You can now access the query engine directly. There's a new function `relevanssi_do_query()`, which can be used to do search queries just about anywhere. The function takes a WP_Query object as a parameter, so you need to store all the search parameters in the object (for example, put the search terms in `$your_query_object->query_vars['s']`). Then just pass the WP_Query object to Relevanssi with `relevanssi_do_query($your_wp_query_object);`.
-
-Relevanssi will process the query and insert the found posts as `$your_query_object->posts`. The query object is passed as reference and modified directly, so there's no return value. The posts array will contain all results that are found.
-
-= Sorting search results =
-If you want something else than relevancy ranking, you can use orderby and order parameters. Orderby accepts $post variable attributes and order can be "asc" or "desc". The most relevant attributes here are most likely "post_date" and "comment_count".
-
-If you want to give your users the ability to sort search results by date, you can just add a link to http://www.yourblogdomain.com/?s=search-term&orderby=post_date&order=desc to your search result page.
-
-Order by relevance is either orderby=relevance or no orderby parameter at all.
-
-= Filtering results by date =
-You can specify date limits on searches with `by_date` search parameter. You can use it your search result page like this: http://www.yourblogdomain.com/?s=search-term&by_date=1d to offer your visitor the ability to restrict their search to certain time limit (see [RAPLIQ](http://www.rapliq.org/) for a working example).
-
-The date range is always back from the current date and time. Possible units are hour (h), day (d), week (w), month (m) and year (y). So, to see only posts from past week, you could use by_date=7d or by_date=1w.
-
-Using wrong letters for units or impossible date ranges will lead to either defaulting to date or no results at all, depending on case.
-
-Thanks to Charles St-Pierre for the idea.
-
-= Displaying the relevance score =
-Relevanssi stores the relevance score it uses to sort results in the $post variable. Just add something like
-
-`echo $post->relevance_score`
-
-to your search results template inside a PHP code block to display the relevance score.
-
-= Did you mean? suggestions =
-To use Google-style "did you mean?" suggestions, first enable search query logging. The suggestions are based on logged queries, so without good base of logged queries, the suggestions will be odd and not very useful.
-
-To use the suggestions, add the following line to your search result template, preferably before the have_posts() check:
-
-`Did you mean: ", "?", 5); }?>`
-
-The first parameter passes the search term, the second is the text before the result, the third is the text after the result and the number is the amount of search results necessary to not show suggestions. With the default value of 5, suggestions are not shown if the search returns more than 5 hits.
-
-= Search shortcode =
-Relevanssi also adds a shortcode to help making links to search results. That way users can easily find more information about a given subject from your blog. The syntax is simple:
-
-`[search]John Doe[/search]`
-
-This will make the text John Doe a link to search results for John Doe. In case you want to link to some other search term than the anchor text (necessary in languages like Finnish), you can use:
-
-`[search term="John Doe"]Mr. John Doe[/search]`
-
-Now the search will be for John Doe, but the anchor says Mr. John Doe.
-
-One more parameter: setting `[search phrase="on"]` will wrap the search term in quotation marks, making it a phrase. This can be useful in some cases.
-
-= Restricting searches to categories and tags =
-Relevanssi supports the hidden input field `cat` to restrict searches to certain categories (or tags, since those are pretty much the same). Just add a hidden input field named `cat` in your search form and list the desired category or tag IDs in the `value` field - positive numbers include those categories and tags, negative numbers exclude them.
-
-This input field can only take one category or tag id (a restriction caused by WordPress, not Relevanssi). If you need more, use `cats` and use a comma-separated list of category IDs.
-
-You can also set the restriction from general plugin settings (and then override it in individual search forms with the special field). This works with custom taxonomies as well, just replace `cat` with the name of your taxonomy.
-
-If you want to restrict the search to categories using a dropdown box on the search form, use a code like this:
-
-``
-
-This produces a search form with a dropdown box for categories. Do note that this code won't work when placed in a Text widget: either place it directly in the template or use a PHP widget plugin to get a widget that can execute PHP code.
-
-= Restricting searches with taxonomies =
-
-You can use taxonomies to restrict search results to posts and pages tagged with a certain taxonomy term. If you have a custom taxonomy of "People" and want to search entries tagged "John" in this taxonomy, just use `?s=keyword&people=John` in the URL. You should be able to use an input field in the search form to do this, as well - just name the input field with the name of the taxonomy you want to use.
-
-It's also possible to do a dropdown for custom taxonomies, using the same function. Just adjust the arguments like this:
-
-`wp_dropdown_categories(array('show_option_all' => 'All people', 'name' => 'people', 'taxonomy' => 'people'));`
-
-This would do a dropdown box for the "People" taxonomy. The 'name' must be the keyword used in the URL, while 'taxonomy' has the name of the taxonomy.
-
-= Automatic indexing =
-Relevanssi indexes changes in documents as soon as they happen. However, changes in shortcoded content won't be registered automatically. If you use lots of shortcodes and dynamic content, you may want to add extra indexing. Here's how to do it:
-
-`if (!wp_next_scheduled('relevanssi_build_index')) {
- wp_schedule_event( time(), 'daily', 'relevanssi_build_index' );
-}`
-
-Add the code above in your theme functions.php file so it gets executed. This will cause WordPress to build the index once a day. This is an untested and unsupported feature that may cause trouble and corrupt index if your database is large, so use at your own risk. This was presented at [forum](http://wordpress.org/support/topic/plugin-relevanssi-a-better-search-relevanssi-chron-indexing?replies=2).
-
-= Highlighting terms =
-Relevanssi search term highlighting can be used outside search results. You can access the search term highlighting function directly. This can be used for example to highlight search terms in structured search result data that comes from custom fields and isn't normally highlighted by Relevanssi.
-
-Just pass the content you want highlighted through `relevanssi_highlight_terms()` function. The content to highlight is the first parameter, the search query the second. The content with highlights is then returned by the function. Use it like this:
-
-`if (function_exists('relevanssi_highlight_terms')) {
- echo relevanssi_highlight_terms($content, get_search_query());
-}
-else { echo $content; }`
-
-= Multisite searching =
-To search multiple blogs in the same WordPress network, use the `searchblogs` argument. You can add a hidden input field, for example. List the desired blog ids as the value. For example, searchblogs=1,2,3 would search blogs 1, 2, and 3.
-
-The features are very limited in the multiblog search, none of the advanced filtering works, and there'll probably be fairly serious performance issues if searching common words from multiple blogs.
-
-= What is tf * idf weighing? =
-
-It's the basic weighing scheme used in information retrieval. Tf stands for *term frequency* while idf is *inverted document frequency*. Term frequency is simply the number of times the term appears in a document, while document frequency is the number of documents in the database where the term appears.
-
-Thus, the weight of the word for a document increases the more often it appears in the document and the less often it appears in other documents.
-
-= What are stop words? =
-
-Each document database is full of useless words. All the little words that appear in just about every document are completely useless for information retrieval purposes. Basically, their inverted document frequency is really low, so they never have much power in matching. Also, removing those words helps to make the index smaller and searching faster.
-
-== Known issues and To-do's ==
-* Known issue: In general, multiple Loops on the search page may cause surprising results. Please make sure the actual search results are the first loop.
-* Known issue: Relevanssi doesn't necessarily play nice with plugins that modify the excerpt. If you're having problems, try using relevanssi_the_excerpt() instead of the_excerpt().
-* Known issue: When a tag is removed, Relevanssi index isn't updated until the post is indexed again.
-
-== Thanks ==
-* Cristian Damm for tag indexing, comment indexing, post/page exclusion and general helpfulness.
-* Marcus Dalgren for UTF-8 fixing.
-* Warren Tape.
-* Mohib Ebrahim for relentless bug hunting.
-* John Blackbourn for amazing internal link feature and other fixes.
-* John Calahan for extensive 2.0 beta testing.
-
-== Changelog ==
-= 2.25.2 =
-* Security fix: Prevent CSV injection attack in log export.
-* Security fix: Restrict access to doc count updates.
-* Minor fix: Product variations check the parent product for access restrictions, to avoid situations where variations of a draft product appear in the results.
-* Minor fix: Improved TablePress compatibility.
-* Minor fix: Added error handling to the Ninja Table compatibility code.
-
-= 2.25.1 =
-* Security fix: Relevanssi had a vulnerability where anyone could access the search logs and click logs. The log export is now protected.
-* Minor fix: Relevanssi had problems with Polylang when a post or term didn't have language specified. Now Relevanssi handles those situations better.
-* Minor fix: Post date throttling had a MySQL error that made it replace JOINs instead of concatenating.
-* Minor fix: The log database table now has an index on session_id, as not having that index can slow down the search a lot.
-
-= 2.25.0 =
-* New feature: New filter hook `relevanssi_searchform_dropdown_args` filters the arguments for `wp_dropdown_categories()` in search forms.
-* Changed behaviour: Search form shortcode taxonomy dropdowns are now sorted alphabetically and not by term ID.
-* Minor fix: Caught a bug in excerpt-building with empty words.
-* Minor fix: It's now possible to set both `post__in` and `post__not_in` and likewise for `parent__in` and `parent__not_in`.
-* Minor fix: The `post_status` is no longer available as a query parameter.
-
-= 2.24.4 =
-* Minor fix: Fixes broken taxonomy indexing.
-
-= 2.24.3 =
-* Security fix: Relevanssi had a vulnerability for SQL injections. Exploiting the vulnerability does require WP admin access. This vulnerability is now fixed.
-* Security fix: Relevanssi had a vulnerability for error log injections. Exploiting this vulnerability requires file upload access to the site. This vulnerability is now fixed.
-* New feature: New filter hook 'relevanssi_get_attachment_posts_query_final' filters the final SQL query for attachment post fetching.
-* Changed behaviour: Relevanssi now skips attachments with 'Server did not respond' errors when reading attachments. This should help with problems coming from attachments that are too big read.
-* Minor fix: Improved server timeout error handling for attachment reading.
-* Minor fix: Relevanssi didn't strip tags from custom field specific excerpts, and could show zero-hit excerpts for the content.
-* Minor fix: Multisite search failed when the search term resolved to nothing in the tokenizer.
-
-= 2.24.2 =
-* Minor fix: Fixes broken WP CLI progress bars.
-* Minor fix: Meta query boolean to array conversion.
-* Minor fix: For indexing, stemmer is always in OR mode so that both stemmed word and the original word is indexed.
-
-= 2.24.1 =
-* New feature: The debugging tab now shows the status of the 'relevanssi_words' option.
-* Changed behaviour: The 'relevanssi_index_content' and 'relevanssi_index_titles' filter hooks now get the post object as a second parameter.
-* Minor fix: Stop Relevanssi from blocking the feed searches.
-* Minor fix: Remove warning from missing blog_id parameter.
-* Minor fix: Improve exact match boosts with accented letters.
-* Minor fix: Entering synonyms in Polylang all languages mode was possible; it shouldn't be.
-* Minor fix: Relevanssi is now blocked in the reusable content block search.
-
-= 2.24.0 =
-* New feature: New filter hook `relevanssi_highlight_regex` makes it possible to adjust the regex used for highlighting.
-* New feature: New filter hook `relevanssi_excerpt_custom_fields` filters the list of custom fields used for creating the excerpt.
-* New feature: New filter hook `relevanssi_phrase_custom_fields` filters the list of custom fields used for phrase matching. Return an empty array to disable phrase matching in custom fields.
-* New feature: New filter hook `relevanssi_phrase_taxonomies` filters the list of taxonomies used for phrase matching. Return an empty array to disable phrase matching in taxonomies.
-* New feature: If RELEVANSSI_DEBUG, WP_DEBUG and WP_DEBUG_DISPLAY are all true, Relevanssi will print out indexing debugging messages to the error log (PHP error log or whatever is defined in WP_DEBUG_LOG).
-* Changed behaviour: If the `relevanssi_accents_replacement_arrays` returns an empty array, the accent variation feature is disabled.
-* Minor fix: Term indexing with WPML only indexed the terms in the current admin language. Now the terms are indexed in all languages.
-* Minor fix: Some ACF fields change the global $post, leading to indexing problems. Relevanssi tries to prevent that now.
-* Minor fix: Relevanssi couldn't create the click tracking table on subsites during the multisite installation.
-* Minor fix: Safety features for post-part targeting to avoid fatal errors from wrong variable types.
-* Minor fix: Pinning failed in multisite if the search site didn't have any pinned posts.
-* Minor fix: The `relevanssi_custom_field_value` filter hook is now applied to `_relevanssi_pdf_content` field when the PDF content is indexed for the parent post.
-* Minor fix: The `relevanssi_premium_get_post()` now returns a `WP_Error` when the post is not found.
-* Minor fix: The "Did you mean" feature now makes less suggestions for words that are already correct.
-* Minor fix: Trigger reindexing of the parent post when an attachment is attached or detached from the Media Library.
-* Minor fix: Click tracking now works much better in multisite searches and counts the clicks for the correct subsite.
-
-= 2.23.0 =
-* New feature: Relevanssi can now create custom field specific excerpts that come from one custom field only and know which field that is.
-* New feature: You can see the list of indexed custom field names in the indexing and excerpt settings.
-* New feature: New filter hook `relevanssi_excerpt_specific_custom_field_content` filters the excerpt custom field content if `relevanssi_excerpt_specific_fields` is enabled.
-* Changed behaviour: The `relevanssi_get_custom_field_content()` function now returns an array instead of string. If `relevanssi_excerpt_specific_fields` is off, the previous string return value is returned as a single-item array with the string in index 0. If the setting is on, the array keys are the field names.
-* Changed behaviour: The `relevanssi_get_child_pdf_content()` function now returns an array.
-* Minor fix: The "none" value in category dropdowns from the searchform shortcode is changed from -1 to 0.
-* Minor fix: The stopword population during the multisite installation used the wrong database table, leading to failed population.
-* Minor fix: Multisite installation is moved from `wp_insert_site` (priority 10) to `wp_initialize_site` (priority 200) in order to avoid trouble.
-* Minor fix: Wildcard search now works in whole word matching, not only in partial matching.
-* Minor fix: The Gutenberg sidebar translations didn't show up. Now you should be able to see the sidebar in the right language.
-
-= 2.22.0 =
-* New feature: Logging now includes a session ID (based on user ID for logged-in users, HTTP user agent for others, and current time, stable for 10 minutes per user). This is used to remove duplicate searches from live searches, keeping only the final search query.
-* Minor fix: The pin weights did not appear in the classic editor Relevanssi metabox, despite being stored in the database.
-
-= 2.21.0 =
-* New feature: You can now add weights to pinned terms to control the order of the pinned posts.
-* New feature: New filter hook `relevanssi_add_attachment_scripts` lets you add the attachment javascripts to other post types than `attachment`.
-* New feature: New filter hook `relevanssi_highlight_query` lets you modify the search query for highlighting.
-* Changed behavior: Relevanssi no longer searches in feed searches by default.
-* Minor fix: The filter `relevanssi_get_attachment_url` is now also used when adding the attachment metabox.
-* Minor fix: No more crashes from Polylang forced plugin updates.
-* Minor fix: PHP 8.1 deprecated FILTER_SANITIZE_STRING, those are now replaced.
-
-= 2.20.4 =
-* New feature: New filter hook `relevanssi_blocked_field_types` can be used to control which ACF field types are excluded from the index. By default, this includes 'repeater', 'flexible_content', and 'group'.
-* New feature: New filter hook `relevanssi_acf_field_object` can be used to filter the ACF field object before Relevanssi indexes it. Return false to have Relevanssi ignore the field type.
-* Minor fix: ACF field exclusion is now recursive. If a parent field is excluded, all sub fields will also be excluded.
-* Minor fix: The indexing settings tab now checks if the wp_relevanssi database table exists and will create the table if it doesn't.
-* Minor fix: Pinning code has been foolproofed to cover some situations that would lead to errors.
-* Minor fix: Handling of data attributes in in-document highlighting had a bug that caused problems with third-party plugins.
-
-= 2.20.3 =
-* New feature: Relevanssi now has a debug mode that will help troubleshooting and support.
-* Minor fix: Using the_permalink() caused problems with search result links. That is now fixed. Relevanssi no longer hooks onto `the_permalink` hook and instead uses `post_link` and other similar hooks.
-* Minor fix: Click tracking parameters have more control to avoid problems from malformed click tracking data.
-
-= 2.20.2 =
-* Fixes the persistent update nag.
-
-= 2.20.1 =
-* New feature: New filter hook `relevanssi_add_highlight_and_tracking` can be used to force Relevanssi to add the `highlight` and tracking parameters to permalinks.
-* Changed behaviour: Exclusions now override pinning. If a post is pinned for 'foo' and excluded for 'foo bar', it will now be excluded when someone searches for 'foo bar'. Previously pinning overrode the exclusion.
-* Changed behaviour: The 'relevanssi_wpml_filter' filter function now runs on priority 9 instead of 10 to avoid problems with custom filters on relevanssi_hits_filter.
-* Minor fix: Page links didn't get the click tracking tags. This is fixed now.
-* Minor fix: Including posts in the Related posts could cause duplicates. Now Relevanssi excludes the included posts from the search so that there won't be duplicates.
-* Minor fix: Handle cases of missing posts better; relevanssi_get_post() now returns a WP_Error if no post is found.
-* Minor fix: Avoid a slow query on the searching tab when the throttle is not enabled.
-* Minor fix: Search queries that contain apostrophes and quotes can now be deleted from the log.
-
-= 2.20.0 =
-* New feature: Relevanssi now shows the MySQL `max_allowed_packet` size on the debug tab.
-* New feature: Relevanssi now shows the indexing query on the debug tab.
-* New feature: You can now edit pinning and exclusions from Quick Edit.
-* New feature: You can now remove queries from the search log from the query insights page.
-* New feature: ACF field settings now include a 'Exclude from Relevanssi index' setting. You can use that to exclude ACF fields from the Relevanssi index.
-* Changed behaviour: Click tracking is disabled in multisite searches. It causes problems with wrong links and isn't very reliable in the best case.
-* Changed behaviour: Plugin translation updates are disabled, unless explicitly enabled either from the Overview settings or with the `relevanssi_update_translations` filter hook.
-* Minor fix: Relevanssi was adding extra quotes around search terms in the `highlight` parameter.
-* Minor fix: Metabox fields look nicer on Firefox.
-* Minor fix: Adds the `relevanssi_related_posts_cache_id` filter to the relevanssi_related_posts() function.
-* Minor fix: Yet another update to data attributes in highlighting. Thanks to Faeddur.
-* Minor fix: Taxonomy query handling was improved. This should help in particular Polylang users who've had problems with Relevanssi ignoring Polylang language restrictions.
-* Minor fix: Negative search terms in AND searches caused problems, but now work better.
-* Minor fix: Pinning phrases that had the same word more than once (e.g. 'word by word') didn't work. Now it works better.
-
-== Upgrade notice ==
-= 2.25.2 =
-* Security hardening, improved WooCommerce, TablePress and Ninja Table compatibility.
-
-= 2.25.1 =
-* Security hardening, better Polylang support.
-
-= 2.25.0 =
-* Improvements to search form shortcode.
-
-= 2.24.4 =
-* Fix broken taxonomy indexing.
-
-= 2.24.3 =
-* Security hardening, attachment handling improvements.
-
-= 2.24.2 =
-* Meta query errors, WP CLI progress bars, stemmer indexing.
-
-= 2.24.1 =
-* Fix for the blog_id bug, small improvements.
-
-= 2.24.0 =
-* Improved debugging, bug fixes and new filter hooks.
-
-= 2.23.0 =
-* Better method for handling custom fields in excerpts, bug fixes.
-
-= 2.22.0 =
-* Logs now include a session ID.
-
-= 2.21.0 =
-* You can now assign weights to pinned keywords.
-
-= 2.20.4 =
-* Better ACF field controls, bug fixes.
-
-= 2.20.3 =
-* Fixes a bug with broken permalinks.
-
-= 2.20.2 =
-* Fixes the persistent update nag.
-
-= 2.20.1 =
-* Bug fixes and small improvements.
-
-= 2.20.0 =
-* New features, performance improvements, bug fixes.
\ No newline at end of file
diff --git a/relevanssi-premium/relevanssi.php b/relevanssi-premium/relevanssi.php
deleted file mode 100644
index 092dfabe..00000000
--- a/relevanssi-premium/relevanssi.php
+++ /dev/null
@@ -1,189 +0,0 @@
-.
-*/
-
-add_action( 'init', 'relevanssi_premium_init' );
-add_action( 'init', 'relevanssi_activate_auto_update' );
-add_action( 'profile_update', 'relevanssi_profile_update', 9999 );
-add_action( 'edit_user_profile_update', 'relevanssi_profile_update', 9999 );
-add_action( 'user_register', 'relevanssi_profile_update', 9999 );
-add_action( 'delete_user', 'relevanssi_delete_user' );
-add_action( 'created_term', 'relevanssi_add_term', 9999, 3 );
-add_action( 'edited_term', 'relevanssi_edit_term', 9999, 3 );
-add_action( 'delete_term', 'relevanssi_delete_taxonomy_term', 9999, 3 );
-add_action( 'save_post', 'relevanssi_save_postdata', 10 );
-add_action( 'edit_attachment', 'relevanssi_save_postdata' );
-add_action( 'edit_attachment', 'relevanssi_save_pdf_postdata' );
-add_action( 'plugins_loaded', 'relevanssi_spamblock' );
-add_filter( 'wpmu_drop_tables', 'relevanssi_wpmu_drop' );
-add_action( 'network_admin_menu', 'relevanssi_network_menu' );
-add_filter( 'attachment_link', 'relevanssi_post_link_replace', 10, 2 );
-add_action( 'admin_enqueue_scripts', 'relevanssi_premium_add_admin_scripts', 11 );
-add_filter( 'relevanssi_premium_tokenizer', 'relevanssi_enable_stemmer' );
-add_filter( 'query_vars', 'relevanssi_premium_query_vars' );
-add_filter( 'relevanssi_tabs', 'relevanssi_premium_add_tabs', 10 );
-add_filter( 'relevanssi_phrase_queries', 'relevanssi_premium_phrase_queries', 10, 3 );
-
-global $wp_version;
-if ( version_compare( $wp_version, '5.1', '>=' ) ) {
- add_action( 'wp_initialize_site', 'relevanssi_new_blog', 200, 1 );
-} else {
- add_action( 'wpmu_new_blog', 'relevanssi_new_blog', 10, 1 );
-}
-
-global $wpdb;
-global $relevanssi_variables;
-
-$relevanssi_variables['relevanssi_table'] = $wpdb->prefix . 'relevanssi';
-$relevanssi_variables['stopword_table'] = $wpdb->prefix . 'relevanssi_stopwords';
-$relevanssi_variables['log_table'] = $wpdb->prefix . 'relevanssi_log';
-$relevanssi_variables['tracking_table'] = $wpdb->prefix . 'relevanssi_tracking'; // Note: this is also hardcoded in /premium/click-tracking.php.
-$relevanssi_variables['post_type_weight_defaults']['post_tag'] = 0.5;
-$relevanssi_variables['post_type_weight_defaults']['category'] = 0.5;
-$relevanssi_variables['content_boost_default'] = 5;
-$relevanssi_variables['title_boost_default'] = 5;
-$relevanssi_variables['link_boost_default'] = 0.75;
-$relevanssi_variables['comment_boost_default'] = 0.75;
-$relevanssi_variables['database_version'] = 23;
-$relevanssi_variables['plugin_version'] = '2.25.2';
-$relevanssi_variables['plugin_dir'] = plugin_dir_path( __FILE__ );
-$relevanssi_variables['plugin_basename'] = plugin_basename( __FILE__ );
-$relevanssi_variables['file'] = __FILE__;
-$relevanssi_variables['sidebar_capability'] = 'edit_others_posts';
-
-define( 'RELEVANSSI_PREMIUM', true );
-define( 'RELEVANSSI_EU_SERVICES_URL', 'https://eu.relevanssiservices.com/' );
-define( 'RELEVANSSI_US_SERVICES_URL', 'https://us.relevanssiservices.com/' );
-if ( ! defined( 'RELEVANSSI_DEVELOP' ) ) {
- define( 'RELEVANSSI_DEVELOP', false );
-}
-
-require_once 'lib/admin-ajax.php';
-require_once 'lib/common.php';
-require_once 'lib/debug.php';
-require_once 'lib/didyoumean.php';
-require_once 'lib/excerpts-highlights.php';
-require_once 'lib/indexing.php';
-require_once 'lib/init.php';
-require_once 'lib/install.php';
-require_once 'lib/interface.php';
-require_once 'lib/log.php';
-require_once 'lib/options.php';
-require_once 'lib/phrases.php';
-require_once 'lib/privacy.php';
-require_once 'lib/search.php';
-require_once 'lib/search-tax-query.php';
-require_once 'lib/search-query-restrictions.php';
-require_once 'lib/shortcodes.php';
-require_once 'lib/stopwords.php';
-require_once 'lib/sorting.php';
-require_once 'lib/user-searches.php';
-require_once 'lib/utils.php';
-
-require_once 'premium/admin-ajax.php';
-require_once 'premium/body-stopwords.php';
-require_once 'premium/class-relevanssi-language-packs.php';
-require_once 'premium/class-relevanssi-spellcorrector.php';
-require_once 'premium/class-relevanssi-wp-auto-update.php';
-require_once 'premium/click-tracking.php';
-require_once 'premium/common.php';
-require_once 'premium/excerpts-highlights.php';
-require_once 'premium/indexing.php';
-require_once 'premium/interface.php';
-require_once 'premium/network-options.php';
-require_once 'premium/pdf-upload.php';
-require_once 'premium/pinning.php';
-require_once 'premium/post-metabox.php';
-require_once 'premium/proximity.php';
-require_once 'premium/redirects.php';
-require_once 'premium/related.php';
-require_once 'premium/search.php';
-require_once 'premium/search-multi.php';
-require_once 'premium/spamblock.php';
-
-if ( version_compare( $wp_version, '5.0', '>=' ) ) {
- require_once 'premium/gutenberg-sidebar.php';
-}
-
-if ( defined( 'WP_CLI' ) && WP_CLI ) {
- require_once 'premium/class-relevanssi-wp-cli-command.php';
- add_filter( 'relevanssi_search_ok', 'relevanssi_cli_query_ok', 10, 2 );
-}
-
-/**
- * Sets the relevanssi_search_ok true for searches.
- *
- * @param boolean $ok Whether it's ok to do a Relevanssi search or not.
- * @param WP_Query $query The query object.
- *
- * @return boolean Whether it's ok to do a Relevanssi search or not.
- */
-function relevanssi_cli_query_ok( $ok, $query ) {
- if ( $query->is_search() ) {
- return true;
- }
- return $ok;
-}
-
-/**
- * Activates the auto update mechanism.
- *
- * @global array $relevanssi_variables Relevanssi global variables, used for plugin file name and version number.
- *
- * Hooks into 'init' filter hook to activate the auto update mechanism.
- */
-function relevanssi_activate_auto_update() {
- global $relevanssi_variables;
- $api_key = get_network_option( null, 'relevanssi_api_key' );
- if ( ! $api_key ) {
- $api_key = get_option( 'relevanssi_api_key' );
- }
- if ( 'su9qtC30xCLLA' === crypt( $api_key, 'suolaa' ) ) {
- $relevanssi_plugin_remote_path = 'https://www.relevanssi.com/update/update-development-2022.php';
- } else {
- $relevanssi_plugin_remote_path = 'https://www.relevanssi.com/update/update-2022.php';
- }
- $relevanssi_variables['autoupdate'] = new Relevanssi_WP_Auto_Update(
- $relevanssi_variables['plugin_version'],
- $relevanssi_plugin_remote_path,
- $relevanssi_variables['plugin_basename']
- );
-}
diff --git a/relevanssi-premium/relevanssi.po b/relevanssi-premium/relevanssi.po
deleted file mode 100644
index 06872cf3..00000000
--- a/relevanssi-premium/relevanssi.po
+++ /dev/null
@@ -1,4490 +0,0 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: Relevanssi Premium\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-05-11 06:12+0300\n"
-"PO-Revision-Date: \n"
-"Last-Translator: Mikko Saari \n"
-"Language-Team: \n"
-"Language: en\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-KeywordsList: _e;__;esc_attr__;esc_attr_e;esc_html__;_n;esc_html_e;"
-"esc_html_x;esc_attr_x;_x;__ngettext;__ngettext_noop;_n_noop;_nx;_nx_noop;_ex;"
-"_c;_nc\n"
-"X-Poedit-Basepath: .\n"
-"X-Generator: Poedit 3.3\n"
-"X-Poedit-SearchPath-0: .\n"
-"X-Poedit-SearchPath-1: premium\n"
-"X-Poedit-SearchPath-2: lib\n"
-"X-Poedit-SearchPathExcluded-0: src\n"
-"X-Poedit-SearchPathExcluded-1: release\n"
-"X-Poedit-SearchPathExcluded-2: build\n"
-"X-Poedit-SearchPathExcluded-3: node_modules\n"
-"X-Poedit-SearchPathExcluded-4: coverage\n"
-"X-Poedit-SearchPathExcluded-5: vendor\n"
-
-#: lib/admin-ajax.php:36 lib/admin-ajax.php:190
-msgid "You do not have sufficient permissions to access this page."
-msgstr ""
-
-#: lib/admin-ajax.php:115
-#, php-format
-msgid "Indexed %1$d post (total %2$d), processed %3$d / %4$d."
-msgstr ""
-
-#: lib/admin-ajax.php:252 lib/tabs/indexing-tab.php:135
-#: premium/tabs/attachments-tab.php:63
-msgid "Results"
-msgstr ""
-
-#: lib/admin-ajax.php:256
-#, php-format
-msgid "Found a total of %1$d posts, showing posts %2$d–%3$s."
-msgstr ""
-
-#: lib/admin-ajax.php:258
-msgid "Previous page"
-msgstr ""
-
-#: lib/admin-ajax.php:261
-msgid "Next page"
-msgstr ""
-
-#: lib/admin-ajax.php:265
-msgid "Score:"
-msgstr ""
-
-#: lib/admin-ajax.php:290
-msgid "Edit"
-msgstr ""
-
-#: lib/admin-ajax.php:338
-msgid "Query variables"
-msgstr ""
-
-#: lib/admin-ajax.php:407
-msgid "Filters"
-msgstr ""
-
-#: lib/admin-ajax.php:408
-msgid "show"
-msgstr ""
-
-#: lib/admin-ajax.php:409
-msgid "hide"
-msgstr ""
-
-#: lib/common.php:147
-msgid "Missing"
-msgstr ""
-
-#: lib/common.php:1143
-msgid "25 most common words in the index"
-msgstr ""
-
-#: lib/common.php:1144
-msgid ""
-"These words are excellent stopword material. A word that appears in most of "
-"the posts in the database is quite pointless when searching. This is also an "
-"easy way to create a completely new stopword list, if one isn't available in "
-"your language. Click the word to add the word to the stopword list. The word "
-"will also be removed from the index, so rebuilding the index is not "
-"necessary."
-msgstr ""
-
-#: lib/common.php:1150
-msgid "Stopword Candidates"
-msgstr ""
-
-#: lib/common.php:1155
-msgid "Add to stopwords"
-msgstr ""
-
-#: lib/common.php:1158
-msgid "Add to content stopwords"
-msgstr ""
-
-#: lib/common.php:1525
-#, php-format
-msgid "Nothing found for ID %d."
-msgstr ""
-
-#: lib/common.php:1532
-msgid "Possible reasons this post is not indexed"
-msgstr ""
-
-#: lib/common.php:1536
-msgid "The title"
-msgstr ""
-
-#: lib/common.php:1540
-msgid "The content"
-msgstr ""
-
-#: lib/common.php:1544 lib/tabs/indexing-tab.php:325
-msgid "Comments"
-msgstr ""
-
-#: lib/common.php:1548
-msgid "Tags"
-msgstr ""
-
-#: lib/common.php:1552
-msgid "Categories"
-msgstr ""
-
-#: lib/common.php:1556
-msgid "Other taxonomies"
-msgstr ""
-
-#: lib/common.php:1560
-msgid "Links"
-msgstr ""
-
-#: lib/common.php:1564
-msgid "Authors"
-msgstr ""
-
-#: lib/common.php:1568
-msgid "Excerpt"
-msgstr ""
-
-#: lib/common.php:1572 lib/tabs/indexing-tab.php:339
-msgid "Custom fields"
-msgstr ""
-
-#: lib/common.php:1576
-msgid "MySQL content"
-msgstr ""
-
-#: lib/compatibility/acf.php:131
-msgid "Exclude from Relevanssi index"
-msgstr ""
-
-#: lib/compatibility/acf.php:132
-msgid ""
-"If this setting is enabled, Relevanssi will not index the value of this "
-"field for posts."
-msgstr ""
-
-#: lib/compatibility/aioseo.php:88
-msgid "Use All-in-One SEO noindex"
-msgstr ""
-
-#: lib/compatibility/aioseo.php:93
-msgid "Use All-in-One SEO noindex."
-msgstr ""
-
-#: lib/compatibility/aioseo.php:95
-msgid ""
-"If checked, Relevanssi will not index posts marked as \"No index\" in All-in-"
-"One SEO settings."
-msgstr ""
-
-#: lib/compatibility/rankmath.php:80
-msgid "Use Rank Math SEO noindex"
-msgstr ""
-
-#: lib/compatibility/rankmath.php:85
-msgid "Use Rank Math SEO noindex."
-msgstr ""
-
-#: lib/compatibility/rankmath.php:87
-msgid ""
-"If checked, Relevanssi will not index posts marked as \"No index\" in Rank "
-"Math SEO settings."
-msgstr ""
-
-#: lib/compatibility/seoframework.php:76
-msgid "Use SEO Framework noindex"
-msgstr ""
-
-#: lib/compatibility/seoframework.php:81
-msgid "Use SEO Framework noindex."
-msgstr ""
-
-#: lib/compatibility/seoframework.php:83
-msgid ""
-"If checked, Relevanssi will not index posts marked as \"No index\" in SEO "
-"Framework settings."
-msgstr ""
-
-#: lib/compatibility/seopress.php:82
-msgid "Use SEOPress noindex"
-msgstr ""
-
-#: lib/compatibility/seopress.php:87
-msgid "Use SEOPress noindex."
-msgstr ""
-
-#: lib/compatibility/seopress.php:89
-msgid ""
-"If checked, Relevanssi will not index posts marked as \"No index\" in "
-"SEOPress settings."
-msgstr ""
-
-#: lib/compatibility/yoast-seo.php:82
-msgid "Use Yoast SEO noindex"
-msgstr ""
-
-#: lib/compatibility/yoast-seo.php:87
-msgid "Use Yoast SEO noindex."
-msgstr ""
-
-#: lib/compatibility/yoast-seo.php:89
-msgid ""
-"If checked, Relevanssi will not index posts marked as \"No index\" in Yoast "
-"SEO settings."
-msgstr ""
-
-#: lib/contextual-help.php:24
-#, php-format
-msgid ""
-"To adjust the post order, you can use the %1$s query parameter. With %1$s, "
-"you can use multiple layers of different sorting methods. See WordPress Codex for more details on using arrays for orderby."
-msgstr ""
-
-#: lib/contextual-help.php:26
-#, php-format
-msgid ""
-"To get inside-word highlights, uncheck the \"%s\" option. That has a side-"
-"effect of enabling the inside-word highlights."
-msgstr ""
-
-#: lib/contextual-help.php:26
-msgid "Uncheck this if you use non-ASCII characters"
-msgstr ""
-
-#: lib/contextual-help.php:28
-#, php-format
-msgid "In order to adjust the throttle limit, you can use the %s filter hook."
-msgstr ""
-
-#: lib/contextual-help.php:33 lib/interface.php:198
-#: lib/tabs/overview-tab.php:59
-msgid "Searching"
-msgstr ""
-
-#: lib/contextual-help.php:36
-msgid ""
-"Inside-word matching is disabled by default, because it increases garbage "
-"results that don't really match the search term. If you want to enable it, "
-"add the following function to your theme functions.php:"
-msgstr ""
-
-#: lib/contextual-help.php:44
-msgid ""
-"It's not usually necessary to adjust the limit from 500, but in some cases "
-"performance gains can be achieved by setting a lower limit. We don't suggest "
-"going under 200, as low values will make the results worse."
-msgstr ""
-
-#: lib/contextual-help.php:50
-#, php-format
-msgid "For all the possible options, see the Codex documentation for %s."
-msgstr ""
-
-#: lib/contextual-help.php:55
-msgid "Restrictions"
-msgstr ""
-
-#: lib/contextual-help.php:57
-msgid ""
-"If you want the general search to target all posts, but have a single search "
-"form target only certain posts, you can add a hidden input variable to the "
-"search form."
-msgstr ""
-
-#: lib/contextual-help.php:58
-msgid ""
-"For example in order to restrict the search to categories 10, 14 and 17, you "
-"could add this to the search form:"
-msgstr ""
-
-#: lib/contextual-help.php:60
-msgid ""
-"To restrict the search to posts tagged with alfa AND beta, you could add "
-"this to the search form:"
-msgstr ""
-
-#: lib/contextual-help.php:67
-#, php-format
-msgid ""
-"For more exclusion options, see the Codex documentation for %s. For example, "
-"to exclude tag ID 10, use"
-msgstr ""
-
-#: lib/contextual-help.php:69
-#, php-format
-msgid ""
-"To exclude posts from the index and not just from the search, you can use "
-"the %s filter hook. This would not index posts that have a certain taxonomy "
-"term:"
-msgstr ""
-
-#: lib/contextual-help.php:71 lib/contextual-help.php:153
-#, php-format
-msgid ""
-"For more examples, see the related knowledge base posts."
-msgstr ""
-
-#: lib/contextual-help.php:76
-msgid "Exclusions"
-msgstr ""
-
-#: lib/contextual-help.php:95
-#, php-format
-msgid ""
-"By default, the User searches page shows 20 most common keywords. In order "
-"to see more, you can adjust the value with the %s filter hook, like this:"
-msgstr ""
-
-#: lib/contextual-help.php:97
-#, php-format
-msgid ""
-"The complete logs are stored in the %s database table, where you can access "
-"them if you need more information than what the User searches page provides."
-msgstr ""
-
-#: lib/contextual-help.php:102
-msgid "Logs"
-msgstr ""
-
-#: lib/contextual-help.php:112
-#, php-format
-msgid ""
-"Custom snippets require that the search results template uses %s to print "
-"out the excerpts."
-msgstr ""
-
-#: lib/contextual-help.php:114
-#, php-format
-msgid ""
-"If you want more control over what content Relevanssi uses to create the "
-"excerpts, you can use the %1$s and %2$s filter hooks to adjust the content."
-msgstr ""
-
-#: lib/contextual-help.php:116
-#, php-format
-msgid ""
-"Some shortcode do not work well with Relevanssi excerpt-generation. "
-"Relevanssi disables some shortcodes automatically to prevent problems. This "
-"can be adjusted with the %s filter hook."
-msgstr ""
-
-#: lib/contextual-help.php:118
-#, php-format
-msgid ""
-"If you want Relevanssi to build excerpts faster and don't mind that they may "
-"be less than perfect in quality, add a filter that returns true on hook %s."
-msgstr ""
-
-#: lib/contextual-help.php:123 lib/tabs/indexing-tab.php:398
-msgid "Excerpts"
-msgstr ""
-
-#: lib/contextual-help.php:125
-msgid ""
-"Building custom excerpts can be slow. If you are not actually using the "
-"excerpts, make sure you disable the option."
-msgstr ""
-
-#: lib/contextual-help.php:127
-msgid ""
-"Generally, Relevanssi generates the excerpts from post content. If you want "
-"to include custom field content in the excerpt-building, this can be done "
-"with a simple setting from the excerpt settings."
-msgstr ""
-
-#: lib/contextual-help.php:137
-#, php-format
-msgid ""
-"In order to see title highlights from Relevanssi, replace %1$s in the search "
-"results template with %2$s. It does the same thing, but supports Relevanssi "
-"title highlights."
-msgstr ""
-
-#: lib/contextual-help.php:142
-msgid "Highlights"
-msgstr ""
-
-#: lib/contextual-help.php:144
-msgid ""
-"Title highlights don't appear automatically, because that led to problems "
-"with highlights appearing in wrong places and messing up navigation menus, "
-"for example."
-msgstr ""
-
-#: lib/contextual-help.php:151
-#, php-format
-msgid ""
-"For more fine-tuned changes, you can use %1$s filter hook to adjust what is "
-"replaced with what, and %2$s filter hook to completely override the default "
-"punctuation control."
-msgstr ""
-
-#: lib/contextual-help.php:158
-msgid "Punctuation"
-msgstr ""
-
-#: lib/contextual-help.php:160
-msgid ""
-"Relevanssi removes punctuation. Some punctuation is removed, some replaced "
-"with spaces. Advanced indexing settings include some of the more common "
-"settings people want to change."
-msgstr ""
-
-#: lib/contextual-help.php:168
-#, php-format
-msgid ""
-"If you have content that you don't want indexed, you can wrap that content "
-"in a %s shortcode."
-msgstr ""
-
-#: lib/contextual-help.php:170
-#, php-format
-msgid ""
-"If you need a search form on some page on your site, you can use the %s "
-"shortcode to print out a basic search form."
-msgstr ""
-
-#: lib/contextual-help.php:172
-#, php-format
-msgid ""
-"If you need to add query variables to the search form, the shortcode takes "
-"parameters, which are then printed out as hidden input fields. To get a "
-"search form with a post type restriction, you can use %1$s. To restrict the "
-"search to categories 10, 14 and 17, you can use %2$s and so on."
-msgstr ""
-
-#: lib/contextual-help.php:174
-#, php-format
-msgid ""
-"You can use the %1$s parameter to add a taxonomy dropdown to the search "
-"form. Just use the name of the taxonomy, like %2$s. This works best with "
-"hierarchical taxonomies like categories with relatively few options "
-"available."
-msgstr ""
-
-#: lib/contextual-help.php:179
-msgid "Helpful shortcodes"
-msgstr ""
-
-#: lib/contextual-help.php:190
-#, php-format
-msgid ""
-"For more details how to fix that issue, see WooCommerce tips in "
-"Relevanssi user manual."
-msgstr ""
-
-#: lib/contextual-help.php:195
-msgid "WooCommerce"
-msgstr ""
-
-#: lib/contextual-help.php:197
-msgid ""
-"If your SKUs include hyphens or other punctuation, do note that Relevanssi "
-"replaces most punctuation with spaces. That's going to cause issues with SKU "
-"searches."
-msgstr ""
-
-#: lib/contextual-help.php:199
-msgid ""
-"If you don't want to index products that are out of stock, excluded from the "
-"catalog or excluded from the search, there's a product visibility filtering "
-"method that is described in the user manual (see link above)."
-msgstr ""
-
-#: lib/contextual-help.php:205
-#, php-format
-msgid ""
-"To adjust the amount of the exact match bonus, you can use the %s filter "
-"hook. It works like this:"
-msgstr ""
-
-#: lib/contextual-help.php:207
-#, php-format
-msgid "The default values are %1$s for titles and %2$s for content."
-msgstr ""
-
-#: lib/contextual-help.php:212
-msgid "Exact match bonus"
-msgstr ""
-
-#: lib/contextual-help.php:223 premium/contextual-help.php:97
-msgid "For more information:"
-msgstr ""
-
-#: lib/contextual-help.php:224 premium/contextual-help.php:101
-msgid "Plugin knowledge base"
-msgstr ""
-
-#: lib/contextual-help.php:225 premium/contextual-help.php:99
-msgid "WordPress.org forum"
-msgstr ""
-
-#: lib/debug.php:122
-msgid "Post not found"
-msgstr ""
-
-#: lib/indexing.php:31
-msgid "Relevanssi image attachment filter"
-msgstr ""
-
-#: lib/indexing.php:480 premium/common.php:575
-msgid "Relevanssi index exclude"
-msgstr ""
-
-#: lib/indexing.php:509
-msgid "Blocked by a filter function"
-msgstr ""
-
-#: lib/init.php:125
-msgid ""
-"You do not have an index! Remember to build the index (click the \"Build the "
-"index\" button), otherwise searching won't work."
-msgstr ""
-
-#: lib/init.php:137
-msgid ""
-"Multibyte string functions are not available. Relevanssi may not work well "
-"without them. Please install (or ask your host to install) the mbstring "
-"extension."
-msgstr ""
-
-#: lib/init.php:222 lib/init.php:223 lib/tabs/logging-tab.php:47
-#: lib/user-searches.php:18
-msgid "User searches"
-msgstr ""
-
-#: lib/init.php:234 lib/init.php:235 lib/tabs/searching-tab.php:258
-msgid "Admin search"
-msgstr ""
-
-#: lib/init.php:462
-msgid "Settings"
-msgstr ""
-
-#: lib/init.php:465
-msgid "Go Premium!"
-msgstr ""
-
-#: lib/interface.php:18
-msgid "Relevanssi Search Options"
-msgstr ""
-
-#: lib/interface.php:20
-msgid "Relevanssi Premium Search Options"
-msgstr ""
-
-#: lib/interface.php:108
-msgid "Admin Search"
-msgstr ""
-
-#: lib/interface.php:137
-msgid "Logs clear!"
-msgstr ""
-
-#: lib/interface.php:139
-msgid "Clearing the logs failed."
-msgstr ""
-
-#: lib/interface.php:177
-msgid "Overview"
-msgstr ""
-
-#: lib/interface.php:184 lib/tabs/overview-tab.php:47
-msgid "Indexing"
-msgstr ""
-
-#: lib/interface.php:191 premium/interface.php:1199
-msgid "Attachments"
-msgstr ""
-
-#: lib/interface.php:205
-msgid "Logging"
-msgstr ""
-
-#: lib/interface.php:212 lib/tabs/overview-tab.php:63
-msgid "Excerpts and highlights"
-msgstr ""
-
-#: lib/interface.php:219 lib/tabs/synonyms-tab.php:41
-#: lib/tabs/synonyms-tab.php:67 lib/tabs/synonyms-tab.php:98
-msgid "Synonyms"
-msgstr ""
-
-#: lib/interface.php:226 lib/tabs/stopwords-tab.php:22
-#: lib/tabs/stopwords-tab.php:144
-msgid "Stopwords"
-msgstr ""
-
-#: lib/interface.php:233 lib/tabs/redirects-tab.php:18
-#: premium/interface.php:1191 premium/tabs/redirects-tab.php:26
-msgid "Redirects"
-msgstr ""
-
-#: lib/interface.php:240 lib/tabs/debugging-tab.php:54
-msgid "Debugging"
-msgstr ""
-
-#: lib/interface.php:284 lib/tabs/indexing-tab.php:115
-#: premium/network-options.php:75
-msgid "Save the options"
-msgstr ""
-
-#: lib/interface.php:348
-msgid "Click OK to copy Relevanssi options to all subsites"
-msgstr ""
-
-#: lib/interface.php:349
-msgid "Are you sure you want to remove all stopwords?"
-msgstr ""
-
-#: lib/interface.php:350
-msgid "Are you sure you want to delete the query?"
-msgstr ""
-
-#: lib/interface.php:351
-msgid "Wiping out the index..."
-msgstr ""
-
-#: lib/interface.php:352
-msgid "Done."
-msgstr ""
-
-#: lib/interface.php:353
-msgid "Indexing users..."
-msgstr ""
-
-#: lib/interface.php:354
-msgid "Indexing the following taxonomies:"
-msgstr ""
-
-#: lib/interface.php:355
-msgid "Indexing attachments..."
-msgstr ""
-
-#: lib/interface.php:356
-msgid "Counting posts..."
-msgstr ""
-
-#: lib/interface.php:357
-msgid "Counting taxonomy terms..."
-msgstr ""
-
-#: lib/interface.php:358
-msgid "Counting users..."
-msgstr ""
-
-#: lib/interface.php:359
-msgid "Counting attachments..."
-msgstr ""
-
-#: lib/interface.php:360
-msgid "posts found."
-msgstr ""
-
-#: lib/interface.php:361
-msgid "taxonomy terms found."
-msgstr ""
-
-#: lib/interface.php:362
-msgid "users found."
-msgstr ""
-
-#: lib/interface.php:363
-msgid "attachments found."
-msgstr ""
-
-#: lib/interface.php:364
-msgid "Taxonomy term indexing is disabled."
-msgstr ""
-
-#: lib/interface.php:365
-msgid "User indexing is disabled."
-msgstr ""
-
-#: lib/interface.php:366
-msgid "Indexing complete."
-msgstr ""
-
-#: lib/interface.php:367
-msgid "posts excluded."
-msgstr ""
-
-#: lib/interface.php:368
-msgid "Settings have changed, please save the options before indexing."
-msgstr ""
-
-#: lib/interface.php:369
-msgid "Reload the page to refresh the state of the index."
-msgstr ""
-
-#: lib/interface.php:370
-msgid "Are you sure you want to delete all attachment content from the index?"
-msgstr ""
-
-#: lib/interface.php:371
-msgid "Relevanssi attachment data wiped clean."
-msgstr ""
-
-#: lib/interface.php:372
-msgid "There were problems wiping the Relevanssi attachment data clean."
-msgstr ""
-
-#: lib/interface.php:373
-msgid "hour"
-msgstr ""
-
-#: lib/interface.php:374
-msgid "hours"
-msgstr ""
-
-#: lib/interface.php:375
-msgid "about"
-msgstr ""
-
-#: lib/interface.php:376
-msgid "about an hour"
-msgstr ""
-
-#: lib/interface.php:377
-msgid "about an hour and a half"
-msgstr ""
-
-#: lib/interface.php:378
-msgid "minute"
-msgstr ""
-
-#: lib/interface.php:379
-msgid "minutes"
-msgstr ""
-
-#: lib/interface.php:380
-msgid "less than a minute"
-msgstr ""
-
-#: lib/interface.php:381
-msgid "we're done!"
-msgstr ""
-
-#: lib/interface.php:448
-msgid "Tag weight"
-msgstr ""
-
-#: lib/interface.php:456
-msgid "Category weight"
-msgstr ""
-
-#: lib/log.php:202
-msgid "Logged searches"
-msgstr ""
-
-#: lib/log.php:205
-msgid "Time"
-msgstr ""
-
-#: lib/log.php:209 lib/user-searches.php:319 lib/user-searches.php:333
-#: premium/click-tracking.php:641 premium/tabs/redirects-tab.php:52
-msgid "Query"
-msgstr ""
-
-#: lib/log.php:213
-msgid "Hits found"
-msgstr ""
-
-#: lib/log.php:217
-msgid "IP address"
-msgstr ""
-
-#: lib/log.php:221
-msgid "Session ID"
-msgstr ""
-
-#: lib/log.php:307
-msgid "No search keywords logged."
-msgstr ""
-
-#: lib/log.php:402
-#, php-format
-msgid "The query '%s' deleted from the log."
-msgstr ""
-
-#: lib/log.php:414
-#, php-format
-msgid "Couldn't remove the query '%s' from the log."
-msgstr ""
-
-#: lib/privacy.php:34
-msgid "What personal data we collect and why we collect it"
-msgstr ""
-
-#: lib/privacy.php:36
-msgid "IP address for searches"
-msgstr ""
-
-#: lib/privacy.php:37
-msgid ""
-"All searches performed using the internal site search are logged in the "
-"database, including the following information: the search query, the number "
-"of hits found, user ID for users who are logged in, date and time and the IP "
-"address. The IP address is stored for security and auditing purposes."
-msgstr ""
-
-#: lib/privacy.php:39
-msgid ""
-"All searches performed using the internal site search are logged in the "
-"database, including the following information: the search query, the number "
-"of hits found, user ID for users who are logged in and date and time."
-msgstr ""
-
-#: lib/privacy.php:42
-msgid "How long we retain your data"
-msgstr ""
-
-#: lib/privacy.php:45
-#, php-format
-msgid ""
-"The search logs are stored for %d days before they are automatically removed."
-msgstr ""
-
-#: lib/privacy.php:47
-msgid "The search logs are stored indefinitely."
-msgstr ""
-
-#: lib/privacy.php:64 lib/privacy.php:81
-msgid "Relevanssi Search Logs"
-msgstr ""
-
-#: lib/shortcodes.php:166
-msgid "None"
-msgstr ""
-
-#: lib/stopwords.php:42
-msgid "Added stopwords from the database."
-msgstr ""
-
-#: lib/stopwords.php:57
-#, php-format
-msgid "The stopword file for the language '%s' doesn't exist."
-msgstr ""
-
-#: lib/stopwords.php:73
-msgid "Couldn't read the stopwords from the file."
-msgstr ""
-
-#: lib/stopwords.php:83
-msgid "Added stopwords from the stopword file."
-msgstr ""
-
-#: lib/stopwords.php:142
-#, php-format
-msgid "Successfully added %1$d/%2$d terms to stopwords!"
-msgstr ""
-
-#: lib/stopwords.php:161
-#, php-format
-msgid "Term '%s' added to stopwords!"
-msgstr ""
-
-#: lib/stopwords.php:170
-#, php-format
-msgid "Couldn't add term '%s' to stopwords!"
-msgstr ""
-
-#: lib/stopwords.php:321
-msgid "All stopwords removed! Remember to re-index."
-msgstr ""
-
-#: lib/stopwords.php:329
-msgid "There was a problem, and stopwords couldn't be removed."
-msgstr ""
-
-#: lib/stopwords.php:366
-#, php-format
-msgid "Term '%s' removed from stopwords! Re-index to get it back to index."
-msgstr ""
-
-#: lib/stopwords.php:379
-#, php-format
-msgid "Couldn't remove term '%s' from stopwords!"
-msgstr ""
-
-#: lib/tabs/attachments-tab.php:18
-msgid "Indexing attachment content"
-msgstr ""
-
-#: lib/tabs/attachments-tab.php:20
-msgid ""
-"With Relevanssi Premium, you can index the text contents of attachments "
-"(PDFs, Word documents, Open Office documents and many other types). The "
-"contents of the attachments are processed on an external service, which "
-"makes the feature reliable and light on your own server performance."
-msgstr ""
-
-#: lib/tabs/attachments-tab.php:22 lib/tabs/redirects-tab.php:22
-#, php-format
-msgid ""
-"In order to access this and many other delightful Premium features, %1$sbuy "
-"Relevanssi Premium here%2$s."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:56
-msgid ""
-"In order to figure out problems with indexing posts, you can test how "
-"Relevanssi sees the post by entering the post ID number in the field below."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:60
-msgid ""
-"You can also check user profiles and taxonomy terms by choosing the type "
-"from the dropdown."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:65
-#, php-format
-msgid ""
-"In Relevanssi Premium, you can find this feature for each post on the post "
-"edit page. %1$sBuy Relevanssi Premium here%2$s."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:68 lib/tabs/debugging-tab.php:110
-msgid "The ID"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:83 premium/click-tracking.php:487
-msgid "Post"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:87
-msgid "Taxonomy term"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:91
-msgid "User"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:100 lib/tabs/debugging-tab.php:122
-msgid "Check the post"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:106
-msgid "What does the post look like in the database?"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:108
-msgid ""
-"This feature will show you how the post looks like in the database. It can "
-"sometimes be very helpful for debugging why a post isn't indexed the way you "
-"expect it to be."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:128
-msgid "Debugging information"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:143
-msgid "Indexing query"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:150
-msgid "Debugging mode"
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:157 lib/tabs/debugging-tab.php:160
-msgid "Enable the debugging mode."
-msgstr ""
-
-#: lib/tabs/debugging-tab.php:162
-msgid ""
-"Relevanssi support may ask you to enable the debugging mode. When you check "
-"this box, it's possible to see debugging information from the front-end."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:86
-msgid "Custom excerpts/snippets"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:91
-msgid "Custom search result snippets"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:96
-msgid "Create custom search result snippets"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:98
-msgid "Only enable this if you actually use the custom excerpts."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:105
-#, php-format
-msgid ""
-"Looks like you are using Divi. In order to use custom excerpts with Divi, "
-"you need to make some changes to your templates. %1$sSee instructions "
-"here%2$s."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:117
-msgid "Length of the snippet"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:127
-msgid "Excerpt length type"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:135
-msgid "characters"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:136
-msgid "words"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:138
-msgid ""
-"Using words is much faster than characters. Don't use characters, unless you "
-"have a really good reason and your posts are short."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:154
-msgid "Allowable tags in excerpts"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:164
-msgid ""
-"List all tags you want to allow in excerpts. For example: <p><a>"
-"<strong>."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:175
-msgid "Use custom fields for excerpts"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:186
-msgid "Use custom field content for building excerpts"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:188
-msgid ""
-"Use the custom fields setting for indexing for excerpt-making as well. "
-"Enabling this option will show custom field content in Relevanssi-generated "
-"excerpts."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:191
-msgid "Enable this option to use PDF content for excerpts."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:204
-msgid "Create custom field specific excerpts"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:206
-msgid ""
-"The default method of adding custom field content to excerpts cannot tell "
-"which custom fields is the source of the excerpts. Using custom field "
-"specific excerpts is slower, but you can tell which custom field was the "
-"source of the excerpt."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:208
-msgid "Current custom field setting"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:211
-msgid "all visible custom fields"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:213
-msgid "all custom fields"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:217
-msgid "Just PDF content"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:219
-msgid "None selected"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:228 lib/tabs/excerpts-tab.php:231
-msgid "List custom fields"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:232
-msgid "Click the button above to see the list of indexed custom fields."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:235
-msgid ""
-"Fields excluded from ACF settings and with filter functions are included "
-"here."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:242
-msgid "Search hit highlighting"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:253
-msgid "Highlight type"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:263
-msgid "No highlighting"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:267 lib/tabs/excerpts-tab.php:277
-msgid "Text color"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:268 lib/tabs/excerpts-tab.php:291
-msgid "Background color"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:269
-msgid "CSS Style"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:270
-msgid "CSS Class"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:272 lib/tabs/excerpts-tab.php:435
-msgid "Requires custom snippets to work."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:305
-msgid "CSS style for highlights"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:316
-#, php-format
-msgid ""
-"The highlights will be wrapped in a %s with this CSS in the style parameter."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:321
-msgid "CSS class for highlights"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:332
-#, php-format
-msgid "The highlights will be wrapped in a %s with this class."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:337
-msgid "Highlight in titles"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:348
-msgid "Highlight query terms in titles"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:351
-#, php-format
-msgid ""
-"Highlights in titles require changes to the search results template. You "
-"need to replace %1$s in the search results template with %2$s. For more "
-"information, see the contextual help."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:356
-msgid "Highlight in documents"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:367
-msgid "Highlight query terms in documents"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:370
-#, php-format
-msgid ""
-"Highlights hits when user opens the post from search results. This requires "
-"an extra parameter (%s) to the links from the search results pages, which "
-"Relevanssi should add automatically."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:375
-msgid "Highlight in comments"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:386
-msgid "Highlight query terms in comments"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:388
-msgid ""
-"Highlights hits in comments when user opens the post from search results."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:393
-msgid "Expand highlights"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:404
-msgid "Expand highlights to cover full words"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:406
-msgid ""
-"When a highlight matches part of the word, if this option is enabled, the "
-"highlight will be expanded to highlight the whole word."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:411
-msgid "Breakdown of search results"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:422
-msgid "Breakdown of search hits in excerpts"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:433
-msgid "Show the breakdown of search hits in the excerpts."
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:440
-msgid "The breakdown format"
-msgstr ""
-
-#: lib/tabs/excerpts-tab.php:450
-msgid ""
-"Use %body%, %title%, %categories%, %tags%, %taxonomies%, %comments%, "
-"%customfields%, %author%, %excerpt% and %mysqlcolumns% to display the number "
-"of hits (in different parts of the post), %total% for total hits, %score% to "
-"display the document weight and %terms% to show how many hits each search "
-"term got."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:116 lib/tabs/indexing-tab.php:122
-msgid "Build the index"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:117 lib/tabs/indexing-tab.php:124
-msgid "Index unindexed posts"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:122
-#, php-format
-msgid "%s empties the existing index and rebuilds it from scratch."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:124
-#, php-format
-msgid ""
-"%s doesn't empty the index and only indexes those posts that are not "
-"indexed. You can use it if you have to interrupt building the index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:127
-msgid "This doesn't index any taxonomy terms or users."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:134 premium/tabs/attachments-tab.php:62
-msgid "Time elapsed"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:134 premium/tabs/attachments-tab.php:62
-msgid "Time remaining"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:134 premium/tabs/attachments-tab.php:62
-msgid "some time"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:136
-msgid ""
-"Indexing should respond quickly. If nothing happens in couple of minutes, "
-"it's probably stuck. The most common reasons for indexing issues are "
-"incompatible shortcodes, so try disabling the shortcode expansion setting "
-"and try again. Also, if you've just updated Relevanssi, doing a hard refresh "
-"in your browser will make sure your browser is not trying to use an outdated "
-"version of the Relevanssi scripts."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:140
-msgid "State of the index"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:141
-msgid "document in the index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:143
-msgid "user in the index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:144
-msgid "taxonomy term in the index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:147
-msgid "term in the index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:148
-msgid "is the lowest post ID indexed."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:150
-#, php-format
-msgid ""
-"These values may be inaccurate. If you need exact values, %1$supdate the "
-"counts%2$s"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:160
-msgid ""
-"WARNING: You've chosen no post types to index. Nothing will be indexed. "
-"Choose some post types to index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:165
-msgid "Indexing options"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:167
-msgid ""
-"Any changes to the settings on this page require reindexing before they take "
-"effect."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:171
-msgid "Post types"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:175
-msgid "Post types to index"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:179
-msgid "Type"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:180 lib/tabs/indexing-tab.php:272
-#: premium/interface.php:720
-msgid "Index"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:181
-msgid "Excluded from search?"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:198
-#, php-format
-msgid "Index post type %s"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:200 lib/tabs/indexing-tab.php:294
-#: premium/interface.php:737 premium/interface.php:748
-msgid "yes"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:202
-#, php-format
-msgid "Post type %s is excluded from search"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:204 lib/tabs/indexing-tab.php:290
-#: premium/interface.php:739 premium/interface.php:744
-msgid "no"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:206
-#, php-format
-msgid "Post type %s can be searched"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:237
-msgid ""
-"If you want to index a post type that's marked 'Excluded from search', you "
-"can do that without worrying about it – but you need to uncheck the 'Respect "
-"exclude_from_search' setting from the Searching tab."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:249
-msgid "Index image files"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:254
-msgid "Index image attachments"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:256
-msgid ""
-"If this option is enabled, Relevanssi will include image attachments in the "
-"index. If the option is disabled, only other attachment types are included."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:258
-#, php-format
-msgid ""
-"For more detailed control over the attachment type indexing, see "
-"%1$sControlling attachment types in the Knowledge base%2$s."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:264 premium/interface.php:713
-msgid "Taxonomies"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:271 premium/interface.php:719
-msgid "Taxonomy"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:273 premium/interface.php:721
-msgid "Public?"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:289
-#, php-format
-msgid "Index taxonomy %s"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:292 premium/interface.php:746
-#, php-format
-msgid "Taxonomy %s is not public"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:296 premium/interface.php:750
-#, php-format
-msgid "Taxonomy %s is public"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:318
-msgid ""
-"If you check a taxonomy here, the terms for that taxonomy are indexed with "
-"the posts. If you for example choose \"post_tag\", searching for a tag will "
-"find all posts that have the tag."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:329 lib/tabs/indexing-tab.php:343
-msgid "none"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:330
-msgid "comments"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:331
-msgid "comments and pingbacks"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:333
-msgid ""
-"If you choose to index comments, you can choose if you want to index just "
-"comments, or everything including comments and track- and pingbacks."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:344
-msgid "all"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:345
-msgid "visible"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:346 lib/tabs/indexing-tab.php:378
-msgid "some"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:350
-msgid "'All' indexes all custom fields for posts."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:352
-msgid ""
-"'Visible' only includes the custom fields that are visible in the user "
-"interface (with names that don't start with an underscore)."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:354
-msgid "'Some' lets you choose individual custom fields to index."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:360
-msgid ""
-"Advanced Custom Fields has lots of invisible custom fields with meta data. "
-"Selecting \"all\" will include lots of garbage in the index and excerpts. "
-"\"Visible\" is usually a better option with ACF."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:371
-msgid "Custom fields to index"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:373
-msgid ""
-"Enter a comma-separated list of custom fields to include in the index. With "
-"Relevanssi Premium, you can also use 'fieldname_%_subfieldname' notation for "
-"ACF repeater fields."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:374
-msgid ""
-"You can use 'relevanssi_index_custom_fields' filter hook to adjust which "
-"custom fields are indexed."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:378
-#, php-format
-msgid ""
-"If you want the SKU included, choose %1$s and enter %2$s. Also see the "
-"contextual help for more details."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:385
-msgid "Author display names"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:390
-msgid "Index the post author display name"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:392
-msgid ""
-"Searching for the post author display name will return posts by that author."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:403
-msgid "Index the post excerpt"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:405
-msgid "Relevanssi will find posts by the content in the excerpt."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:407
-msgid ""
-"WooCommerce stores the product short description in the excerpt, so it's a "
-"good idea to index excerpts."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:414
-msgid "Shortcodes"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:419
-msgid "Expand shortcodes"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:424
-msgid "Expand shortcodes when indexing"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:427
-msgid ""
-"WooCommerce has shortcodes that don't work well with Relevanssi. With "
-"WooCommerce, make sure the option is disabled."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:429
-msgid ""
-"If checked, Relevanssi will expand shortcodes in post content before "
-"indexing. Otherwise shortcodes will be stripped."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:430
-msgid ""
-"If you use shortcodes to include dynamic content, Relevanssi will not keep "
-"the index updated, the index will reflect the status of the shortcode "
-"content at the moment of indexing."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:444
-msgid "Advanced indexing settings"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:446
-msgid "Show advanced settings"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:451
-msgid "Minimum word length"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:455
-msgid "Words shorter than this many letters will not be indexed."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:457
-#, php-format
-msgid ""
-"To enable one-letter searches, you need to add a filter function on the "
-"filter hook %1$s that returns %2$s."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:461
-msgid "Punctuation control"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:462
-msgid ""
-"Here you can adjust how the punctuation is controlled. For more information, "
-"see help. Remember that any changes here require reindexing, otherwise "
-"searches will fail to find posts they should."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:466
-msgid "Hyphens and dashes"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:470 lib/tabs/indexing-tab.php:497
-#: lib/tabs/indexing-tab.php:511
-msgid "Keep"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:471 lib/tabs/indexing-tab.php:484
-#: lib/tabs/indexing-tab.php:498 lib/tabs/indexing-tab.php:512
-msgid "Replace with spaces"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:472 lib/tabs/indexing-tab.php:485
-#: lib/tabs/indexing-tab.php:499 lib/tabs/indexing-tab.php:513
-#: premium/tabs/redirects-tab.php:66 premium/tabs/redirects-tab.php:108
-msgid "Remove"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:474
-msgid ""
-"How Relevanssi should handle hyphens and dashes (en and em dashes)? "
-"Replacing with spaces is generally the best option, but in some cases "
-"removing completely is the best option. Keeping them is rarely the best "
-"option."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:480
-msgid "Apostrophes and quotes"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:487
-msgid ""
-"How Relevanssi should handle apostrophes and quotes? It's not possible to "
-"keep them; that would lead to problems. Default behaviour is to replace with "
-"spaces, but sometimes removing makes sense."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:493
-msgid "Ampersands"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:501
-msgid ""
-"How Relevanssi should handle ampersands? Replacing with spaces is generally "
-"the best option, but if you talk a lot about D&D, for example, keeping "
-"the ampersands is useful."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:507
-msgid "Decimal separators"
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:515
-msgid ""
-"How Relevanssi should handle periods between decimals? Replacing with spaces "
-"is the default option, but that often leads to the numbers being removed "
-"completely. If you need to search decimal numbers a lot, keep the periods."
-msgstr ""
-
-#: lib/tabs/indexing-tab.php:525
-msgid "Hide advanced settings"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:32
-msgid "Enable logs"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:36 lib/tabs/logging-tab.php:39
-msgid "Keep a log of user queries."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:46
-#, php-format
-msgid ""
-"If enabled, Relevanssi will log user queries. The logs can be examined under "
-"'%1$s' on the Dashboard admin menu and are stored in the %2$s database table."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:56
-msgid "Log user IP"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:60 lib/tabs/logging-tab.php:63
-msgid "Log the user's IP with the queries."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:66
-msgid ""
-"If enabled, Relevanssi will log user's IP adress with the queries. Note that "
-"this may be illegal where you live, and in EU will create a person registry "
-"that falls under the GDPR."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:71
-msgid "Exclude users"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:75
-msgid ""
-"Comma-separated list of numeric user IDs or user login names that will not "
-"be logged."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:85 premium/click-tracking.php:735
-msgid "Trim logs"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:89
-msgid "How many days of logs to keep in the database."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:93
-msgid ""
-"Big log database table will eventually start to slow down the search, so "
-"it's a good idea to use some level of automatic log trimming."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:98
-#, php-format
-msgid "Set to %d for no trimming."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:107
-msgid "Export logs"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:110
-msgid "Export the log as a CSV file"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:111
-msgid "Push the button to export the search log as a CSV file."
-msgstr ""
-
-#: lib/tabs/logging-tab.php:122 premium/click-tracking.php:709
-msgid "Click tracking"
-msgstr ""
-
-#: lib/tabs/logging-tab.php:123
-msgid ""
-"Relevanssi Premium has a click tracking feature where you can track which "
-"posts are clicked from the search results. That way you can tell what is "
-"your most interesting content and how the search is actually used to access "
-"posts."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:22
-msgid "Welcome to Relevanssi!"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:41
-msgid "Getting started"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:43
-msgid ""
-"You've already installed Relevanssi. That's a great first step towards good "
-"search experience!"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:47
-#, php-format
-msgid ""
-"Now, you need an index. Head over to the %1$s%2$s%3$s tab to set up the "
-"basic indexing options and to build the index."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:48
-msgid "You need to check at least the following options:"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:49
-msgid "Make sure the post types you want to include in the index are indexed."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:51
-#, php-format
-msgid ""
-"Do you use custom fields to store content you want included? If so, add "
-"those too. WooCommerce user? You probably want to include %s."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:52
-msgid ""
-"Then just save the options and build the index. First time you have to do it "
-"manually, but after that, it's fully automatic: all changes are reflected in "
-"the index without reindexing. (That said, it's a good idea to rebuild the "
-"index once a year.)"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:55
-msgid "Great, you already have an index!"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:59
-#, php-format
-msgid ""
-"On the %1$s%2$s%3$s tab, choose whether you want the default operator to be "
-"AND (less results, but more precise) or OR (more results, less precise)."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:63
-#, php-format
-msgid ""
-"The next step is the %1$s%2$s%3$s tab, where you can enable the custom "
-"excerpts that show the relevant part of post in the search results pages."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:64
-msgid ""
-"There are couple of options related to that, so if you want highlighting in "
-"the results, you can adjust the styles for that to suit the look of your "
-"site."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:67
-msgid ""
-"That's about it! Now you should have Relevanssi up and running. The rest of "
-"the options is mostly fine-tuning."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:70
-msgid ""
-"Relevanssi doesn't have a separate search widget. Instead, Relevanssi uses "
-"the default search widget. Any standard search form will do!"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:74
-msgid "Relevanssi Live Ajax Search"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:77
-#, php-format
-msgid ""
-"If you want a live search results, you can use the Relevanssi Live Ajax "
-"Search plugin. %1$sYou can find it in the plugin repository%2$s. It will "
-"make your search forms show instant results, powered by Relevanssi."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:81
-msgid "Privacy and GDPR compliance"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:84
-#, php-format
-msgid ""
-"%1$sGDPR Compliance at Relevanssi knowledge base%2$s explains how using "
-"Relevanssi affects the GDPR compliance and the privacy policies of your "
-"site. Relevanssi also supports the %3$sprivacy policy tool%2$s and the "
-"WordPress user data export and erase tools."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:88
-msgid "For more information"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:90
-msgid ""
-"Relevanssi uses the WordPress contextual help. Click 'Help' on the top right "
-"corner for more information on many Relevanssi topics."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:92
-#, php-format
-msgid ""
-"%1$sRelevanssi knowledge base%2$s has lots of information about advanced "
-"Relevanssi use, including plenty of code samples."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:96
-msgid "Do you like Relevanssi?"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:98
-msgid ""
-"If you do, the best way to show your appreciation is to spread the word and "
-"perhaps give us a good review on WordPress.org."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:100
-#, php-format
-msgid ""
-"If you like Relevanssi, leaving a five-star review on WordPress.org will "
-"help others discover Relevanssi. %1$sYou can add your review here%2$s."
-msgstr ""
-
-#: lib/tabs/overview-tab.php:106
-msgid "Buy Relevanssi Premium"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:109
-msgid "Buy Relevanssi Premium now"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:111
-#, php-format
-msgid ""
-"use coupon code %1$s for 20%% discount (valid at least until the end of %2$s)"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:112
-msgid "Here are some improvements Relevanssi Premium offers:"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:114
-msgid "PDF content indexing"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:115
-msgid "A Related posts feature"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:116
-msgid "Index and search user profile pages"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:117
-msgid "Index and search taxonomy term pages"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:118
-msgid "Multisite searches across many subsites"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:119
-msgid "WP CLI commands"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:120
-msgid "Adjust weights separately for each post type and taxonomy"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:121
-msgid "Internal link anchors can be search terms for the target posts"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:122
-msgid "Index and search any columns in the wp_posts database"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:123
-msgid ""
-"Hide Relevanssi branding from the User Searches page on a client installation"
-msgstr ""
-
-#: lib/tabs/overview-tab.php:124
-msgid "Redirect search queries to custom URLs"
-msgstr ""
-
-#: lib/tabs/redirects-tab.php:20
-msgid ""
-"With Relevanssi Premium, you can set up redirects. These are keywords that "
-"automatically redirect the user to certain page, without going through the "
-"usual search process. For example, you could set it up so that all searches "
-"for \"job\" automatically lead to your \"Careers\" page."
-msgstr ""
-
-#: lib/tabs/search-page.php:18
-msgid ""
-"You can use this search to perform Relevanssi searches without any "
-"restrictions from WordPress. You can search all post types here."
-msgstr ""
-
-#: lib/tabs/search-page.php:24
-msgid "Search terms"
-msgstr ""
-
-#: lib/tabs/search-page.php:32
-msgid "Post type"
-msgstr ""
-
-#: lib/tabs/search-page.php:36
-msgid "Any"
-msgstr ""
-
-#: lib/tabs/search-page.php:55
-msgid "Users"
-msgstr ""
-
-#: lib/tabs/search-page.php:64
-msgid "Posts per page"
-msgstr ""
-
-#: lib/tabs/search-page.php:68
-msgid "All"
-msgstr ""
-
-#: lib/tabs/search-page.php:77
-msgid "Search parameters"
-msgstr ""
-
-#: lib/tabs/search-page.php:82
-#, php-format
-msgid ""
-"Use query parameter formatting here, the same that would appear on search "
-"page results URL. For example %s."
-msgstr ""
-
-#: lib/tabs/search-page.php:89
-msgid "Search"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:76
-msgid "Default operator"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:80
-msgid "AND - require all terms"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:81
-msgid "OR - any term present is enough"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:83
-msgid "This setting determines the default operator for the search."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:87
-#, php-format
-msgid ""
-"You can override this setting with the %1$s query parameter, like this: %2$s"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:94
-msgid "Fallback to OR"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:98 lib/tabs/searching-tab.php:101
-msgid "Disable the OR fallback."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:104
-msgid ""
-"By default, if AND search fails to find any results, Relevanssi will switch "
-"the operator to OR and run the search again. You can prevent that by "
-"checking this option."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:109
-msgid "Default order"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:113
-msgid "Relevance (highly recommended)"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:114
-msgid "Post date"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:117
-#, php-format
-msgid ""
-"If you want to override this or use multi-layered ordering (eg. first order "
-"by relevance, but sort ties by post title), you can use the %s query "
-"variable. See Help for more information."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:119
-msgid ""
-"If you want date-based results, see the recent post bonus in the Weights "
-"section."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:125
-msgid "Keyword matching"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:129
-msgid "Whole words"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:130 lib/tabs/searching-tab.php:135
-msgid "Partial words"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:131
-msgid "Partial words if no hits for whole words"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:135
-#, php-format
-msgid ""
-"Choosing the \"%1$s\" option may lead to unexpected results. Most of the "
-"time the \"%2$s\" option is the better choice."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:135
-msgid "Partial words if not hits for whole words"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:137
-msgid ""
-"Whole words means Relevanssi only finds posts that include the whole search "
-"term."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:138
-msgid ""
-"Partial words also includes cases where the word in the index begins or ends "
-"with the search term (searching for 'ana' will match 'anaconda' or 'banana', "
-"but not 'banal'). See Help, if you want to make Relevanssi match also inside "
-"words."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:143
-msgid "Weights"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:146
-msgid ""
-"All the weights in the table are multipliers. To increase the weight of an "
-"element, use a higher number. To make an element less significant, use a "
-"number lower than 1."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:150
-msgid "Element"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:151
-msgid "Weight"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:156
-msgid "Content"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:164
-msgid "Titles"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:177
-msgid "Comment text"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:206
-msgid "Boost exact matches"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:210 lib/tabs/searching-tab.php:213
-msgid "Give boost to exact matches."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:217
-#, php-format
-msgid ""
-"If you enable this option, matches where the search query appears in title "
-"or content as a phrase will get a weight boost. To adjust the boost, you can "
-"use the %s filter hook. See Help for more details."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:225
-msgid "WPML"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:229 lib/tabs/searching-tab.php:232
-msgid "Limit results to current language."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:235
-msgid ""
-"Enabling this option will restrict the results to the currently active "
-"language. If the option is disabled, results will include posts in all "
-"languages."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:242
-msgid "Polylang"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:246 lib/tabs/searching-tab.php:249
-msgid "Allow results from all languages."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:252
-msgid ""
-"By default Polylang restricts the search to the current language. Enabling "
-"this option will lift this restriction."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:262 lib/tabs/searching-tab.php:265
-msgid "Use Relevanssi for admin searches."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:268
-msgid ""
-"If checked, Relevanssi will be used for searches in the admin interface. The "
-"page search doesn't use Relevanssi, because WordPress works like that."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:274
-#, php-format
-msgid "Respect %s"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:278
-msgid "Respect exclude_from_search for custom post types"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:282
-#, php-format
-msgid "Respect %s for custom post types"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:284
-msgid ""
-"If checked, Relevanssi won't display posts of custom post types that have "
-"'exclude_from_search' set to true."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:296
-msgid ""
-"You probably should uncheck this option, because you've set Relevanssi to "
-"index the following non-public post types:"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:309
-msgid "Throttle searches"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:314 lib/tabs/searching-tab.php:317
-msgid "Throttle searches."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:321
-msgid "Your database is so small that you don't need to enable this."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:323
-msgid ""
-"If this option is checked, Relevanssi will limit search results to at most "
-"500 results per term. This will improve performance, but may cause some "
-"relevant documents to go unfound. See Help for more details."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:325
-msgid ""
-"You have the default ordering set to post date and have enabled user or "
-"taxonomy term indexing. If you enable the throttle, the search results will "
-"only include posts. Users and taxonomy terms will be excluded. Either keep "
-"the throttle disabled or set the post ordering to relevance."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:332 lib/tabs/searching-tab.php:338
-msgid "Category restriction"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:358
-msgid ""
-"You can restrict search results to a category for all searches. For "
-"restricting on a per-search basis and more options (eg. tag restrictions), "
-"see Help."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:363 lib/tabs/searching-tab.php:369
-msgid "Category exclusion"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:389
-msgid ""
-"Posts in these categories are not included in search results. To exclude the "
-"posts completely from the index, see Help."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:394
-msgid "Post exclusion"
-msgstr ""
-
-#: lib/tabs/searching-tab.php:398
-msgid ""
-"Enter a comma-separated list of post or page ID's to exclude those pages "
-"from the search results."
-msgstr ""
-
-#: lib/tabs/searching-tab.php:400
-msgid ""
-"With Relevanssi Premium, it's better to use the check box on post edit "
-"pages. That will remove the posts completely from the index, and will work "
-"with multisite searches unlike this setting."
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:29
-msgid "Content stopwords"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:38
-msgid ""
-"Content stopwords are a premium feature where you can set stopwords that "
-"only apply to the post content. Those stopwords will still be indexed if "
-"they appear in post titles, tags, categories, custom fields or other parts "
-"of the post. To use content stopwords, you need Relevanssi Premium."
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:68
-msgid ""
-"Enter a word here to add it to the list of stopwords. The word will "
-"automatically be removed from the index, so re-indexing is not necessary. "
-"You can enter many words at the same time, separate words with commas."
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:76
-msgid "Stopword(s) to add"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:80 premium/body-stopwords.php:311
-msgid "Add"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:84
-msgid ""
-"Here's a list of stopwords in the database. Click a word to remove it from "
-"stopwords. Removing stopwords won't automatically return them to index, so "
-"you need to re-index all posts after removing stopwords to get those words "
-"back to index."
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:89
-msgid "Current stopwords"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:111
-msgid "Remove all stopwords"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:118
-msgid "Add default stopwords"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:126 lib/tabs/stopwords-tab.php:129
-msgid "Exportable list of stopwords"
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:131
-msgid ""
-"You can copy the list of stopwords here if you want to back up the list, "
-"copy it to a different blog or otherwise need the list."
-msgstr ""
-
-#: lib/tabs/stopwords-tab.php:146
-msgid ""
-"You are using Polylang and are in \"Show all languages\" mode. Please select "
-"a language before adjusting the stopword settings."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:54
-msgid "No synonyms!"
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:57
-msgid ""
-"Synonyms are disabled because the searching operator is set to AND. Enable "
-"OR searching to use the synonyms."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:59
-msgid ""
-"If you want to use synonyms in AND searches, enable synonym indexing on the "
-"Indexing tab. Also, any changes to the synonyms won't take effect until you "
-"rebuild the index."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:61
-msgid ""
-"Relevanssi Premium has a feature that allows you to include the synonyms in "
-"the indexing. This makes it possible to use synonyms in AND searches."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:70
-msgid ""
-"Add synonyms here to make the searches find better results. If you notice "
-"your users frequently misspelling a product name, or for other reasons use "
-"many names for one thing, adding synonyms will make the results better."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:72
-msgid ""
-"Do not go overboard, though, as too many synonyms can make the search "
-"confusing: users understand if a search query doesn't match everything, but "
-"they get confused if the searches match to unexpected things."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:82
-msgid ""
-"The format here is key = value. If you add dog = hound"
-"code> to the list of synonyms, searches for dog automatically "
-"become a search for dog hound and will thus match to posts that "
-"include either dog or hound. This only works in OR "
-"searches: in AND searches the synonyms only restrict the search, as now the "
-"search only finds posts that contain bothdog "
-"and hound."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:84
-msgid ""
-"The synonyms are one direction only. If you want both directions, add the "
-"synonym again, reversed: hound = dog."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:86
-msgid ""
-"It's possible to use phrases for the value, but not for the key. dog = "
-"\"great dane\" works, but \"great dane\" = dog doesn't."
-msgstr ""
-
-#: lib/tabs/synonyms-tab.php:100
-msgid ""
-"You are using Polylang and are in \"Show all languages\" mode. Please select "
-"a language before adjusting the synonym settings."
-msgstr ""
-
-#: lib/user-searches.php:20
-msgid "Relevanssi User Searches"
-msgstr ""
-
-#: lib/user-searches.php:44
-msgid "Enable query logging to see stats here."
-msgstr ""
-
-#: lib/user-searches.php:91
-msgid "From:"
-msgstr ""
-
-#: lib/user-searches.php:92
-msgid "To:"
-msgstr ""
-
-#: lib/user-searches.php:93
-msgid "Filter"
-msgstr ""
-
-#: lib/user-searches.php:96
-msgid "Year so far"
-msgstr ""
-
-#: lib/user-searches.php:97
-msgid "This month"
-msgstr ""
-
-#: lib/user-searches.php:98
-msgid "Last month"
-msgstr ""
-
-#: lib/user-searches.php:99
-msgid "30 days"
-msgstr ""
-
-#: lib/user-searches.php:100
-msgid "This week"
-msgstr ""
-
-#: lib/user-searches.php:101
-msgid "Last week"
-msgstr ""
-
-#: lib/user-searches.php:102
-msgid "7 days"
-msgstr ""
-
-#: lib/user-searches.php:103
-msgid "All history"
-msgstr ""
-
-#: lib/user-searches.php:112 premium/click-tracking.php:475
-msgid "# of Searches"
-msgstr ""
-
-#: lib/user-searches.php:120
-msgid "Total searches"
-msgstr ""
-
-#: lib/user-searches.php:125
-msgid "Searches that found nothing"
-msgstr ""
-
-#: lib/user-searches.php:137
-msgid "Successful searches"
-msgstr ""
-
-#: lib/user-searches.php:138
-msgid "\"Hits\" is the average hits this search query has found."
-msgstr ""
-
-#: lib/user-searches.php:142
-msgid "In order to see the clicks, you need Relevanssi Premium."
-msgstr ""
-
-#: lib/user-searches.php:146
-msgid ""
-"In order to see the clicks, you need to enable click tracking. Click "
-"tracking is not currently enabled, and you're not collecting new clicks."
-msgstr ""
-
-#: lib/user-searches.php:153
-msgid "Unsuccessful searches"
-msgstr ""
-
-#: lib/user-searches.php:154
-msgid "These queries have found no results."
-msgstr ""
-
-#: lib/user-searches.php:163
-msgid "Reset Logs"
-msgstr ""
-
-#: lib/user-searches.php:169
-msgid ""
-"To reset the logs, type \"reset\" into the box here and click the Reset "
-"button"
-msgstr ""
-
-#: lib/user-searches.php:176
-msgid ""
-"To reset the logs, type \"reset\" into the box here and click the Reset "
-"button. This will reset both the search log and the click tracking log."
-msgstr ""
-
-#: lib/user-searches.php:186
-msgid "Reset"
-msgstr ""
-
-#: lib/user-searches.php:320 premium/tabs/redirects-tab.php:55
-msgid "Hits"
-msgstr ""
-
-#: lib/user-searches.php:321
-msgid "Clicks"
-msgstr ""
-
-#: lib/utils.php:540
-msgid "The requested post does not exist."
-msgstr ""
-
-#: lib/utils.php:1391
-msgid "There is no excerpt because this is a protected post."
-msgstr ""
-
-#: premium/admin-ajax.php:158
-msgid "Indexing complete!"
-msgstr ""
-
-#: premium/admin-ajax.php:174
-#, php-format
-msgid "Successfully indexed attachment id %d."
-msgstr ""
-
-#: premium/admin-ajax.php:177
-#, php-format
-msgid "Failed to index attachment id %1$d: %2$s"
-msgstr ""
-
-#: premium/admin-ajax.php:262
-msgid "Attachment ID"
-msgstr ""
-
-#: premium/admin-ajax.php:322 premium/admin-ajax.php:326
-#, php-format
-msgid "%1$d taxonomy term, total %2$d / %3$d."
-msgstr ""
-
-#: premium/admin-ajax.php:361
-msgid "disabled."
-msgstr ""
-
-#: premium/admin-ajax.php:369
-#, php-format
-msgid "%1$d post type archive indexed."
-msgstr ""
-
-#: premium/admin-ajax.php:426
-#, php-format
-msgid "Indexed %1$d user (total %2$d), processed %3$d / %4$d."
-msgstr ""
-
-#: premium/body-stopwords.php:42
-#, php-format
-msgid "Successfully added %1$d/%2$d terms to content stopwords!"
-msgstr ""
-
-#: premium/body-stopwords.php:53
-#, php-format
-msgid "Term '%s' added to content stopwords!"
-msgstr ""
-
-#: premium/body-stopwords.php:56
-#, php-format
-msgid "Couldn't add term '%s' to content stopwords!"
-msgstr ""
-
-#: premium/body-stopwords.php:193
-msgid "All content stopwords removed! Remember to re-index."
-msgstr ""
-
-#: premium/body-stopwords.php:198
-msgid "There was a problem, and content stopwords couldn't be removed."
-msgstr ""
-
-#: premium/body-stopwords.php:251
-#, php-format
-msgid ""
-"Term '%s' removed from content stopwords! Re-index to get it back to index."
-msgstr ""
-
-#: premium/body-stopwords.php:266
-#, php-format
-msgid "Couldn't remove term '%s' from content stopwords!"
-msgstr ""
-
-#: premium/body-stopwords.php:301
-msgid ""
-"Post content stopwords are like stopwords, but they are only applied to the "
-"post content. These words can be used for searching and will be found in "
-"post titles, custom fields and other indexed content – just not in the post "
-"body content. Sometimes a word can be very common, but also have a more "
-"specific meaning and use on your site, and making it a content stopword will "
-"make it easier to find the specific use cases."
-msgstr ""
-
-#: premium/body-stopwords.php:307
-msgid "Content stopword(s) to add"
-msgstr ""
-
-#: premium/body-stopwords.php:315
-msgid ""
-"Here's a list of content stopwords in the database. Click a word to remove "
-"it from content stopwords. You need to reindex the database to get the words "
-"back in to the index."
-msgstr ""
-
-#: premium/body-stopwords.php:320
-msgid "Current content stopwords"
-msgstr ""
-
-#: premium/body-stopwords.php:337
-msgid "Remove all content stopwords"
-msgstr ""
-
-#: premium/body-stopwords.php:342 premium/body-stopwords.php:345
-msgid "Exportable list of content stopwords"
-msgstr ""
-
-#: premium/body-stopwords.php:347
-msgid ""
-"You can copy the list of content stopwords from here if you want to back up "
-"the list, copy it to a different blog or otherwise need the list."
-msgstr ""
-
-#: premium/class-relevanssi-wp-cli-command.php:516
-msgid "all keywords"
-msgstr ""
-
-#: premium/class-relevanssi-wp-cli-command.php:535
-msgid "Pinned posts"
-msgstr ""
-
-#: premium/class-relevanssi-wp-cli-command.php:544
-msgid "Unpinned posts"
-msgstr ""
-
-#: premium/class-relevanssi-wp-cli-command.php:552
-msgid "No pinned posts found."
-msgstr ""
-
-#: premium/click-tracking.php:72 premium/click-tracking.php:78
-msgid "Invalid click tracking value format."
-msgstr ""
-
-#: premium/click-tracking.php:376
-#, php-format
-msgid "The query '%s' deleted from the click tracking log."
-msgstr ""
-
-#: premium/click-tracking.php:388
-#, php-format
-msgid "Couldn't remove the query '%s' from the click tracking log."
-msgstr ""
-
-#: premium/click-tracking.php:410 premium/click-tracking.php:576
-msgid "Back to the User Searches page"
-msgstr ""
-
-#: premium/click-tracking.php:416 premium/click-tracking.php:582
-#, php-format
-msgid "Search insights for %s"
-msgstr ""
-
-#: premium/click-tracking.php:476 premium/click-tracking.php:630
-msgid "# of Clicks"
-msgstr ""
-
-#: premium/click-tracking.php:482
-msgid "Posts found with this search term"
-msgstr ""
-
-#: premium/click-tracking.php:488 premium/click-tracking.php:642
-msgid "Times clicked"
-msgstr ""
-
-#: premium/click-tracking.php:489 premium/click-tracking.php:643
-msgid "Avg rank"
-msgstr ""
-
-#: premium/click-tracking.php:490 premium/click-tracking.php:644
-msgid "Avg page"
-msgstr ""
-
-#: premium/click-tracking.php:504 premium/click-tracking.php:590
-msgid "View post"
-msgstr ""
-
-#: premium/click-tracking.php:505 premium/click-tracking.php:591
-msgid "Edit post"
-msgstr ""
-
-#: premium/click-tracking.php:517
-msgid "Remove this query from the click log"
-msgstr ""
-
-#: premium/click-tracking.php:523 premium/click-tracking.php:536
-msgid "Delete"
-msgstr ""
-
-#: premium/click-tracking.php:530
-msgid "Remove this query from the search log"
-msgstr ""
-
-#: premium/click-tracking.php:636
-msgid "Search queries for this post"
-msgstr ""
-
-#: premium/click-tracking.php:711
-msgid ""
-"Enabling this option will add click tracking information to the post URLs on "
-"Relevanssi search results pages, allowing to you see stats on which posts "
-"are clicked and what their rankings are. You can find the stats on "
-"individual post edit pages in the Relevanssi sidebar, or from the User "
-"searches page by clicking the search term."
-msgstr ""
-
-#: premium/click-tracking.php:713
-msgid ""
-"Click tracking stores post ID, the search query and ranking information for "
-"the post. No personal information about the user doing the search are stored."
-msgstr ""
-
-#: premium/click-tracking.php:718
-msgid "Enable click tracking"
-msgstr ""
-
-#: premium/click-tracking.php:728
-msgid "Enable click tracking on Relevanssi search results pages."
-msgstr ""
-
-#: premium/click-tracking.php:739
-msgid "How many days of click tracking logs to keep in the database."
-msgstr ""
-
-#: premium/click-tracking.php:743
-#, php-format
-msgid ""
-"Set to %d for no trimming. The click tracking logs will be smaller than the "
-"search logs, so this value can be bigger than the value for regular logs."
-msgstr ""
-
-#: premium/click-tracking.php:751
-msgid "Export click logs"
-msgstr ""
-
-#: premium/click-tracking.php:754
-msgid "Export the click tracking log as a CSV file"
-msgstr ""
-
-#: premium/click-tracking.php:755
-msgid "Push the button to export the click tracking log as a CSV file."
-msgstr ""
-
-#: premium/click-tracking.php:794
-msgid "Total clicks"
-msgstr ""
-
-#: premium/click-tracking.php:801
-#, php-format
-msgid "%s %% of all queries"
-msgstr ""
-
-#: premium/click-tracking.php:806
-msgid "Click tracking insights"
-msgstr ""
-
-#: premium/click-tracking.php:837
-msgid "These posts got the most clicks. This is content users like!"
-msgstr ""
-
-#: premium/click-tracking.php:866
-msgid ""
-"These posts were got clicks from a low ranking. Should they be boosted "
-"higher?"
-msgstr ""
-
-#: premium/click-tracking.php:897
-#, php-format
-msgid "%1$s posts"
-msgstr ""
-
-#: premium/click-tracking.php:902
-msgid ""
-"You have search queries that generate clicks to many posts. Perhaps more "
-"focus would be good?"
-msgstr ""
-
-#: premium/click-tracking.php:910
-msgid "Sorry, no clicks recorded for this period!"
-msgstr ""
-
-#: premium/click-tracking.php:1004
-msgid "No search clicks logged."
-msgstr ""
-
-#: premium/common.php:502
-msgid ""
-"Your site is not public. By default, Relevanssi does not search private "
-"sites. If you want to be able to search on this site, either make it public "
-"or add a filter function that returns true on "
-"'relevanssi_multisite_public_status' filter hook."
-msgstr ""
-
-#: premium/common.php:1074
-msgid "Must have"
-msgstr ""
-
-#: premium/contextual-help.php:23
-msgid "Boolean operators"
-msgstr ""
-
-#: premium/contextual-help.php:25
-msgid ""
-"Relevanssi Premium offers limited support for Boolean logic. In addition of "
-"setting the default operator from Relevanssi settings, you can use AND and "
-"NOT operators in searches."
-msgstr ""
-
-#: premium/contextual-help.php:26
-msgid "To use the NOT operator, prefix the search term with a minus sign:"
-msgstr ""
-
-#: premium/contextual-help.php:27
-msgid "cats -dogs"
-msgstr ""
-
-#: premium/contextual-help.php:28
-msgid ""
-"This would only show posts that have the word 'cats' but not the word 'dogs'."
-msgstr ""
-
-#: premium/contextual-help.php:29
-msgid ""
-"To use the AND operator, set the default operator to OR and prefix the "
-"search term with a plus sign:"
-msgstr ""
-
-#: premium/contextual-help.php:30
-msgid "+cats dogs mice"
-msgstr ""
-
-#: premium/contextual-help.php:31
-msgid ""
-"This would show posts that have the word 'cats' and either 'dogs' or 'mice' "
-"or both, and would prioritize posts that have all three."
-msgstr ""
-
-#: premium/contextual-help.php:37
-#, php-format
-msgid ""
-"Permalinks to user profiles may not always work on search results templates. "
-"%1$s should work, but if it doesn't, you can replace it with %2$s."
-msgstr ""
-
-#: premium/contextual-help.php:39
-#, php-format
-msgid ""
-"To control which user meta fields are indexed, you can use the %s option. It "
-"should have a comma-separated list of user meta fields. It can be set like "
-"this (you only need to run this code once):"
-msgstr ""
-
-#: premium/contextual-help.php:41
-#, php-format
-msgid ""
-"For more details on user profiles and search results templates, see %1$sthis "
-"knowledge base entry%2$s."
-msgstr ""
-
-#: premium/contextual-help.php:46
-msgid "User profiles"
-msgstr ""
-
-#: premium/contextual-help.php:58 premium/interface.php:156
-#: premium/interface.php:231
-msgid "Internal links"
-msgstr ""
-
-#: premium/contextual-help.php:60
-msgid ""
-"This option sets how Relevanssi handles internal links that point to your "
-"own site."
-msgstr ""
-
-#: premium/contextual-help.php:61
-msgid ""
-"If you choose 'No special processing', Relevanssi doesn’t care about links "
-"and indexes the link anchor (the text of the link) like it is any other text."
-msgstr ""
-
-#: premium/contextual-help.php:62
-msgid ""
-"If you choose 'Index internal links for target documents only', then the "
-"link is indexed like the link anchor text were the part of the link target, "
-"not the post where the link is."
-msgstr ""
-
-#: premium/contextual-help.php:63
-msgid ""
-"If you choose 'Index internal links for target and source', the link anchor "
-"text will count for both posts."
-msgstr ""
-
-#: premium/contextual-help.php:70
-msgid "Stemming"
-msgstr ""
-
-#: premium/contextual-help.php:72
-msgid ""
-"By default Relevanssi doesn't understand anything about singular word forms, "
-"plurals or anything else. You can, however, add a stemmer that will stem all "
-"the words to their basic form, making all different forms equal in searching."
-msgstr ""
-
-#: premium/contextual-help.php:73
-msgid ""
-"To enable the English-language stemmer, add this to the theme functions.php:"
-msgstr ""
-
-#: premium/contextual-help.php:75
-msgid "After you add the code, rebuild the index to get correct results."
-msgstr ""
-
-#: premium/contextual-help.php:81
-#, php-format
-msgid ""
-"If you have WP CLI installed, Relevanssi Premium has some helpful commands. "
-"Use %s to get a list of available commands."
-msgstr ""
-
-#: premium/contextual-help.php:83
-#, php-format
-msgid "You can also see %1$sthe user manual page%2$s."
-msgstr ""
-
-#: premium/contextual-help.php:88
-msgid "WP CLI"
-msgstr ""
-
-#: premium/contextual-help.php:98
-msgid "Plugin support page"
-msgstr ""
-
-#: premium/indexing.php:1123
-#, php-format
-msgid "Indexed %d taxonomy terms."
-msgstr ""
-
-#: premium/indexing.php:1125
-msgid "No taxonomies to index."
-msgstr ""
-
-#: premium/interface.php:67 premium/interface.php:80
-msgid "API key"
-msgstr ""
-
-#: premium/interface.php:70
-msgid "API key is set"
-msgstr ""
-
-#: premium/interface.php:71
-msgid "Remove the API key."
-msgstr ""
-
-#: premium/interface.php:72 premium/interface.php:85
-msgid ""
-"A valid API key is required to use the automatic update feature and the PDF "
-"indexing. Otherwise the plugin will work just fine without an API key. Get "
-"your API key from Relevanssi.com."
-msgstr ""
-
-#: premium/interface.php:83
-msgid "Set the API key:"
-msgstr ""
-
-#: premium/interface.php:103
-msgid "Disable outside connections"
-msgstr ""
-
-#: premium/interface.php:108
-msgid "Disable update version checking and attachment indexing"
-msgstr ""
-
-#: premium/interface.php:110
-msgid ""
-"If you check this box, Relevanssi will stop all outside connections. This "
-"means the plugin won't check for updates from Relevanssi.com, won't read "
-"attachment contents using Relevanssiservices.com attachment reader (using "
-"custom attachment reader is still allowed), or update plugin translations. "
-"Do not check this box unless you know what you're doing, because this will "
-"disable Relevanssi updates."
-msgstr ""
-
-#: premium/interface.php:126
-msgid "Update translations"
-msgstr ""
-
-#: premium/interface.php:131
-msgid "Check for plugin translation updates"
-msgstr ""
-
-#: premium/interface.php:133
-msgid ""
-"If you check this box, Relevanssi will check for updates to the plugin "
-"translations. At the moment, translations are available for:"
-msgstr ""
-
-#: premium/interface.php:160
-msgid "No special processing for internal links"
-msgstr ""
-
-#: premium/interface.php:161
-msgid "Index internal links for target documents only"
-msgstr ""
-
-#: premium/interface.php:162
-msgid "Index internal links for both target and source"
-msgstr ""
-
-#: premium/interface.php:164
-msgid ""
-"Internal link anchor tags can be indexed for target document, both target "
-"and source or source only. See Help for more details."
-msgstr ""
-
-#: premium/interface.php:192
-msgid "Hide Relevanssi"
-msgstr ""
-
-#: premium/interface.php:197
-msgid "Hide Relevanssi on edit pages"
-msgstr ""
-
-#: premium/interface.php:199
-msgid "Enabling this option hides Relevanssi on all post edit pages."
-msgstr ""
-
-#: premium/interface.php:204
-msgid "Show Relevanssi for admins"
-msgstr ""
-
-#: premium/interface.php:208
-msgid "Show Relevanssi for admins on edit pages"
-msgstr ""
-
-#: premium/interface.php:211
-msgid "Show Relevanssi on edit pages for admins"
-msgstr ""
-
-#: premium/interface.php:215
-#, php-format
-msgid ""
-"If Relevanssi is hidden on post edit pages, enabling this option will show "
-"Relevanssi features for admin-level users. Admin-level users are those with "
-"%1$s capabilities, but if you want to use a different capability, you can "
-"use the %2$s filter to modify that."
-msgstr ""
-
-#: premium/interface.php:262
-#, php-format
-msgid "Post type '%s':"
-msgstr ""
-
-#: premium/interface.php:301
-#, php-format
-msgid "Posts tagged with taxonomy '%s':"
-msgstr ""
-
-#: premium/interface.php:331
-#, php-format
-msgid "Terms in the taxonomy '%s':"
-msgstr ""
-
-#: premium/interface.php:357
-msgid "Recent posts bonus weight:"
-msgstr ""
-
-#: premium/interface.php:377
-msgid "Recent posts bonus cutoff"
-msgstr ""
-
-#: premium/interface.php:380
-msgid "days"
-msgstr ""
-
-#: premium/interface.php:381
-msgid ""
-"Posts newer than the day cutoff specified here will have their weight "
-"multiplied with the bonus above."
-msgstr ""
-
-#: premium/interface.php:399
-msgid "Hide Relevanssi branding"
-msgstr ""
-
-#: premium/interface.php:404 premium/interface.php:408
-#, php-format
-msgid "Don't show Relevanssi branding on the '%s' screen."
-msgstr ""
-
-#: premium/interface.php:404 premium/interface.php:408
-msgid "User Searches"
-msgstr ""
-
-#: premium/interface.php:426
-msgid "Thousands separator"
-msgstr ""
-
-#: premium/interface.php:430
-msgid ""
-"If Relevanssi sees this character between numbers, it'll stick the numbers "
-"together no matter how the character would otherwise be handled. Especially "
-"useful if a space is used as a thousands separator."
-msgstr ""
-
-#: premium/interface.php:446
-msgid "Disable these shortcodes"
-msgstr ""
-
-#: premium/interface.php:450
-msgid ""
-"Enter a comma-separated list of shortcodes. These shortcodes will not be "
-"expanded if expand shortcodes above is enabled. This is useful if a "
-"particular shortcode is causing problems in indexing."
-msgstr ""
-
-#: premium/interface.php:480
-msgid "MySQL columns"
-msgstr ""
-
-#: premium/interface.php:487
-#, php-format
-msgid ""
-"A comma-separated list of %s MySQL table columns to include in the index. "
-"Following columns are available: "
-msgstr ""
-
-#: premium/interface.php:510 premium/interface.php:517
-msgid "Search all subsites"
-msgstr ""
-
-#: premium/interface.php:514
-msgid "Search all subsites."
-msgstr ""
-
-#: premium/interface.php:519
-msgid ""
-"If this option is checked, multisite searches will include all subsites. "
-"Warning: if you have dozens of sites in your network, the searches may "
-"become too slow. This can be overridden from the search form."
-msgstr ""
-
-#: premium/interface.php:525
-msgid "Search some subsites"
-msgstr ""
-
-#: premium/interface.php:535
-msgid ""
-"Add a comma-separated list of blog ID values to have all search forms on "
-"this site search these multisite subsites. This can be overridden from the "
-"search form."
-msgstr ""
-
-#: premium/interface.php:559
-msgid "Indexing user profiles"
-msgstr ""
-
-#: premium/interface.php:564
-msgid "Index user profiles"
-msgstr ""
-
-#: premium/interface.php:568 premium/interface.php:571
-msgid "Index user profiles."
-msgstr ""
-
-#: premium/interface.php:573
-msgid ""
-"Relevanssi will index user profiles. This includes first name, last name, "
-"display name and user description."
-msgstr ""
-
-#: premium/interface.php:574
-msgid ""
-"This may require changes to search results template, see the contextual help."
-msgstr ""
-
-#: premium/interface.php:580
-msgid "Index subscribers"
-msgstr ""
-
-#: premium/interface.php:584 premium/interface.php:587
-msgid "Index also subscriber profiles."
-msgstr ""
-
-#: premium/interface.php:589
-msgid ""
-"By default, Relevanssi indexes authors, editors, contributors and admins, "
-"but not subscribers. You can change that with this option."
-msgstr ""
-
-#: premium/interface.php:596
-msgid "Extra fields"
-msgstr ""
-
-#: premium/interface.php:600
-msgid ""
-"A comma-separated list of extra user fields to include in the index. These "
-"can be user fields or user meta."
-msgstr ""
-
-#: premium/interface.php:616
-msgid "Indexing synonyms"
-msgstr ""
-
-#: premium/interface.php:620
-msgid "Index synonyms"
-msgstr ""
-
-#: premium/interface.php:624 premium/interface.php:627
-msgid "Index synonyms for AND searches."
-msgstr ""
-
-#: premium/interface.php:632
-msgid ""
-"If checked, Relevanssi will use the synonyms in indexing. If you add "
-"dog = hound to the synonym list and enable this feature, every "
-"time the indexer sees hound in post content or post title, it "
-"will index it as hound dog. Thus, the post will be found when "
-"searching with either word. This makes it possible to use synonyms with AND "
-"searches, but will slow down indexing, especially with large databases and "
-"large lists of synonyms. You can use multi-word values, but phrases do not "
-"work."
-msgstr ""
-
-#: premium/interface.php:652
-msgid "Indexing PDF content"
-msgstr ""
-
-#: premium/interface.php:657
-msgid "Index for parent"
-msgstr ""
-
-#: premium/interface.php:662
-msgid "Index PDF contents for parent post"
-msgstr ""
-
-#: premium/interface.php:665
-#, php-format
-msgid ""
-"If checked, Relevanssi indexes the PDF content both for the attachment post "
-"and the parent post. You can control the attachment post visibility by "
-"indexing or not indexing the post type %s."
-msgstr ""
-
-#: premium/interface.php:668
-#, php-format
-msgid ""
-"You have not chosen to index the post type %s. You won't see any PDF content "
-"in the search results, unless you check this option."
-msgstr ""
-
-#: premium/interface.php:672
-msgid ""
-"Searching for PDF contents will now return both the attachment itself and "
-"the parent post. Are you sure you want both in the results?"
-msgstr ""
-
-#: premium/interface.php:696
-msgid "Indexing taxonomy terms"
-msgstr ""
-
-#: premium/interface.php:701
-msgid "Index taxonomy terms"
-msgstr ""
-
-#: premium/interface.php:706
-msgid "Index taxonomy terms."
-msgstr ""
-
-#: premium/interface.php:708
-msgid ""
-"Relevanssi will index taxonomy terms (categories, tags and custom "
-"taxonomies). Searching for taxonomy term name will return the taxonomy term "
-"page."
-msgstr ""
-
-#: premium/interface.php:743
-#, php-format
-msgid "Index terms for taxonomy %s"
-msgstr ""
-
-#: premium/interface.php:795
-msgid "Index post type archives"
-msgstr ""
-
-#: premium/interface.php:799 premium/interface.php:802
-msgid "Index post type archives."
-msgstr ""
-
-#: premium/interface.php:805
-#, php-format
-msgid ""
-"Relevanssi will index post type archive pages. By default Relevanssi indexes "
-"the post type label and the description set when the post type is "
-"registered. If you want to index some other content, you can use the %s "
-"filter hook to adjust the content."
-msgstr ""
-
-#: premium/interface.php:811
-msgid "Post types indexed"
-msgstr ""
-
-#: premium/interface.php:819
-#, php-format
-msgid ""
-"This list includes all post types that are not built in and have %1$s set to "
-"true. If you want to adjust the list, you can use the %2$s filter hook."
-msgstr ""
-
-#: premium/interface.php:836
-msgid "Number of excerpt snippets"
-msgstr ""
-
-#: premium/interface.php:848
-msgid ""
-"The maximum number of excerpt snippets Relevanssi will create for each post."
-msgstr ""
-
-#: premium/interface.php:974
-msgid "Options updated!"
-msgstr ""
-
-#: premium/interface.php:1208
-msgid "Import / Export options"
-msgstr ""
-
-#: premium/interface.php:1216
-msgid "Related"
-msgstr ""
-
-#: premium/interface.php:1224
-msgid "Spam Block"
-msgstr ""
-
-#: premium/interface.php:1232 premium/tabs/support-tab.php:26
-msgid "Support"
-msgstr ""
-
-#: premium/interface.php:1245
-msgid "Reset the option"
-msgstr ""
-
-#: premium/interface.php:1259
-msgid "Option successfully reset!"
-msgstr ""
-
-#: premium/interface.php:1261
-msgid "Couldn't reset the option, reload the page to try again."
-msgstr ""
-
-#: premium/interface.php:1266
-msgid "Reset the relevanssi_words option"
-msgstr ""
-
-#: premium/interface.php:1273
-#, php-format
-msgid ""
-"If you are having problems with the Did you mean? feature, you can reset the "
-"%1$s option that keeps a cache. Next time the Did you mean? suggestions are "
-"needed the option is regenerated."
-msgstr ""
-
-#: premium/interface.php:1323
-#, php-format
-msgid ""
-"The API key is not set. Please enter your API key in the %1$sthe Relevanssi "
-"settings%2$s. If you don't have one, %3$syou can buy a new license here%2$s."
-msgstr ""
-
-#: premium/interface.php:1331
-#, php-format
-msgid ""
-"Your API key is set, but it looks like you don't have a valid license. "
-"%1$sYou can buy a new license here%2$s."
-msgstr ""
-
-#: premium/interface.php:1351 premium/interface.php:1437
-msgid "Pinned keywords"
-msgstr ""
-
-#: premium/interface.php:1352 premium/interface.php:1446
-msgid "Excluded keywords"
-msgstr ""
-
-#: premium/interface.php:1353
-msgid "Pin for all searches"
-msgstr ""
-
-#: premium/interface.php:1354
-msgid "Exclude post"
-msgstr ""
-
-#: premium/interface.php:1355
-msgid "Ignore post content"
-msgstr ""
-
-#: premium/interface.php:1433
-msgid "Relevanssi pinning"
-msgstr ""
-
-#: premium/interface.php:1460 premium/post-metabox.php:106
-msgid "Pin this post for all searches it appears in."
-msgstr ""
-
-#: premium/interface.php:1468 premium/post-metabox.php:116
-msgid "Exclude this post or page from the index."
-msgstr ""
-
-#: premium/interface.php:1476 premium/post-metabox.php:121
-msgid "Ignore post content in the indexing."
-msgstr ""
-
-#: premium/network-options.php:47
-msgid "Relevanssi network options"
-msgstr ""
-
-#: premium/network-options.php:78
-msgid "Copy options from one site to other sites"
-msgstr ""
-
-#: premium/network-options.php:79
-msgid ""
-"Choose a blog and copy all the options from that blog to all other blogs "
-"that have active Relevanssi Premium. Be careful! There's no way to undo the "
-"procedure!"
-msgstr ""
-
-#: premium/network-options.php:86
-msgid "Copy options"
-msgstr ""
-
-#: premium/network-options.php:104
-msgid "Copy options to all other subsites"
-msgstr ""
-
-#: premium/network-options.php:154
-#, php-format
-msgid "Copying options from blog %s"
-msgstr ""
-
-#: premium/network-options.php:170
-#, php-format
-msgid "Processing blog %s:"
-msgstr ""
-
-#: premium/network-options.php:172
-msgid "Relevanssi is not active in this blog."
-msgstr ""
-
-#: premium/network-options.php:183
-msgid "Options updated."
-msgstr ""
-
-#: premium/pdf-upload.php:17
-msgid "Post excluded from the index by the user."
-msgstr ""
-
-#: premium/pdf-upload.php:18
-msgid ""
-"Relevanssi is in privacy mode and not allowed to contact Relevanssiservices."
-"com."
-msgstr ""
-
-#: premium/pdf-upload.php:19
-msgid "Attachment MIME type blocked."
-msgstr ""
-
-#: premium/pdf-upload.php:20
-msgid "Attachment file size is too large."
-msgstr ""
-
-#: premium/pdf-upload.php:21
-msgid "Attachment reading in process, please try again later."
-msgstr ""
-
-#: premium/pdf-upload.php:22
-msgid "Server did not respond."
-msgstr ""
-
-#: premium/pdf-upload.php:176
-msgid "Relevanssi attachment controls"
-msgstr ""
-
-#: premium/pdf-upload.php:216
-msgid "Reread the attachment content"
-msgstr ""
-
-#: premium/pdf-upload.php:216
-msgid "Read the attachment content"
-msgstr ""
-
-#: premium/pdf-upload.php:219
-msgid "Indexer will fetch the file from your server."
-msgstr ""
-
-#: premium/pdf-upload.php:222
-msgid "The file will be uploaded to the indexer."
-msgstr ""
-
-#: premium/pdf-upload.php:232
-msgid "No API key set. API key is required for attachment indexing."
-msgstr ""
-
-#: premium/pdf-upload.php:245
-msgid ""
-"The attachment content has been modified and won't be reread from the file "
-"when doing a general rereading. If you want to reread the attachment "
-"contents from the file, you can force rereading here."
-msgstr ""
-
-#: premium/pdf-upload.php:250
-msgid "Attachment content"
-msgstr ""
-
-#: premium/pdf-upload.php:262
-msgid ""
-"Relevanssi is currently in process of reading the file contents, please "
-"return here later."
-msgstr ""
-
-#: premium/pdf-upload.php:265
-msgid "Attachment error message"
-msgstr ""
-
-#: premium/pdf-upload.php:276
-msgid "No attachment content found for this post at the moment."
-msgstr ""
-
-#: premium/pdf-upload.php:547
-msgid "Could not save the file content to the custom field."
-msgstr ""
-
-#: premium/pinning.php:243
-msgid "(pinned)"
-msgstr ""
-
-#: premium/pinning.php:254
-#, php-format
-msgid "Pin for '%s'"
-msgstr ""
-
-#: premium/pinning.php:258
-#, php-format
-msgid "Unpin for '%s'"
-msgstr ""
-
-#: premium/post-metabox.php:43
-msgid "Relevanssi"
-msgstr ""
-
-#: premium/post-metabox.php:87
-msgid "How Relevanssi sees this post"
-msgstr ""
-
-#: premium/post-metabox.php:89
-msgid "Pin this post"
-msgstr ""
-
-#: premium/post-metabox.php:90
-msgid ""
-"A comma-separated list of single word keywords or multi-word phrases. If any "
-"of these keywords are present in the search query, this post will be moved "
-"on top of the search results."
-msgstr ""
-
-#: premium/post-metabox.php:91
-msgid "Pinned keywords for this post"
-msgstr ""
-
-#: premium/post-metabox.php:94
-msgid ""
-"You can add weights to pinned keywords like this: 'keyword (100)'. The post "
-"with the highest weight will be sorted first if there are multiple posts "
-"pinned to the same keyword."
-msgstr ""
-
-#: premium/post-metabox.php:99
-msgid ""
-"NOTE: You have set the post content weight to 0. This means that keywords "
-"that don't appear elsewhere in the post won't work, because they are indexed "
-"as part of the post content. If you set the post content weight to any "
-"positive value, the pinned keywords will work again."
-msgstr ""
-
-#: premium/post-metabox.php:109
-msgid "Exclude this post"
-msgstr ""
-
-#: premium/post-metabox.php:110
-msgid ""
-"A comma-separated list of single word keywords or multi-word phrases. If any "
-"of these keywords are present in the search query, this post will be removed "
-"from the search results."
-msgstr ""
-
-#: premium/post-metabox.php:111
-msgid "Excluded keywords for this post"
-msgstr ""
-
-#: premium/post-metabox.php:394 premium/tabs/related-tab.php:103
-#: premium/templates/relevanssi-related.php:25
-msgid "Related Posts"
-msgstr ""
-
-#: premium/post-metabox.php:397
-msgid "Don't append the related posts to this page."
-msgstr ""
-
-#: premium/post-metabox.php:400
-msgid "Don't show this as a related post for any post."
-msgstr ""
-
-#: premium/post-metabox.php:402
-msgid "Related Posts keywords"
-msgstr ""
-
-#: premium/post-metabox.php:403
-msgid ""
-"A comma-separated list of keywords to use for the Related Posts feature. "
-"Anything entered here will used when searching for related posts. Using "
-"phrases with quotes is allowed, but will restrict the related posts to posts "
-"including that phrase."
-msgstr ""
-
-#: premium/post-metabox.php:404
-msgid "Related posts keywords for this post"
-msgstr ""
-
-#: premium/post-metabox.php:407
-msgid ""
-"A comma-separated list of post IDs to use as related posts for this post"
-msgstr ""
-
-#: premium/post-metabox.php:410
-msgid ""
-"These are the related posts Relevanssi currently will show for this post:"
-msgstr ""
-
-#: premium/post-metabox.php:419
-msgid "These posts are excluded from related posts for this post"
-msgstr ""
-
-#: premium/post-metabox.php:426
-msgid "Insights"
-msgstr ""
-
-#: premium/post-metabox.php:562
-msgid "not this"
-msgstr ""
-
-#: premium/post-metabox.php:596
-msgid "use this"
-msgstr ""
-
-#: premium/post-metabox.php:607
-msgid "Nothing excluded."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:53
-msgid "Read all unread attachments"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:58
-#, php-format
-msgid ""
-"Clicking the button will read the contents of all the unread attachments "
-"files and store the contents to the %s custom field for future indexing. "
-"Attachments with errors will be skipped, except for the files with timeout "
-"and connection related errors: those will be attempted again."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:68
-msgid "State of the attachments"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:83
-msgid "document has read attachment content."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:84
-msgid "document has an attachment reading error."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:86
-msgid "Show errors"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:88
-msgid "Attachment reading errors"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:93
-msgid "Server location"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:96
-msgid "United States"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:97
-msgid "European Union"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:102
-msgid "Reset attachment content"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:104
-msgid "Reset all attachment data from posts"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:106
-#, php-format
-msgid ""
-"This will remove all %1$s and %2$s custom fields from all posts. If you want "
-"to reread all attachment files, use this to clean up; clicking the reading "
-"button doesn't wipe the slate clean like it does in regular indexing."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:107
-msgid ""
-"If you have posts where you have modified the attachment content after "
-"reading it, this will leave those posts untouched."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:112
-msgid "Read new files"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:116 premium/tabs/attachments-tab.php:119
-msgid "Read new files automatically"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:121
-msgid ""
-"If this option is enabled, Relevanssi will automatically read the contents "
-"of new attachments as they are uploaded. This may cause unexpected delays in "
-"uploading posts. If this is not enabled, new attachments are not read "
-"automatically and need to be manually read and reindexed."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:127
-msgid "Upload files"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:131 premium/tabs/attachments-tab.php:134
-msgid "Upload files for reading"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:136
-msgid ""
-"By default, Relevanssi only sends a link to the attachment to the attachment "
-"reader. If your files are not accessible (for example your site is inside an "
-"intranet, password protected, or a local dev site, and the files can't be "
-"downloaded if given the URL of the file), check this option to upload the "
-"whole file to the reader."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:142
-msgid "Link to files"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:146 premium/tabs/attachments-tab.php:149
-msgid "Link search results directly to the files"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:151
-msgid ""
-"If this option is checked, attachment results in search results will link "
-"directly to the file. Otherwise the results will link to the attachment page."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:154
-#, php-format
-msgid ""
-"You're not indexing the %s post type, so this setting doesn't have any "
-"effect."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:158
-#, php-format
-msgid ""
-"You're not indexing the %s post type and haven't connected the files to the "
-"parent posts in the indexing settings. You won't be seeing any files in the "
-"results."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:164
-msgid "Instructions"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:167
-#, php-format
-msgid ""
-"When Relevanssi reads attachment content, the text is extracted and saved in "
-"the %s custom field for the attachment post. This alone does not add the "
-"attachment content in the Relevanssi index; it just makes the contents of "
-"the attachments easily available for the regular Relevanssi indexing process."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:169
-#, php-format
-msgid ""
-"There are two ways to index the attachment content. If you choose to index "
-"the %s post type, Relevanssi will show the attachment posts in the results."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:170
-msgid ""
-"You can also choose to index the attachment content for the parent post, in "
-"which case Relevanssi will show the parent post in the results (this setting "
-"can be found on the indexing settings). Obviously this does not find the "
-"content in attachments that are not attached to another post – if you just "
-"upload a file to the WordPress Media Library, it is not attached and won't "
-"be found unless you index the attachment posts."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:171
-msgid ""
-"If you need to reread a file, you can do read individual files from Media "
-"Library. Choose an attachment and click 'Edit more details' to read the "
-"content."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:175
-msgid "Key not valid?"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:177
-msgid ""
-"Are you a new Relevanssi customer and seeing 'Key xxxxxx is not valid' error "
-"messages? New API keys are delivered to the server once per hour, so if try "
-"again an hour later, the key should work."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:178
-msgid ""
-"A 'Key 0 is not valid' error message means you're on a multisite, but have "
-"only entered the API key in the subsite settings. Set the API key in the "
-"network settings to fix that."
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:182
-msgid "Important!"
-msgstr ""
-
-#: premium/tabs/attachments-tab.php:184
-msgid ""
-"In order to read the contents of the files, the files are sent over to "
-"Relevanssiservices.com, a processing service hosted on a Digital Ocean "
-"Droplet. There are two servers: one in the US and another in the EU. The "
-"service creates a working copy of the files. The copy is removed after the "
-"file has been processed, but there are no guarantees that someone with an "
-"access to the server couldn't see the files. Do not read files with "
-"confidential information in them. In order to block individual files from "
-"reading, use the Relevanssi post controls on attachment edit page to exclude "
-"attachment posts from indexing."
-msgstr ""
-
-#: premium/tabs/import-export-tab.php:19
-msgid "Import or export options"
-msgstr ""
-
-#: premium/tabs/import-export-tab.php:21
-msgid ""
-"Here you find the current Relevanssi Premium options in a text format. Copy "
-"the contents of the text field to make a backup of your settings. You can "
-"also paste new settings here to change all settings at the same time. This "
-"is useful if you have default settings you want to use on every system."
-msgstr ""
-
-#: premium/tabs/import-export-tab.php:25
-msgid "Current Settings"
-msgstr ""
-
-#: premium/tabs/import-export-tab.php:39
-msgid "Import settings"
-msgstr ""
-
-#: premium/tabs/import-export-tab.php:46
-msgid ""
-"Note! Make sure you've got correct settings from a right version of "
-"Relevanssi. Settings from a different version of Relevanssi may or may not "
-"work and may or may not mess your settings."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:28
-msgid ""
-"If you want a particular search to always lead to a specific page, you can "
-"use the redirects. Whenever the search query matches a redirect, the search "
-"is automatically bypassed and the user is redirected to the target page."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:30
-msgid ""
-"Enter the search term and the target URL, which may be relative to your site "
-"home page or an absolute URL. If \"Partial match\" is checked, the redirect "
-"happens if the query word appears anywhere in the search query, even inside "
-"a word, so use it with care. If the search query matches multiple "
-"redirections, the first one it matches will trigger."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:32
-msgid "The \"Hits\" column shows how many times each redirect has been used."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:37
-msgid "Redirect empty searches"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:39
-msgid ""
-"Enter an URL here to redirect all searches that find nothing to this URL."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:42
-msgid "Redirect searches without terms"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:44
-msgid "Enter an URL here to redirect all searches without any search terms."
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:53 premium/tabs/redirects-tab.php:115
-msgid "Partial match"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:54
-msgid "URL"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:65 premium/tabs/redirects-tab.php:107
-msgid "Copy"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:98
-msgid "Query string"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:127
-msgid "Target URL"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:153
-msgid "Add a redirect"
-msgstr ""
-
-#: premium/tabs/redirects-tab.php:155
-msgid "Once you're done, remember to click the save button below!"
-msgstr ""
-
-#: premium/tabs/related-tab.php:105
-msgid ""
-"Relevanssi Related Posts feature shows related posts on posts pages, based "
-"on keywords like post title, tags and categories. This feature uses the "
-"Relevanssi index to find the best-matching related posts. All results are "
-"cached, so your site performance won't suffer."
-msgstr ""
-
-#: premium/tabs/related-tab.php:108
-#, php-format
-msgid ""
-"A pro tip: you can regenerate related posts for all posts with the WP CLI "
-"command %s."
-msgstr ""
-
-#: premium/tabs/related-tab.php:110
-msgid "Displaying the related posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:115
-msgid "Enable related posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:120
-msgid "If this is unchecked, related posts will be completely disabled."
-msgstr ""
-
-#: premium/tabs/related-tab.php:125 premium/tabs/related-tab.php:128
-msgid "Automatically add to these post types"
-msgstr ""
-
-#: premium/tabs/related-tab.php:153
-#, php-format
-msgid ""
-"The related posts will be automatically displayed for these post types. The "
-"element is added using %1$s filter hook with priority 99 (you can adjust "
-"that with the %2$s filter hook)."
-msgstr ""
-
-#: premium/tabs/related-tab.php:155
-#, php-format
-msgid ""
-"If you don't choose to display the related posts automatically, you need to "
-"add them manually to your template. You can use the template function %1$s "
-"or the shortcode %2$s to display the related posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:160
-msgid "Choosing the related posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:164 premium/tabs/related-tab.php:167
-msgid "Keyword sources"
-msgstr ""
-
-#: premium/tabs/related-tab.php:174
-msgid "Title"
-msgstr ""
-
-#: premium/tabs/related-tab.php:213
-msgid "Restrict to taxonomy "
-msgstr ""
-
-#: premium/tabs/related-tab.php:225
-msgid ""
-"The sources Relevanssi uses for related post keywords. Keywords from these "
-"sources are then used to search the Relevanssi index to find related posts. "
-"Make sure you choose something, otherwise you won't see results or will see "
-"random results. In addition of these sources, you can also define your own "
-"keywords for each post from the post edit screen."
-msgstr ""
-
-#: premium/tabs/related-tab.php:226
-msgid ""
-"If you choose to restrict to the taxonomy, those keywords will only match in "
-"the same category. For example restricted category search terms will only "
-"match to category, not to post content. This may lead to better precision, "
-"depending on how the taxonomy terms are used."
-msgstr ""
-
-#: premium/tabs/related-tab.php:232
-msgid ""
-"These taxonomies are missing here, because Relevanssi isn't set to index "
-"them:"
-msgstr ""
-
-#: premium/tabs/related-tab.php:242
-msgid "Number of posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:245
-msgid "The number of related posts to show."
-msgstr ""
-
-#: premium/tabs/related-tab.php:249
-msgid "Months to use"
-msgstr ""
-
-#: premium/tabs/related-tab.php:252
-msgid ""
-"Use only posts published within this many months. (For more fine-grained "
-"date controls, use filters.)"
-msgstr ""
-
-#: premium/tabs/related-tab.php:256 premium/tabs/related-tab.php:259
-msgid "Post types to use"
-msgstr ""
-
-#: premium/tabs/related-tab.php:270
-msgid "Matching post type"
-msgstr ""
-
-#: premium/tabs/related-tab.php:271
-msgid "Uncheck this option to choose other post types."
-msgstr ""
-
-#: premium/tabs/related-tab.php:303
-msgid ""
-"The post types to use for related posts. Matching post type means that for "
-"each post type, only posts from the same post type are used for related "
-"posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:307
-msgid "No related posts found"
-msgstr ""
-
-#: premium/tabs/related-tab.php:310
-msgid "Show nothing"
-msgstr ""
-
-#: premium/tabs/related-tab.php:311
-msgid "Random posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:312
-msgid "Random posts from same category"
-msgstr ""
-
-#: premium/tabs/related-tab.php:314
-msgid ""
-"What to do when no related posts are found? The options are to show nothing "
-"and just disable the whole element, or to show random posts (either fully "
-"random, or from the same category). Do note that the related posts are "
-"cached, so the random posts do not change on every page load."
-msgstr ""
-
-#: premium/tabs/related-tab.php:318
-msgid "Not enough related posts found"
-msgstr ""
-
-#: premium/tabs/related-tab.php:321
-msgid "Show the found posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:322
-msgid "Fill with random posts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:323
-msgid "Fill with random posts from same category"
-msgstr ""
-
-#: premium/tabs/related-tab.php:325
-msgid ""
-"What to do when not enough related posts are found? The options are to show "
-"what was found, or to fill up the display with random posts. Do note that "
-"the related posts are cached, so the random posts do not change on every "
-"page load."
-msgstr ""
-
-#: premium/tabs/related-tab.php:330
-msgid "Style options"
-msgstr ""
-
-#: premium/tabs/related-tab.php:332
-msgid ""
-"When you add the related posts to your site, Relevanssi will use a template "
-"to print out the results. These settings control how that template displays "
-"the posts. If you need to modify the related posts in a way these settings "
-"do not allow, you can always create your own template."
-msgstr ""
-
-#: premium/tabs/related-tab.php:337
-#, php-format
-msgid ""
-"To create your own template, it's best if you begin with the default "
-"Relevanssi template, which can be found in the file %1$s. Copy the template "
-"in the %2$s folder in your theme and make the necessary changes. Relevanssi "
-"will then use your template file to display the related posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:344
-msgid "Display titles"
-msgstr ""
-
-#: premium/tabs/related-tab.php:349
-msgid "Display titles for related posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:355
-msgid "Display thumbnails"
-msgstr ""
-
-#: premium/tabs/related-tab.php:360
-msgid "Display thumbnails for related posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:362
-msgid ""
-"If enabled, this will show the featured image for the post if the post has "
-"one."
-msgstr ""
-
-#: premium/tabs/related-tab.php:368
-msgid "Default thumbnail"
-msgstr ""
-
-#: premium/tabs/related-tab.php:374
-msgid "Select image"
-msgstr ""
-
-#: premium/tabs/related-tab.php:376
-msgid ""
-"If a post doesn't have a featured image, this image will be used instead."
-msgstr ""
-
-#: premium/tabs/related-tab.php:380
-msgid "Check this post to remove the default thumbnail."
-msgstr ""
-
-#: premium/tabs/related-tab.php:387
-msgid "Display excerpts"
-msgstr ""
-
-#: premium/tabs/related-tab.php:392
-msgid "Display excerpts for related posts."
-msgstr ""
-
-#: premium/tabs/related-tab.php:395
-#, php-format
-msgid ""
-"This uses the manually created post excerpt if one exists, otherwise the "
-"beginning of the post is used. Default length is 50 characters, use the %s "
-"filter hook to adjust that."
-msgstr ""
-
-#: premium/tabs/related-tab.php:401
-msgid "Minimum width"
-msgstr ""
-
-#: premium/tabs/related-tab.php:402
-msgid "in pixels"
-msgstr ""
-
-#: premium/tabs/related-tab.php:407
-msgid "The minimum width of the related post element."
-msgstr ""
-
-#: premium/tabs/related-tab.php:412
-msgid "Caching"
-msgstr ""
-
-#: premium/tabs/related-tab.php:414
-msgid ""
-"The related posts are cached using WordPress transients. The related posts "
-"for each post are stored in a transient that is stored for two weeks. The "
-"cache for each post is flushed whenever the post is saved. When a post is "
-"made non-public (returned to draft, trashed), Relevanssi automatically "
-"flushes all related post caches where that post appears."
-msgstr ""
-
-#: premium/tabs/related-tab.php:419
-msgid "Use cache for admins"
-msgstr ""
-
-#: premium/tabs/related-tab.php:424
-msgid "Use the cache for admin users."
-msgstr ""
-
-#: premium/tabs/related-tab.php:426
-msgid ""
-"Disable this option when adjusting the settings to see changes on the site."
-msgstr ""
-
-#: premium/tabs/related-tab.php:432
-msgid "Flush cache"
-msgstr ""
-
-#: premium/tabs/related-tab.php:437
-msgid "Flush the caches."
-msgstr ""
-
-#: premium/tabs/related-tab.php:439
-msgid "Check this box to flush all related posts caches."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:42
-msgid "Spam Blocking"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:44
-msgid ""
-"These tools can be used to block spam searches on your site. It's best if "
-"the spam searches can be blocked earlier on server level before WordPress "
-"starts at all, but if that's not possible, this is a fine option."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:50
-#, php-format
-msgid ""
-"These filters are applied to all searches done using the %1$s parameter, the "
-"%2$s pretty URLs (if your pretty URLs are using a different prefix, you can "
-"use the %3$s filter hook to adjust the spam block) and also on page views "
-"with the %4$s parameter."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:59
-msgid ""
-"You can figure out the suitable keywords from your User searches page. Look "
-"for common terms. Often spam queries contain URLs, and the top level domain "
-"names are good keywords, things like '.shop', '.online', '.com' – those "
-"appear rarely in legitimate searches."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:64
-msgid "Keyword spam blocking"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:66
-msgid ""
-"Enter keywords, one per line. If these keywords appear anywhere in the "
-"search string, the search will be stopped. Use as short keywords as "
-"possible, but be careful to avoid blocking legitimate searches. The keywords "
-"are case insensitive."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:69
-msgid "Regex keywords"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:72
-#, php-format
-msgid ""
-"These keywords support the use of regular expressions with preg_match(). The "
-"keywords will be wrapped with %1$s."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:75
-msgid "Block Chinese queries"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:77
-msgid "Block queries that contain Chinese characters."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:80
-msgid "Block Cyrillic queries"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:82
-msgid "Block queries that contain Cyrillic characters."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:85
-msgid "Block emoji queries"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:87
-msgid "Block queries that contain emoji characters."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:90
-msgid "Block bot queries"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:92
-msgid ""
-"Block queries from bots. Only applied to searches, not to page views with "
-"highlights."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:95
-msgid "Current list of bots: "
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:101
-#, php-format
-msgid "You can add new bots to the list with the filter hook %1$s."
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:108
-msgid "Blocking bots"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:110
-msgid ""
-"You can use the Relevanssi spam block to also block requests from bots. In "
-"general there's very little reason to allow bots to crawl search results "
-"pages. They can create lots of really quite pointless traffic. On one of my "
-"sites, out of 20.000 search queries, 16.000 were useless queries by the Bing "
-"bot. Nice bots will obey the robots.txt instructions. This code snippet adds "
-"robots.txt rules that block rule-obeying bots from accessing search results "
-"pages:"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:123
-msgid "Blocking at the server level"
-msgstr ""
-
-#: premium/tabs/spamblock-tab.php:125
-msgid ""
-"It's best if the blocking is done before WordPress starts up in the first "
-"place: that will increase security and will save server resources. These "
-"tools can be used to block bot traffic on your site, but using them requires "
-"expertise on server settings. Use them only if you know what you're doing, "
-"or have a professional help you."
-msgstr ""
-
-#: premium/tabs/support-tab.php:38
-#, php-format
-msgid ""
-"This form sends out an email to the Relevanssi support. If you have a "
-"question, please fill in the form below and we will get back to you as soon "
-"as possible. If you don't hear from us in a day or two, it's possible your "
-"email has gone astray. In that case, please contact us again and use %1$sthe "
-"support form at Relevanssi.com%2$s. You can also email us directly at %3$s. "
-"Expect slower response times during June and July."
-msgstr ""
-
-#: premium/tabs/support-tab.php:49
-#, php-format
-msgid ""
-"We have a large knowledge base. %1$sTake a look there%2$s, perhaps your "
-"question is already answered there."
-msgstr ""
-
-#: premium/tabs/support-tab.php:53
-msgid ""
-"Instead of telling us \"X doesn't work\", please try be as specific as "
-"possible. Please tell us what you expect to happen and what actually happens."
-msgstr ""
-
-#: premium/tabs/support-tab.php:55
-msgid ""
-"Feel free to ask questions in English or Finnish. Please do not send us "
-"video questions."
-msgstr ""
-
-#: premium/tabs/support-tab.php:62
-msgid "Your email address"
-msgstr ""
-
-#: premium/tabs/support-tab.php:66
-msgid "Subject"
-msgstr ""
-
-#: premium/tabs/support-tab.php:70
-msgid "Message"
-msgstr ""
-
-#: premium/tabs/support-tab.php:75
-msgid "Send"
-msgstr ""
-
-#: premium/tabs/support-tab.php:111
-msgid "Email sent!"
-msgstr ""
-
-#: premium/tabs/support-tab.php:117
-msgid "Email failed!"
-msgstr ""
diff --git a/relevanssi-premium/stopwords/stopwords.cs_CZ b/relevanssi-premium/stopwords/stopwords.cs_CZ
deleted file mode 100644
index 9e8b426a..00000000
--- a/relevanssi-premium/stopwords/stopwords.cs_CZ
+++ /dev/null
@@ -1,327 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.de_DE b/relevanssi-premium/stopwords/stopwords.de_DE
deleted file mode 100644
index be4105ea..00000000
--- a/relevanssi-premium/stopwords/stopwords.de_DE
+++ /dev/null
@@ -1,1037 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.en_CA b/relevanssi-premium/stopwords/stopwords.en_CA
deleted file mode 100644
index 86215bda..00000000
--- a/relevanssi-premium/stopwords/stopwords.en_CA
+++ /dev/null
@@ -1,323 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.en_GB b/relevanssi-premium/stopwords/stopwords.en_GB
deleted file mode 100644
index 86215bda..00000000
--- a/relevanssi-premium/stopwords/stopwords.en_GB
+++ /dev/null
@@ -1,323 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.en_US b/relevanssi-premium/stopwords/stopwords.en_US
deleted file mode 100644
index 86215bda..00000000
--- a/relevanssi-premium/stopwords/stopwords.en_US
+++ /dev/null
@@ -1,323 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.es_ES b/relevanssi-premium/stopwords/stopwords.es_ES
deleted file mode 100644
index 4dbeea01..00000000
--- a/relevanssi-premium/stopwords/stopwords.es_ES
+++ /dev/null
@@ -1,386 +0,0 @@
-
diff --git a/relevanssi-premium/stopwords/stopwords.fi b/relevanssi-premium/stopwords/stopwords.fi
deleted file mode 100644
index c9e56028..00000000
--- a/relevanssi-premium/stopwords/stopwords.fi
+++ /dev/null
@@ -1,365 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.fr_FR b/relevanssi-premium/stopwords/stopwords.fr_FR
deleted file mode 100644
index 87290ad5..00000000
--- a/relevanssi-premium/stopwords/stopwords.fr_FR
+++ /dev/null
@@ -1,72 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.it_IT b/relevanssi-premium/stopwords/stopwords.it_IT
deleted file mode 100644
index 10aa1b0f..00000000
--- a/relevanssi-premium/stopwords/stopwords.it_IT
+++ /dev/null
@@ -1,666 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.pt_BR b/relevanssi-premium/stopwords/stopwords.pt_BR
deleted file mode 100644
index b0798a02..00000000
--- a/relevanssi-premium/stopwords/stopwords.pt_BR
+++ /dev/null
@@ -1,173 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/stopwords/stopwords.zh_TW b/relevanssi-premium/stopwords/stopwords.zh_TW
deleted file mode 100644
index 5e13ccad..00000000
--- a/relevanssi-premium/stopwords/stopwords.zh_TW
+++ /dev/null
@@ -1,769 +0,0 @@
-
\ No newline at end of file
diff --git a/relevanssi-premium/uninstall.php b/relevanssi-premium/uninstall.php
deleted file mode 100644
index ff56fb0c..00000000
--- a/relevanssi-premium/uninstall.php
+++ /dev/null
@@ -1,32 +0,0 @@
-get_col( "SELECT blog_id FROM $wpdb->blogs" );
- $old_blogid = $wpdb->blogid;
- foreach ( $blogids as $uninstall_blog_id ) {
- switch_to_blog( $uninstall_blog_id );
- relevanssi_uninstall();
- restore_current_blog();
- }
-
- delete_site_option( 'relevanssi_api_key' );
-} else {
- relevanssi_uninstall();
-}