feat(cache): Verhaltensprobe und Smoke für WP Super Cache

SuperCacheProbe prüft beim Prüfen, ob wp_cache_post_edit die Cache-Datei einer Testseite entfernt; während der Probe ist nur der Einzelseiten-Purge erlaubt, der Pfad kommt aus home und es werden nur feste Dateinamen gelöscht. ProbeStep bündelt die Schrittlogik von Pods und WP Super Cache; ThrowawayPost hält Marker und Titel zentral und räumt auch private Probe-Seiten auf (WP Super Cache wie Pods beim Laden des Reiters). super-cache-smoke.sh prüft gegen das echte Plugin; lib.sh sperrt parallele Smoke-Läufe per flock, wp-config.php wird atomar wiederhergestellt. Doku: Host-Abhängigkeit des Einzel-Purges, WP-Cron für den Nachlauf, Komplett-Purge durch Divi beim Prüfen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-11-06 17:25:37 +01:00
co-authored by Claude Opus 5.5
parent 05bf890481
commit 661d3945fd
22 changed files with 1432 additions and 49 deletions
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace LIT\MCP\Integrations\SuperCache;
use Closure;
use LIT\MCP\Compatibility\CheckStep;
use LIT\MCP\Compatibility\ProbeStep;
defined('ABSPATH') || exit;
/** The check step only WP Super Cache has (the purge probe, SuperCacheProbe) and its labels. */
final class SuperCacheCheckSteps
{
public const PROBE = 'probe';
private const LABEL = 'Leeren-Test an einer Wegwerf-Seite im Cache';
private const LABEL_CACHE_OFF = self::LABEL . ' (Cache ist ausgeschaltet, nicht geprüft)';
/**
* The Profile::$extraSteps of WP Super Cache. A switched-off cache is a green step that says so: a skipped step
* would lock the purge on a site that caches nothing.
*
* @param Closure(): (list<string>|null) $probe SuperCacheProbe::run().
* @return Closure(bool): list<CheckStep>
*/
public static function extra(Closure $probe): Closure
{
return ProbeStep::extra(self::PROBE, self::LABEL, self::LABEL_CACHE_OFF, $probe);
}
public static function label(CheckStep $step): string
{
// Reports saved before labels were stored have none.
return $step->label
?? ($step->key === self::PROBE ? self::LABEL : null)
?? CheckStep::genericLabel($step->key, SuperCacheCompatibility::LABEL)
?? $step->key;
}
}