From c1db133ffa931ce264d7a978e45cee1e58ddda97 Mon Sep 17 00:00:00 2001 From: dwindown Date: Sun, 16 Nov 2025 13:02:04 +0700 Subject: [PATCH] fix: Remove hardcoded dev mode filters from woonoow.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 CRITICAL FIX - Root Cause Found! The plugin had hardcoded dev mode filters that forced EVERYONE into dev mode: - add_filter('woonoow/admin_is_dev', '__return_true'); - add_filter('woonoow/admin_dev_server', fn() => 'https://woonoow.local:5173'); This caused: - ✗ SPA trying to load from localhost:5173 - ✗ Loading @react-refresh and main.tsx (dev files) - ✗ Not loading app.js and app.css (production files) ✅ Solution: - Removed hardcoded filters from woonoow.php - Commented them out with instructions - Added debug logging to is_dev_mode() - Updated installation checker to detect this issue 📝 For Developers: If you need dev mode, add to wp-config.php: define('WOONOOW_ADMIN_DEV', true); Or use filter in your development plugin: add_filter('woonoow/admin_is_dev', '__return_true'); 🎯 Result: - Production mode by default (no config needed) - Dev mode only when explicitly enabled - Better UX - plugin works out of the box --- check-installation.php | 18 ++++++++++++++++++ includes/Admin/Assets.php | 12 +++++++++++- woonoow.php | 5 +++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/check-installation.php b/check-installation.php index 70717f4..3e3306e 100644 --- a/check-installation.php +++ b/check-installation.php @@ -125,6 +125,24 @@ header('Content-Type: text/html; charset=utf-8'); } ?> +

5b. Dev Mode Filter Check (woonoow.php)

+ ✗ FAIL - Hardcoded dev mode filter found in woonoow.php!"; + echo "
  This forces dev mode ON for everyone.\n";
+            echo "  Remove this line from woonoow.php:\n";
+            echo "  add_filter('woonoow/admin_is_dev', '__return_true');
"; + } else { + echo "
✓ PASS - No hardcoded dev mode filters
"; + } + } + ?> +

6. Asset URLs

'https://woonoow.local:5173'); \ No newline at end of file +// Dev mode filters removed - use wp-config.php if needed: +// add_filter('woonoow/admin_is_dev', '__return_true'); +// add_filter('woonoow/admin_dev_server', fn() => 'https://woonoow.local:5173'); \ No newline at end of file