WPFTS Pro Main Site

    WPFTS Community Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    1. Home
    2. EpsilonAdmin
    3. Posts
    Get WPFTS Pro today with 25% discount!
    • Profile
    • Following 0
    • Followers 0
    • Topics 33
    • Posts 151
    • Best 3
    • Controversial 0
    • Groups 1

    Posts made by EpsilonAdmin

    • RE: Not working (critical error) on WP 6.0.3-6.1.1

      Hi @Bards

      Officially yes, 2.46.180 is the latest. However there is a pre-release version 2.49.208 that have a lot of fixes including fixed support for PHP8.1+

      I've sent you that version to the private chat, please install it to replace 2.46.180 and try with PHP8.1.

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Not working (critical error) on WP 6.0.3-6.1.1

      Hi @Bards

      Okay could you still tell me which WPFTS version is there?
      Basically it can be too old, because latest WPFTS version DOES support PHP8.1.

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Not working (critical error) on WP 6.0.3-6.1.1

      Hi @Bards

      It's a very strange issue. Look to the error message, it says "Call to undefined function error_log()" that means "error_log" function was not found. However it's a native PHP function which should be present always.

      https://www.php.net/manual/en/function.error-log.php

      Why it's not defined? It can be your server or your hosting issue. Could you consult your hosting provider's support for that?

      Also there is a link to this code from WPFTS core:

      			$q = 'select 
      					count(*) n_inindex, 
      					sum(if ((force_rebuild = 0) and (build_time != 0), 1, 0)) n_actual
      				from `'.$idx.'index` 
      				where `tsrc` = "wp_posts"';
      			$res = $wpfts_core->db->get_results($q, ARRAY_A);
      
      

      As you can see it's a very simple code that basically should not trigger a critical error.

      Please could you tell me which WPFTS version you tried and which PHP version is used there.

      Thank you!

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Not working (critical error) on WP 6.0.3-6.1.1

      Hi @Bards

      Strange issue. Could you please check or share your error.log with lines about fulltext-search plugin? There should be any records in this case.

      Could you share any screenshot with the critical error message?

      Thanks!

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Indexing failure

      @docholliday Hi I sent you a pre-release version of WPFTS to the chat. Please check it out. Thank you!

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Endless indexing

      @NetzPrinz I sent you a newer (pre-release) version to the private chat. Please try to install it above the 2.46.180, it has numerous fixes including those for better indexing.

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • RE: Endless indexing

      @dcuder It's not correct. For the WPFTS the number of documents is not limited on any plan (neither free nor pro).

      @NetzPrinz Often this happen because there is one post that breaks the indexing routine. We tried to make the indexing routine more protected from such cases, but it is still happen sometimes (in very rare cases!). Could you please tell me which version of the WPFTS you are using currently?

      posted in Bugs and Fixes
      EpsilonAdmin
      EpsilonAdmin
    • [Solved] The files excerpt is not visible in Scientia Theme

      The one small conflict we detected today with the relatively new Scientia Theme.

      This theme is great, but unfortunately it does not show file content excerpts in search results with WPFTS Pro which rather greatly reduces the user experience of the site.

      Fortunately, this is quite easy to fix. The reason is that the authors of this theme (Scientia Theme) decided to override the standard excerpt generation function, and it is the standard the_excerpt hook that our plugin intercepts to output clever quotes.

      Let's create our own function, which will declare itself a little earlier and prevent the theme from creating its own.

      Our function is very simple and looks like this

      if ( ! function_exists( 'scientia_excerpt' ) ) {
      	function scientia_excerpt( $str, $maxlength, $add = '…' ) {
      		ob_start();
      		the_excerpt();
      		return ob_get_clean();
      	}
      }
      

      This solution has been tested with Scientia Theme v1.0.2.

      Of course, you don't need to go into the code now and paste it in. You can just download our add-on, where this code is already there.

      WPFTS Addon for Scientia Theme

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      The problem with the links has been fixed - just a typo in the code. The code in the messages above is correct.

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      This would be great, so I can check by myself.
      BTW I see a strange error in search results page.

      Unfortunately I gonna go right now and will be back in some hours to check WP admin. Please send me access to email.

      Thanks!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Okay, Larry

      I am sure they made some tricks in the plugin to modify URL, but I can't say which tricks, since I only have version 1.1.2 at the moment.

      So let's go with the "patch" solution. Please replace the line

      $a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
      

      with this one

      $a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars(preg_replace('~^\/\/http~', 'http', $link)).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
      

      It should work.

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      I don't think so, it looks like a PHP problem.

      Which version of the Document Library Pro you are using?

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Okay, Larry,

      please could you go to the code we added last time and replace 6th line from the end:

      $a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.esc_url($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
      

      by this one:

      $a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
      

      (actually only esc_url has been replaced by htmlspecialchars).

      I think this function breaks the URL somehow on your server (and it's VERY strange).

      Please let me know. Thanks!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Okay, Larry,

      could you please show me how the links looks like when added to the Document Library Pro document edit window in WP Admin?
      I just checked on my side and I don't see this problem, so I think the difference is how we put links to documents.

      Thanks!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      Yes, we can use Astra-specific hook to add target="_blank" attribute to the title's link.

      Also I made a hook that adds "Download" link below near to "score" value. Unfortunately it's hard to detect filesize at this point (since the file can be located on another server).

      Place this code right below the code that I posted above, in the functions.php:

      
      // Hook to force search result files to open in new tab
      add_filter('astra_the_post_title_before', function($before)
      {
      	if (is_search()) {
      		// Modify the search result title
      		$before = preg_replace('/<a\s+href=/', '<a target="_blank" href=', $before);
      	}
      	
      	return $before;
      });
      
      // Hook to add "Download" link below the excerpt (near the "Score" value)
      add_filter('wpfts_se_output', function($a, $post)
      {
      	if ($a && $post) {
      		if (isset($post['post_type']) && ($post['post_type'] == 'dlp_document')) {
      			// Add Download button
      			$shift = (strlen($a['score']) > 0) ? ' wpfts-shift' : '';
      
      			$link = '';
      
      			$post_id = $post['ID'];
      			
      			$link_type = get_post_meta($post_id, '_dlp_document_link_type', true);
      			$file_size = get_post_meta($post_id, '_dlp_document_file_size', true);
      			$file_id = get_post_meta($post_id, '_dlp_attached_file_id', true);
      			$link_url = get_post_meta($post_id, '_dlp_direct_link_url', true);
      
      			$local_url = false;
      			if ($link_type === 'file') {
      				// The attachment post
      				if ($file_id > 0) {
      				
      					$link = wp_get_attachment_url($file_id);
      				}
      			
      			} elseif ($link_type === 'url') {
      				// The link
      				$link = $link_url;
      			} else {
      				// Unknown link_type
      			
      			}
      			
      			if (strlen($link) > 0) {
      				$a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.esc_url($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
      			}
      		}
      	}
      	
      	return $a;
      }, 10, 2);
      

      Hope this helps. Thanks you!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      The Date and Author is not related to WPFTS, it's the theme author preferences - whether include Date and Author info to the post list. However, thanks to WP's hook system we can add this functionality with a simple code.

      I would recommend to place it into the child theme's functions.php, however you can put it into the main theme functions.php if you are not using child theme.

      add_action('astra_entry_content_before', function()
      {
      	if (is_search()) {
      		// Modify search result posts
      		// Add date and author
      		$author = get_the_author();
      		$author_url = get_the_author_link();
      		
      		echo '<span class="post-meta-infos"><time class="date-container minor-meta updated" itemprop="datePublished">'.the_date().'</time><span class="text-sep"> / </span><span class="blog-author minor-meta">by <span class="entry-author-link" itemprop="author"><span class="author"><span class="fn"><a href="'.htmlspecialchars($author_url).'" title="Posts by '.htmlspecialchars($author).'" rel="author">'.htmlspecialchars($author).'</a></span></span></span></span></span>';
      	}
      });
      

      This code will add Date and Author info to search results.

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      This new Widget editor is crazy, I think there are sidebars on the left and you need to press [+] to see the list of available widgets.

      Okay, for search results style: it looks like your theme is allowed to show the post title only. I don't see here if you are using Elementor to create search results page or you are using theme's default search results page. In the first case you need to add those items (author/date/excerpt) in Elementor. In the second case you need to tell me which theme you are using so I can see if it possible to switch on those fields on the theme settings or make a fix.

      BTW you can search for the theme name over this forum to find any fixes that we already done before.

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      About the WPFTS :: Live Search widget. This widget should be in your widget library (where all other widgets are listed). You can put it on the sidebar or another widget area and fill up some Settings inside the widget form as displayed below:

      E20221005-022126-001[1].png

      Alternatively you can use shortcode to insert the widget into any text content. It can be done with:

      [wpfts_widget preset="<preset_id>" title="" placeholder="Search..." button_text="Search" hidebutton="0" class=""]
      

      You need to put preset_id value to "preset_media" if you want to search for Files Only with this widget or "preset_dlp" for Document Library Pro documents only.

      title can be set in case you want to have a widget title above the input, placeholder and button_text are the texts inside the input and button. Also you can hide the button ("enter key" to start search) by hidebutton=1 and you can set up CSS class via class attribute in case you want to customize widget style.

      Hope this is clear. Feel free to ask if you have some questions!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • RE: How to implement FullTextSearch on a page?

      Hi, Larry

      I've already answered you to email, but have to copy the answer here just for upcoming users.

      Yes, we can make a filter that only searches for "attachment" records.
      To do this, you'll need to add a small addon plugin. It adds a Preset, which can then be selected in the list when adding "WPFTS :: Live Search" widget to the page.

      Earlier we contacted about Document Library Pro record search. These records are of a different type (dlp_document), but we can make a Preset for them too.

      Specify what you would like to use.

      Please before installing next addons, update the main WPFTS Pro package (Pro 2.49.205 or later, I given you the link in the letter)

      Here is an Addon which have two presets:

      • "Media Files Only" - this will search for Media Library files only,
      • "Document Library Pro Only" - this is for DLP documents only.

      https://fulltextsearch.org/wpfts-addon-for-larry-1.0.1.zip

      You need to download, install and activate the addon plugin. No rebuild index required on this step.

      Also here is an addon for Document Library Pro, install it, activate. Then make a fast test: open any Document Library document for Edit in WP Admin and simple Update (Save) it.

      This will trigger the index rebuild for this particular document, and in case the Document Library Addon works fine, you will be able to find this Document in the Test Search.

      https://fulltextsearch.org/wpfts-addon-document-library-pro-1.1.2.zip

      When this works, you can make a complete index rebuild to get all your Document Library Pro documents indexed.

      Let me know how it comes with tests. Thanks!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin
    • [Solved] EduMall theme does not show Smart Excerpts and broken the search results page

      The famous and beautiful EduMall theme for WordPress has a little incompatibility with the WPFTS's Smart Excerpt. The reason for this is simple - the authors of this theme use their own way of shortening article text to generate excerpts and do not offer a workaround method within the code using hooks.

      Well, we'll have to use a tougher method to fix this incompatibility than simply installing an addon (as we do in most other cases).

      So, first of all, we have to switch to the child theme EduMall Child Theme. Technically, we could make fixes in the main theme as well, but in this case any update of the theme would result in the loss of all changes, and we don't need that.

      So, go to the child theme folder, edumall-child, and create a subfolder tree there:

      template-parts/blog/loop/

      Then go to the same folder in the main theme, find files excerpt.php and excerpt-long.php and copy only these two files to the new created folder in the child theme.

      Now we need to "patch" both files.

      Open the first file, excerpt.php, find two calls of the method Edumall_Templates::excerpt and comment it out with parameters, using /* */ operator.

      Then add this line below the "*/":

      the_excerpt();

      Do this in both places in this file.

      When done, move to the second file excerpt-long.php and do exactly the same in it, patch in two places.

      Finally your files should look like this:

      excerpt.php:

      <?php
      /**
       * The template for displaying loop excerpt.
       *
       * @link    https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
       *
       * @package Edumall
       * @since   1.0
       */
      
      defined( 'ABSPATH' ) || exit;
      
      $post_title = get_the_title();
      ?>
      <div class="post-excerpt">
      	<?php if ( empty( $post_title ) ) : ?>
      		<a href="<?php the_permalink(); ?>">
      			<?php /*Edumall_Templates::excerpt( array(
      				'limit' => 11,
      				'type'  => 'word',
      			) );*/ 
      			the_excerpt(); ?>
      		</a>
      	<?php else: ?>
      		<?php /*Edumall_Templates::excerpt( array(
      			'limit' => 11,
      			'type'  => 'word',
      		) );*/ 
      		the_excerpt();	?>
      	<?php endif; ?>
      </div>
      

      and excerpt-long.php:

      <?php
      /**
       * The template for displaying loop excerpt.
       *
       * @link    https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
       *
       * @package Edumall
       * @since   1.0
       */
      
      defined( 'ABSPATH' ) || exit;
      
      $post_title = get_the_title();
      ?>
      <div class="post-excerpt">
      	<?php if ( empty( $post_title ) ) : ?>
      		<a href="<?php the_permalink(); ?>">
      			<?php /*Edumall_Templates::excerpt( array(
      				'limit' => 42,
      				'type'  => 'word',
      			) );*/
      			the_excerpt(); ?>
      		</a>
      	<?php else: ?>
      		<?php /*Edumall_Templates::excerpt( array(
      			'limit' => 42,
      			'type'  => 'word',
      		) );*/
      		the_excerpt(); ?>
      	<?php endif; ?>
      </div> 
      

      All Done.

      After this, the useful Smart Excerpt of WPFTS should be visible on the Search Results pages.

      If it does not work - please let us know!

      posted in Recipes and Known Solutions
      EpsilonAdmin
      EpsilonAdmin