Skip to content
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

Top Posts & Pages Block: Remove Deleted Content #37251

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

Aurorum
Copy link
Contributor

@Aurorum Aurorum commented May 6, 2024

Fixes Automattic/wp-calypso#90308

Proposed changes:

  • Filters out deleted content from the Top Posts and Pages block.

Jetpack product discussion

N/A.

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

No.

Testing instructions:

  • Create a post and view it several times from an incognito browser (note: stats are cached for five minutes)
  • Add a Top Posts and Pages block
  • Delete the post, and confirm that the post currently still appears in the block
  • Confirm that this change ensures the post no longer appears

For context, this issue only applies to posts which are published and viewed several times, then subsequently deleted; the API endpoint still considers them a 'most viewed post', even though it has been deleted. It doesn't apply to the randomly generated posts whenever there aren't enough posts provided by the endpoint.

@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

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 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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.



Jetpack plugin:

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

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for September 3, 2024 (scheduled code freeze on September 2, 2024).

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

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This feels like something that may be best addressed higher up, at least in the get_top_posts method of WPCOM_Stats.

@Automattic/red What's your take on this?

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Status] In Progress [Pri] Normal [Block] Top Posts labels May 7, 2024
@Aurorum
Copy link
Contributor Author

Aurorum commented May 7, 2024

I originally thought so too, but I concluded that there might be cases where it’s beneficial to display all the top posts irrespective of whether they’ve been deleted - for example, in the Stats dashboard on the backend, where users might want to compare all posts regardless of whether they’ve now been deleted.

I think this is the only case where the top posts list is actually shown to site readers, which is where I felt deleted posts ought to be removed.

Happy to change it if you reckon that’d be more fitting though!

Copy link
Contributor

github-actions bot commented Aug 6, 2024

This PR has been marked as stale. This happened because:

  • It has been inactive for the past 3 months.
  • It hasn’t been labeled `[Pri] BLOCKER`, `[Pri] High`, etc.

If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation.

If the PR is not updated (or at least commented on) in another month, it will be automatically closed.

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.

Works well for me. Thanks for the contribution!

@kangzj kangzj merged commit 58080fd into Automattic:trunk Aug 22, 2024
55 checks passed
@github-actions github-actions bot added this to the jetpack/13.8 milestone Aug 22, 2024
pkuliga pushed a commit that referenced this pull request Aug 23, 2024
* Changelog

* Top Posts & Pages Block: Filter Deleted Content
gogdzl pushed a commit that referenced this pull request Oct 25, 2024
* Changelog

* Top Posts & Pages Block: Filter Deleted Content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Top Posts [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top Post & Pages Displays Deleted Post
4 participants