=== MyVendorHub for WooCommerce ===

Contributors: myvendorhub
Tags: woocommerce, dropshipping, fulfillment, vendors, suppliers
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate supplier notifications, Accept/Reject tracking, and multi-vendor fulfillment for your WooCommerce store.

== Description ==

**Selling products from suppliers?** [MyVendorHub](https://www.myvendorhub.com) organizes your inventory, pricing, and orders â€” automatically.

This free plugin connects your WooCommerce store to MyVendorHub. When a customer orders a supplierâ€™s products, MyVendorHub notifies the right vendor by email or WhatsApp, tracks their Accept / Reject / Other response, and writes status updates back to your order notes â€” so nothing falls through the cracks.

Less spreadsheets. Less WhatsApp chaos. Fewer mistakes. More control.

= What MyVendorHub does for your store =

* **Automatic supplier notifications** â€” New orders are routed to the right vendor with product details, quantities, and shipping address
* **Email & WhatsApp** â€” Reach vendors on the channels they already use (WhatsApp on Growth+ plans)
* **One-click Accept / Reject / Other** â€” Vendors respond from a secure link; you get alerts when something needs attention
* **Smart reminders** â€” Configurable follow-ups for vendors who havenâ€™t replied, optionally limited to working hours
* **Supplier dashboard** â€” Orders grouped by vendor with revenue, product details, and fulfillment status at a glance
* **Vendor sync from your catalog** â€” Pull vendor names from product meta and manage contacts in one place
* **Product Scanner** â€” Track supplier product page URLs for price, availability, and catalog changes
* **Event Hub** â€” Activity feed for notifications sent, vendor responses, reminders, and failures
* **Multi-language messaging** â€” Notify vendors in 12 languages (including Hebrew and Arabic)
* **Multi-store ready** â€” Manage multiple WooCommerce stores from one MyVendorHub account
* **HPOS compatible** â€” Works with WooCommerce High-Performance Order Storage

Merchants manage vendors, reminders, scanner, billing, and responses in the **[MyVendorHub web dashboard](https://www.myvendorhub.com)** â€” this plugin keeps your store connected securely.

**Free Starter plan** available after connect (limits apply). Paid plans unlock more vendors, reminders, WhatsApp, and higher volume. See [pricing on myvendorhub.com](https://www.myvendorhub.com).

= How it works =

**Install â†’ Connect â†’ done.** No WooCommerce REST API keys are required for the standard setup â€” the plugin securely handles order sync, vendor sync, draft product creation, and order note/status write-back on its own.

1. Install and activate this plugin (WooCommerce 6.0+ required).
2. Connect your store to MyVendorHub in **WooCommerce â†’ Settings â†’ MyVendorHub**.
3. Add vendor contacts and enable notifications in the MyVendorHub dashboard.
4. Place a test order â€” vendors are notified within seconds, and responses appear on the order in WooCommerce.

= Connect your store =

**Recommended: one-click Connect**

Review the permissions checklist on the settings page, then click **Connect to MyVendorHub**. Sign in (or create an account), and your store credentials are returned securely â€” no secrets are embedded in the plugin.

After connecting, use **Open MyVendorHub** in wp-admin to return to your dashboard without signing in again (signed SSO launch).

**Manual connection (Advanced)**

Already have a store in MyVendorHub? Copy **Store ID** and **API token** from MyVendorHub â†’ Settings â†’ API access, then paste them under **Advanced â†’ Manual connection** in WooCommerce â†’ Settings â†’ MyVendorHub.

**Developers (self-hosted only)**

For local / self-hosted MyVendorHub environments, define `VENDORHUB_WC_CONNECT_SECRET` in `wp-config.php` to enable a **Direct connect (dev)** HMAC registration button. Not used for the public SaaS.

= External services =

This plugin connects your store to **MyVendorHub** cloud services over HTTPS (default host: `https://www.myvendorhub.com`). A MyVendorHub account is required to forward orders.

Data that may be transmitted after you connect:

* **Connect** â€” your site URL, store display name, and a per-site plugin token used to complete the handshake
* **Order sync** â€” order number, line items, SKUs, vendor names, shipping address, and customer contact details needed for fulfillment
* **Inbound updates** â€” MyVendorHub securely POSTs vendor status, notes, and tracking back to your WordPress site (HMAC-verified)

No MyVendorHub admin passwords are stored in WordPress. Only the per-store `storeId` and `apiToken` from connect are saved locally.

Privacy policy: [https://www.myvendorhub.com/privacy](https://www.myvendorhub.com/privacy)

Learn more or try the live demo: [https://www.myvendorhub.com](https://www.myvendorhub.com)

== Installation ==

1. In WordPress, go to **Plugins â†’ Add New**, search for **MyVendorHub for WooCommerce**, and click **Install Now** â€” or upload the plugin ZIP.
2. Activate the plugin (requires **WooCommerce 6.0+**).
3. You are guided to **WooCommerce â†’ Settings â†’ MyVendorHub** to review permissions.
4. Click **Connect to MyVendorHub** and sign in, **or** paste Store ID + API token under **Advanced â†’ Manual connection**.
5. In the MyVendorHub dashboard, set your admin email, sync or add vendors, and enable notifications.
6. Place a test order â€” it should appear in MyVendorHub within seconds. Vendor responses write back to WooCommerce order notes.

== Frequently Asked Questions ==

= What is MyVendorHub? =

MyVendorHub is a vendor order management platform for online stores. It automatically notifies suppliers when their products are ordered, tracks Accept / Reject / Other responses, sends reminders, and gives you a dashboard of vendor performance â€” so you spend less time on manual emails and WhatsApp threads.

= Do I need a MyVendorHub account? =

Yes. Without a connection the plugin shows â€œNot connectedâ€ and does not transmit order data. A free Starter plan is available after you connect.

= Where do I manage vendors and settings? =

In the MyVendorHub web dashboard at [https://www.myvendorhub.com](https://www.myvendorhub.com). This plugin connects your WooCommerce store; day-to-day vendor management happens in MyVendorHub. After connect, use **Open MyVendorHub** from the plugin settings for one-click return (no re-login).

= Are WooCommerce REST API keys required? =

No. Order forwarding works through this plugin alone. Optional WooCommerce REST keys can be added later in MyVendorHub for richer dashboard reads and advanced features.

= How do vendors get notified? =

When an order includes a vendorâ€™s products, MyVendorHub emails them (and optionally WhatsApp on eligible plans) with order details and one-click Accept / Reject / Other buttons. You configure contacts and notification channels in the Vendors list inside MyVendorHub.

= What if a vendor doesnâ€™t respond? =

Enable smart reminders in MyVendorHub Settings. You can schedule up to three follow-ups and optionally restrict them to working hours so vendors arenâ€™t contacted at night.

= Does this work with Dokan, WC Vendors, or similar plugins? =

Vendor names are read from common product / line-item meta keys (`_vendor`, `vendor`, `_wcv_vendor`, `_dokan_vendor_id`). You can also set a custom vendor meta key in MyVendorHub Settings.

= Does the plugin store MyVendorHub passwords? =

No. Only the per-store `storeId` and `apiToken` from the connect handshake are stored in WordPress options.

= What personal data is sent to MyVendorHub? =

Order and fulfillment data needed for vendors to ship â€” including customer name, shipping address, and phone when present on the order. MyVendorHub does not sell personal data. See [https://www.myvendorhub.com/privacy](https://www.myvendorhub.com/privacy).

= Is it compatible with HPOS? =

Yes. The plugin declares compatibility with WooCommerce High-Performance Order Storage.

== Screenshots ==

1. WooCommerce â†’ Settings â†’ MyVendorHub onboarding (permissions disclosure)
2. Connected state with Open MyVendorHub (SSO launch)
3. Advanced manual Store ID and API token entry
4. Order note applied after vendor accept in MyVendorHub

== Changelog ==

= 1.2.2 =

* Force package refresh so staging installs the order-meta-keys discovery endpoint.

= 1.2.1 =

* Publish order custom-field discovery (order-meta-keys) for MyVendorHub Settings filtering.
* Include merchant-facing order `customFields` on order list, single-order read, and new-order ingest (required for MyVendorHub Settings â†’ Order filtering by custom field, including dashboard exclusion and skip vendor notifications).
* Add `GET /wp-json/vendorhub/v1/order-meta-keys` discovery endpoint (HPOS-safe) so MyVendorHub can populate the custom-field filter picker.

= 1.2.0 =

* Mode B+ agent endpoints: the plugin now serves orders, product creation, and product images directly to MyVendorHub â€” no WooCommerce REST API keys required for the standard setup.
* Capabilities discovery endpoint so MyVendorHub detects supported features and older installs degrade gracefully.
* Read orders (list + single) in MyVendorHub's normalized shape, including vendor names and product images (HPOS-safe).
* Create draft (or active/private) products from MyVendorHub, with image sideloading into the media library.
* Product image backfill endpoint for existing catalog items.
* Order forwarding now always includes the store timezone and product image URLs, plus a passive version/capabilities handshake.
* Updated connect permissions disclosure to cover reading orders, syncing vendors, creating draft products, and writing order notes/settings.

= 1.1.7 =

* Load plugin includes defensively so an incomplete install shows an admin notice instead of a fatal error.
* Notify MyVendorHub on plugin activation (best-effort, only for already-connected stores; never blocks activation).

= 1.1.5 =

* Harden uninstall/deactivate lifecycle callbacks so WordPress delete cannot fail with a server error if MyVendorHub is unreachable or plugin files are incomplete.

= 1.1.4 =

* Notify MyVendorHub on plugin deactivate and uninstall (signed lifecycle callbacks).
* Uninstall notifies the app before deleting stored credentials.

= 1.1.3 =

* Refresh WordPress.org listing copy (features, connect, external services, FAQ).
* Fix short description so WooCommerce version headers are not shown in the plugin excerpt.

= 1.1.2 =

* Rename plugin to **MyVendorHub for WooCommerce** (distinctive branding for WordPress.org).
* Require valid connect `state` on redirect return â€” reject missing or invalid CSRF state before saving credentials.

= 1.1.1 =

* Align text domain with WordPress.org slug (`vendorhub-for-woocommerce`).
* Fix Plugin URI / Author URI headers for directory submission.

= 1.1.0 =

* SSO launch â€” Open MyVendorHub from wp-admin without re-login.
* Configurable vendor meta key for multi-vendor plugins.
* Onboarding UX and permissions disclosure improvements.
* WordPress 7.0 compatibility.
* PHPCS, Plugin Check CI, and E2E verification script.

= 1.0.0 =

* Initial release: redirect connect, manual token paste, order ingest, REST callback, settings UI, privacy disclosures, WordPress.org readiness (Phase 7F).

== Upgrade Notice ==

= 1.2.1 =

Adds order custom field support for MyVendorHub order filtering (dashboard + skip vendor notifications). Update recommended if you use Settings â†’ Order filtering by custom field.

= 1.2.0 =

Adds direct order reads, draft product creation, and product images so MyVendorHub works without WooCommerce REST API keys. Enriches order sync with store timezone and product images.

= 1.1.7 =

Incomplete installs now show an admin notice instead of failing with a fatal error, and activation notifies MyVendorHub for connected stores.

= 1.1.5 =

Fixes plugin delete failures related to lifecycle notifications on uninstall.

= 1.1.4 =

Sends deactivate/uninstall lifecycle notifications to MyVendorHub when the store was connected.

= 1.1.3 =

Listing and documentation update for the WordPress.org directory.

= 1.1.2 =

Security and branding update for WordPress.org review.

= 1.1.1 =

= 1.1.0 =

Adds SSO launch, vendor meta configuration, and WordPress 7.0 support.

= 1.0.0 =

Initial public release for WordPress.org submission.
