If you’re using Lead Booster Pro forms on your website along with the WP Rocket caching plugin, you might encounter issues where the forms do not load or function correctly. This is due to WP Rocket’s optimization features interfering with the Lead Booster Pro scripts.
This guide will walk you through the steps to configure WP Rocket to work seamlessly with Lead Booster Pro by excluding its scripts from certain optimizations.
Understanding the issue
WP Rocket optimizes your website’s performance by minifying, combining, deferring, and delaying the execution of JavaScript files. While these optimizations improve load times, they can interfere with scripts like Lead Booster Pro’s embed code, which requires immediate and unaltered execution to function properly.
By default, WP Rocket may:
- Modify the Lead Booster Pro scripts: Changing the script can break its functionality.
- Defer the script loading: This can cause the script to load after the page has finished parsing, leading to errors.
- Delay the script execution: The script might not run until user interaction, which isn’t suitable for forms that need to load immediately.
Steps to configure WP Rocket
To ensure that Lead Booster Pro works correctly, you’ll need to exclude its scripts from WP Rocket’s optimization processes.
1. Exclude scripts from minification and combination
Minification removes unnecessary characters from code without changing its functionality, while combination merges multiple scripts into one. Both can interfere with external scripts.
Steps:
- Access WP Rocket Settings:
- Log in to your WordPress admin dashboard.
- Navigate to Settings > WP Rocket.
- Go to the File Optimization Tab:
- Click on the “File Optimization” tab.
- Exclude the Lead Booster Pro Scripts:
- Under JavaScript Files: Find the sections for “Minify JavaScript Files” and “Combine JavaScript Files”.
- Add Exclusion:
- In the “Exclude JavaScript Files” fields (for both minification and combination), add the following line:
app.leadboosterpro.io
- This wildcard pattern ensures that any script from
app.leadboosterpro.io
is excluded from minification and combination.
- In the “Exclude JavaScript Files” fields (for both minification and combination), add the following line:
- Save Changes:
- Click on the “Save Changes” button at the bottom of the page.
2. Exclude scripts from deferred loading
Deferring JavaScript means loading scripts after the initial page load, which can cause Lead Booster Pro scripts to fail if they are needed immediately.
Steps:
- Still in the File Optimization Tab:
- Scroll down to the “Load JavaScript Deferred” section.
- Exclude the Lead Booster Pro Scripts:
- In the “Excluded JavaScript Files” field, add: app.leadboosterpro.io
- Save Changes:
- Click on “Save Changes” if you haven’t already.
Verifying the configuration
After updating the settings, it’s essential to ensure that everything works correctly.
Steps:
Clear WP Rocket Cache:
- Go to WP Rocket > Dashboard.
- Click on “Clear Cache”.
Test Your Website:
- Visit the page(s) where your Lead Booster Pro forms are embedded.
- Ensure that the forms load correctly and are fully functional.
Check for Console Errors:
- Open your browser’s developer tools (usually by pressing
F12
). - Look for any JavaScript errors in the console that might indicate issues.
- Open your browser’s developer tools (usually by pressing
Conclusion
By excluding Lead Booster Pro scripts from WP Rocket’s optimization features, you ensure that your forms load and function correctly without sacrificing the overall performance benefits WP Rocket provides. This configuration allows both plugins to coexist harmoniously, providing a seamless experience for your website visitors.
FAQ
Will excluding scripts from optimization impact my site's performance?
Excluding a few essential scripts like those from Lead Booster Pro will have a minimal impact on your site’s performance. The benefits of the forms working correctly outweigh the negligible performance difference.
Can I use a specific script URL instead of a wildcard in the exclusions?
Yes, if you prefer to target a specific script, you can use the exact URL, such as: https://app.leadboosterpro.io/form/iframe.js
.
However, using a wildcard ensures that any current or future scripts from Lead Booster Pro are also excluded.
Do I need to repeat these steps after updating WP Rocket?
These settings should persist through updates. However, verifying your configurations after major plugin updates is a good practice.
What if I still experience issues after making these changes?
If problems persist:
- Ensure that all caching (including browser cache) is cleared.
- Check for conflicts with other plugins.
- Contact Lead Booster Pro support for further assistance.
Is there an alternative to excluding scripts?
While not recommended in this case, you could try adjusting the script loading order or using custom code to ensure scripts execute properly. However, excluding the scripts is the most straightforward and reliable solution.