500 error

This topic contains 5 replies, has 2 voices, and was last updated by malhyp malhyp 1 year, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #39949
    malhyp
    malhyp
    Participant

    Hi Ernest,

    I sent an email yesterday about the 500 error, can you have a look into this urgently? The whole site relies on search as there are many products and this is the third time we get this error. Last time you mentioned that the issue was resolved via a plugin update.

    To confirm, we upgraded to PHP 8 yesterday and noticed this straight after the update.

    In relation to access to the site, can you test admin and SSH? there is no FTP on this server.

    Thanks
    Malcolm

    #39951
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Malcolm,

    Thank you very much for the details. I have logged in to the back-end and installed a beta version of the next release, which addresses a few known bugs.

    Can you please test if that resolved the issues?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39954
    malhyp
    malhyp
    Participant

    Hi Ernest, thanks for the update, did you try?

    Attached is what we see, one is searching for something, and the other is when we hit enter.

    Attachments:
    You must be logged in to view attached files.
    #39957
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I did, and strangely it actually worked.

    I will do a debugging session via the sftp access, and will let you know what I found.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39958
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The issue was not related to the plugin, you had a custom code in your functions.php file which was incorrect and caused the error. I made a correction to it, now it is going to be fine. For reference, this is the correct code:

    // Replace search phrases
    add_filter('asp_search_phrase_before_cleaning', 'asp_replace_characters', 10, 1);
    add_filter('asp_query_args', 'asp_replace_characters', 10, 1);
    function asp_replace_characters( $s ) {
    	$before_strings = array(
    		"landc" => "land c", //land cruiser
    		"brakes" => "brake",
    		"rangero" => "range ro", //range rover
    		"landr" => "land r", //land rover
    		"towb" => "tow b", //towbar
    		"bellh" => "bell h", //bellhousing
    		"extractor" => "header",
    		"pickup" => "ute",
    		"hood" => "bonnet",
    		"mfg12" => "mfk12",
    		"brake disc" => "brake rotor",
    		"adapte" => "adapto",
    		"centref" => "centerf",
    		"hydrob" => "hydro b"
    	);
    	
    	foreach($before_strings as $key => $value){
    		if ( is_array($s) ) {
    			$s['s'] = str_replace($key, $value, $s['s']);
    		} else {
    			$s = str_replace($key, $value, $s);
    		}
    	};
    	
      	return $s; 
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39961
    malhyp
    malhyp
    Participant

    Hi Ernest,

    Thanks for the update, and for finding that issue.

    Honestly, I don’t know why it’s there but will ask.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.