wp-rocket
wp-rocket copied to clipboard
Fix WP Search with Algolia seach feature
https://secure.helpscout.net/conversation/1736063475/315781/
The issue was reproducible while jQuery
is excluded in UI. However, on the branch (while excluding jQuery), the original error was fixed but another error was there in the console.
@DahmaniAdame can you please check if anything else needs to be excluded.
@Mai-Saad the issue is fixed adding the underscore.min.js
and the wp-util.min.js
libraries to the exclusions:
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
/wp-includes/js/underscore.min.js
/wp-includes/js/wp-util.min.js
/wp-search-with-algolia/js/algoliasearch/dist/algoliasearch-lite.umd.js
/wp-search-with-algolia/js/autocomplete-noconflict.js
/wp-search-with-algolia/js/autocomplete.js/dist/autocomplete.min.js
var algolia
Can you check if it's working properly now on https://new.rocketlabsqa.ovh/youtube-regular-2/?
@DahmaniAdame Please notice that (on branch):
1- Exclusions mentioned here https://github.com/wp-media/wp-rocket/pull/4645#issuecomment-1013653974 are working fine with delay js
2- We have a jQuery
error when combine js is enabled (same on the trunk) I think the same exclusions are needed for Combine JS (not sure if we will add this here or on different PR). what do you think?
Note:
For the Delay JS problem, it wasn't reproducible on trunk except if we excluded jQuery
so do we need global exclusions here not site-based? (just confirming that)
@Mai-Saad Do we have any problem when nothing is excluded from Delay JS? If the problem happens only when jQuery is excluded, I don't think we need a global exclusion for that.
@piotrbak on the test site using trunk, the problem with Delay JS is there only when we exclude jQuery
(if we auto exclude jQuery
with any other plugin/theme then maybe that was causing the problem at the client site)
While the error with Combine JS is there without adding any exclusions.
@Mai-Saad @DahmaniAdame I'm not able to reproduce the problem when no exclusions are there. Here's what I'm experiencing:
Delay JS
- No exclusions are being made, no issue
-
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
exclusion, no issue -
jquery
exclusion, there's a problem mentioned by Adame (this exclusion doesn't seem to be correct though)
Combine JS
- There's a problem, as Algolia inline script is automatically excluded because of dynamic inline exclusions. However, it's dependent on the jQuery, so it should be placed below the combined file. The solution is to move this exclusion to this array.
@DahmaniAdame Could you confirm the Delay JS part on the customer's website?
Removing it from the 3.11.2 milestone. We still need an exploratory and confirmation here.