=== ShopCentral - Advanced Multi Store Management & Store Analytics for WooCommerce ===
Contributors: dominopress
Tags: woocommerce, store manager, multi-store management, analytics, order sync
Requires at least: 6.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Manage your WooCommerce store with a powerful, centralized dashboard. View analytics, products, orders, and customers in a premium interface.

== Description ==

**ShopCentral** is the ultimate, streamlined **Store Manager and Analytics Suite for WooCommerce**. Designed specifically for ambitious store owners, agencies, and high-volume merchants, ShopCentral replaces the standard, often cluttered WordPress admin view with a lightning-fast, modern dashboard.

Whether you manage a single high-traffic store or an entire network of WooCommerce sites, ShopCentral gives you the unified "Command Center" you need to take full control of your business. Say goodbye to logging in and out of multiple websites, juggling numerous tabs, and struggling with slow, fragmented data.

**Version 2.6.0+ transforms ShopCentral into a full Order & Customer Sync platform.** Now, child site orders are imported as real WooCommerce orders on the hub site, complete with customers, line items, metadata, and ACF fields. This enables full compatibility with accounting plugins like Xero, warehouse management solutions, and any WooCommerce order-based tooling.

### 🏬 Why Store Owners Love ShopCentral

https://www.youtube.com/watch?v=En5K5L23XYg

Managing a growing e-commerce business is challenging. As your store scales—or as you add more stores to your portfolio—keeping track of orders, products, and customer behavior becomes incredibly time-consuming. ShopCentral solves this by aggregating your crucial business data into a single, high-performance interface.

*   **Save Hours of Time:** Manage all your stores from one centralized login. No more jumping between different WordPress admin panels.
*   **Make Data-Driven Decisions:** Instantly see which products are performing best and track your revenue trends across all your sites.
*   **Improve Operational Efficiency:** Process orders, update stock, and analyze customer behavior at blazing fast speeds.
*   **Scale Without Limits:** Built to handle high-volume data without bloating your main site's database, thanks to our smart remote proxy architecture.

### 🚀 Core Features & Capabilities

*   **Premium Store Manager Dashboard:** Experience your WooCommerce store through a beautiful, responsive, state-of-the-art interface that feels like a modern SaaS application.
*   **Central Order Timeline:** Track your orders in a powerful chronological timeline with real-time updates. Quickly spot new sales and monitor fulfillment status across your entire network.
*   **Order List with Pagination:** Navigate through orders efficiently with configurable per-page display (10, 25, 50, or 100 orders). First/Previous/Next/Last navigation buttons for fast order management.
*   **Advanced Order Filters:** Filter orders by status, date, and customer details with high-speed performance. Find exactly what you're looking for in seconds, not minutes.
*   **Multi-Store Order Import:** Import orders from multiple connected stores simultaneously. Sequential import with real-time progress tracking per store.
*   **Unified Analytics & Reporting:** Track your **Revenue**, **Total Orders**, **Top Selling Products**, and sales trends globally. Get a bird's-eye view of your business health without needing expensive external reporting tools.
*   **Comprehensive Product & Stock Overview:** Keep a close eye on your product catalog. Instantly identify low stock or out-of-stock items, monitor product performance, and ensure your inventory is always optimized for sales.
*   **Product Type Filtering:** Filter products by type (simple, variable, etc.) in the product listing for better catalog management and quick access to specific product types.
*   **Customer Intelligence:** Analyze customer behavior, identify your most valuable buyers, and segment your audience to generate targeted follow-ups and dramatically improve customer retention.
*   **Export Tools - Data Export Suite:** Export comprehensive data from all connected stores including Products, Orders, Product Reviews, Categories, Tags, Customers, and Coupons. Filter exports by time period (This Month, This Year, or All Time) for flexible reporting.
*   **Centralized PDF Reports:** Generate invoice-style PDF reports summarizing cross-store revenue, total orders, and average order value. Perfect for accounting and stakeholder presentations.
*   **Marketing & Automation Ready:** Built-in controllers to help you orchestrate marketing campaigns and create robust automation rules directly from your centralized dashboard.
*   **Performance First (No Database Bloat):** ShopCentral uses a highly optimized proxy system for remote data. It fetches data on-the-fly, ensuring your command center site remains lightning fast regardless of how many stores you connect.
*   **HPOS Compatible:** Fully supports WooCommerce High-Performance Order Storage (formerly Custom Order Tables) for maximum scalability.

### 💎 Unlock Even More Power with ShopCentral Pro

Ready to take your e-commerce empire to the next level? Upgrading to **ShopCentral Pro** unlocks enterprise-grade features designed for serious growth:

*   **Smart Product Creator:** Create simple and variable products across multiple stores with a 3-step wizard (Stores → Details → Variations). Supports categories, tags, variable product variations with attribute-wise pricing, per-store price adjustments, and image uploads.
*   **Product Editor:** Edit existing products with variable product support in pricing tab, variations table for managing variation prices and stock, and image upload to Media tab for featured image and gallery management.
*   **Connect Multiple Stores:** Seamlessly connect and manage external WooCommerce sites (up to 3 for Personal, 5 for Professional, and Unlimited for Business/Unlimited plans).
*   **Product & Inventory Sync System:** Automatically synchronize products and stock levels across your entire network of connected stores. Push products to multiple stores with categories and tags sync.
*   **Bulk Clone Products:** Launching a new store? Instantly clone your best-performing products across all your connected sites with a single click.
*   **Global Price Adjustments:** Need to run a network-wide sale or adjust pricing for inflation? Apply global price updates across your entire network instantly with multiple store support and sequential updates.
*   **Advanced Automation Engine:** Create complex, multi-store automation workflows for cart abandonment, post-purchase follow-ups, VIP customer tagging, and more.
*   **Global Coupon Broadcasting:** Create and distribute discount codes across all your stores simultaneously from your central dashboard.


== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/shopcentral` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Navigate to the **ShopCentral** menu in your dashboard.
4. Your current site will be added by default to the Store Manager.
5. To connect an external store, generate REST API keys (Consumer Key and Consumer Secret) on your other WooCommerce site (`WooCommerce > Settings > Advanced > REST API`) with 'Read/Write' permissions.
6. Click 'Add Store' in the ShopCentral dashboard and enter the external store's URL and API keys.
7. Switch between active and connected stores to manage them using the shop selector on the top nav bar of the ShopCentral Dashboard.

== Frequently Asked Questions ==

= Is my data sent to a third-party server? =
No. ShopCentral connects your "Command Center" WordPress site directly to your other WooCommerce stores using the WooCommerce REST API. Your store data is not stored on any third-party servers. The optional usage tracking function only collects basic anonymous plugin usage telemetry, which can be easily disabled from the settings.

= Does it sync all orders to my main database? =
No. To preserve your main site's performance, ShopCentral acts as a remote proxy viewer. It fetches remote data on-the-fly when you view the dashboard, preventing massive database bloat on your command center site.

= Is it compatible with High-Performance Order Storage (HPOS)? =
Yes, ShopCentral is fully compatible with WooCommerce HPOS (formerly Custom Order Tables).

== Screenshots ==

1. **Centralized Dashboard** - View aggregated analytics including Revenue, Orders, and Product stats.
2. **Multi-Store Management** - Switch between multiple WooCommerce sites from a single "Command Center" without logging in separately.
3. **Advanced Features Overview** - Access powerful tools like the Automation Engine, Marketing Controller, and Customer Intelligence right within the intuitive interface.
4. **Connect New Store** - Easily add external WooCommerce sites using secure REST API keys.
5. **Orders Overview** - Track orders of remote WooCommerce stores within the single command center.

== Changelog ==

= 2.7.0 =
*   New: Smart Product Creator - Create simple & variable products across multiple stores with a 3-step wizard (Stores → Details → Variations).
*   New: Product type selector with support for simple and variable products.
*   New: Categories & Tags support in Smart Product Creator for both main and remote stores.
*   New: Variable product variations with attribute-wise pricing and stock management.
*   New: Price adjustment per store (percentage-based) during product creation.
*   New: Image upload support for featured image in Smart Product Creator.
*   New: Product Editor - Added variable product support in pricing tab with variations table.
*   New: Product Editor - Added image upload to Media tab for featured image and gallery.
*   New: Main store auto-selected by default in Product Editor.
*   New: Added product type filter (simple, variable, etc.) in product listing.
*   New: Smart Product Creator & Product Editor locked as Pro features in free version.
*   New: Export Tools - Product Reviews export with rating, reviewer name, and content.
*   New: Export Tools - Product Categories export with name, slug, and parent category.
*   New: Export Tools - Product Tags export with name, slug, and description.
*   New: Export Tools - Customers export with order count and total spend.
*   New: Export Tools - Coupons export with discount type, amount, and usage count.
*   New: Order Import - Multiple store support for importing orders from multiple stores sequentially.
*   New: Order List - Pagination with per-page selector (10, 25, 50, 100) and navigation buttons.
*   Improvement: SyncProductsModal redesigned with 2-column layout and warning info.
*   Improvement: GlobalPriceModal redesigned with multiple store support and warning info.
*   Improvement: Detailed error messages from WooCommerce API shown on deploy failure.
*   Improvement: Product matching by SKU for cross-store updates.
*   Improvement: Deploy warning added - product must exist in target store with same SKU.
*   Improvement: Redesign products, orders, coupons, customers page with fully responsive.
*   Fix: Categories now properly created and attached on remote/child stores via REST API.

= 2.6.1 =
*   Improvement: updated order import modal with child store selected.
*   Fix: Fixed pro lock modal ui issue

= 2.6.0 =
*   New: Custom Meta & ACF Repeater Sync - Synchronizes product metadata between central and child stores using WC CRUD methods.
*   New: ACF Auto-Detection - Automatically detects ACF field groups and includes both field names and field keys when ACF is active.
*   New: Customer Sync by Email - Automatically links imported orders to existing WordPress users by email or creates new customer profiles.
*   New: Order Import & Sync (Background Queues & Webhooks) - Real WooCommerce orders created on the central from child site orders using Action Scheduler for background processing and WC REST API webhooks. Compatible with Xero, warehouse plugins, and other accounting tools.
*   New: Duplicate Order Prevention - prevent re-importing the same order.
*   New: Manual Order Sync - Background sync with progress bar, cancel support, and configurable batch limits (50-50,000 orders per batch).
*   New: Webhook Payload Enhancement - Child site webhooks now include billing, shipping, line items, coupons, fees, and full metadata for complete order reconstruction.
*   New: Retry System - Failed push orders are automatically retried every 5 minutes via WP Cron.
*   Improvement: Orders dashboard "Order Sync" modal with real-time progress polling and cancel button.
*   Improvement: Connected Stores page now has Order Import (green) and Customer Sync (purple) toggle switches per child store.
*   Improvement: Cache-Optimized Customer Lookups - Customer email lookups use static caching to reduce database queries during batch imports.
*   Improvement: Hub Site Protection - Order import and customer sync toggles are only available for child stores, not the central site.
*   Fix: WooCommerce Email Notifications for imported customers.
*   Fix: Action Scheduler integration - Async actions with chunked processing (50 orders per batch) for reliable large imports.
*   New: Smart Firewall Bypass (Cloudflare WAF Integration) - Cryptographically generates a unique `shared_secret` per store to whitelist automated API requests.
*   New: Branded requests - Outbound API calls now inject custom `X-ShopCentral-Secret` headers and a branded `ShopCentral-Core` User-Agent to bypass firewalls without static IP whitelisting.
*   New: Interactive Firewall Config UI - Adds an interactive "Firewall Setup" modal in the stores list showing ready-to-copy Cloudflare WAF rule expressions and step-by-step instructions.
*   Improvement: WordPress submenu routing synchronizes correctly, ensuring active states match selected sub-menus.
*   New: ShopCentral Logs - Centralized activity log viewer with date filter, feature/level filtering, bulk delete, clear all, copy-to-clipboard, and expandable context details for debugging.
*   New: WP Cron auto-cleanup - Logs older than 30 days are automatically purged daily.

= 2.5.0 =
*   New: Bidirectional Inventory Sync (Automatic network-wide stock reduction on sale).
*   New: Recursive Variable Product Sync (Includes all variations, attributes, and stock).
*   Improvement: Smart Firewall Bypass (Mimics modern browsers to prevent blocks by Bluehost/Cloudflare).
*   Fix: Resolved issue where manual product push would skip titles and prices.

= 2.4.0 =
*   New: Multi-Store connection limits based on Freemius Plan (Personal: 3, Professional: 5, Business: Unlimited).
*   New: Implement product & inventory sync system across all connected store.
*   Improvement: Added store limit information to the dashboard configuration.

= 2.3.0 =
*   New: Standardized label-based Date Picker across all store modules (Today, Yesterday, All Time, etc.).
*   New: Enhanced Pro feature locking with interactive "Click-to-Upgrade" modals for premium buttons.
*   Improvement: Synchronized "All Time" date range defaults across the entire dashboard.
*   Security/UX: Restricted Global Coupon broadcasting and Automation Rules to Pro users with improved UI feedback.
*   Fix: Resolved layout and syntax issues in Order and Product list view components.

= 2.2.0 =
*   Release: Version 2.2.0 release.

= 2.1.2 =
*   Update: Streamlined plugin structure focusing exclusively on the Multi-Store Manager module.
*   Fix: Various improvements to the remote API connection stability.

= 2.1.1 =
*   Major Release: Added upcoming feature listed on settings page.
*   Fix: Fixed remote API issue & handle it in central file.
*   New: Added deactivate confirmation modal for user friendly feedback.

= 2.1.0 =
*   Major Release: Plugin rebranded to ShopCentral – Multiple Store Manager.
*   New: Multi-Store Manager with remote analytics.
*   Improvement: Enhanced SEO friendly description and modular architecture.
