100 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub 088d337ef5 fix: address WordPress.org plugin review (rename + prefixing + headers) (#1019)
* fix: address WordPress.org plugin review feedback

- Prefix the session transaction queue transient with the plugin's
  graphql_woocommerce_ namespace instead of the generic "woo_" word, to
  avoid collisions (Plugin Directory: prefix data storage).
- Declare the WooCommerce dependency via the "Requires Plugins: woocommerce"
  plugin header.
- Bump README.txt "Tested up to" to 7.0.
- Ship composer.json in the distributed plugin (drop it, and composer.lock,
  from composer archive excludes) so the build is reproducible/reviewable.

* chore: rename plugin to "GraphQL for eCommerce" for trademark compliance

The WordPress.org plugin review flagged the display name/slug for beginning
with the "WPGraphQL" trademark (and the "WooGraphQL" portmanteau of the
WooCommerce mark), which can imply official affiliation.

- Display name (plugin header + readme title) -> "GraphQL for eCommerce".
- Slug/text domain -> "graphql-for-ecommerce" (header, all i18n string
  literals, and the PHPCS WordPress.WP.I18n text_domain config).
- Update user-facing notices/errors that named the old plugin.

"WooGraphQL" remains the project's informal nickname (repo, docs, community),
just not in the WordPress.org directory's official name/slug. Internal file
names and GitHub URLs are unchanged.

* fix: keep test-only dev deps out of the committed composer.json

The committed manifest mirrors develop (lint/stan dev deps only); CI adds the
test suite deps at runtime via `composer installTestEnv`. A previous commit
captured the installTestEnv-modified composer.json, desyncing it from
composer.lock and breaking `composer install` in CI.

* chore: regenerate composer.lock (refresh dev dependencies)

Regenerate the lock from the manifest so it is in sync (fixes the CI
`composer install` failure) and refresh dependencies in the process —
firebase/php-jwt v7.0.4 -> v7.1.0 plus 11 others, with vendor-prefixed
re-strauss'd to match. Full wpunit suite passes against the updated deps
(305 tests, 835 assertions).

* chore: rename text domain in createdVia/attribution strings from #1018

#1018 (createdVia + order attribution) merged into develop after the rename
commit was authored, so its new i18n strings still used the old
'wp-graphql-woocommerce' text domain. Update them to 'graphql-for-ecommerce'
to match the rename.
2026-06-30 10:16:21 -04:00
Geoff TaylorandGitHub 01876f5344 feat: persist shipping phone through the checkout mutation (#1017)
* feat: persist shipping phone through the checkout mutation

The shipping fieldset in Checkout_Mutation::get_checkout_fields() omitted
the phone field, so a phone passed in the checkout mutation's shipping
input was never mapped into shipping_phone and WC_Order::set_shipping_phone()
was never called. Add phone to the shipping fieldset so it flows through to
the order, matching the billing fieldset.

Closes #1016

* fix: load QL session handler when a session token header is present

should_load_session_handler() only matched explicit wc-ajax / WC_DOING_AJAX
and REST_REQUEST contexts. Headless callers drive session state through the
Store-API Cart-Token header or the legacy woocommerce-session header and can
land on other admin-ajax/REST entrypoints, leaving the session bootstrapped
from an absent cookie. Detect either session header and also honor
wp_doing_ajax() so QL_Session_Handler loads and rebuilds the session from the
token.

* ci: authenticate composer GitHub access to fix flaky strauss install

The dependency-install steps run with the github-oauth token that composer
rejects ("contains invalid characters"), so composer and strauss's internal
composer bootstrap fall back to unauthenticated GitHub access. Under the
shared runner IP's 60/hr unauthenticated rate limit, strauss intermittently
exits 1 during post-install-cmd, failing lint, PHPStan, wpunit, functional
and acceptance jobs at random.

Provide a well-formed COMPOSER_AUTH built from the always-available
GITHUB_TOKEN on every dependency-install step so GitHub API access is
authenticated (5000/hr), removing the flake.

* ci: run strauss with a clean composer auth context

setup-php writes the runner's GITHUB_TOKEN into composer's global auth.json,
and this composer rejects that token format ("github oauth token contains
invalid characters"). strauss spins up its own internal Composer instance,
which reads that auth, hits the validation error and exits 1 with no output,
failing every job at the post-install/post-update strauss step.

strauss only rewrites local vendor packages and needs no GitHub auth, so run
it with COMPOSER_AUTH unset and a throwaway COMPOSER_HOME. Fixes all CI
install steps, local installs and release packaging from one place.

This reverts the earlier per-workflow COMPOSER_AUTH attempt, which could not
work because composer rejects the token regardless of how it is supplied.

* style: align equals sign in should_load_session_handler (phpcs)
2026-06-11 20:02:26 -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
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 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 36e79d3b34 devops: git hooks locked to dev environment installs (#911) 2024-12-09 18:40:23 -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 d9d968ac91 fix: product connection resolution refactored to better work with the ProductQuery class (#880)
* fix: product connection resolution refactored to better work with the ProductQuery class

* chore: Linter and PHPStan compliance met

* devops: New product connection tests implemented and passing

* fix: products connection pricing filters fixed

* devops: CartTransactionQueueCest skipped until failing PHP version removed from CI matrix
2024-08-06 18:07:37 -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 e684a51004 "vendor/woographql" -> "vendor-prefixed" (#777) 2023-08-03 17:02:54 -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
Dovid LevineandGitHub fa8e3005e5 fix: remove trailing commas from function calls (#768)
* fix!: update deps to required versions

* fix: trailing commas not allowed in PHP 7.2
2023-07-19 15:10:22 -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 461caad55b feat: "NAME" added to "PostTypeOrderbyEnum" values (#722) 2023-03-29 13:18:06 -04: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 c083fa51a4 fix: Parent connection classes namespaces updated. (#696) 2023-01-24 17:21:16 -05: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 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
Geoff Taylor 8089d0462c composer archive configurations added. 2021-07-05 16:23:59 -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 9e31f47e51 Cart item connection pagination refactored. 2021-06-12 22:06:44 -04:00
Geoff Taylor e293fe8b6a coding standards met. 2021-06-04 19:58:37 -04:00
Geoff Taylor 8215901e93 Order connections refactored. 2021-06-03 21:37:09 -04:00
Geoff Taylor da2cbdf484 "Coupon_Connection_Resolver" deprecated. 2021-05-19 19:45:02 -04:00
Geoff Taylor c264114daa "Product=>reviews" resolver re-implemented 2021-03-17 19:10:06 -04:00
Geoffrey K TaylorandGeoff Taylor a04e1871fb Merge pull request #444 from wp-graphql/release/v0.8.0
Release v0.8.0
2021-03-01 11:06:33 -05:00
Geoff Taylor db095015b1 Version numbers and Repo templates updated. 2021-02-26 21:12:52 -05:00
Geoff Taylor 888ac9696d autoloader files rebuilt 2021-02-26 19:21:39 -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 TaylorandGeoff Taylor bda03f0b3e wp-browser updated. 2021-02-26 10:09:29 -05:00
Geoff Taylor 73d6418b9d "fillCart" mutation implemented and tested. 2021-02-24 09:17:12 -05:00
Geoff Taylor aa780cf2e7 "AddCartItems" mutation implemented and tested. 2021-02-22 21:17:39 -05:00
Geoff Taylor effd712f16 Coding standards met 2021-02-22 19:42:54 -05:00
Geoff Taylor aacb6bf2bf Workflow badges updated. 2021-01-22 11:37:18 -05:00
Geoff Taylor 71d0f4454b Remote tests removed from codecoverage. 2021-01-22 11:37:18 -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 673ce74547 Docker testing entrypoint script refactored to work better with old versions of PHP. 2020-10-15 00:55:33 -04:00
Geoff Taylor 885736b970 Minor bugs in tests resolved. 2020-10-14 20:33:55 -04:00
Geoff Taylor b7a14f95a1 Session Handler upgraded. 2020-10-01 01:45:26 -04:00
Geoff Taylor ab6b03ad12 composer.json fixed 2020-05-11 21:43:39 -04:00
Geoff Taylor 9704f8d0b2 Merge branch 'release/v0.5.1' into develop 2020-05-11 21:36:24 -04:00