Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
CRAP | n/a |
0 / 0 |
|
| Automattic\Jetpack_Boost\Compatibility\JS_Concatenate\maybe_do_not_concat | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Exclude known scripts that causes problem when concatenated. |
| 4 | */ |
| 5 | |
| 6 | namespace Automattic\Jetpack_Boost\Compatibility\JS_Concatenate; |
| 7 | |
| 8 | function maybe_do_not_concat( $do_concat, $handle ) { |
| 9 | $excluded_handles = array( |
| 10 | // Plugin: `event-tickets` |
| 11 | 'tribe-tickets-block', |
| 12 | 'tribe-tickets-provider', |
| 13 | // Plugin: `woocommerce-shipping` |
| 14 | 'woocommerce-shipping-checkout-address-validation', |
| 15 | // Plugin: `depay-payments-for-woocommerce` |
| 16 | 'DEPAY_WC_WIDGETS', |
| 17 | // Plugin: `woocommerce-bookings` |
| 18 | 'wc-bookings-booking-form', |
| 19 | // WooCommerce Analytics |
| 20 | 'woocommerce-analytics-client', |
| 21 | ); |
| 22 | |
| 23 | if ( in_array( $handle, $excluded_handles, true ) ) { |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | return $do_concat; |
| 28 | } |
| 29 | |
| 30 | add_filter( 'js_do_concat', __NAMESPACE__ . '\maybe_do_not_concat', 10, 2 ); |