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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

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 June 4, 2024 (scheduled code freeze on May 27, 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!

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 [Status] In Progress [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
2 participants