* devops: Variable product performance optimization and tests
- Memoize get_variation_prices() in the Product model to avoid
redundant lookups across multiple pricing fields (price, regularPrice,
salePrice, and their RAW variants)
- Remove redundant post__in filter from variations connection resolver;
post_parent already constrains the query, and the post__in triggered
an extra get_children() call per product
- Add createVariableProductCatalog() helper to GraphQLE2E for creating
variable products with many variations in tests
- Add VariableProductPerformanceTest (wpunit) measuring DB query count
and duration for 15 variable products with 18 variations each
- Add VariableProductPerformanceCest (functional) verifying 6 rapid
queries do not return 429 errors
Addresses #897
* fix: Skip timing assertion when xdebug is active and clean up debug code
* devops: WC email template tests, COT cursor HPOS fix, checkout account auth
WC Email Template Tests:
- Add WooCommerceEmailTemplatesTest verifying WC email templates are used
for registerCustomer, checkout with account creation, and password reset
- Use MockPHPMailer to capture emails and verify HTML content type
- Disable deferred transactional emails during tests via GRAPHQL_TESTING flag
COT Cursor HPOS Fix:
- Fix COT_Cursor::compare_with to resolve orderby aliases and legacy meta
keys (_order_total, _date_completed, etc.) to COT column names
- Add resolve_orderby_alias() mapping short aliases and meta keys to columns
- Add DB_Hooks::clean_query_vars to translate post_* and meta_key orderby
to COT-compatible equivalents via woocommerce_order_query_args filter
Checkout Account Authentication:
- Add authenticate field to CreateAccountInput type
- Gate wc_set_customer_auth_cookie() behind authenticate flag in checkout
mutation so account creation doesn't auto-authenticate by default
Closes#882
* devops: codeception.dist.yml updated
* fix: Functional test cleanup and CI coverage condition
Test fixes:
- Enable authorizing URL fields in ProtectedRouterCest and
DownloadableItemAuthCest via setWooGraphQLSetting
- Add stale data cleanup (sessions, users, products, orders) to
GraphQLE2E _setupStore/getCatalog/setupStoreAndUsers
- Fix CartTransactionQueueCest and CartQueriesTest for test isolation
CI:
- Only run coverage job when at least one upstream job succeeds
* chore: Linter compliances met
* fix: HPOS order mutation data loss and CI coverage condition
Refactor order create/update mutations to set all props on a single
WC_Order instance before saving, mirroring the WC REST API pattern.
Previously, separate add_order_meta() and add_items() calls each loaded
their own order instance and saved independently, causing HPOS data loss
for payment method, addresses, and other fields.
Also fix CI coverage job to only run when all upstream jobs succeed,
and correct test assertions for RAW format line item totals.
Closes#591
* chore: Linter compliances met
* chore: Remove dead code from Order_Mutation after prepare_order refactor
Removes add_items() and update_address() which are no longer called
after the prepare_order() consolidation.
* chore: Remove dead code add_order_meta and update_item_meta_data
* fix: downloadsRemaining returns null for valid numeric string values
Use is_numeric() + intval() instead of 'integer' === gettype() to handle
cases where WooCommerce stores downloads_remaining as a numeric string.
Mirrors WooCommerce's own approach in its download templates.
Co-authored-by: Nestor Vera <hacknug@users.noreply.github.com>
Closes#937
* fix: Match CI phpcov php-code-coverage version to Docker container
The Docker container uses php-code-coverage 9.2.x which serializes
coverage with v9 classes (e.g. Xdebug3Driver). phpcov v9 bundles
php-code-coverage v11 with different classes, causing
__PHP_Incomplete_Class errors. Pin to phpcov v8 + php-code-coverage v9
to match the Docker environment.
---------
Co-authored-by: Nestor Vera <hacknug@users.noreply.github.com>
* feat: add authenticated download URLs for headless frontends
- Add downloadNonce and downloadUrl fields to DownloadableItem type
using the existing Protected Router session transfer pattern
- Add preAuthDownloadUrl field (toggleable via settings) that generates
tokenized download URLs for direct file access without cookie auth
- Add download_url nonce handling to Protected_Router
- Add enable_pre_auth_download_urls and download_url_nonce_param settings
- Add GraphQLE2E helpers for checkout and account shortcode pages
- Rewrite ProtectedRouterCest to test redirect flow without JS-dependent
page content assertions, add account and payment method URL tests
- Add DownloadableItemAuthCest with 5 e2e tests covering both options
* fix: test suite stability and code coverage collection
- Add WC_Unit_Tests_Bootstrap stub to wpunit bootstrap to bypass
wc_get_product_visibility_term_ids static cache between suites
- Add setWooGraphQLSetting helper to GraphQLE2E for safe individual
field updates to woographql_settings option with proper defaults
- Update all functional tests to use setWooGraphQLSetting instead of
replacing the entire woographql_settings option
- Fix createRelated factory to use explicit shared category instead
of relying on default Uncategorized category
- Add download_url to ProtectedRouterTest nonce names assertion
- Remove debug logs from ProductQueriesTest and ProductsQueriesTest
- Fix CI workflow to run suites separately and aggregate coverage
via phpcov merge
- Wire c3.php into WordPress index.php for remote coverage collection
- Update .coveralls.yml service_name to github-actions
- Clean up Xdebug 2 settings in Dockerfile
* chore: Linter compliances met
* fix: ensure tests/_output is writable for c3.php coverage collection
* devops: .env.docker removed from setup
* devops: split CI into separate jobs per suite with retry and coverage aggregation
* devops: add +Coverage indicator to CI job names
* devops: add --fail-fast to first run, fix retry to mark job as passing on retry success
* fix: resolve REQUEST_URI fatal error and JWT key length issues in CI
QLSessionHandlerTest::tearDown() was calling unset($_SERVER) which
destroyed the entire superglobal. WordPress cron.php then fataled on
shutdown when accessing $_SERVER['REQUEST_URI']. Changed to only unset
the specific HTTP_WOOCOMMERCE_SESSION key.
Also updated JWT secret keys to meet firebase/php-jwt v7's minimum
32-byte requirement for HS256 in both test config and Docker entrypoint.
* fix: the rest of the files added
* devops: php7.4 removed from matrix
* chore: Linter compliances met
* devops: More broken test updated
* devops: Tests updated for CI
* fix: QLSessionHandlerCest fixed
* fix: QLSessionHandlerCest fixed
* devops: CI fixed
* feat: Add Store API Cart-Token compatibility and session handler improvements
* chore: Linter compliances met
* chore: linter compliances met
* chore: linter compliances met
* - remove several fields that are already registered by core when the post type is mapped to the schema
* devops: Tests updated and coupon "salt" restored
* chore: Linter & PHPStan compliance met
* chore: Linter & PHPStan compliance met
* devops: "self" replaced with "static" in cli tests
* chore: fix cleanup after rebasing
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* feat: "product" and "variation" connections added to LineItem type
* chore: Coding standards met
* fix: GraphQLE2E helper updated to reflect schema changes
* chore: PHP 8.0 compliance met
* chore: Workflow codecoverage set to target PHP 7.4
* chore: WPCS compliance met