Skip to content

Stats: Give no "View" action to a row whose URL is a wp-admin page - #54215

Merged
dognose24 merged 2 commits into
trunkfrom
fix/stats-552-no-view-action-for-admin-urls
Oct 29, 2026
Merged

dognose24 merged 2 commits into
trunkfrom
fix/stats-552-no-view-action-for-admin-urls

Conversation

@dognose24

Copy link
Copy Markdown
Contributor

Part of STATS-552.

Proposed changes

Since #53996 every row in VideoPress's Top videos widget offers a "View in new tab" action, but the stats/video-plays endpoint sends wp-admin/media.php?action=edit&attachment_id=<id> as a video's URL, so the action opens the media editor rather than the video. Per the design decision on STATS-552, video rows get no action rather than one that leads into wp-admin.

toViewLiveUrl(), which decides in one place whether a row gets the action, now treats a wp-admin page as not live content and returns no URL for it. The Top videos widget needs no change; once the endpoint sends the public permalink (STATS-567) the action comes back by itself, and the Videos report (#54058) can pass the same row action as Posts & pages.

Post and email rows are unaffected: their endpoints send the public URL.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

On a Jetpack site with Premium Analytics and at least one VideoPress video with plays, open the Stats dashboard.

  1. Hover a row in the Top videos widget. No "View in new tab" icon appears after the title; on trunk it does, and it opens the media editor. Clicking the title still opens the video's stats.
  2. Hover a row in Top posts & pages: the icon is still there and opens the live post, as before.

🤖 Generated with Claude Code

Since #53996 every Top videos widget row offers "View in new tab", but
stats/video-plays sends the media editor as the video's URL, so the action
opens wp-admin. toViewLiveUrl() now treats a wp-admin page as not live content,
so the widget shows no action until the endpoint sends the permalink.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. [Type] Bug labels Oct 28, 2026
@dognose24
dognose24 requested a review from a team as a code owner October 28, 2026 13:32
@dognose24 dognose24 self-assigned this Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/stats-552-no-view-action-for-admin-urls branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/stats-552-no-view-action-for-admin-urls

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics labels Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/packages/widgets-toolkit/src/components/view-live-link/view-live-url.ts 7/7 (100.00%) 0.00% 0 💚

Full summary · PHP report · JS report

@dognose24
dognose24 requested a review from chihsuan October 28, 2026 13:49
chihsuan
chihsuan previously approved these changes Oct 29, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the media editor links! @dognose24 Tested well, LGTM. 🚀 Not blocking, but #53996 hasn't shipped yet, so could we make these entries empty with a Comment: and drop "video" from its pending ones? Otherwise the next release notes would contradict each other.

@dognose24

dognose24 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Good point, done in 4e25a37: this PR's three entries are now empty with a Comment:, and the pending #53996 entries read "post, page or email" so the release notes only describe the action that ships.

The action #53996 gave Top videos rows never reached a release, so this
fix's entries become comments and the pending ones stop naming video.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dognose24
dognose24 merged commit 59b93be into trunk Oct 29, 2026
94 checks passed
@dognose24
dognose24 deleted the fix/stats-552-no-view-action-for-admin-urls branch October 29, 2026 07:28
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Oct 29, 2026
@tbradsha

Copy link
Copy Markdown
Contributor

👋 It looks like you modified some previous changelog files, which caused some conflicts in the backport PR: #54241

In the future, please treat changelogs as history and avoid changing them. If you roll back a change in a future PR, you can just mention that in the new changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Type] Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants