Skip to content

Blocks: Enable the Top Posts block for Simple sites WP-Admin #43275

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 7 commits into from
May 1, 2025

Conversation

dognose24
Copy link
Contributor

@dognose24 dognose24 commented Apr 28, 2025

Fixes #34506.

Proposed changes:

  • Enable the Top Posts & Pages editor block on the WP-Admin of Simple sites.
  • Directly access top posts on WPCOM, as Simple sites run on the same environment.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

No.

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

No.

Testing instructions:

  • Sync this change to sandbox: bin/jetpack-downloader test jetpack update/fix_top_posts_block_for_simple_sites.
  • Sandbox a Simple site.
  • Go to WP-Admin of the Simple site.
  • Create a new post.
  • Apply the Top Posts & Pages editor block.
  • Ensure the block is available by adding top posts to the block.
截圖 2025-04-30 晚上11 52 50

@dognose24 dognose24 changed the title Update/fix top posts block for simple sites Blocks: Enable the Top Posts block for Simple sites WP-Admin Apr 28, 2025
@github-actions github-actions bot added [Block] Top Posts [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress labels Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: May 6, 2025
    • Code freeze: May 5, 2025

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

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

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 update/fix_top_posts_block_for_simple_sites branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/fix_top_posts_block_for_simple_sites

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

@dognose24 dognose24 self-assigned this Apr 28, 2025
@dognose24 dognose24 requested a review from a team April 28, 2025 15:55
Copy link

jp-launch-control bot commented Apr 28, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/_inc/lib/class-jetpack-top-posts-helper.php 0/76 (0.00%) 0.00% 5 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@dognose24 dognose24 marked this pull request as ready for review April 30, 2025 14:55
@dognose24 dognose24 force-pushed the update/fix_top_posts_block_for_simple_sites branch from c629849 to 1192b83 Compare April 30, 2025 15:47
@dognose24 dognose24 requested review from kangzj and Copilot April 30, 2025 15:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (3)
  • projects/plugins/jetpack/_inc/lib/class-jetpack-top-posts-helper.php: Language not supported
  • projects/plugins/jetpack/changelog/update-fix_top_posts_block_for_simple_sites: Language not supported
  • projects/plugins/jetpack/extensions/blocks/top-posts/top-posts.php: Language not supported

@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Apr 30, 2025
@github-actions github-actions bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Apr 30, 2025
@dognose24 dognose24 added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Apr 30, 2025
@dognose24 dognose24 added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Apr 30, 2025
@kangzj kangzj added the DO NOT MERGE don't merge it! label Apr 30, 2025
@kangzj
Copy link
Contributor

kangzj commented Apr 30, 2025

In my test, it's still returning random posts for simple sites. I'll take a look.

@kangzj kangzj removed the DO NOT MERGE don't merge it! label Apr 30, 2025
Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

In my test, it's still returning random posts for simple sites. I'll take a look.

@dognose24
Copy link
Contributor Author

dognose24 commented May 1, 2025

it's still returning random posts for simple sites.

Perhaps it's because those top posts all have the same number 0 of views, which are not in a stable order. 🤔

截圖 2025-05-01 上午11 10 53

Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

The random filled posts are actually expected when there are not enough data.

@kangzj kangzj merged commit 3d51e97 into trunk May 1, 2025
70 checks passed
@kangzj kangzj deleted the update/fix_top_posts_block_for_simple_sites branch May 1, 2025 03:36
@github-actions github-actions bot added this to the jetpack/14.6 milestone May 1, 2025
@github-actions github-actions bot removed [Status] Needs Review This PR is ready for review. [Status] Needs Team Review Obsolete. Use Needs Review instead. labels May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Top Posts I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top Posts & Blog Stats: support WPCOM
2 participants