Skip to content

Fix store-sync product ingestion filter logic (6694) - #4547

Merged
Dinamiko merged 16 commits into
dev/developfrom
dev/PCP-6694-store-sync-ingestion-filters
Jul 22, 2026
Merged

Fix store-sync product ingestion filter logic (6694)#4547
Dinamiko merged 16 commits into
dev/developfrom
dev/PCP-6694-store-sync-ingestion-filters

Conversation

@stracker-phil

@stracker-phil stracker-phil commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

Improves product filtering for store-sync ingestion batches. Three things:

  • New third-party filters. A reduce-only woocommerce_paypal_payments_store_sync_exclude_product
    hook 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.
  • Fixed the freshness selection. wc_get_products() silently drops a raw
    meta_query, so the fresh/stale clause was ignored and every cron run re-synced
    the same products. It is now injected via WooCommerce's
    woocommerce_product_data_store_cpt_get_products_query filter.
  • Consolidated eligibility into one ProductFilter class 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_at marker. No migration logic is included, since store
sync is not yet used by any merchant.

🔍 What to review

The meta_query fix leans on WooCommerce internals (wc_get_products dropping the
raw arg, the CPT query filter re-adding it). Unit tests stub wc_get_products and
cannot 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

  1. Enable store sync and trigger the ingestion cron.
  2. Trigger it again without editing anything: previously handled products are not
    re-sent.
  3. Add a woocommerce_paypal_payments_store_sync_exclude_product filter returning
    true for a product, or remove a product's feature image, then trigger a run:
    that product is absent from the batch.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

🔗 Test this pull request with WordPress Playground

What's included:

  • ✅ WordPress (latest)
  • ✅ WooCommerce (latest)
  • ✅ PayPal Payments plugin v4.1.1-pr4547-29832700119-g0c62720 (built from this PR)

Login credentials:

  • Username: admin
  • Password: password

Plugin Details:

  • Version: 4.1.1-pr4547-29832700119-g0c62720
  • Commit: c85e2e0
  • Artifact: woocommerce-paypal-payments-4.1.1-pr4547-29832700119-g0c62720

💡 The demo environment resets each time you refresh. Perfect for testing!

🔄 This link updates automatically with each new commit to the PR.

⚠️ This URL is valid for 30 days from when this comment was last updated.


🤖 Auto-generated for commit c85e2e0 • Last updated: 2026-07-21T13:07:37.595Z

@stracker-phil
stracker-phil marked this pull request as ready for review July 21, 2026 13:24
@Dinamiko
Dinamiko merged commit a0356d3 into dev/develop Jul 22, 2026
11 checks passed
@Dinamiko
Dinamiko deleted the dev/PCP-6694-store-sync-ingestion-filters branch July 22, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants