Automattic / Automattic/jetpack

Related posts contain non-visible WooCommerce Products

Open
#6,354 5 comments 0 reactions 0 assignees View on GitHub
[Feature] Related Posts [Pri] Normal [Status] Stale Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

Products can be visible, hidden or search (meaning they must only show up in searches), this is stored in the _visibility meta key with a corresponding value 'visible', 'hidden', or 'search'.
Jetpack's related posts doesn't appear to take this into account, and thus happily shows hidden products.

To test this, create a hidden product and see it show up in Related posts from another product details page.

#### What I expected

Jetpack shouldn't do this. Considering Jetpack and WooCommerce come from the same Automattic stable, we can expect them to be aware of each other. Products that are not marked as visible should not be shown.
Logic: if there is a _visibility meta key, remove the post unless it has value of 'visible'.

#### What happened instead

Hidden products are visible in Related Posts.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Jetpack Related Posts and how it handles WooCommerce products, then reproduce the issue with a hidden product as described. Done means products with a _visibility value other than "visible" no longer appear in Related Posts, while visible products still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.