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 | admin/class-convertkit-admin-cache-plugins.php +36 -1 3.3.22.8.6 View file →
@@ -55,9 +55,9 @@
55 55 public function maybe_configure_cache_plugins() {
56 56
57 57 // If no Pages, Posts or CPTs are configured to use Restrict Content, don't
58 58 // configure any caching plugins.
59 - if ( ! WP_ConvertKit()->get_class( 'admin_restrict_content' )->restrict_content_enabled() ) {
59 + if ( ! $this->restrict_content_enabled() ) {
60 60 return;
61 61 }
62 62
63 63 $this->litespeed_cache();
@@ -65,8 +65,43 @@
65 65 $this->wp_fastest_cache();
66 66 $this->wp_optimize();
67 67 $this->wp_rocket();
68 68 $this->wp_super_cache();
69 +
70 + }
71 +
72 + /**
73 + * Check if any Pages, Posts or CPTs are configured to use Restrict Content.
74 + *
75 + * @since 2.7.6
76 + *
77 + * @return bool
78 + */
79 + private function restrict_content_enabled() {
80 +
81 + // Check if any Pages, Posts or CPTs are configured to use Restrict Content.
82 + $query = new WP_Query(
83 + array(
84 + 'post_type' => convertkit_get_supported_post_types(),
85 + 'post_status' => 'publish',
86 + 'meta_query' => array(
87 + array(
88 + 'key' => '_wp_convertkit_post_meta',
89 + 'value' => '"restrict_content";',
90 + 'compare' => 'LIKE',
91 + ),
92 + array(
93 + 'key' => '_wp_convertkit_post_meta',
94 + 'value' => '"restrict_content";s:1:"0"',
95 + 'compare' => 'NOT LIKE',
96 + ),
97 + ),
98 + 'posts_per_page' => 1,
99 + 'fields' => 'ids',
100 + )
101 + );
102 +
103 + return $query->have_posts();
69 104
70 105 }
71 106
72 107 /**