WP Rocket: Fixing JavaScript errors on pages with Stylish Cost Calculator
Follow the steps to fix JavaScript errors on frontend pages cached/optimized by WP Rocket and has 'Stylish Cost Calculator' forms.

If you use Stylish Cost Calculator Premium, use the following pattern in the exclusions list

If you are using Stylish Cost Calculator free version, use the following
To avoid any potential issues with WP Rocket, we recommend avoiding caching pages that have a calculator. You can use the "Never Cache This Page" option to avoid caching from your page editor.

Method 1:
Go to WP Rocket Settings

Exclude Stylish Cost Calculator Files
If you use Stylish Cost Calculator Premium, use the following pattern in the exclusions list
/wp-content/plugins/stylish-cost-calculator-premium/assets/js/(.*).js
/wp-content/plugins/stylish-cost-calculator-premium/dist/frontend/(.*).js

If you are using Stylish Cost Calculator free version, use the following
/wp-content/plugins/stylish-cost-calculator/assets/js/(.*).js
Method 2:
Exclude Calculator Page Cache
To avoid any potential issues with WP Rocket, we recommend avoiding caching pages that have a calculator. You can use the "Never Cache This Page" option to avoid caching from your page editor.

Updated on: 04/03/2025
Thank you!