url parameter is getting changed from ?s= to ?phrase= while implementing the plu

Home Forums Product Support Forums Ajax Search Pro for WordPress Support url parameter is getting changed from ?s= to ?phrase= while implementing the plu

This topic contains 22 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 1 month ago.

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #32126
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    Finally some good news. We got the script to load when we removed “wp-hooks” from the “wp_register_script” dependency in (./ajax-search-pro/includes/classes/core/class-asp-init.php:516).

    wp_register_script(
    ‘wd-asp-ajaxsearchpro’, ASP_URL . “js/” . $js_source . “/jquery.ajaxsearchpro” . $minify_string . “.min.js”,
    array(‘jquery’, ‘wp-hooks’),
    $media_query,
    $load_in_footer);

    So now the script is working fine and the functionalities seems to work fine as of now. But my concern is as we have removed a dependency “wp-hooks” from wp_register_script, so will it impact anything?

    Thanks
    Jyotiranjan

    #32127
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    No, luckily there is a secondary check in the script files to check if the wp-hooks module is loaded, it should be perfectly fine.

    Best,
    Ernest Marcinko

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


    #32132
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    That is really some great news as the secondary check of wp-hooks will avoid any disrupt in the plugin functions.

    But I just want to know or, can you provide some information on why after removing the wp-hooks (from plugin code) made the script to load properly.

    Now as we know the culprit, so can we make some configuration settings check or, change from the wordpress dashboard so that we do not have to explicitly remove this piece of code from the plugin code files while deploying the changes to other environments.

    Thanks
    Jyotiranjan

    #32138
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The reason it started working is because the plugin enqueues it’s scripts and as prerequesites are marked two WordPress internal resources, one is ‘jquery’ and the other is ‘wp-hooks’.
    Any internal prerequesite scripts marked in enqueued scripts are automatically loaded by WordPress upon initialization. The issue in your case is, that something is very likely forecefully dequeueing or preventing the queue the ‘wp-hooks’ script handle, thus the prerequesites are not met, and wordpress simply ignores the scripts from loading.
    I can (and probably will) make an adjustment in our plugin to try to load without the ‘wp-hooks’ enqueue in the future release, which could bypass the issue – but I still recommend investigating what the actual cause is for that missing resource. Unfortuantely I don’t know where to look for these, I very highly doubt it is a configuration related issue. Scripts are usually dequeued programmatically.

    Best,
    Ernest Marcinko

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


    #32155
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    Perfect. Will wait for the updated version of the plugin.

    I tried different plugin configuration combinations, but no success yet. I was also trying to figure out if any other plugin is causing the issue.
    During my further analysis I did found something interesting which I am gonna share below, just let me know if that is the root cause.

    Our actual application environment uses wordpress v-4.9.16. To check for validity, in localhost, I installed the ASP plugin (v-4.20.2) in different fresh wordpress installations with versions (4.9.16, 5.0, 5.1, 5.2, 5.3, 5.5) with no other plugins installed. The ASP plugin is working(initializing) as expected for all the wordpress versions only except for the wordpress v-4.9.16. And as expected only after removing “wp-hooks” from the code in file (/ajax-search-pro/includes/classes/core/class-asp-init.php:516) [ wp_register_script( ‘wd-asp-ajaxsearchpro’, ASP_URL . “js/” . $js_source . “/jquery.ajaxsearchpro” . $minify_string . “.min.js”, array(‘jquery’, ‘wp-hooks’), $media_query, $load_in_footer); ] It is working fine.

    As per the documentation, the plugin is compatible with WP 4.9, but looks like it is somehow getting restricted.
    Also I have installed the AjaxsearchPro (v-4.20.2) in a separate temporary WordPress instance (v-4.9.16) in a public domain (which you can access for testing)
    https://tinyurl.com/yfsb5k44 with temporary admin credentials (Tmpadmin, Welcome@135). Let me know if you can find any configuration changes that can be done which could fix the problem.

    • This reply was modified 3 years, 1 month ago by jsamal29 jsamal29.
    • This reply was modified 3 years, 1 month ago by jsamal29 jsamal29.
    • This reply was modified 3 years, 1 month ago by jsamal29 jsamal29.
    #32165
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you!

    I assume the wp-hooks was added later on, even though it was documented to be available for 4.9 – I strongly believe that is the case, it explains everything perfectly.
    I will keep that in mid, in the meantime I already impletmented a solution to the upcoming release so the plugin only tries to access that resource if possible, but prevents wordpress from terminating the script loading if not available.

    Best,
    Ernest Marcinko

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


    #32172
    jsamal29
    jsamal29
    Participant

    Did you mean wp-hooks was added later into the wordpress core itself or, was it added into the AjaxSearchPro plugin for making compatible with wordpress 4.9?

    Also when can we expect the next updated version of plugin with these fixes?

    #32177
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I mean WordPress core, the wp-hooks asset was probably added in a later RC patch of 4.9 (or could have been removed as well, I could not find any information).

    The next patch is dated to next week 🙂

    Best,
    Ernest Marcinko

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


Viewing 8 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic.