Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Plugin Customasation
This topic contains 8 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 8 months ago.
- AuthorPosts
- December 1, 2017 at 1:09 pm #15685
Good day
Kindly assist with a plugin customisation.December 1, 2017 at 1:59 pm #15686Hi,
Please note that plugin customization is not part of the support process (Support Policy). If you need some basic changes, let me know as detailed as possible, I might be able to help.
For more complex customizations, I recommend the following service: wpkraken.io
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 1, 2017 at 2:21 pm #15687You cannot access this content.December 1, 2017 at 3:47 pm #15688Hi,
The problem was because there is something going wrong with the minification process, I had to turn it off: https://i.imgur.com/2LdIXwv.png
The localization of the main script was not executed correctly after the minification, so the script variables were unset. I will investigate this issue on my local environment, and contact the w3tc plugin developers if neccessary.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 1, 2017 at 3:49 pm #15689You cannot access this content.December 7, 2017 at 1:58 pm #15768You cannot access this content.December 7, 2017 at 2:04 pm #15771Hi,
Yes, I did investigate this further, but the issue is not within the search apparently, nor within the core W3TC plugin.
I see you have a custom made W3TC plugin as well, which I guess takes the localized inline script and puts it within a custom function. That is not correct, as it moves it out of the window scope and the ASP variable gets undefined.
If you are the one who made that, then make sure that the:
wp_localize_script('wd-asp-ajaxsearchpro', 'ASP', array(...
and the
wp_localize_script('wd-asp-ajaxsearchpro', 'ajaxsearchpro', array(..
..localizations are not moved away from the window scope. This is not possible to fix from this plugins perspective, as wp_localize_script is a core wordpress function, which places an inline script just before the handler, which is executed in the window scope. If the output is moved to a custom javascript function, it will not work.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 11, 2017 at 11:56 am #15833You cannot access this content.December 11, 2017 at 3:41 pm #15838Hi,
The issue still the minification unfortunately. I cannot re-create the issue with the core W3TC plugin, as it works correctly – I use it on the demo site as well, it is great.
However as I mentioned earlier, the two very important global variables are moved by the minification script to the site footer, into a custom function. Please take a look at this, this is from your site footer: https://i.imgur.com/WNUNR95.png
These variables have to be outside of any function, and currently they are encapsuled within the window.w3tc_run_foot() function, which is causing the problem, as the ASP and the ajaxsearchpro variables become local and no longer accessible outside the function, as they should be.This is not caused by the search plugin, it is very likely a customization, the code originally works fine as well as with the original W3TC minification script. There is nothing I can do about this, as it is caused by customization, which moves the search variables to a function scope, making them local, which is incorrect. Localized variables should not be removed from the window’s scope.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.