Support » Plugin: Ajax Search Lite » No images in new version + search phrase modification

  • Resolved r3crac

    (@r3crac)


    Hello, I have two problems.
    1. I have updated ASL from 4.8.6 to 4.9.2 and I had to roll it back to 4.8.6. After updating there’re no images in search results. Images should be downloaded from post content (it’s working on 4.8.6), but there’re no images at all.

    2. I was modyfing your code by adding simple PHP code to change search phrase. In new version you have changed files/code and I’m not sure where I should put my code so it will work. Here is my code in ajax-search-lite/includes/classes/search/search.controller.class.php in version 4.8.6:

    public function search() {
                $this->parseOptions();
    
                $sd = &$this->args['instance']['data'];
                $s = $this->args['phrase'];
                $id = $this->args['id'];
    			
    			// Moj dodatek
    			if (preg_match('/.+banggood.com.+/', $s))
    			{
    				preg_match('/(p\\-[0-9]+)\\.html/', $s, $matches);
    				$s = $matches[0];
    			}
    
    			if (preg_match('/.+gearbest.com.+/', $s))
    			{
    				preg_match('/(pp\\_[0-9]+)\\.html/', $s, $matches);
    				$s = $matches[0];
    			}
    			// --------------------
    
                $allpageposts = array();
                $pageposts = array();(...)

    Can you tell me where I should modify code in new version?
    Cheers

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    1. Check the image options, if everything is set correctly here: https://i.imgur.com/ajbWHQP.png
    There was no change in the image parser in the last releases, we only added a couple of new options.

    2. I do not recommend doing customizations directly, as you will lose it on every update.
    There are two new hooks, which you can add custom code to:

    apply_filters('asl_search_phrase_before_cleaning', $phrase);
    apply_filters('asl_search_phrase_after_cleaning', $phrase);

    I ratrher recommend these if you want to make changes to the search phrase 🙂

    Best,
    Ernest M.

    Thread Starter r3crac

    (@r3crac)

    1. I’ve set the same settings as in the image and there’re no images. Also search result is the same for every phrase on cached version (non-admin) of the website!!! It doesn’t matter what I write – the result is the same every time.
    https://i.imgur.com/qtwZfOD.png
    I’ve had to rollback to 1.8.6 again. I think I need to make complete plugin wipe (“Maintencance – Wipe & Deactivate”). Shouldn’t I?

    2. Your method is working ;).
    Thanks

    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    Plugin Author wpdreams

    (@wpdreams)

    Hi,

    1. Yes, try a complete plugin wipe for sure. Rolling back and frorth is a bad idea in general.

    Thread Starter r3crac

    (@r3crac)

    1. I found out why there’re no images. When I turn off “Show description in results?”, then images disappear!
    https://i.imgur.com/S8GZQ5n.png

    When I turn it on, then they appear.
    https://i.imgur.com/l2yXFbw.png

    I have images in post content. It was working in version 4.8.6. I think there is some bug in your code or I have wrong image settings, which are visible here: https://i.imgur.com/P3qgHba.png

    2. I found out that in cached version on main page there’re always the same results for anything I search.
    I https://i.imgur.com/EHHAu92.png
    II https://i.imgur.com/8UOUr8U.png

    When I search from any other page than main page, then search results are OK (on cached website). On non-cached (admin) version there’re proper results. I will check it out tomorrow and let you know.
    Cheers

    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    • This reply was modified 3 months, 1 week ago by r3crac.
    Thread Starter r3crac

    (@r3crac)

    2. Update: it’s working on main page after some time

    Plugin Author wpdreams

    (@wpdreams)

    1. Indeed, I can replicate that, thank you for figuring that out. I will make sure to resolve it in the next release.
    Until then, use this custom CSS to hide the description and to keep the images:

    p.asl_desc {
        display: none !important;
    }
    Thread Starter r3crac

    (@r3crac)

    I’ll just wait for next version. Thanks!

    Thread Starter r3crac

    (@r3crac)

    Now everything is working (after update)! Thanks!

    Plugin Author wpdreams

    (@wpdreams)

    Neat 🙂

    I will mark this topic as resolved then.

    Feel free to rate the plugin if you like it, it is greatly appreciated.

    Best,
    Ernest M.

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