fix: add wp_body_open to WooCommerce header

This commit is contained in:
2026-05-21 14:46:36 +02:00
parent e90c251d0b
commit 07e0174035
10 changed files with 411 additions and 30 deletions

View File

@@ -67,3 +67,14 @@
- Kilka pluginów obsługuje InPost, więc zmiana w `ws-inpost-map` może kolidować z gotowymi integracjami.
- Tracking i płatności zależą od poprawnych eventów WooCommerce po checkout.
- Brak dumpa bazy utrudnia potwierdzenie, które pluginy są aktywne w środowisku.
## Plan Scan: InPost Pay `wp_body_open` Na Podstronach WooCommerce
**Data analizy:** 2026-05-21
**Tryb radaru:** `plan`
**Scope:** `wp-content/themes/betheme/header-shop.php`, `wp-content/themes/betheme/woocommerce.php`, `wp-content/themes/betheme/single-template.php`, `wp-content/plugins/inpost-pay/src/hooks/front/FrontWidgetV2.php`
- Strona glowna uzywa `wp-content/themes/betheme/header.php`, gdzie poprzednio dodano `<?php wp_body_open(); ?>`.
- Podstrony WooCommerce, w tym produkt, moga uzywac `get_header( 'shop' )`, czyli `wp-content/themes/betheme/header-shop.php`.
- `header-shop.php` ma osobny znacznik `<body <?php body_class(); ?>>` i obecnie nie uruchamia `wp_body_open()`.
- `inpost-pay` podpina skrypt inicjalizacyjny pod `wp_body_open`, wiec brak hooka w wariancie shop blokuje `IPPWidgetOptions` na produktach i stronach sklepu.
- Obszar weryfikacji: strona produktu z `?showIzi=true`, strona sklepu/archiwum, koszyk/checkout jezeli uzywaja wariantu shop.

View File

@@ -52,3 +52,11 @@
- Duplikaty i duże pliki w vendorowych pluginach są oczekiwane i nie powinny automatycznie prowadzić do refaktoryzacji.
- Motywy `twentytwenty*` mogą być nieaktywne; pozostają w repo jako standardowe motywy WordPress.
- Brak pełnej informacji z bazy oznacza, że "zainstalowany" nie znaczy "aktywny".
## Plan Scan: InPost Pay `wp_body_open` Na Podstronach WooCommerce
**Data analizy:** 2026-05-21
- Istnieja dwa frontendowe naglowki Betheme dla normalnych stron i sklepu: `header.php` oraz `header-shop.php`.
- Ryzyko duplikacji poprawki: naprawa tylko w `header.php` nie obejmuje WooCommerce, bo `woocommerce.php` i szablony produktowe moga ladowac `header-shop.php`.
- Ryzyko aktualizacji motywu pozostaje: brak child theme oznacza, ze zmiana w `wp-content/themes/betheme/header-shop.php` moze zostac nadpisana przy aktualizacji Betheme.
- Deferred: nie tworzymy child theme w tym hotfixie, bo celem jest szybkie przywrocenie kompatybilnosci `wp_body_open` dla podstron sklepu.

View File

@@ -0,0 +1,20 @@
Timestamp: 2026-05-21T14:32:06+02:00
Mode: plan
Scope: InPost Pay / wp_body_open / WooCommerce product pages
codebase-memory-mcp:
- list_projects did not include this repository.
- index_repository(mode=fast) for C:\visual-studio-code\krolewskie-miody.pl timed out after 120s.
- Status: degraded.
Fallback targeted scan:
- `rg -n "wp_body_open|<body|body_class|get_header\(|header\.php|woocommerce_before_single_product" wp-content\themes wp-content\plugins\inpost-pay wp-content\plugins\woocommerce -g "*.php"`
- `wp-content/themes/betheme/header.php` has `<body <?php body_class(); ?>>` followed by `<?php wp_body_open(); ?>`.
- `wp-content/themes/betheme/header-shop.php` has `<body <?php body_class(); ?>>` without `wp_body_open()`.
- `wp-content/themes/betheme/woocommerce.php` calls `get_header( 'shop' );`.
- `wp-content/themes/betheme/single-template.php` calls `get_header( 'shop' );` for `single-product` and `shop-archive` templates.
- `wp-content/plugins/inpost-pay/src/hooks/front/FrontWidgetV2.php` registers `add_root_script_after_body_open` on `wp_body_open`.
Conclusion:
- The homepage fix covered `header.php`, but WooCommerce product/shop pages can render through `header-shop.php`.
- Add `wp_body_open()` directly after the `<body>` tag in `header-shop.php`.

View File

@@ -0,0 +1,21 @@
Timestamp: 2026-05-21T14:37:52+02:00
Mode: post-apply
Scope: .paul/plans/20260521-1428-naprawa-wp-body-open-woocommerce/PLAN.md
codebase-memory-mcp:
- Post-apply MCP graph scan not rerun because the plan scan already degraded: repository indexing timed out after 120s.
- Fallback verification used targeted `rg` and `php -l`.
Changed files:
- `wp-content/themes/betheme/header-shop.php`
Verification:
- `rg -n "wp_body_open|<body" wp-content\themes\betheme\header.php wp-content\themes\betheme\header-shop.php`
Result: both `header.php` and `header-shop.php` contain `<body <?php body_class(); ?>>` immediately followed by `<?php wp_body_open(); ?>`.
- `rg -n "<body|wp_body_open" wp-content\themes\betheme -g "*.php"`
Result: standard frontend header and shop header include `wp_body_open()`. Special templates `template-blank.php`, `under-construction.php`, visual builder headers, and demo builder header still have separate `<body>` tags and were intentionally not changed.
- `php -l wp-content\themes\betheme\header-shop.php`
Result: No syntax errors detected.
Checkpoint:
- Manual production/staging verification remains required for `https://krolewskie-miody.pl/produkt/miod-borowkowy-400g/?showIzi=true`.

View File

@@ -51,3 +51,46 @@ Użyj `$paul-plan [work]` dla konkretnej zmiany. Przy planowaniu zawęź radar d
- Verification: `rg` potwierdził `wp_body_open()` bezpośrednio po `<body <?php body_class(); ?>>`.
- PHP lint: skipped, `php` nie jest dostępny w PATH.
- Raw output: `.paul/codebase/radar/codebase-memory-post-apply-20260519-1532-naprawa-inpost-pay-wp-body-open.txt`
## 2026-05-21T14:32:06+02:00 - Plan Scan
**Mode:** `plan`
**Scope:** InPost Pay / `wp_body_open` / WooCommerce product pages
**Tools:**
- `codebase-memory-mcp`: degraded. Repo not present in `list_projects`; `index_repository(mode=fast)` timed out after 120s.
- `jscpd`: disabled by policy (`quality_radar.tools.jscpd: false`).
- `ast-grep`: disabled by policy (`quality_radar.tools.ast_grep: false`).
- Fallback: targeted `rg` scans and direct file reads.
**Commands / checks attempted:**
- MCP `list_projects`
- MCP `index_repository` for `C:\visual-studio-code\krolewskie-miody.pl`
- `rg -n "wp_body_open|<body|body_class|get_header\(|header\.php|woocommerce_before_single_product" wp-content\themes wp-content\plugins\inpost-pay wp-content\plugins\woocommerce -g "*.php"`
- `rg -n 'wp_body_open|IPPWidgetOptions|body_open|showIzi' wp-content\plugins\inpost-pay wp-content\themes\betheme -g '*.php' -g '*.js'`
**Raw output:**
- `.paul/codebase/radar/codebase-memory-plan.txt`
**Next action:**
- Apply planned hotfix in `wp-content/themes/betheme/header-shop.php`.
## 2026-05-21T14:37:52+02:00 - Post-Apply Scan
**Mode:** `post-apply`
**Scope:** `.paul/plans/20260521-1428-naprawa-wp-body-open-woocommerce/PLAN.md`
**Tools:**
- `codebase-memory-mcp`: degraded. Full graph scan not rerun because repository indexing timed out during plan scan.
- `jscpd`: disabled by policy (`quality_radar.tools.jscpd: false`).
- `ast-grep`: disabled by policy (`quality_radar.tools.ast_grep: false`).
- Fallback: targeted `rg` scans and `php -l`.
**Commands / checks attempted:**
- `rg -n "wp_body_open|<body" wp-content\themes\betheme\header.php wp-content\themes\betheme\header-shop.php`
- `rg -n "<body|wp_body_open" wp-content\themes\betheme -g "*.php"`
- `php -l wp-content\themes\betheme\header-shop.php`
**Raw output:**
- `.paul/codebase/radar/codebase-memory-post-apply.txt`
**Next action:**
- Manual browser verification on product URL with `?showIzi=true`.