Repository navigation
Premium Analytics: carry declarative widget actions and icons through the registry #51925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
560443e
fix widget record test to use the manifest fixture
retrofox 7607a03
add icon and actions to the widget type registry
retrofox fa6ae9f
add icon and actions to the widget-modules record
retrofox b79badb
carry widget.json actions into story widget types
retrofox 6a85f39
accept the medium relevance tier for widget actions
retrofox bb41a6c
keep the download intent through the manifest gate
retrofox caa7bb4
keep the doing_it_wrong call on one line
retrofox 2f85e09
Merge remote-tracking branch 'origin/trunk' into update/pa-widget-das…
retrofox 68c0dbb
share the fixture widget manifest across tests
retrofox 2179b21
reuse WidgetActionRecord in the story helper
retrofox 79608d0
Merge remote-tracking branch 'origin/trunk' into update/pa-widget-das…
retrofox 0d8dfa4
Merge remote-tracking branch 'origin/trunk' into update/pa-widget-das…
retrofox 8f74181
Merge remote-tracking branch 'origin/trunk' into update/pa-widget-das…
retrofox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/premium-analytics/changelog/update-pa-widget-dashboard-backend
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: added | ||
|
|
||
| Dashboard widgets: carry declarative actions and icon references from the widget manifest to the registry and the widget-modules REST record. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things I hit poking at this on my site, both non-blocking since nothing declares actions yet:
export_report.php?type=csvcomes back ashttp://export_report.php?type=csv(esc_url_raw()only exempts[a-z0-9-]+.php, this check lets anything.phpthrough), and any:in the query of a relative admin href gets read as a scheme by kses and the action is dropped with the notice - e.g.admin.php?page=jetpack-premium-analytics-wp-admin&p=/reports/posts?from=2026-08-05T00:00:00.000+00:00, while the%3Aencoded form survives. Same story for..in the query (range=2024-01-01..2024-01-31) tripping the traversal check, since it runs on$hrefrather than$path_only.I think anchoring the single-segment entry points through
admin_url()and moving the..check onto$path_onlywould cover all three, at the cost of the record carrying absolute admin URLs (and the tests wanting the absolute form). Up to you whether it's worth doing here or in the follow-up that adds the first real action.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, all three reproduce as described. Nothing declares an action yet and the fix changes the href shape the
linkscapability will match, so I filed it as a follow-up with youradmin_url()+$path_onlyproposal, plus the upstream report since the resolver is identical there. TheWidget_Modules_Testfatal and theWidgetActionRecordreuse are in the two latest commits.