PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.10.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.10.0
2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 All 51 releases
← All changes | includes/seo/class-schema-cache-manager.php +14 -2 1.29.0 → 2.10.0 View file →
@@ -136,10 +136,22 @@
136 136 */
137 137 public function clear_all(): bool {
138 138 global $wpdb;
139 139
140 - // Clear memory cache (if using object cache)
141 - wp_cache_flush_group(self::CACHE_GROUP);
140 + // Clear memory cache (if using object cache).
141 + //
142 + // wp_cache_flush_group() is WordPress 6.1+, and the plugin header
143 + // declares "Requires at least: 6.0" — on 6.0 this was a fatal
144 + // "call to undefined function" on every schema settings save, since
145 + // save_settings() reaches here via invalidate_all_cache(). Fall back to
146 + // a full flush rather than skipping: a no-op would leave stale schema
147 + // served until the database rows expire, which is worse than a coarse
148 + // flush. Deactivator already guards the same call this way.
149 + if (function_exists('wp_cache_flush_group')) {
150 + wp_cache_flush_group(self::CACHE_GROUP);
151 + } else {
152 + wp_cache_flush();
153 + }
142 154
143 155 // Clear database cache
144 156 $table_name = $wpdb->prefix . 'thinkrank_ai_cache';
145 157 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Table name is properly constructed from controlled prefix, cache clearing requires direct database access