/*
Theme Name: Shiko Game Store
Theme URI: https://shikogamestore.com
Author: Shiko
Author URI: https://shikogamestore.com
Description: Custom dark/light gaming theme for Shiko Game Store. Elementor-compatible, WooCommerce-ready, with system-based dark/light mode.
Version: 3.35.20
Changelog: 3.35.20 — Revert the 3.35.19 PDP gallery-image CLS rule. Live before/after measurement (slow-4G + 4xCPU, cold, 6 samples) showed CLS UNCHANGED (median 0.281 vs 0.274 baseline): the rule was based on a WRONG root cause (the gallery does NOT collapse from a tall stack — it is a stable 380px pre/post flexslider) AND was inert anyway — overridden by WooCommerce core's higher-specificity `.woocommerce div.product div.images .woocommerce-product-gallery__image:nth-child(n+2){display:inline-block}`, so it never hid anything. The real PDP CLS (~0.27 lab, the gallery's rendered rect moving up ~26px as async main.css applies) is intermittent/bimodal (0.005<->0.28) and could not be pinned to a fixable element across 4 instrumentation passes (shift-rect trace, height-delta diff, offset-parent-chain diff, per-frame rAF monitor — the container reads stable per-frame even when the layout-shift API attributes ~0.28 to it); may be partly a CPU-throttle artifact. Deferred pending CrUX/field data (PSI keyless API 429'd). No functional change vs 3.35.19 (the reverted rule was a no-op). See 02-state/perf-history.md + ledger. 3.35.19 — PDP mobile CLS fix (Core Web Vital). A throttled mobile audit (slow-4G + 4xCPU, cold, 5 samples) found product pages shifting CLS median 0.274 / max 0.70 ('poor', >0.25) while home + category were clean and LCP was good everywhere — so the parked 'logo srcset / tablet CLS' follow-up was the wrong lever. Live shift-trace: the WooCommerce flexslider product gallery renders all its images stacked at full column width before JS init (critical img{height:auto} + 800x800 attrs), then collapses to a single slide + thumb-nav on init, so the .summary column below jumps up. Fix: in inc/cwv-hints.php's inlined critical CSS for critical-product.css, show only the FIRST gallery image until flexslider wraps the rest — scoped to the pre-init state via :has(.flex-viewport) so it has ZERO effect on the interactive gallery and unsupported browsers keep the status quo. Gallery is ~one-image tall from first paint → no large shrink on init. Closes the parked spec-111 CLS follow-up (now traced). First-paint inline only; woocommerce.css carries a pointer comment. No markup change. 3.35.18 — AR localization of the mini-cart drawer chrome. The 3.35.16 drawer's shiko-theme gettext strings (Your cart / Remove / Browse games / Your cart is empty / Instant digital delivery · paid in EGP / Total / View cart / Checkout / Close cart / Remove item) rendered in ENGLISH on /ar/ — they weren't in the AR gettext map. Added them to inc/ar-localization-fixes.php's existing AR-locale-gated gettext filter (same pattern as the footer tagline + "Related products"). The drawer is the EN design mirrored; only the copy is translated (no layout/art change). Operator-confirmed Arabic wording. No markup/CSS change. 3.35.17 — Mini-cart Remove is now inline (no full-page reload). The drawer's Remove link is intercepted and the item removed via WC's own cart-remove URL fetched in place (redirect:'manual' lands the server-side removal without rendering+discarding the /cart/ page), then the drawer body + count re-render inline by calling WC's get_refreshed_fragments endpoint DIRECTLY — the drawer stays open and updates. (CodeRabbit caught that this site has the wc-cart-fragments script dequeued for perf, so the wc_fragment_refresh jQuery event has no listener; we apply the same woocommerce_add_to_cart_fragments output ourselves via a data-smc-refresh endpoint on the drawer.) Every failure path — no fetch, fetch error, fragments unavailable/bad response — falls back to a native full-page nav so the UI is NEVER left stale. Adds a .smc-removing dimmed/disabled state during the request + restores focus to the close button after the re-render (a11y). CSS-only addition (.smc-removing) in main.css; markup adds one data attribute. Follow-up to 3.35.16; pairs with a WP Rocket RUCSS safelist entry (smc-, is-open) so Remove-Unused-CSS cannot strip the JS-toggled .is-open / .smc-open / .smc-removing rules. 3.35.16 — Mini-cart overlay (Enhanced-Checkout US-8/9/10; operator-approved mockup; A4 first gap). The header cart icon now opens a right-side drawer (inc/checkout/mini-cart.php) hydrated from WC()->cart: items (thumb, name, variation, read-only ×qty + line price, functional Remove via WC native cart-remove URL), trust line, total, View-cart + Checkout CTAs, friendly empty state. Live-updates via the existing woocommerce_add_to_cart_fragments mechanism and auto-opens on add-to-cart. Self-contained inline behavior script: open on cart-icon click (href is the no-JS fallback), close on X/Esc/outside-click, focus-trap, body-scroll-lock, prefers-reduced-motion. Token-driven + RTL-safe (drawer + shadow flip to the inline-end). Kill-switch: shiko_minicart_enabled theme-mod/filter (default on). Qty is read-only (no dead-click stepper — full editing on the cart page). CSS in main.css + rtl.css; suppressed on the checkout page. 3.35.15 — Footer refinement (operator-approved mockup). Removed the customer-facing "Theme vX.Y.Z" string from the copyright (internal version leak — Constitution VIII no-internals; minor info-disclosure) and replaced it with a brand tagline. Column titles (Shop/Account/Help) are now real <h2> headings inside their <summary> (a11y: the footer previously had zero heading elements). Added a brand-red gradient accent strip across the footer body, an accent underline on the column headings, and a social-icon hover lift. CSS-only + footer.php markup; structure/links/payments/accordions unchanged; token-driven + RTL-safe. 3.35.14 — Logo LCP: the header logo <img> already had a srcset (medium ~13KB), but inc/performance.php was preloading the FULL 512px (~40KB) on every device, defeating it on mobile. The preload now mirrors the <img> srcset+sizes via imagesrcset/imagesizes so the browser preloads the same small candidate it paints (~13KB on phones); href stays as the fallback. No markup change to the <img>. 3.35.13 — Complete the 3.35.12 llms-full.txt plain-text cleanup (post-deploy curl found 15 residual leaks). Two remaining entity sources fixed: (a) wp_trim_words() appends its default `&hellip;` more-marker AFTER the html_entity_decode, leaking on every truncated excerpt — now passes a literal "…"; (b) the Categories section still esc_html()'d term names ("Apple &amp; iTunes") — now uses the shared $to_plain() helper (hoisted above the Products loop so both sections share it). Live re-verify: 0 shortcode/entity leaks. 3.35.12 — SEO + GEO bundle (grounded audit follow-up). (1) AR head localization — NEW inc/seo/ar-head-localizer.php swaps the rendered <title>, meta description, and og:title/og:description to the per-post _shiko_ar_title / _shiko_ar_description on /ar/ singular requests (via Rank Math's rank_math/frontend/title + /description + opengraph/facebook/og_* filters — the live owners; the theme's OG-fallback block is dead behind a class_exists('RankMath') guard). The indexed AR mirror previously served English titles/snippets in SERPs despite correct hreflang + translated AR JSON-LD. (2) hreflang: Arabic alternate region-qualified `ar`→`ar-EG` (matches inLanguage + /upcoming/); EN stays language-only + x-default→EN; also skip 404s in the hreflang emitter (was emitting en/ar/x-default to fabricated /ar/<bad-path>/). (3) GEO/AI: llms-full.txt now lists the FULL in-stock catalog (was capped 50 of ~110) and strips shortcodes + decodes HTML entities in product names/excerpts (plain-text file; esc_html() was emitting literal [caption]/&amp;/&#039;). (4) CollectionPage ItemList items now carry name + image (was URL-only → ineligible for Google's product carousel). og:locale intentionally LEFT at ar_AR (Facebook's own Arabic code — no ar_EG in FB's locale list; region targeting is carried by hreflang). 3.35.11 — Revert the 3.35.10 JSON-LD name/description html_entity_decode (it was a no-op). Rank Math runs the whole @graph through wp_kses_post_deep() at OUTPUT (seo-by-rank-math/includes/modules/schema/class-jsonld.php:164), which re-encodes `&`→`&amp;` AFTER any `rank_math/json_ld` filter — confirmed live: wp_kses_post_deep("PS5 & PS4")=="PS5 &amp; PS4". So a filter-layer decode can never change the rendered output; removed as dead code. `&amp;` in Rank Math JSON-LD is its universal kses behavior (every Rank Math site emits it) and is decoded by Google's structured-data parser; revisit only if Search Console flags it as a real rich-result error (would need an output-buffer pass, not a filter). The 3.35.10 PDP reviews brand styling stays. 3.35.10 — PDP reviews brand styling + schema name-decode (review-loop ship, alongside shiko-whatsapp-bot 2.27.0). (1) Brand-aligned the native WooCommerce reviews block that shiko-product-reviews surfaces inside `.shiko-pdp-reviews`: token-driven card adapts to light + [data-theme="dark"], styled review list + leave-a-review form, brand-primary (#B7080A) submit, gold (#FBBF24) interactive star rater with >=44px mobile tap targets (WCAG 2.5.5), RTL mirror in rtl.css; form controls scoped under `#respond` to beat WooCommerce's own ID-level rules (woocommerce.css + rtl.css). (2) inc/seo/product-merchant-schema.php now html_entity_decode()s the `name`/`description` of Product / ProductGroup / hasVariant nodes, so Google no longer renders a literal "&amp;" in rich results ("PS5 &amp; PS4" → "PS5 & PS4") — the stored Rank Math title was already clean; only the JSON-LD string was over-encoded. No PDP markup change. 3.35.9 — Clarity audit fixes: price wrappers now emit current data-clarity-unmask="true" while preserving legacy mask=False; Clarity server-side collector now records only human HTML pageviews and suppresses WP Rocket preload, bots, AJAX, feeds, and sitemap noise. 3.35.8 — WC template-override version reconcile (no markup change). Cleared 3 "template out of date / version header missing" warnings on WooCommerce → Status → Templates by stamping the override `@version` docblocks to the current core template versions: woocommerce/cart/cart-empty.php 3.14.8 → 7.0.1, woocommerce/cart/cart.php 3.5.12 → 10.8.0, woocommerce/checkout/form-checkout.php (missing) → 9.4.0. Verified hook-completeness before bumping: cart.php fires all structural woocommerce_*cart* actions + nonced wc_get_cart_remove_url() (coupon/update relocated to cart-totals.php by design); cart-empty.php fires woocommerce_cart_is_empty; form-checkout.php is the intentional Shiko_Checkout custom override with default-WC fallback. Stacks on 3.35.7 (security) + 3.35.6 (sticky pay-bar). 3.35.7 — Security P2/P3 hardening (audit 2026-05-28) + AR localization. P2-7: quick-view / compare endpoints now reject unpublished products (draft-catalog leak). P2-10: atc-notify per-IP throttle + 500/variant subscriber cap (email-bomb / option-bloat) — the cap branch returns a distinct `cap_reached` sentinel (not the duplicate `false`) and the AJAX handler replies 429, so a cap-hit is no longer reported as a successful duplicate (CodeRabbit). P3: Payment Rules admin menu gated at `manage_woocommerce`. New `inc/ar-localization-fixes.php` — AR-locale-gated filters (T&C consent-checkbox text + T&C page title + "Related products" + product_cat name map) + `inc/seo/ar-schema-localizer.php` dict. See audit-2026-05-28/. 3.35.6 — Mobile sticky checkout pay-bar (2026-05-29 visual UX audit M-2 redo). Root-caused that spec-075's "mobile sticky total" never worked: it shipped a `position:sticky` rule for `.shiko-checkout__mobile-total` in main.css, but NO template ever rendered an element with that class — dead CSS since theme 3.23.0 (the desktop `.shiko-checkout-summary` card is deliberately `position:static` ≤900px). Fix pins the EXISTING `.shiko-checkout-pay-cta` (the real submit button + live-updating total, rendered by woocommerce/checkout/form-checkout.php) to the viewport bottom at ≤768px via `position:sticky;bottom:0`, so mobile shoppers never scroll to find Pay. CSS-only (assets/css/checkout.css, enqueued only on checkout) — no new markup, no second submit path (avoids PayTabs-iframe / installment-gateway double-submit). Pinning verified on live despite the `<body> overflow-x:clip` that breaks naive sticky. Trust-strip hidden inside the compact bar; floating back-to-top + chat FAB lifted clear. Removed the dead `.shiko-checkout__mobile-total` rule from main.css. 3.35.4 — spec 111 Clarity follow-up bundle (3 USes in one PATCH): US1 P1 — `/account/loyalty/` 5.38% dead-click fix. The 4 `.shiko-account-split-feat` decorative panels (⚡ Instant Delivery / 🔒 Secure Payments / 💬 24/7 WhatsApp Support / 🎮 500+ Games) have card chrome that makes them look interactive but they're plain `<div>` with no click handler. Marked parent `aria-hidden="true"` + added `pointer-events: none; user-select: none; cursor: default;` so visual is unchanged but they can no longer be clicked or selected. US2 P2 — Clarity benign-error filter. New `inc/clarity-error-filter.php` emits a `wp_head` priority-1 inline `<script>` registering a capture-phase `error` listener that suppresses the `ResizeObserver loop completed with undelivered notifications.` warning (Elementor/Slick noise, 3309/wk in Clarity, ~33% of all JS errors). Real errors still propagate. US3 P3 — `inc/seo/ar-schema-localizer.php` dict expansion. Added Arabic translations for 12 product categories + 6 static page URLs (covers PlayStation Gift Card / PlayStation Plus Editions / Hardware / VR2 / Apple iTunes / Razer Gold / Roblox / PUBG UC / Fortnite V-Bucks / XBOX Gift Card / Valorant / Steam + /ar/about / s-farouk / cancellation-refund / privacy / terms / contact-us). Closes EN-fallback leakage on AR JSON-LD breadcrumbs + WebPage names. DEFERRED: tablet CLS 0.141 follow-up — needs live Chrome MCP shift trace before speculative `min-height` reservation. See specs/111-loyalty-clarity-ar-dict/. 3.35.3 — spec 110 inLanguage scope-down: allowlist-scoped the 3.30.4 recursive `inLanguage` stamper in `inc/seo.php` so it stamps only on language-bearing @types (WebPage / WebSite / Organization / Product / ProductGroup / BreadcrumbList / ListItem / Article / BlogPosting / etc.) and skips nested QuantitativeValue / ImageObject / Offer / MerchantReturnPolicy / OfferShippingDetails / MonetaryAmount / DefinedRegion / ShippingDeliveryTime / PostalAddress / ContactPoint / Place / Brand. New `shiko_inlanguage_allowed_types` filter for operator extension. Same allowlist applied to the non-Rank-Math `shiko_structured_data()` fallback path. PDP inLanguage stamp count drops 56 → ~11 per page; validator.schema.org PDP warnings drop ~50 → ~5. Original spec 109 (http://schema.org → https URL form) RETIRED — live audit confirmed RM Pro already migrated; 0 http:// refs site-wide. See specs/110-inlanguage-scope-down/. 3.35.2 — spec 108 priceValidUntil past-date normalizer extension: extended the 3.16.0 priceValidUntil rewrite condition in inc/agent-readiness.php so it ALSO catches past Y-m-d dates (in addition to the existing 2027-* / 2028-* / empty triggers). Closes the "every Offer signals expired" leak caused by RM Pro reading stale _sale_price_dates_to postmeta on variants whose prior sale has ended. See specs/108-pricevaliduntil-past-date-fix/. 3.35.1 — spec 107 SpeakableSpecification cssSelector fix: swapped default WC class `.woocommerce-product-details__short-description` (never matched on this site since 3.7.0) for Shiko's custom-template class `.shiko-pdp-excerpt` per woocommerce/content-single-product.php:57. Closes the one red ❌ on validator.schema.org's SpeakableSpecification node on every PDP. See specs/107-speakable-selector-fix/. 3.35.0 — spec 105 PDP merchant-fields: hasMerchantReturnPolicy (MerchantReturnNotPermitted + EG) + shippingDetails (zero-cost EGP instant + EG + 0/0 day handling + 0/0 day transit) on every Offer + aggregateRating on Product/ProductGroup when WC review_count >= 1 AND avg > 0 (graceful-degrade otherwise). Closes Google Merchant Listings missing-field warnings. See specs/105-pdp-merchant-fields/. 3.34.1 — spec 104 CR pass-1 hotfix: filter now unsets stale author.description/sameAs/image from upstream Rank Math before conditional re-emit (FR-007/8/9 omit-rule integrity); byline + bio-link labels i18n-wrapped via __('...', 'shiko-theme'); main.css currentColor → currentcolor (stylelint); spec docs updated (AR /ar/ URL prefix not cookie; tasks.md parent lookup 'about' not 'about-us'; rollback chmod sweep). 3.34.0 — spec 104 author E-E-A-T: bio page at /about/s-farouk/ + Person.author url/@id/sameAs/image/description on every BlogPosting + AR mirror via _shiko_ar_* meta. See specs/104-author-eeat/.
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shiko-theme
WC requires at least: 8.0
WC tested up to: 10.6
*/
