=== TSync Sheet for WooCommerce ===
Contributors: taalhaa, ABDUL_KARIM911
Tags: woocommerce, google sheets, order sync, spreadsheet, automation
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 9.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically sync WooCommerce orders to Google Sheets in real time via webhook. Non-blocking asynchronous dispatch with zero monthly fees.

== Description ==

Managing WooCommerce orders often requires sharing live order data with fulfillment teams, delivery personnel, dropship suppliers, or accountants.

**TSync Sheet for WooCommerce** connects your WooCommerce store directly to your Google Spreadsheet via a fast, secure Webhook. Whenever a new order is placed, customer details, line items, and totals are automatically added as a new row in your Google Sheet in real time.

### 🚀 Key Features (Version 1.0.0)

*   **Real-Time Order Synchronization:** New orders trigger an automated webhook that appends order data directly to your designated Google Sheet.
*   **Zero Checkout Delay:** Uses asynchronous non-blocking background dispatch (`wp_remote_post` with non-blocking mode), ensuring customer checkout performance is never impacted.
*   **Built-in Connection Tester:** Test your webhook URL directly from the WordPress administration settings with the "Send Test Data" button before going live.
*   **Concurrency Safe:** The included Google Apps Script code utilizes Google's `LockService` to prevent data collisions during high-traffic sales.
*   **HPOS Compatible:** Fully compatible with WooCommerce High-Performance Order Storage (Custom Order Tables).
*   **Order Deduplication:** Includes built-in metadata safeguards to ensure that individual orders are synchronized without duplication.

### 💡 Direct & Self-Hosted Integration

TSync Sheet communicates directly between your WordPress server and your own Google Apps Script Web App. This eliminates intermediate third-party service dependencies, keeping your order data private and under your control.

== Installation ==

Setting up TSync Sheet takes only a few minutes:

### Step 1: Install the Plugin
1. Go to your WordPress Dashboard.
2. Navigate to **Plugins > Add New Plugin**.
3. Click **Upload Plugin** and select `tsync-sheet.zip`.
4. Click **Install Now** and then **Activate**.

### Step 2: Set up your Google Sheet
1. Open a new Google Sheet.
2. Click **Extensions > Apps Script** in the top menu.
3. Paste the provided script code from the plugin guide into the script editor.
4. Click **Deploy > New deployment**, select **Web app**, set access to **Anyone**, and click **Deploy**.
5. Copy the generated Web app URL.

### Step 3: Connect WooCommerce
1. In your WordPress admin, go to **WooCommerce > TSync Sheet**.
2. Paste your Web app URL into the field and click **Save Settings**.
3. Click **Send Test Data** to verify your setup.

== Frequently Asked Questions ==

= Does it support WooCommerce High-Performance Order Storage (HPOS)? =
Yes! TSync Sheet is 100% compatible with HPOS (Custom Order Tables).

= Will it slow down my website's checkout page? =
No. The plugin uses asynchronous non-blocking HTTP requests. WooCommerce creates the order and finishes checkout without waiting for Google's HTTP response.

= Which order fields are synced to Google Sheets? =
The plugin synchronizes: Order ID, Order Number, Date, Status, Currency, Totals, Subtotals, Shipping Cost, Payment Method, Customer Name, Email, Phone, Shipping Address, Item Details (Product Name, SKU, Quantity, Price), and Customer Notes.

== Screenshots ==

1. The clean settings page under WooCommerce.
2. The Send Test Data feature verifying webhook connectivity.
3. Live order data appearing structured in Google Sheets.

== Changelog ==

= 1.0.0 =
* Initial release.
* Automated order synchronization on order creation.
* Settings screen with instant Webhook test dispatch.
* Concurrency-safe Google Apps Script template.
* Full WooCommerce HPOS compatibility.
