37 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 684732aa0d perf: Migrate type descriptions to lazy lambdas (#1005)
* 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
2026-03-30 23:37:51 -04:00
Geoff TaylorandGitHub fb93d6f6eb fix: term_taxonomy_id mismatch in coupon category connections and dead WC post type loop (#985)
- Fix coupon productCategories and excludedProductCategories connections
  to convert term_ids to term_taxonomy_ids before querying, resolving
  failures when term_id and term_taxonomy_id differ (shared terms across
  taxonomies)
- Remove dead WC post type taxonomy connection loop that was skipping
  products/variations and had no effect on remaining post types
- Remove unused WPGraphQL and WP_GraphQL_WooCommerce imports
- Add coupon category connection test with mismatched term IDs and
  exclude filter validation
- Add product category test with mismatched term_id/term_taxonomy_id
  regression coverage
2026-03-23 21:55:22 -04:00
Alex LykesasandGitHub 1424f57ff8 feat: Add Product_Attributes_Connection_Orderby_Enum with MENU_ORDER (#876)
* Add Product_Attributes_Connection_Orderby_Enum with MENU_ORDER

* Fix description

* Add namespace

* Lint fix

* Make minor commit

* Lint fix
2024-07-29 17:15:49 -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
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 58fbce7c57 fix: clean up unnecessary variables and ternaries (#766) 2023-07-19 16:10:23 -04:00
Dovid LevineandGitHub 4ed9cb94da chore: use fully-qualified class names for PHPDoc types (#767)
* fix!: update deps to required versions

* chore: use fqcn for PHPDoc types

* chore: cleanup use statements
2023-07-19 16:01:50 -04:00
Dovid LevineandGitHub d4927b9637 fix: use static closures when possible (#764)
* fix!: update deps to required versions

* fix: use static closures when possible
2023-07-19 15:56:42 -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 c083fa51a4 fix: Parent connection classes namespaces updated. (#696) 2023-01-24 17:21:16 -05:00
0b8ce4f634 fix: Connections need to connect to Types that implement the Node interface (#675)
* - implement Node on different Types

* - update class-customers to return arrays for edges and nodes
- move id resolver from product-attribute interface to the specific types

* - return empty arrays for edges/nodes for coupon connections
- update test to check for falsy vs null

* - remove manual registration of the `Product` Interface
- register the fields to the Product Interface

* - fix code style

* - fix code style

* - no longer pass type registry to Product::register_interface()

* -  use post type registry to register the Product type as an Interface

* WPGraphQL v1.13.x support added.

* WPGraphQL v1.13.x support added.

* fix: filter corrected.

* fix: Needed code restored

* fix: Needed code restored

* parent field no longer overwritten

* chore: WPCS compliance met.

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2022-12-07 17:04:39 -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 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 aacb6bf2bf Workflow badges updated. 2021-01-22 11:37:18 -05:00
Jacob Arriola 46c6772d18 If term_ids is empty pass in an array with 0 to properly guard 2020-11-17 15:09:15 -08:00
Jacob ArriolaandGitHub 53cd35bb13 Guard against empty terms
Addresses #372, which prevents returning all data for a given taxonomy when it's not associated with a product.
2020-11-16 16:00:40 -08:00
Jacob Arriola 85ad48ece8 Add correct params after last merge 2020-11-10 09:38:25 -08:00
be5e7ceb48 Use core WC object instead of handrolling our own guards
Co-authored-by: Geoffrey K Taylor <geoffrey.taylor@outlook.com>
2020-11-10 09:29:45 -08:00
Jacob Arriola 1852adec71 Formatting 2020-11-09 14:17:15 -08:00
Jacob Arriola e1e4a75848 Typo fix 2020-11-09 14:17:03 -08:00
Jacob ArriolaandGitHub 6366a9b147 Guard against false terms when plucking IDs
`get_the_terms` can return `false`, which causes errors when running anything other than an array in `wp_list_pluck`. Related to #363.
2020-11-09 14:10:35 -08:00
Jacob ArriolaandGitHub 3fc6ebeeb4 Connect terms to their source
Rather than assume this only runs on `$attributes`, we need to connect the $source to it's given `$tax_object` that is passed instead.
2020-10-21 11:33:13 -07:00
Jacob ArriolaandGitHub 15dcfa75e0 Remove unused variable 2020-10-20 08:04:26 -07:00
88af7d8fc4 Ensure that no terms are returned for products that don't have that attribute assigned
Co-authored-by: Geoffrey K Taylor <geoffrey.taylor@outlook.com>
2020-10-20 07:57:49 -07:00
Jacob ArriolaandGitHub 9cfffa090d Return TermObjects from the PostObjectType
The current implementation `$source->{"$taxonomy}_ids"}` returns null, which results in all TermObjects getting returned, not just the connected ones.

`$tax_object` is an instance of `WP_Term`, so we can use the `attributes` array of the `$source` instead to collect the connected ids to properly set the query args.
2020-10-16 14:47:39 -07:00
Geoff Taylor edf10a8a1c WC_Term_Connection_Resolver class removed. 2020-08-06 16:02:46 -04:00
Renato Alves 1e0546c1ea Updating connection classes 2020-02-27 21:30:21 -03:00
Geoff Taylor c1239d0863 "ProductAttribute" re-designed. 2020-01-15 20:24:38 -05:00
Geoff Taylor 487a538593 "Product" to "Review(Comment)" connection implemented. 2020-01-15 17:43:38 -05:00
Geoff Taylor 1b84ab80e7 taxonomy connection registration refactored 2019-11-28 12:56:27 -05:00
Geoff Taylor 56138c9a30 Unneeded "register_graphql_connection()" calls removed. 2019-11-04 10:28:54 -05:00
Geoff Taylor 22deb98fe9 Namespaces refactored. 2019-10-25 19:13:36 -04:00
Geoff Taylor 52ceafce03 "ProductUnion" to "Product" 2019-10-24 22:11:04 -04:00
Geoff Taylor 971f4eaf0f ""ProductUnion" type implemented. 2019-10-17 21:39:38 -04:00
Geoff Taylor 158e7ff64d Unnecessary "use" statements removed. 2019-07-11 18:08:02 -04:00
Geoff Taylor c581d6f71e "src" directory renamed to "includes" 2019-05-11 01:10:05 -04:00