| @@ -216,11 +216,14 @@ | ||
| 216 | 216 | private function generate_cache_key(string $endpoint, array $params = [], ?int $user_id = null): string { |
| 217 | 217 | // Sort parameters for consistent key generation |
| 218 | 218 | ksort($params); |
| 219 | 219 | |
| 220 | - // Build key components | |
| 220 | + // Build key components. The prefix is stored with a trailing underscore | |
| 221 | + // so the "_transient_{$this->cache_prefix}%" LIKE patterns above keep a | |
| 222 | + // word boundary; implode() supplies the separator here, so trim it off | |
| 223 | + // rather than emitting keys like `thinkrank_seo_analytics__totals_<md5>`. | |
| 221 | 224 | $key_parts = [ |
| 222 | - $this->cache_prefix, | |
| 225 | + rtrim($this->cache_prefix, '_'), | |
| 223 | 226 | $endpoint, |
| 224 | 227 | md5(wp_json_encode($params)) |
| 225 | 228 | ]; |
| 226 | 229 | |