72 Commits
Author SHA1 Message Date
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
Geoff TaylorandGitHub 6fb7b226fc feat: WC Settings API, compatibility refactor, HPOS fix (#1002)
* feat: WC Settings API, compatibility refactor, HPOS fix, CI improvements

WC Settings GraphQL API:
- Add WCSetting interface with common fields and type-safe resolveType
- Add concrete types: WCStringSetting, WCArraySetting, WCRelativeDateSetting,
  WCImageWidthSetting with typed value/default fields
- Add WCSettingGroup type with nested settings field
- Add wcSettingGroups and wcSettings root query fields (admin only)
- Add updateWCSetting and updateWCSettings mutations
- Dynamic WCSettingTypeEnum collected from registered WC settings
- Filters: graphql_woocommerce_setting_type_map, graphql_woocommerce_setting_types
- Register WC admin settings for GraphQL requests via Compatibility class

Compatibility refactor:
- Consolidate ACF, JWT Auth, and QL Search filters into Compatibility class
- Remove class-acf-schema-filters.php, class-jwt-auth-schema-filters.php, functions.php

HPOS compatibility fix:
- Replace hardcoded directory name check with dirname(__DIR__) === WP_PLUGIN_DIR
- Works with any plugin folder name while still skipping nested vendor installs

CI improvements:
- Remove STRIPE_API_PUBLISHABLE_KEY restriction from coverage job
- Add HPOS to coverage matrix entries
- Sort type registry and includes alphabetically

Other fixes:
- Fix Settings_Mutation::validate_setting_checkbox_field to be static
- Update ShippingZone settings field type to WCStringSetting

Closes #864, closes #969

* refactor: Rename and split core classes, add order cursor pagination tests

Class renames:
- WooCommerce_Filters → WooCommerce (class-woocommerce.php), setup() → init()
- Core_Schema_Filters → Post_Types (class-post-types.php)

Class split:
- Extract taxonomy registration from Core_Schema_Filters into Taxonomies (class-taxonomies.php)

Access functions:
- Add wc_graphql_resolve_product_type() for interface resolveType callbacks
- Add wc_graphql_is_session_handler_disabled()
- Add wc_graphql_enabled_authorizing_url_fields()
- Add wc_graphql_get_authorizing_url_nonce_param_name()
- Replace direct class references with global functions in type-registry,
  compatibility, protected-router, and all product interface files

Stripe gateway compatibility:
- Move woographql_stripe_gateway_args from WooCommerce to Compatibility class
- Rename to woocommerce_gateway_stripe_args

Tests:
- Add OrderCursorPaginationTest (6 tests) covering COT cursor-based
  pagination: forward/backward, date ordering ASC/DESC, cursor integrity

* fix: Use proper expectedField/expectedNode assertions in cursor pagination tests

Replace empty assertQuerySuccessful([]) calls and manual lodashGet
assertions with expectedField, expectedNode, and not()->expectedNode()
for proper GraphQL response validation.
2026-03-27 16:32:30 -04:00
Geoff TaylorandGitHub 66f840efc4 fix: Symlink Docker path on CI runner for coverage report generation (#1001)
The .cov files contain Docker container paths (/var/www/html/...) but
phpcov needs to read actual source files to build the Clover report.
Create a symlink from the Docker path to the CI workspace so phpcov
can resolve the source files.
2026-03-26 23:31:57 -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 cfd5115498 fix: Order status filter incorrectly uses single value (#999)
* fix: Order status filter incorrectly uses single value when statuses is the only filter arg

The condition `1 === count($where_args)` checked the total number of filter
args instead of `1 === count($where_args['statuses'])`, causing multi-status
queries to only return results for the first status when no other filters
were provided.

Closes #968

* fix: Upgrade phpcov to v9 for newer coverage file format

The Docker test environment produces .cov files in the php-code-coverage
v10+ format (PHP file wrapper around serialized data). phpcov v8 only
supports raw serialized data and silently produces empty coverage.
2026-03-26 22:45:38 -04:00
Geoff TaylorandGitHub 19c9fa31c0 devops: CI GA script updated (#998) 2026-03-26 22:23:32 -04:00
5792d76344 Automatically get and set data from the specified product ID (#947)
* always calculate; default quantity of 1

* fill the name; complete order item data

* dont introduce new requirement; leave as is

* fix: auto-fill line item data from product, add format arg to LineItem pricing fields, fix isPaid check (#946)

* devops: upload coverage XML and JSON as debug artifacts after Coveralls push

* chore: Lintercompliances met

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2026-03-26 21:29:40 -04:00
974393aeeb fix: Sanitize ProductAttribute name to match VariationAttribute [#965] (#966)
* fix: Sanitize ProductAttribute name to match VariationAttribute [#965]

* devops: add unit test for attribute name consistency between product and variation (#965)

* devops: fix phpcov merge by using .cov extension and pinning phpcov to v8

* chore: Lintercompliances met

* fix: update test expectation for sanitized local attribute name

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2026-03-26 20:10:08 -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 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
01991ad873 Fix/recursive interface definitions (#934)
* fix: recursive interface definitions for Product, etc.

* devops: CI & Linter compliances met

* devops: lint-code.yml updated

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2025-05-01 14:46:55 -04:00
Geoff TaylorandGitHub 2f3cef08b7 devops: package-for-release.yml updated (#910) 2024-12-09 18:17:12 -05:00
Geoff TaylorandGitHub edbd31c3bd devops: Name officially changed to "WPGraphQL for WooCommerce" (#900)
* devops: Name officially changed to "WPGraphQL for WooCommerce"

* devops: GA workflow environment updated

* devops: GA workflow environment updated

* devops: composer-git-hooks downgraded to "2.8.5"

* devops: Unstable session manager tests skipped

* chore: cleanup applied

* devops: Docker configurations updated

* devops: Docker configurations updated

* devops: Docker configurations updated

* devops: Docker configurations updated

* devops: Docker configurations updated
2024-11-06 19:23:36 -05:00
Geoff TaylorandGitHub 8fc7986e4d devops: composer-git-hooks added. CONTRIBUTING.md updated. (#904) 2024-11-06 11:34:09 -05:00
Geoff TaylorandGitHub 57f2a1eba0 chore: version numbers and READMEs updated (#883) 2024-08-07 12:54:57 -04:00
Geoff TaylorandGitHub 61b99ea2f3 devops: release script updated (#859) 2024-05-21 01:06:32 -04:00
8690ede673 dev!: namespace Composer dependencies with strauss (#762)
* dev!: namespace Composer dependencies with strauss

* chore: include vendor-prefixed when stanning

* Strauss configurations properly applied. Contribution docs restored.

* Linter and PHPStan compliance met

* `platform` removed from `composer.json`

* devops: PHP7.3 removed from CI matrix

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-08-02 16:54:46 -04:00
f583628199 chore: implement WPGraphQL Coding Standards (#769)
* chore: avoid magic constants [PHPCS]

* chore: change ruleset to wp-graphql-cs and lint

* devops: HPOS added back to CI with the release of WC 3.9

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-07-19 17:11:25 -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
4ef46acd15 chore: setup PHPStan (#746)
* chore: setup PHPStan

* chore: General code cleanup for PHPStan

* chore: PHPStan to level 2

* chore: PHPStan to level 2

* fix: Syntax error fixed.

* devops: PHPStan level 2 reached.

* devops: PHPStan level 3 passed

* devops: PHPStan level 4 passed

* chore: fix bad typehints from jwt-auth [phpstan]

* chore: simplify conditional logic in WC_Terms::register_connections()

* chore: add stubs for WP type properties.

* fix: check for valid WC_Order_Item before caching order.

* chore: lint

* devops: PHPStan level 6 passed.

* chore: Linter compliance met.

* chore: simplify logic and check for valid term.

* fix: ensure valid types (partial)

* chore: [phpcs] allow inline type annotations

* devops: PHPStan level 8 reached.

* devops: More stability fixes.

* fix: general bugfixes and improvements

* devops: Code Quality GA script added.

* devops: Linter compliance met & 2 "phpstan-ignore" statements set.

* devops: PHPStan config and CI script fixed.

* fix: "cartItem" query resolution refactored

* devops: GA scripts updated.

* chore: Simple copy changes

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-06-13 16:17:02 -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 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 b7d181ed35 Syntax error fixed 2021-07-05 16:43:12 -04:00
Geoff Taylor 8b0fc88acf php-coveralls configs updated. 2021-07-05 16:32:28 -04:00
Geoff Taylor 47ee81df8f packager workflow updated. 2021-07-05 15:42:16 -04:00
Geoffrey K TaylorandGitHub 9bbb81ee36 Support for custom order statuses. (#518)
* Support for custom order statuses.

* package workflow updated.
2021-07-05 15:31:17 -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 c264114daa "Product=>reviews" resolver re-implemented 2021-03-17 19:10:06 -04:00
Geoff Taylor db095015b1 Version numbers and Repo templates updated. 2021-02-26 21:12:52 -05:00
Geoff Taylor ea4a4a539b coding standards met. 2021-01-27 14:02:06 -05:00
Geoff Taylor 1e809bbf20 ci workflow updated. 2021-01-27 00:27:47 -05:00
Geoff Taylor b8d913ee8d Docker/Codeception CI configuration updated. 2021-01-22 11:36:50 -05:00
Geoff Taylor 9984d2e072 continous-integration.yml updated. 2021-01-22 11:36:11 -05:00
Geoff TaylorandGeoff Taylor f47bee2b5f Docker/Codeception configuration heavily refactored.. 2021-01-22 11:34:09 -05:00
Geoff Taylor ddf7661ccf Minor patches applied 2020-10-15 13:12:57 -04:00
Geoff Taylor 673ce74547 Docker testing entrypoint script refactored to work better with old versions of PHP. 2020-10-15 00:55:33 -04:00
Geoff Taylor c0b39bc1e1 php version matrix rearranged to provide collisions with old version. 2020-10-14 23:26:23 -04:00
Geoff Taylor dd190fbde1 README.md updated. 2020-10-14 20:48:45 -04:00
Geoff Taylor 0773277b4e release/v0.6.0 removed from workflow watch list 2020-10-14 10:46:30 -04:00
Geoff Taylor 3a445ed0ed Broken workflow removed. 2020-10-14 10:43:18 -04:00
Geoff Taylor 7b5568fef0 CHANGELOG.md updated 2020-10-13 17:09:44 -04:00
Geoffrey K TaylorandGitHub e708346e65 Merge branch 'release/v0.6.0' into feature/some-node-interfaces-support 2020-10-03 01:46:46 -04:00
Geoff Taylor fcda02cd00 Syntax error fixed in workflow 2020-10-03 01:31:57 -04:00
Geoff Taylor 6026ed9cd3 "testCheckoutMutationCartItemValidation" completed. 2020-10-03 01:28:55 -04:00
Geoff Taylor b7a14f95a1 Session Handler upgraded. 2020-10-01 01:45:26 -04:00
Geoff Taylor 1039e6a2cb Github workflows updated 2020-08-04 20:16:42 -04:00
Geoff Taylor cdf7bd951c "build-release" workflow added. 2020-08-04 14:14:30 -04:00
Geoffrey K TaylorandGitHub fa0e01dde5 Update wordpress-coding-standards.yml 2020-08-04 12:41:57 -04:00
Geoffrey K TaylorandGitHub 59ec0e7bd4 Update testing-integration.yml 2020-08-04 12:41:19 -04:00