This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Javascript in results and Datafeedr

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Javascript in results and Datafeedr

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5652
    apeksapeks
    Participant

    I am building a new site and have a couple of queries for you in relation to your plugin.

    1. Javascript in results. – If I place a line of javascript (for example to show an image brought in by javascript) into the first lines of a post then when you conduct a search using the search bar then the the actual javascript code is shown in the search result
    Example Search Results Image

    Is there a way I can avoid this in your search plugin?

    2. Does your plugin support plugins such as Datafeedr so when a search is conducted it searches Datafeedr products contained in the database? (table name is dfr_shop_products)

    Many thanks
    Adrian

    • This topic was modified 10 years, 9 months ago by apeksapeks.
    #5660
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    1. It’s happening because the PHP strip_tags() function returns the content between the tags. I’ve implemented a regex check to remove extra CSS and JS in case it finds any, but I think it only executes when the Run shortcodes found in post content option is enabled on the Advanced Options panel.
    If that doesn’t work, let me know. In that case the only option is to make direct modifications to the search code. I will try to re-create the problem and suggest a change to force removing the script tags.

    2. It’s definitely not possible. Custom table search is always been on and off the table, but there are several yet unsolvable issues. The problem is not exactly the searching itself, but the processing of results – finding the proper image, getting the url to the result item etc.. These stuff are usually not stored in the database for any plugin and must be obtained with a function call, or instantiating an object – it differs for each and every plugin.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.