WP Manifestindependent plugin directory
manifest / ecommerce / trendyol-woocommerce

Trendyol – WooCommerce Entegrasyon Eklentisi

WooCommerce tabanlı e-ticaret siteniz ile Trendyol pazaryeri arasında doğrudan ve akıllı bir köprü kuran hayati bir araçtır. Yüksek performanslı işlemler göz önünde bulundurularak tasarlanan bu eklenti, ürünlerin, fiyatların, stokların ve siparişlerin senkronizasyonunu yapar.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/hidemyas/trendyol-woocommerce/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Trendyol – WooCommerce Entegrasyon Eklentisi (Integration Plugin)

Project Banner

Visual Banner Concept: A sleek, modern digital bridge connecting a vibrant WooCommerce storefront (purple hues) and a Trendyol marketplace dashboard (orange and white hues), with data packets (represented by illuminated dots) seamlessly flowing back and forth. This represents the continuous and reliable synchronization between the two platforms.

Trendyol - WooCommerce Integration Plugin is a vital tool that establishes a direct, intelligent bridge between your WooCommerce-powered ecommerce website and the Trendyol marketplace. Designed with high-performance operations in mind, it automates the synchronization of products, prices, stock, and orders, reducing manual data entry and preventing critical errors like overselling.


🚀 Main Features

  • Real-time Order Synchronization: Automatically fetches orders from Trendyol and converts them into standard WooCommerce orders.
  • Intelligent Status Matching: Maps Trendyol order statuses (e.g., Created, Shipped, Delivered) directly to native WooCommerce statuses automatically via reliable CRON scheduling.
  • Product & Price Syncing: Accurately syncs product data using SKUs and maintains updated pricing and VAT records in the product metadata.
  • High-Performance Batch Processing: Engineered with paginated client-side and server-side batch processing, memory limit expansion, and execution time tuning (set_time_limit(300)) specifically to handle thousands of records without crashing the server.
  • Custom Database Mapping: Utilizes dedicated, lightweight database tables (wp_trendyol_orders) instead of relying solely on heavy WordPress post-meta tables, significantly enhancing query speeds.
  • Admin Dashboard & Logging: Includes a powerful reporting GUI natively embedded within WordPress, paired with an extensive logging system mechanism (Trendyol_WC_Log) to audit all API interactions.

⚙️ System Architecture

The project strictly follows a WordPress/WooCommerce monolithic plugin architecture but separates concerns using a clear OOP design:

  1. Bootstrapping Layer: trendyol-woocommerce.php initializes hooks, actions, and the autoloader.
  2. Setup Layer: class-install.php dictates the database schema setup upon activation.
  3. Data Access (API) Layer: class-api.php and class-trendyol-request.php act as customized wrappers around GuzzleHTTP for executing signed requests to Trendyol endpoints.
  4. Domain Logic Layer: class-order-sync.php and class-product-sync.php contain the core intelligence dictating how properties and orders are formatted, mapped, and updated.
  5. Presentation (Admin) Layer: class-admin.php and class-list-table.php construct the user interface within the WP Admin space using core WP UI principles (List Tables, Option pages).

📐 Architecture Diagram

flowchart LR
    subgraph WP[WordPress / WooCommerce]
        Plugin[Trendyol WC Plugin]
        DB[(MySQL Database\nwp_trendyol_orders)]
        WC[WC Core\nOrders / Products]
        Cron((WP-Cron Daemon))
        Admin[(Store Manager)]
    end

    subgraph TY[Trendyol Marketplace]
        TYAPI[Trendyol Seller API]
    end

    %% Automatic Sync Flow
    Cron -->|Triggers Hourly| Plugin
    Plugin -- 1. Fetch Modified Orders --> TYAPI
    TYAPI -- 2. JSON Response --> Plugin
    Plugin -->|3. Record Audit Logs| DB
    Plugin -->|4. Create / Update Order Status| WC

    %% Manual Interface Flow
    Admin -->|Initiates Manual Sync| Plugin
    Admin -->|Views Status Filters| WC

🛠 Technology Stack

This project leverages the following core technologies:

PHP WordPress MySQL

  • PHP 8.2+: Foundational language ensuring type safety and top-tier performance.
  • WordPress (6.0+) & WooCommerce: Base platform frameworks for hooks, schedules, and APIs.
  • MySQL / MariaDB: Core RDBMS handling custom indices for rapid transaction lookups.
  • Guzzle HTTP Client (^7.9): Manages concurrent HTTP requests, timeouts, and API polling mechanisms.

📦 Installation & Setup

  1. Prerequisite Check: Ensure your server is running PHP 8.2 or higher.
  2. Download & Upload: Clone this repository into your WordPress plugin directory:
    cd wp-content/plugins/
    git clone <repository-url> trendyol-woocommerce
  3. Install Dependencies: Execute Composer to fetch required API libraries:
    cd trendyol-woocommerce
    composer install
  4. Activate: Go to WP Admin > Plugins and activate Trendyol – WooCommerce Entegrasyon Eklentisi.
  5. Configuration:
    • Navigate to the newly created Trendyol menu in your WordPress sidebar.
    • Provide your Supplier ID, API Key, and API Secret (obtained from Trendyol Seller Center).
    • Save settings and click the Manual Sync button to pull in initial historical data.

🔄 Execution Flow (Working Mechanism)

  1. Authentication: The administrative user provides Trendyol credentials.
  2. Periodic Polling: hourly WooCommerce pseudo-cron rules (trendyol_order_sync_cron & trendyol_order_status_sync_cron) execute tasks.
  3. Delta Extraction: Plugin queries Trendyol for orders created or updated within the last 7 days window (e.g., $start = time() - 7 days).
  4. Ingestion & Loop: Retrieves the JSON manifest, paginates via memory-safe loops (batch_size = 5), matching Items via merchantSku.
  5. Mutation: Native WooCommerce wc_get_order / wc_create_order interfaces are utilized to build local footprints. State is cached back securely into custom SQL table preventing repetitive fetching.

🎯 Example Usage

Scenario: A new order arrives on Trendyol.

  • The WordPress CRON daemon runs its hourly check.
  • It captures a new order labeled Created in Trendyol.
  • A native WooCommerce order is instantly created. Under WooCommerce > Orders, the row is explicitly marked with a ✔ (Green Checkmark) inside the custom is_trendyol column indicating its origin.
  • When the fulfillment center processes the order via external logistics, the state mutates to Shipped. At the next CRON iteration, the WooCommerce order transforms gracefully to shipped, triggering standard customer emails.

📁 Repository Structure

trendyol-woocommerce/
├── assets/                     # Image banners, icons, and local styles
├── includes/
│   ├── class-admin.php         # WP Admin settings & option page logic
│   ├── class-api.php           # Core Trendyol Endpoints wrapper
│   ├── class-install.php       # Handles `register_activation_hook` & DB setup
│   ├── class-list-table.php    # WP_List_Table implementation for Custom Logs
│   ├── class-loader.php        # Register plugin hooks cleanly
│   ├── class-log.php           # File & DB logging diagnostic tooling
│   ├── class-order-sync.php    # Core Order ingestion routine
│   ├── class-product-sync.php  # SKU matching & Price mutations
│   └── class-trendyol-request.php # Isolated HTTP request boundary
├── languages/                  # Translation POT files
├── vendor/                     # Composer dependencies (Guzzle)
├── composer.json               # Dependency definitions
├── readme.txt                  # WP Directory compatibility manifest
└── trendyol-woocommerce.php    # Main plugin entrypoint

📈 Use Cases

  • Multi-channel Operations: Perfect for large sellers who need a single unified dashboard (WooCommerce) instead of operating dual interfaces.
  • Automated Accounting Ecosystems: By bringing Trendyol orders natively into WooCommerce, external accounting plugins (like automated invoicing or ERP sync tools) trigger transparently.
  • Inventory Control: Drastically minimises instances where stock is exhausted on WooCommerce but continues to sell incorrectly on Trendyol, mitigating reputation damages.

⚡ Performance Highlights

Unlike standard plugins that succumb to 504 Timeouts when retrieving 1,000+ orders, this plugin leverages an ingenious Client-Side + Server-Side chunking methodology combined with usleep(500000) governors to gracefully process vast queues sequentially.