Skip to content

VideoPress: list the latest videos on WordPress.com Simple page renders - #53001

Merged
heydemoura merged 1 commit into
trunkfrom
fix/videopress-latest-videos-simple-front-end
Sep 30, 2026
Merged

heydemoura merged 1 commit into
trunkfrom
fix/videopress-latest-videos-simple-front-end

Conversation

@heydemoura

Copy link
Copy Markdown
Contributor

Follow-up to #52665 ( Latest Videos Playlist block ), found while building the VideoPress channel theme on WordPress.com ( Linear VIDP-407 ).

Proposed changes

  • Data::get_latest_videopress_playlist_entries() feeds the Latest Videos Playlist block through an internal wp/v2/media request. WordPress.com Simple registers the wp/v2 routes only for real REST requests ( mu-plugins/rest-api.php removes create_initial_rest_routes otherwise ), so on a page render the request answers rest_no_route and the block renders nothing: a Simple site's Videos page stays empty no matter how many uploads it has.
  • When the internal request fails, the entries now come straight from the attachments with the same rules the endpoint applies: video/videopress attachments off Simple, video/* attachments resolved through wpcom's videos table ( video_get_info_by_blogpostid() ) on it, newest first, capped to the count. Duration and height come from the attachment metadata ( videopress.duration, or the length seconds Simple stores ). The entry shape is unchanged and shared by both paths.

Related product discussion/links

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

No.

Testing instructions

  • jp test php packages/videopress ( Latest_Videos_Playlist_Block_Test, new test_latest_entries_without_the_media_endpoint ), jp phan packages/videopress.
  • On a sandboxed WordPress.com Simple site with a few VideoPress uploads, add a Latest Videos Playlist block to a page: before, the block renders nothing on the front end; after, it lists the uploads. Jetpack and Atomic sites keep going through the media endpoint and are unchanged.

🤖 Generated with Claude Code

The Latest Videos Playlist block feeds itself through an internal wp/v2/media
request. WordPress.com Simple registers the wp/v2 routes only for real REST
requests, so on a page render the request answers rest_no_route and the block
renders nothing. When the request fails, query the attachments directly with
the rules the endpoint applies: video/videopress off Simple, video/* resolved
through wpcom's videos table on it, newest first, capped to the count.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@heydemoura heydemoura added [Feature] VideoPress A feature to help you upload and insert videos on your site. [Status] In Progress labels Sep 30, 2026
@heydemoura heydemoura self-assigned this Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 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/videopress-latest-videos-simple-front-end branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/videopress-latest-videos-simple-front-end

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

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!

@heydemoura
heydemoura marked this pull request as ready for review September 30, 2026 18:18
@heydemoura
heydemoura requested a review from a team as a code owner September 30, 2026 18:18
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/videopress/src/class-data.php 171/315 (54.29%) 3.94% 1 ❤️‍🩹

Full summary · PHP report · JS report

@heydemoura
heydemoura merged commit df6b89e into trunk Sep 30, 2026
85 of 86 checks passed
@heydemoura
heydemoura deleted the fix/videopress-latest-videos-simple-front-end branch September 30, 2026 19:27
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] In Progress labels Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] VideoPress A feature to help you upload and insert videos on your site. [Package] VideoPress [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

1 participant