Fix store-sync product ingestion filter logic (6694) - #4547
Merged
Dinamiko merged 16 commits intoJul 22, 2026
Conversation
We have moved the filtering business logic to the new ProductFilter class, this file becomes a simpler config layer
It turns out that `wc_get_products()` discarded the meta_query, which lost the ability to filter out recently synced products, resulting in the ingestion loop trying to sync the same product batch over and over
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 🔗 Test this pull request with WordPress Playground What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit c85e2e0 • Last updated: 2026-07-21T13:07:37.595Z |
stracker-phil
marked this pull request as ready for review
July 21, 2026 13:24
stracker-phil
requested review from
AlexP11223,
Dinamiko,
Narek13,
danieldudzic and
mmaymo
as code owners
July 21, 2026 13:24
Dinamiko
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Improves product filtering for store-sync ingestion batches. Three things:
woocommerce_paypal_payments_store_sync_exclude_producthook to drop products from the feed, plus a completeness check that removes
products with missing required fields before they are sent (and bounced) by the
ingestion endpoint.
wc_get_products()silently drops a rawmeta_query, so the fresh/stale clause was ignored and every cron run re-syncedthe same products. It is now injected via WooCommerce's
woocommerce_product_data_store_cpt_get_products_queryfilter.ProductFilterclass that the validator,batch provider, ingestion manager, and sync job all defer to.
🗃️ Meta keys
The product meta keys were renamed and consolidated into a single
_ppcp_agentic_processed_atmarker. No migration logic is included, since storesync is not yet used by any merchant.
🔍 What to review
The
meta_queryfix leans on WooCommerce internals (wc_get_productsdropping theraw arg, the CPT query filter re-adding it). Unit tests stub
wc_get_productsandcannot see this coupling, so a regression would pass them silently. Real coverage
needs an integration test seeding products with and without the marker.
🧪 How to verify
re-sent.
woocommerce_paypal_payments_store_sync_exclude_productfilter returningtruefor a product, or remove a product's feature image, then trigger a run:that product is absent from the batch.