From e88423e882c4b93f2157d353fd8590c5e934657b Mon Sep 17 00:00:00 2001 From: magdev Date: Wed, 21 Jan 2026 22:59:53 +0100 Subject: [PATCH] Enable Twig auto_reload to always check for template changes This ensures template changes are detected even when WP_DEBUG is false, avoiding stale cache issues. Co-Authored-By: Claude Opus 4.5 --- src/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin.php b/src/Plugin.php index 18796bb..d340957 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -86,7 +86,7 @@ final class Plugin $loader = new FilesystemLoader(WC_LICENSED_PRODUCT_PLUGIN_DIR . 'templates'); $this->twig = new Environment($loader, [ 'cache' => WP_CONTENT_DIR . '/cache/wc-licensed-product/twig', - 'auto_reload' => WP_DEBUG, + 'auto_reload' => true, // Always check for template changes ]); // Add WordPress functions as Twig functions