* Add image support for productBrand query
* chore: text-domain updated
---------
Co-authored-by: Christian Garibaldi <cgaribaldi94@gmail.com>
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* 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.
* fix: session secret key, cart session persistence, null variation attributes
- Use wp_salt() as fallback secret key instead of hardcoded 24-byte string
to satisfy php-jwt v7's HS256 minimum key length requirement (Closes#1009)
- Call get_cart_from_session() after wc_load_cart() in
initialize_session_and_cart() to prevent cart queries from clearing
persisted session data (Closes#1010)
- Guard against null $attrs in variation_attributes_to_data_array()
to prevent PHP warnings when variations have no attributes (Closes#1011)
- Return empty array instead of null for product attribute options
when no terms exist
* chore: Linter compliances met
* perf: Migrate type descriptions to lazy lambdas
Convert all eager description strings from:
'description' => __( '...', 'wp-graphql-woocommerce' ),
to deferred lambdas:
'description' => static function () { return __( '...', 'wp-graphql-woocommerce' ); },
This defers the __() translation call until the description is actually
needed (e.g. during schema introspection), avoiding unnecessary
translation overhead on every GraphQL request. Mirrors the pattern
used in WPGraphQL core.
1206 descriptions converted across 169 files.
* chore: Linter compliances met
* 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
* 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>
* refactor: Product_Attribute_Connection_Resolver class refactor to be more consistent with contemporaries
* refactor: Product_Attribute_Connection_Resolver class refactoring continued
* feat: implement productAttributes root query, products connection on ProductAttribute, and category-scoped attributes
- Implement build_nodes_from_global_attributes() to return WC_Product_Attribute
objects from wc_get_attribute_taxonomies()
- Fix build_connection() infinite recursion and undefined variable bugs
- Add products connection from ProductAttribute interface to Product via
tax_query (global) or meta_query (local) in class-products.php
- Add productAttributes connection from ProductCategory to GlobalProductAttribute
in class-product-attributes.php
- Move localAttributes/globalAttributes connections from class-product-attributes.php
to ProductWithAttributes interface get_connections()
- Fix ProductAttribute id resolvers to use Relay::toGlobalId() instead of
dynamically set _relay_id
- Remove deprecated get_items() method and GLOBAL_ID_DELIMITER constant
- Add ProductAttributeConnectionsTest with 4 tests covering root query,
global/local attribute products connections, and category-scoped attributes
- Update ProductAttributeQueriesTest expectations for new id format and
taxonomy-prefixed attribute names
* fix: refresh order object after meta save in checkout mutation
The woocommerce_checkout_order_processed hook was receiving a stale
order object without the metadata saved by update_order_meta().
Refreshing the order via wc_get_order() after meta save ensures
plugins hooking into woocommerce_checkout_order_processed can access
the checkout metadata.
Resolves#932
* chore: Linter compliances met
* devops: Product and product attribute mutation tests generated
* feat: Product Mutations implemented and tested
* chore: Linter and PHPStan compliance met
* fix: resolve test failures in product and variation mutation tests
- Removed duplicate requires for payment-method classes (rebase artifact)
- Wrapped bare `attributes` queries in `... on SimpleProduct` inline
fragments (attributes field is on ProductWithAttributes interface,
not the base Product type)
- Fixed attribute label expectations to match factory output (lowercase)
- Fixed relay ID prefix from 'product'/'product_variation' to 'post'
to match WPGraphQL's actual encoding
- Cache WP_Post before force-deletion and re-cache after so the Product
model's type resolver can still determine the GraphQL type in the
response
- Added wp_cache_flush() before asserting product deletion to avoid
false positives from the re-cached post
* chore: fix PHPCS lint errors in mutation files
* fix: resolve CI test failures for attribute and variation mutations
- Fixed ProductVariation type registration in schema filters so the
variation mutation output field resolves correctly
- Renamed attribute slug from 'pattern' to 'fabric' in
ProductAttributeMutationsTest to avoid collision with the pattern
attribute created by ProductAttributeQueriesTest
- Fixed PHPStan errors for redundant is_wp_error checks
- Updated IntrospectionQueryTest
* fix: Checkout notices further implemented
* fix: resolve PHPCS lint errors and remove commented-out code
* test: add stale notice leak regression test
Verifies that error notices from a failed checkout do not leak into
subsequent checkout attempts, reproducing the exact scenario from #666.
* 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
* fix: updated data-loaders to be in compliance with WPGraphQL v2.3.x
* fix: general improvements and bugfixes
* chore: test dependencies removed
* chore: Unnecessary files removed
* chore: Linter compliances met
* chore: Linter compliances met
* fix: "Product" interface applied to all sub Product interfaces for more optimal schema shape
* fix: more inconsistencies fixed.
* feat: "ProductWithAttributes" interface radded to "ProductWithVariations" interface
* 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
* fix: JWT Auth hooks now support WPGraphQL Headless Login
* chore: PHPStan compliance met
* fix: Proper TokenManager function in use for auth token resolution
* 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>
* 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>
* fix: Product and order connections use respective queryclasses.
* fix: include + exclude product connection where args fixed and tested
* chore: docker-compose.yml restored
* 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>