Skip to content

Add woocommerce-quicker extension#27110

Open
g-mai wants to merge 3 commits intoraycast:mainfrom
g-mai:ext/woocommerce-quicker
Open

Add woocommerce-quicker extension#27110
g-mai wants to merge 3 commits intoraycast:mainfrom
g-mai:ext/woocommerce-quicker

Conversation

@g-mai
Copy link
Copy Markdown

@g-mai g-mai commented Apr 12, 2026

Description

WooCommerce Quicker lets users quickly search their WooCommerce stores for orders, customers, and products.

Commands:

  • Search Orders: filter by status, searches in multiple fields, press Enter to open in browser
  • Search Customers: filter by role, search by name or email, press Enter to open in browser
  • Search Products: filter by status, shows price, type, stock status
  • Manage Stores: add, edit, and delete multiple stores with credential validation

Key features:

  • Multi-store support
  • Credentials validated against the WooCommerce API before saving
  • Support for local/self-signed SSL stores (development use)

Notes for reviewers

If you check the useStores.ts custom hook you'll see that I'm using useLocalStorage to save authentication credentials. I'm aware the guidelines mention to use the Preferences API for things like keys and authentication credentials, but I couldn't find a way to do that while supporting multiple stores and make it a good experience for the user.

In the other custom hook, useWooCommerce.ts, I import fetch from "cross-fetch" instead of using the built in fetch or raycast's useFetch, because both of them were failing when calling a local Wordpress with a self-signed SSL certificate. The easiest solution I found was to add an option to the stores that, when checked, allows the hook to use cross-fetch fetch, with a custom agent that ignores SSL errors.

The rest of the extension is just basic fetches and list results, nothing really special about it.

Screencast

woocommerce-quicker-1 woocommerce-quicker-2 woocommerce-quicker-3 woocommerce-quicker-4

Checklist

- Added screenshots
- feat: update README and CHANGELOG with new features; enhance error handling in search components
- feat: integrate currency formatting in order search results
- feat: add currency formatting helper and integrate into product and store components
- feat: enhance store management with formatting options and loading states. Adding currency check for stores.
- feat: add product search functionality with StoreSelection integration
- feat: enhance customer search with role filtering
- feat: WIP customer search functionality (search not working well yet)
- feat: refactor WooCommerceOrders to use StoreSelection component for improved store management
- fixed empty view on first store load in SearchOrders component with proper error handling
- feat: add local store support with SSL verification option in StoreForm and useWooCommerce hook
- feat: update store name in package-lock and improve error handling in SearchOrders component
- feat: add store creation functionality and enhance empty state view in WooCommerce orders
- Fixed various issues with multiple stores selection for orders search
- feat: refactor store management by removing credentials handling and updating order fetching logic
- feat: add store management functionality to start support for multiple stores
- Created hook to manage multiple stores
- feat: update extension icon and add order status filter to WooCommerce orders
- refactor: optimized fetching data using useFetch hook
- feat: refactor WooCommerce order fetching and add missing settings component
- feat: implement settings component for WooCommerce credentials management
- refactor: move setup logic to SetupStepOne component
- pivot: update extension details and implement WooCommerce order fetching
- first commit
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Apr 12, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@g-mai g-mai marked this pull request as ready for review April 12, 2026 18:55
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 12, 2026

Greptile Summary

Adds a new WooCommerce extension supporting multi-store order, customer, and product search with per-store credential validation and a local-SSL development mode. Previous review concerns (printWidth, CHANGELOG date placeholder, cancel-toast style, unused component, cross-fetch justification) have all been addressed in the latest commit.

Two small improvements worth considering before merge:

  • generateUrl doesn't strip trailing slashes from storeUrl, producing //wp-json/... paths that fail on Nginx-hosted stores.
  • parseWooCommerceResponse discards the WooCommerce JSON error body and falls back to statusText, which is empty under HTTP/2.

Confidence Score: 5/5

Safe to merge; remaining findings are P2 quality improvements that don't block core functionality.

All prior blocking issues have been resolved. The two remaining items (trailing-slash URL construction and error body parsing) are edge-case usability improvements, not correctness bugs in the happy path.

extensions/woocommerce-quicker/src/hooks/useWooCommerce.ts — trailing slash and error message handling

Important Files Changed

Filename Overview
extensions/woocommerce-quicker/src/hooks/useWooCommerce.ts Core data-fetching hook split between useFetch (remote) and usePromise+cross-fetch (local SSL). Two minor issues: error response body is not read (WooCommerce JSON error detail lost), and storeUrl trailing slashes aren't stripped before URL construction.
extensions/woocommerce-quicker/src/components/store-form.tsx Store add/edit form with credential validation against the WooCommerce API; URL validation accepts trailing slashes which propagate to double-slash API paths.
extensions/woocommerce-quicker/src/hooks/useStores.ts LocalStorage-backed store CRUD with favourite-first sorting; clean and correct.
extensions/woocommerce-quicker/src/components/store-selection.tsx Store picker that auto-selects when exactly one store is configured; straightforward and correct.
extensions/woocommerce-quicker/src/manage-stores.tsx Store management CRUD with confirmed-delete pattern; previous toast issues were resolved in latest commit.
extensions/woocommerce-quicker/src/types/types.ts Well-structured type definitions for store, order, customer, and product objects.
extensions/woocommerce-quicker/src/helpers/formatters.tsx Currency formatter using per-store separators and decimals; NaN guard handles non-numeric fallbacks correctly.
extensions/woocommerce-quicker/package.json All four dependencies (cross-fetch, he, @raycast/api, @raycast/utils) are imported in source; metadata, category, and platform fields are correct.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/woocommerce-quicker/src/hooks/useWooCommerce.ts
Line: 823

Comment:
**Trailing slash in `storeUrl` creates double-slash API paths**

If a user enters `https://mystore.com/` (trailing slash — common when copy-pasting from a browser), the template literal produces `https://mystore.com//wp-json/wc/v3/orders`. Nginx by default blocks or 404s on double-slash paths, so store credential validation and all subsequent API calls would silently fail for those users. Trimming the trailing slash here is the safest fix since it also covers URLs already persisted in storage.

```suggestion
  const url = new URL(`${storeUrl.replace(/\/+$/, "")}/wp-json/wc/v3/${endpoint}`);
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/woocommerce-quicker/src/hooks/useWooCommerce.ts
Line: 810-812

Comment:
**WooCommerce error body is discarded**

`response.statusText` is empty in HTTP/2 responses (which most modern hosts serve), so `error.message` will be `""` and users fall back to the generic "Please check your store settings" toast. WooCommerce returns a descriptive JSON body on errors (e.g., `"Consumer Key is invalid."`); reading it would give users actionable feedback.

```suggestion
async function parseWooCommerceResponse<T>(response: Response) {
  if (!response.ok) {
    let errorMessage = response.statusText;
    try {
      const body = await response.json();
      if (body?.message) errorMessage = body.message;
    } catch {
      // ignore parse errors
    }
    throw new Error(errorMessage || `HTTP ${response.status}`);
  }
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "improved wording and added screenshots t..." | Re-trigger Greptile

Comment thread extensions/woocommerce-quicker/.prettierrc Outdated
Comment thread extensions/woocommerce-quicker/CHANGELOG.md Outdated
Comment thread extensions/woocommerce-quicker/src/manage-stores.tsx Outdated
Comment thread extensions/woocommerce-quicker/src/components/missing-settings.tsx Outdated
Comment thread extensions/woocommerce-quicker/src/hooks/useWooCommerce.ts
- chore: add comments to clarify usage of cross-fetch for custom HTTPS agent
- FIx linting
@g-mai
Copy link
Copy Markdown
Author

g-mai commented Apr 13, 2026

All suggestions from greptile bot have been handled in the latest commit.

@g-mai g-mai closed this Apr 16, 2026
@g-mai g-mai deleted the ext/woocommerce-quicker branch April 16, 2026 18:04
@g-mai g-mai restored the ext/woocommerce-quicker branch April 16, 2026 18:06
@g-mai g-mai reopened this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants