PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.8.6
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.8.6
3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 All 195 releases
← All changes | includes/class-convertkit-cache-plugins.php +9 -58 3.3.22.8.6 View file →
@@ -14,10 +14,9 @@
14 14 */
15 15 class ConvertKit_Cache_Plugins {
16 16
17 17 /**
18 - * Holds external hosts to exclude from CSS and JS minification
19 - * and lazy loading of images.
18 + * Holds external hosts to exclude from CSS and JS minification.
20 19 *
21 20 * @since 2.4.6
22 21 *
23 22 * @var array
@@ -27,9 +26,8 @@
27 26 'pages.kit.com',
28 27 'kit.com',
29 28 'pages.convertkit.com',
30 29 'convertkit.com',
31 - 'filekitcdn.com',
32 30 );
33 31
34 32 /**
35 33 * Holds internal JS paths to exclude from JS minification.
@@ -52,14 +50,9 @@
52 50
53 51 // Autoptimize: Exclude Forms from JS defer.
54 52 add_filter( 'convertkit_output_script_footer', array( $this, 'autoptimize_exclude_js_defer' ) );
55 53 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'autoptimize_exclude_js_defer' ) );
56 - add_filter( 'autoptimize_filter_imgopt_should_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
57 54
58 - // Debloat: Exclude Forms from Delay Load JS.
59 - add_filter( 'debloat/defer_js_excludes', array( $this, 'exclude_hosts' ) );
60 - add_filter( 'debloat/delay_js_excludes', array( $this, 'exclude_hosts' ) );
61 -
62 55 // Jetpack Boost: Exclude Forms from JS defer.
63 56 add_filter( 'convertkit_output_script_footer', array( $this, 'jetpack_boost_exclude_js_defer' ) );
64 57 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'jetpack_boost_exclude_js_defer' ) );
65 58
@@ -66,29 +59,22 @@
66 59 // LiteSpeed: Exclude Forms from JS defer.
67 60 add_filter( 'convertkit_output_script_footer', array( $this, 'litespeed_cache_exclude_js_defer' ) );
68 61 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'litespeed_cache_exclude_js_defer' ) );
69 62
70 - // LiteSpeed: Exclude Forms from JS optimization.
71 - add_filter( 'convertkit_output_script_footer', array( $this, 'litespeed_cache_exclude_js_optimize' ) );
72 - add_filter( 'convertkit_resource_forms_output_script', array( $this, 'litespeed_cache_exclude_js_optimize' ) );
73 -
74 63 // Perfmatters: Exclude Forms from Delay JavaScript.
75 64 add_filter( 'convertkit_output_script_footer', array( $this, 'perfmatters_exclude_delay_js' ) );
76 65 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'perfmatters_exclude_delay_js' ) );
77 - add_filter( 'perfmatters_lazyload', array( $this, 'disable_image_lazy_loading_on_landing_pages' ) );
66 + add_filter( 'perfmatters_lazyload', array( $this, 'perfmatters_disable_lazy_loading_on_landing_pages' ) );
78 67
79 68 // Siteground Speed Optimizer: Exclude Forms from JS combine.
80 69 add_filter( 'convertkit_output_script_footer', array( $this, 'siteground_speed_optimizer_exclude_js_combine' ) );
81 70 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'siteground_speed_optimizer_exclude_js_combine' ) );
82 71
83 - // Rocket LazyLoad: Exclude images from lazy loading.
84 - add_filter( 'rocket_lazyload_excluded_src', array( $this, 'exclude_hosts' ) );
85 -
86 72 // WP Rocket: Disable Caching and Minification on Landing Pages.
87 73 add_action( 'convertkit_output_landing_page_before', array( $this, 'wp_rocket_disable_caching_and_minification_on_landing_pages' ) );
88 74
89 75 // WP Rocket: Exclude Forms from JS minification and combine.
90 - add_filter( 'rocket_minify_excluded_external_js', array( $this, 'exclude_hosts' ) );
76 + add_filter( 'rocket_minify_excluded_external_js', array( $this, 'exclude_hosts_from_minification' ) );
91 77
92 78 // WP Rocket: Exclude Forms from Delay JavaScript execution.
93 79 add_filter( 'convertkit_output_script_footer', array( $this, 'wp_rocket_exclude_delay_js_execution' ) );
94 80 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'wp_rocket_exclude_delay_js_execution' ) );
@@ -160,28 +146,8 @@
160 146
161 147 }
162 148
163 149 /**
164 - * Disable JS Optimization on Kit scripts when the LiteSpeed Cache Plugin is installed, active
165 - * and its "JS Combine" setting is enabled.
166 - *
167 - * @since 3.3.1
168 - *
169 - * @param array $script Script key/value pairs to output as <script> tag.
170 - * @return array
171 - */
172 - public function litespeed_cache_exclude_js_optimize( $script ) {
173 -
174 - return array_merge(
175 - $script,
176 - array(
177 - 'data-no-optimize' => '1',
178 - )
179 - );
180 -
181 - }
182 -
183 - /**
184 150 * Exclude ConvertKit scripts from Perfmatters' "Delay JS" setting.
185 151 *
186 152 * @since 2.4.7
187 153 *
@@ -205,9 +171,9 @@
205 171
206 172 }
207 173
208 174 /**
209 - * Disable image lazy loading when a WordPress Page configured to display a
175 + * Disable lazy loading in Perfmatters when a WordPress Page configured to display a
210 176 * ConvertKit Landing Page is viewed.
211 177 *
212 178 * @since 2.5.1
213 179 *
@@ -213,9 +179,9 @@
213 179 *
214 180 * @param bool $enabled Lazy loading enabled.
215 181 * @return bool
216 182 */
217 - public function disable_image_lazy_loading_on_landing_pages( $enabled ) {
183 + public function perfmatters_disable_lazy_loading_on_landing_pages( $enabled ) {
218 184
219 185 // If the request isn't for a Page, don't change lazy loading settings.
220 186 if ( ! is_page( get_the_ID() ) ) {
221 187 return $enabled;
@@ -227,9 +193,9 @@
227 193 return $enabled;
228 194 }
229 195
230 196 // ConvertKit Landing Page is going to be displayed.
231 - // Disable image lazy loading so that the Landing Page images display.
197 + // Disable Perfmatters Lazy Loading so that the Landing Page images display.
232 198 return false;
233 199
234 200 }
235 201
@@ -266,11 +232,12 @@
266 232 * @since 2.4.6
267 233 */
268 234 public function wp_rocket_disable_caching_and_minification_on_landing_pages() {
269 235
270 - add_filter( 'rocket_minify_excluded_external_js', array( $this, 'exclude_hosts' ) );
271 - add_filter( 'rocket_exclude_css', array( $this, 'exclude_hosts' ) );
236 + add_filter( 'rocket_minify_excluded_external_js', array( $this, 'exclude_hosts_from_minification' ) );
237 + add_filter( 'rocket_exclude_css', array( $this, 'exclude_hosts_from_minification' ) );
272 238 add_filter( 'rocket_exclude_js', array( $this, 'exclude_local_js_from_minification' ) );
239 + add_filter( 'do_rocket_lazyload', '__return_false' );
273 240
274 241 }
275 242
276 243 /**
@@ -303,24 +270,8 @@
303 270 * @param array $hosts External hosts to ignore.
304 271 * @return array
305 272 */
306 273 public function exclude_hosts_from_minification( $hosts ) {
307 -
308 - _doing_it_wrong( __FUNCTION__, 'Use exclude_hosts() instead.', '3.1.0' );
309 -
310 - return $this->exclude_hosts( $hosts );
311 -
312 - }
313 -
314 - /**
315 - * Appends the $exclude_hosts property to an array of existing hosts.
316 - *
317 - * @since 3.1.0
318 - *
319 - * @param array $hosts External hosts to ignore.
320 - * @return array
321 - */
322 - public function exclude_hosts( $hosts ) {
323 274
324 275 return array_merge( $hosts, $this->exclude_hosts );
325 276
326 277 }