* 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: resolve product variation type when the node is a base Post model
A cart item's variation node can be loaded through the generic post loader (e.g. under Polylang, which doesn't manage the product_variation post-type), arriving as a base \WPGraphQL\Model\Post that has no get_type(). resolve_product_variation_type() then fatals. Fall back to resolving the variation's product type from its ID via wc_get_product() when get_type() isn't callable.
* chore: remove stray graphql_debug() from ProductWithPricing price resolver
* test: disable Customer Note email so order-note tests aren't polluted by the WC email-sent note
* test: cover product-variation type fallback when the node loads as a base Post model
* 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
* 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
* 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
* 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.
* 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>
* 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>
* 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>
* Adds support for tax_lines
* devops: cleanup cart tax lines code style and add unit tests
* feat: add tax-aware cost, subtotal, and taxTotal fields to ShippingRate (#802)
* feat: add format arg to ShippingRate cost/subtotal/taxTotal fields, update test for RAW format
* devops: CartQueriesTest updated
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* feat: add plugin wp-2fa
* devops: add unit test for variation attribute label human-readable values (#965)
* fix: use wc_attribute_label() for variation attribute label instead of term name
---------
Co-authored-by: creative-andrew <andres@netzstrategen.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: improve i18n compatibility for WPML, Polylang, and non-latin character support
- Add Label::get_safe_enum_name() utility with optional transliteration
for non-latin tax class/attribute/taxonomy names (#637, #409)
- Add "Transliterate non-latin characters" admin setting
- Replace get_page_by_path() with WP_Query for product slug resolution
so WPML/Polylang can hook into the standard query pipeline (#403, #368)
- Split product connections: `products` (toType: Product) and
`productsWithVariations` (toType: ProductUnion) so i18n plugins can
register language where args on the standard type name (#811, #952)
- Add ProductTypesWithVariationsEnum for the ProductUnion connection
- Add i18n compatibility tests
* chore: Linter compliances met
* 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
* 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: 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: recursive interface definitions for Product, etc.
* devops: CI & Linter compliances met
* devops: lint-code.yml updated
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* 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
* - 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>
* 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: 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
* fix: JWT Auth hooks now support WPGraphQL Headless Login
* chore: PHPStan compliance met
* fix: Proper TokenManager function in use for auth token resolution