Plugin Customasation

This topic contains 8 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 6 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #15685
    book24sa
    book24sa
    Participant

    Good day
    Kindly assist with a plugin customisation.

    #15686
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #15687
    book24sa
    book24sa
    Participant
    You cannot access this content.
    #15688
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #15689
    book24sa
    book24sa
    Participant
    You cannot access this content.
    #15768
    book24sa
    book24sa
    Participant
    You cannot access this content.
    #15771
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #15833
    book24sa
    book24sa
    Participant
    You cannot access this content.
    #15838
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


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

You must be logged in to reply to this topic.