PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / trunk
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages vtrunk
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 +30 -0 3.3.1trunk View file →
@@ -79,8 +79,11 @@
79 79 // Siteground Speed Optimizer: Exclude Forms from JS combine.
80 80 add_filter( 'convertkit_output_script_footer', array( $this, 'siteground_speed_optimizer_exclude_js_combine' ) );
81 81 add_filter( 'convertkit_resource_forms_output_script', array( $this, 'siteground_speed_optimizer_exclude_js_combine' ) );
82 82
83 + // Siteground Speed Optimizer: Set Member Content Pages in "Exclude URLs from Caching".
84 + add_filter( 'sgo_exclude_urls_from_cache', array( $this, 'exclude_restrict_content_pages_from_caching' ) );
85 +
83 86 // Rocket LazyLoad: Exclude images from lazy loading.
84 87 add_filter( 'rocket_lazyload_excluded_src', array( $this, 'exclude_hosts' ) );
85 88
86 89 // WP Rocket: Disable Caching and Minification on Landing Pages.
@@ -336,8 +339,35 @@
336 339 */
337 340 public function exclude_local_js_from_minification( $scripts ) {
338 341
339 342 return array_merge( $scripts, $this->exclude_plugin_js );
343 +
344 + }
345 +
346 + /**
347 + * Exclude Restrict Content Pages from caching when the Siteground Speed Optimizer Plugin is installed, active
348 + * and its "Exclude URLs from Caching" setting is enabled.
349 + *
350 + * @since 3.3.6
351 + *
352 + * @param array $excluded_urls URLs to exclude from caching.
353 + * @return array
354 + */
355 + public function exclude_restrict_content_pages_from_caching( $excluded_urls ) {
356 +
357 + // Get the list of relative URLs for posts with restrict_content enabled
358 + // from the Plugin's cache.
359 + $restrict_content_cache = WP_ConvertKit()->get_class( 'restrict_content_cache' );
360 + if ( ! $restrict_content_cache ) {
361 + return $excluded_urls;
362 + }
363 +
364 + // Cache stores Restrict Content pages as id => relative url pairs.
365 + // Siteground just needs to the relative URLs.
366 + $restrict_content_urls = array_values( $restrict_content_cache->get() );
367 +
368 + // Merge the list of relative URLs with the list of URLs already excluded from caching.
369 + return array_merge( $excluded_urls, $restrict_content_urls );
340 370
341 371 }
342 372
343 373 }