• Resolved mw815371

    (@mw815371)


    Hi there,

    I tried to get WP-Optimize to exclude some javascript files from the Learnpress plugin. So far, I had no success. The files are used to display the quizzes in learnpress courses. The only way to solve the problem is to switch off the javascript minification, which I wouldn’t like to do for a longer period. But until I have a solution, I switch off javascript minification in WP-Optimize.

    Here is the list of files I need to exclude:

    /wp-content/plugins/learnpress/assets/js/dist/frontend/lp-configs.min.js
    /wp-content/plugins/learnpress/assets/js/dist/frontend/modal.min.js
    /wp-content/plugins/learnpress/assets/js/dist/frontend/question-types.min.js
    /wp-content/plugins/learnpress/assets/js/dist/frontend/quiz.min.js
    /wp-content/plugins/learnpress/assets/js/dist/frontend/single-curriculum.min.js
    /wp-content/plugins/learnpress/assets/js/dist/js/data-controls.min.js
    /wp-content/plugins/learnpress/assets/js/dist/utils.min.js
    /wp-content/plugins/learnpress/assets/js/dist/loadAJAX.min.js
    /wp-includes/js/utils.min.js
    /wp-includes/js/dist/vendor/lodash.min.js

    When I had javascript minification enabled, I also checked the Advanced tab for information. However, there wasn’t anything that helped me solve the issue. I also tried to defer all javascript or excluded more files mentioned on the Advanced tab. But nothing helped.

    Any idea what I could do?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • wpmansour

    (@wpmansour)

    To address the issue of specific JavaScript files not being excluded from minification in WP-Optimize, please follow these additional troubleshooting steps:

    1. Clear All Types of Cache:
      • Server Cache: Ensure you clear any server-side cache (such as Varnish or NGINX cache). Server-side caching can hold onto old versions of files and serve them even after changes are made, preventing new settings from taking effect.
      • Cloudflare Cache: If you’re using Cloudflare, clear the Cloudflare cache as well. Cloudflare can cache static files and deliver them to users, which might include minified versions of JavaScript files that you intend to exclude.
      • WP-Optimize Cache: Make sure to clear the cache within WP-Optimize itself to ensure any changes to the settings are applied correctly.
      • Browser Cache: Clear your browser cache to ensure you are loading the most recent version of the site. Cached versions of JavaScript files might still be loaded otherwise.
    2. Check for Plugin Conflicts:
      • Temporarily deactivate other optimization or caching plugins to see if there is a conflict that prevents the exclusions from taking effect. Plugins such as Autoptimize or WP Rocket may have overlapping functionalities that interfere with WP-Optimize’s exclusions.
    3. Verify Exclusions:
      • Double-check the exclusion paths in WP-Optimize > Minify > JavaScript to ensure they are correctly entered.
      • Try using full URLs for the files if relative paths do not work.
    4. Use Incognito Mode:
      • Open an incognito or private browsing window to test your changes. This mode does not use the browser cache and can help verify if your changes are being applied correctly.

    By following these steps, you should be able to resolve the issue and ensure your Learnpress quizzes function correctly without disabling JavaScript minification entirely.

    Thread Starter mw815371

    (@mw815371)

    Now it works!
    I changed all JavaScript file URLs to full URLs now. This seems to work.
    At first, I only changed the ones I mentioned in my first post to full URLs, which did not work.
    Now I changed all files to be excluded to full URLs.

    Thanks for your help!

    Great to hear that it’s working now! ?? Switching to full URLs often resolves these kinds of issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Some javascript files are not excluded from minification’ is closed to new replies.