PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.3.3
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.3.3
1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 All 29 releases
← All changes | includes/class-recommendations.php +21 -0 1.1.71.3.3 View file →
@@ -257,8 +257,29 @@
257 257 'applied' => $id,
258 258 'recommendations' => self::all(),
259 259 );
260 260 }
261 + /**
262 + * Last chance to resolve a recommendation id this engine doesn't own.
263 + *
264 + * Free and Pro each ship a recommendation engine with its OWN id
265 + * namespace — Free uses underscores (`nginx_snippet_missing`), Pro
266 + * uses hyphens (`cache-disabled`) — but only Free's ids reached this
267 + * method, so EVERY Pro Apply button returned 404 and the failure was
268 + * swallowed by the UI. This seam lets Pro claim its own ids rather
269 + * than duplicating the endpoint. (#198)
270 + *
271 + * Return an array (the same shape this method returns on success) or
272 + * a WP_Error to claim the id; return null to decline it.
273 + *
274 + * @param array|\WP_Error|null $handled Result from a previous filter, or null.
275 + * @param string $id The recommendation id being applied.
276 + */
277 + $handled = apply_filters( 'xspeed_apply_recommendation', null, $id );
278 + if ( is_array( $handled ) || is_wp_error( $handled ) ) {
279 + return $handled;
280 + }
281 +
261 282 return new \WP_Error(
262 283 'xspeed_rec_unknown',
263 284 __( 'Unknown or no-longer-applicable recommendation.', 'xspeed' ),
264 285 array( 'status' => 404 )