157 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub 858887fa78 devops: Variable product performance optimization (#1006)
* 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
2026-03-31 09:17:44 -04:00
Geoff TaylorandGitHub 460b101b47 fix: HPOS order mutation data loss, COT cursor pagination, email tests, checkout auth (#1003)
* 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
2026-03-30 21:42:00 -04:00
506d352292 fix: downloadsRemaining returns null for numeric string values (#1000)
* 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>
2026-03-26 23:03:30 -04:00
Geoff TaylorandGitHub 1807b2e798 Add authenticated download URLs for headless frontends (#995)
* 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
2026-03-26 17:20:55 -04:00
Geoff TaylorandGitHub 146a4430f9 fix: add authenticate flag to registerCustomer mutation (#973)
* fix: add authenticate flag to registerCustomer mutation

Adds an optional `authenticate` boolean input to the registerCustomer
mutation. When true, the mutation sets the current user and reinitializes
the session token for the newly registered customer. Defaults to false
to prevent nonce verification failures in contexts like GraphiQL that
send a nonce with the request.

Resolves #464

* test: add authenticate flag to existing register customer tests

The existing wpunit tests for registerCustomer rely on the user being
authenticated after registration to assert on customer.databaseId and
viewer.userId. Now that authenticate defaults to false, the tests must
explicitly pass authenticate: true.

* test: add authenticate flag to testCustomerMutationsWithMeta

* fix: use explicit billing emails in CustomerQueriesTest assertions

Use wildcard index matching with specific email values instead of
hardcoded node indices with NOT_NULL checks. This prevents failures
when other users in the DB shift the node positions.
2026-03-18 13:13:45 -04:00
Geoff TaylorandGitHub 005f361fb8 fix: inverted logic in pop_transaction_id() causes cart session corruption (#971)
* 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
2026-03-17 23:49:48 -04:00
Geoff TaylorandGitHub ef53404fc3 fix: product variation duplicate fields removed (#957)
* fix: product variation duplicate fields removed

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* devops: CI compliances met

* devops: unneeded access function removed

* devops: unneeded access function removed

* devops: unneeded access function removed
2026-01-16 12:28:23 -05:00
Geoff TaylorandGitHub bde70cb72e feat: Add Store API Cart-Token compatibility and session handler improvements (#954)
* feat: Add Store API Cart-Token compatibility and session handler improvements

* chore: Linter compliances met

* chore: linter compliances met

* chore: linter compliances met
2025-11-15 19:02:41 -05:00
Geoff TaylorandGitHub 594bc29d6b fix: General improvements and bugfixes (#899) 2024-10-29 11:54:06 -04:00
Geoff TaylorandGitHub 76e8db510e feat: QL Session Handler refactored to handle non-GraphQL requests (#870)
* feat: QL Session Handler functionality expanded to support cookies on non-GraphQL requests

* chore: Linter and PHPStan compliance met

* devops: QLSessionHandlerTest patched for suite testing

* chore: Linter and PHPStan compliance met

* fix: More cart session save triggered implemented

* fix: More cart session save triggered implemented

* chore: Linter compliance met

* chore: Linter compliance met

* feat: forgetSession mutation added

* feat: forgetSession mutation added
2024-08-07 12:39:45 -04:00
962410d265 fix: add model classes to type configs to better support query analyzer ID tracking (#874)
* - 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>
2024-08-06 18:54:18 -04:00
Geoff TaylorandGitHub 895b040953 chore: version numbers and changelog updated (#858) 2024-05-21 00:57:56 -04:00
Geoff TaylorandGitHub 2543f33475 fix: Bug in Session_Transaction_Manager::pop_transaction_id() fixed (#852)
* fix: bug in Session_Transaction_Manager::pop_transaction_id fixed

* chore: Linter and PHPStan compliance met

* devops: tests updated

* devops: WPBrowser upgraded to v4.x.x

* devops: Some unit testing configurations updated

* devops: WPBrowser updated and tests passing

* chore: PHPStan and linter compliance met

* devops: WP_CORE_DIR fixed

* devops: More docker config changes

* devops: CartMutationsTest updated

* devops: CI env vars fixed

* devops: More CI fixes

* devops: More CI fixes

* devops: More CI fixes

* devop: Docker env removed

* devops: Codeception configs updated

* devops: configurations tweaked heavily
2024-05-21 00:48:16 -04:00
Geoff TaylorandGitHub f686e743b0 feat: Queries and mutations for shipping zones, tax classes, and tax rates. (#856)
* fix: General bugfixes and improvements

* devops: New mutations and types tested and compliance with Linter and PHPStan

* chore: hooks added to the mutation resolvers

* feat: permission checks added

* chore: Linter and compliance met

* chore: Linter and compliance met
2024-05-17 00:03:10 -04:00
Geoff TaylorandGitHub f1d96bead4 collectionStats query fully implemented (#849)
* fix: WPGraphQL v1.24.x support added

* fix: WPGraphQL v1.24.x support added

* chore: Linter and PHPStan compliance met

* chore: composer.json fixed

* fix: Unnecessary type check restored

* chore: Linter and PHPStan compliance met

* devops: CollectionStatsQueryTest patched
2024-05-16 21:27:54 -04:00
Geoff TaylorandGitHub 8ba35cd50f Fix: WPGraphQL v1.24.x support implemented (#850)
* fix: WPGraphQL v1.24.x support added + WC 3.6 support

* chore: Linter and PHPStan compliance met

* devops: CI config updated

* devops: docker config updated.

* devops: Docker configs updated.
2024-05-07 16:50:42 -04:00
Dovid LevineandGitHub e96236696f chore: bump deps to meet actual requirements and lint for WPCS 3.0 (#816)
* chore: bump min versions to actual and update deps

* chore: fix multiple empty lines at EOF

* chore: preincrement when standalone (phpcs)

* fix: use `printf` instead of `echo sprintf` [phpcs]

* chore: avoid lonely `if()` in `else{}` [phpcs]

* chore: avoid reserved keywords as param names [phpcs]

* chore: remove unused callback params [phpcs]

* chore: remove more unused callback params [phpcs]

* chore: apply lints to tests

* chore: update ruleset for PHPCS 3.0

* texts: restore $last_request_headers
2023-11-30 08:41:32 -05:00
Geoffrey K TaylorandGitHub 44c27174b6 fix: WP User core field support fixed in updateCustomer mutation (#789)
* devops: CustomerMutationsTest refactored heavily

* fix: `updateCustomer` mutation patched
2023-08-22 20:18:47 -04:00
Geoffrey K TaylorandGitHub 87d7a7b1a9 fix: ProductVariation type made to inherit the Product interface. (#788)
* devops: WP theme during e2e locked to TwentyTwentyOne

* fix: "Product Connection Resolver" restored

* chore: Linter/PHPStan compliance met

* devops: CustomerProceedsToCheckoutCept updated.

* chore: Linter compliance met
2023-08-22 17:14:39 -04:00
Geoffrey K TaylorandGitHub 60711aaa1b feat: Account URL added to Auth URLs. (#755)
* feat: Account URL added to Auth URLs.

* fix: Account URL issues resolved + Variation Attribute connections refactored.
2023-07-03 03:34:58 -04:00
57800b46f3 feat: HPOS support added. (#748)
* feat: HPOS support added.

* fix: Refund connections and connection permission fixed

* chore: Linter compliance met.

* devops: CI script updated.

* devops: CI script updated.

* fix: Syntax error fixed.

* devops: CI script updated.

* devops: CI script updated.

* devops: CI script updated.

* chore: PHPStan fixes started.

* chore: linter compliance met.

* chore: fix scanning and type-hinting for non-stubbed classes

* dev: refactor Order model around WC_Abstract_Order

* chore: update dev deps

* devops: PHPStan and Linter compliance met.

* devops: HPOS test temporarily suppressed.

---------

Co-authored-by: David Levine <david@axepress.dev>
2023-06-21 13:21:29 -04:00
Geoffrey K TaylorandGitHub ba13b2ec0a feat: Authorizing URLs implemented and tested. (#745)
* feat: Authorizing URLs implemented and tested.

* feat: More woographql_*_nonce functions implemented.

* chore: linting changes made.

* chore: linting changes made.

* fix: woographql_*_ functions tested.

* chore: WPCS compliance met.

* devops: lint-code script updated to PHP v8.0

* chore: WPCS compliance met

* devops: TransferSessionHandlerTest & QLSessionHandlerTest updated

* devops: codeclimate.yml added.

* chore: Linter compliance met

* devops: Harmonizing WordPress doc written and Settings doc updated.

* chore: Typo fixed in docs.

* fix: General bugfixes and improvements related to Auth URLs

* devops: More docs.

* chore: Linter compliance met

* chore: small change made to docs.
2023-05-22 13:43:10 -04:00
Geoffrey K TaylorandGitHub 80252b0998 feat: Country queries implemented. (#736)
* feat: Country queries implemented.

* chore: WPCS compliance met and late-minute renames.
2023-04-20 19:59:25 -04:00
Geoffrey K TaylorandGitHub 27d9297494 feat: payment method mutations and fields implemented. (#735)
* feat: payment method mutation implemented.

* devops: Unit test updated.

* chore: WPCS compliance met.
2023-04-20 17:33:58 -04:00
Geoffrey K TaylorandGitHub f4b153f147 feat: Docs Restored. Unsupported product type setting implemented. (#731)
* feat: docs started. Unsupported product type implemented.

* chore: WPCS compliance met

* chore: file renamed.

* feat: More docs written

* feat: 2 more docs written

* fix: settings docs images added.

* fix: settings docs images added.

* devops: UnsupportProductTypeTest added.

* devops: More docs changes.

* chore: WPCS compliance met

* devops: UnsupportedProductTypeTest updated.

* chore: WPCS compliance met
2023-04-18 23:48:08 -04:00
Geoffrey K TaylorandGitHub c068671d93 feat: WooGraphQL settings tab added. (#726)
* feat: WooGraphQL settings tab added.

* chore: WPCS compliance met

* bugfix: Order Item Node ID implemented.

* chore: Deprecated "AppContext::getLoader" calls replaced.

* chore: WPCS compliance met.

* fix: DownloadableItem "id" field implemented
2023-04-04 12:02:25 -04:00
Geoffrey K TaylorandGitHub de8cad3a81 fix: Fixed all product connection filtering regressions (#704)
* fix: Fixed all product connection filtering regressions

* chore: WPCS compliance met

* fix: Unsupport syntax refactored
2023-02-02 16:47:19 -05:00
Geoffrey K TaylorandGitHub 82e5e72ff9 fix: Product "price" field now supports the "taxes included" display … (#703)
* fix: Product "price" field now supports the "taxes included" display setting.

* chore: WPCS compliance met.
2023-02-01 17:53:20 -05:00
Geoffrey K TaylorandGitHub 121918ffe2 devops: Test Scripts updated. (#702)
* devops: Test Scripts updated.

* chore: WPCS compliance met.
2023-02-01 14:57:46 -05:00
Geoffrey K TaylorandGitHub 30b34aaaac fix: Customer order connection args priority fixed. (#698) 2023-01-25 15:44:44 -05:00
Geoffrey K TaylorandGitHub b7c7b2d299 fix: Cart emptied after checkout (#649)
* fix: Cart emptied after checkout

* chore: WPCS compliance met.
2022-08-26 20:32:37 -04:00
Geoffrey K TaylorandGitHub 9073793e86 chore: WPGraphQL v1.9.x connection resolver support added and autoloader removed. (#647)
* chore: WPGraphQL v1.9x + WP Bedrock support added.

* chore: lint compliance met.

* chore: composer/installers added back to allow-plugins
2022-08-26 14:53:36 -04:00
Geoffrey K TaylorandGitHub b073dce134 chore: PHP-JWT upgraded to v6.1.0 (#633)
* chore: PHP-JWT upgraded to v6.1.0, Unit tests updated to work with WPGraphQL Testcase v2.3

* chore: PHP7.2 removed from testing workflow matrix.
2022-06-24 17:42:05 -04:00
Geoffrey K TaylorandGitHub 223bde6ea2 feat: "product" and "variation" connections added to LineItem type (#604)
* 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
2022-03-04 23:44:48 -05:00
Geoffrey K TaylorandGitHub 6dbdcb5ae8 fix: Product Attribute naming conventions changed (#603)
* fix: Product Attribute naming conventions changed

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* chore: Docker composer configurations updated

* chore: Coding standards met.
2022-02-04 15:00:44 -05:00
a7714d0cd2 Updates to be compatible with WPGraphQL v1.6.1 (#537)
* fix: Huge refactor across schema and unit tests

* - add shipping_method loader in class-core-schema-filters.php

* - Update class-wc-db-loader.php to respect the new SHIPPING_METHOD loader with a `load_shipping_method_from_id()` function

* - Convert Shipping_Method_Connection_Resolver to extend AbstractConnectionResolver

* - Replace resolver for Shipping Methods connection. Remove use of `resolveNode` and replace the resolver with the new connection class `get_connection()` call

* chore: Factory class refactored.

* - update the function that registers Product Types to the Schema to use the value from the `get_enabled_product_types()` as the Type name and the key as the fieldName

* chore: PaymentGatewayQueriesTest refactored.

* chore: WPCS compliance met

* chore: Syntax error fixed.

Co-authored-by: Jason Bahl <jasonbahl@mac.com>
2021-08-11 14:26:09 -04:00
Geoffrey K TaylorandGitHub f59872ae89 Coupon mutations added. (#510)
* Coupon mutations implemented and tested
* Vendor files no longer versioned and package workflow implemented
2021-07-05 13:51:52 -04:00
Geoff Taylor 66690f03ff "Customer_Connection_Resolver" deprecated. 2021-06-14 11:40:42 -04:00
Geoff Taylor 86c7fb8b4e Refund connections refactored. 2021-06-04 00:12:35 -04:00
Geoff Taylor 8215901e93 Order connections refactored. 2021-06-03 21:37:09 -04:00
Geoff Taylor a37e22480b Order Connection logic/tests heavily refactored. 2021-05-30 14:59:45 -04:00
Geoff Taylor da2cbdf484 "Coupon_Connection_Resolver" deprecated. 2021-05-19 19:45:02 -04:00
Joel 27de711a30 Added refund date field 2021-03-06 04:44:41 +01:00
Geoff Taylor db095015b1 Version numbers and Repo templates updated. 2021-02-26 21:12:52 -05:00
Geoff Taylor a51cb59fa3 Cart* test refactored heavily to extend the WPGraphQLTestCase 2021-02-26 10:53:31 -05:00
Geoff Taylor 993df4b175 "Cart" and "ProductVariation" factories implemented. 2021-02-26 10:25:34 -05:00
Geoff Taylor 1e38166668 CartMutationsTest updated. 2021-02-26 10:24:52 -05:00
Geoff TaylorandGeoff Taylor 56b9f7ddca WPGraphQLTestCase class replaced with same class from "wp-graphql/wp-graphql-testcase" package 2021-02-26 10:24:08 -05:00
Geoff TaylorandGeoff Taylor 34a925a442 "ProductQueriesTest" test refactored to extend the "WooGraphQLTestCase" class 2021-02-26 10:10:23 -05:00
Geoff Taylor 73d6418b9d "fillCart" mutation implemented and tested. 2021-02-24 09:17:12 -05:00