WordPress · Product sync
The plugin syncs your WooCommerce catalog with Neuroon through the endpoint:
/api/plugin/shops/{shopId}/products/syncThe sync is idempotent by externalId (typically the WP product ID). Resending the same product updates, it does not duplicate.
Sync modes
| Mode | When to use it | Behavior |
|---|---|---|
FULL | Initial load or re-bootstrap | Marks as absent any products that are not in the accumulated batch. |
INCREMENTAL | Day-to-day (autosync, deltas) | Only creates / updates the products sent; the rest stays untouched. |
The plugin uses INCREMENTAL by default. It only triggers FULL when you click Reset & Resync All from the Products tab.
Batch size
| Layer | Limit |
|---|---|
| Plugin (client) | 50 products by default (Neuroon_Constants::DEFAULT_BATCH_SIZE = 50), configurable between MIN_BATCH_SIZE = 10 and MAX_BATCH_SIZE = 500 via the neuroon_batch_size option |
| Backend (server) | up to 500 products per request |
Citation: constants in
wordpress-plugin/neuroon-search/includes/class-neuroon-constants.php(lines 42–48).
The plugin sends in small batches deliberately: it bounds the PHP memory footprint, avoids typical PHP-FPM timeouts (max_execution_time) and handles rate limits more gracefully. If your hosting allows it, raise neuroon_batch_size from the Products → Settings tab.
Auto-sync via WooCommerce hooks
The plugin hooks the following WooCommerce events and moves the corresponding product to PENDING state in its local table wp_neuroon_product_sync:
add_action('woocommerce_update_product', array(__CLASS__, 'on_product_updated'));
add_action('woocommerce_new_product', array(__CLASS__, 'on_product_created'));
add_action('woocommerce_product_set_stock', array(__CLASS__, 'on_stock_changed'));
add_action('before_delete_post', array(__CLASS__, 'on_product_deleted'));
Citation: hooks listed in
wordpress-plugin/CLAUDE.mdand registered inwordpress-plugin/neuroon-search/includes/product-sync-hooks.php.
Behavior:
- Edited product → if it was
SYNCED, it goes back toPENDING. - Created product → ends in
PENDING(manual selection or autosync, depending on settings). - Stock change (
woocommerce_product_set_stock) → re-sync. - Deleted product (
before_delete_post) → removed from the local table; a follow-up job will emitDELETE /api/plugin/shops/{shopId}/products/{externalId}.
Local tracking table
Custom table: {prefix}_neuroon_product_sync.
CREATE TABLE wp_neuroon_product_sync (
product_id BIGINT(20) UNSIGNED NOT NULL,
status VARCHAR(20) NOT NULL DEFAULT 'PENDING',
last_synced_at DATETIME NULL,
last_modified_at DATETIME NOT NULL,
error_message TEXT NULL,
sync_attempts INT NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (product_id),
KEY status (status),
KEY last_modified_at (last_modified_at)
);
Citation: schema in
wordpress-plugin/CLAUDE.md(Database Schema section).
States:
| Status | Meaning |
|---|---|
PENDING | Queued, not sent yet. |
PROCESSING | Sent, awaiting response. |
SYNCED | Accepted by the backend (200/201). |
FAILED | Backend returned an error; see error_message. |
NOT_SYNCED | Product excluded by local rules (e.g. draft). |
Endpoint response
Each /products/sync call returns a JSON with the aggregate of that batch:
{
"totalReceived": 100,
"newProducts": 50,
"updatedProducts": 47,
"skipped": 0,
"failed": 3,
"errors": [
{ "externalId": "123", "error": "Invalid price" }
],
"productsCount": 150,
"remainingProducts": 850
}
productsCount and remainingProducts reflect your global quota after the batch. The plugin shows those values in the Products tab and blocks new batches if remainingProducts == 0.
Latency (eventual consistency)
After the 200 OK, products go through the internal pipeline . Indexing takes 2 to 5 seconds. Until it finishes, an immediate search may not return them.
Rate limits
| Endpoint | Limit |
|---|---|
products/sync | 100/min |
shops/me | 60/min |
verification-data | 20/min |
Citation: rate limits matrix summarized in the brief and applied by
Neuroon_Rate_Limit_Handler.
The plugin captures 429 and respects Retry-After. If your shop has more than 6,000 products and you need a fast bootstrap, contact support to widen the window.
Quotas
The plan tied to your API Key defines maxProducts. The Products tab reads productsCount / maxProducts from GET /api/plugin/shops/me (5 min cache in the neuroon_shop_info_{md5(api_key)} transient).
Manual sync from the UI
- wp-admin → Settings → Neuroon Search → Products tab.
- Select products (DataTables 1.13.6 server-side).
- Click Sync selected. The UI fires
wp_ajax_neuroon_start_syncand then pollswp_ajax_neuroon_sync_status. - Each batch (100) is sent sequentially with
usleep(100000)(100 ms) between batches to avoid saturation.
Forced resync
Products tab → Reset & Resync All marks every product as PENDING and triggers a FULL sync. Useful when:
- You suspect the local table is out of sync with Neuroon.
- You have changed attributes / categories in bulk.
- You just migrated plans and need to re-validate the quota.
Next steps
- Cart bridge — once synced, the widget benefits from cart state.
- API ·
products/sync— full reference with playground. - Recipe · WooCommerce end-to-end.