Show per-hotspot Direct revenue in the layer panel - #2088
Closed
subodhr258 wants to merge 2 commits into
Closed
Conversation
Sub-task C (core). Consumes the per-hotspot revenue the layer-analytics endpoint
now returns.
- useVideoLayerData: map revenue_minor/orders/currency onto each sub-hotspot; the
parent carries the sum of its hotspots' revenue (currency from any child).
- SubHotspotRail: a small secondary line per hotspot, "<amount> · N orders",
shown only when that hotspot has orders (Woo layers only).
- LayerDetailPanel: a headline "This hotspot/layer drove <amount> across N orders"
above the funnel, with an InfoTooltip that it is the Direct in-video contribution
only, not the product's total (Assisted purchases are excluded). Reuses the
shipped formatRevenue (correct ISO fraction digits), full numbers.
- WP proxy: pass base_currency = get_option('woocommerce_currency') to
/processed-layer-analytics/.
Base branch feat/top-products (#2086). Pairs with godam-analytics#259.
🔍 WordPress Plugin Check Report
📊 Report
❌ Errors (1)📁 readme.txt (1 error)
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 composer.json (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
missing_composer_json_file | The "/vendor" directory using composer exists, but "composer.json" file is missing. |
📁 assets/build/blocks/godam-gallery-v2/render.php (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
15 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
23 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/08/21/hello-world/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/08/21/hello-world/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
Each Woo composite row carries revenue_minor/orders/currency from the endpoint; assert groupRows maps them onto the sub, sums them onto the parent (currency from a base-currency child), and a non-base order that the server excluded (revenue_minor 0) is never blended in. Also assert the fields default to 0/empty when the endpoint sends none.
Collaborator
Author
|
Consolidated into the single Phase 2 secondary PR #2090 (all Woo Phase 2 core/UI work in one PR against feat/top-products). Closing this per-sub-task PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Shows per-hotspot Direct revenue in the video layer-analytics panel (Sub-task C core; pairs with rtCamp/godam-analytics#259).
useVideoLayerData: mapsrevenue_minor/orders/currencyonto each sub-hotspot from the endpoint row; the parent carries the sum of its hotspots' revenue (currency from any child).SubHotspotRail: a small secondary line per hotspot, "<amount> · N orders", shown only when that hotspot has orders (Woo layers only), so the rail stays scannable.LayerDetailPanel: a headline "This hotspot/layer drove <amount> across N orders" above the funnel, with an InfoTooltip stating it is the Direct in-video contribution only, not the product's total (Assisted purchases via the product page are excluded). Reuses the shippedformatRevenue(correct ISO fraction digits, full numbers).base_currency = get_option('woocommerce_currency')to/processed-layer-analytics/.Single store currency
Per-hotspot revenue sums base-currency orders only; other currencies are excluded server-side (counted on the dashboard, never converted here). Direct-only because a hotspot carries a
layer_id; Assisted purchases have none.Base branch
Targets
feat/top-products(#2086, whereformatRevenueshipped). Nothing merges todevelopuntil Phase 2 is complete.Part of rtCamp/godam-plugin-wp#26.