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.
Install
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.zipTrendyol – WooCommerce Entegrasyon Eklentisi (Integration Plugin)

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:
- Bootstrapping Layer:
trendyol-woocommerce.phpinitializes hooks, actions, and the autoloader. - Setup Layer:
class-install.phpdictates the database schema setup upon activation. - Data Access (API) Layer:
class-api.phpandclass-trendyol-request.phpact as customized wrappers aroundGuzzleHTTPfor executing signed requests to Trendyol endpoints. - Domain Logic Layer:
class-order-sync.phpandclass-product-sync.phpcontain the core intelligence dictating how properties and orders are formatted, mapped, and updated. - Presentation (Admin) Layer:
class-admin.phpandclass-list-table.phpconstruct 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 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
- Prerequisite Check: Ensure your server is running PHP 8.2 or higher.
- Download & Upload: Clone this repository into your WordPress plugin directory:
cd wp-content/plugins/ git clone <repository-url> trendyol-woocommerce - Install Dependencies: Execute Composer to fetch required API libraries:
cd trendyol-woocommerce composer install - Activate: Go to
WP Admin > Pluginsand activate Trendyol – WooCommerce Entegrasyon Eklentisi. - Configuration:
- Navigate to the newly created
Trendyolmenu 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.
- Navigate to the newly created
🔄 Execution Flow (Working Mechanism)
- Authentication: The administrative user provides Trendyol credentials.
- Periodic Polling:
hourlyWooCommerce pseudo-cron rules (trendyol_order_sync_cron&trendyol_order_status_sync_cron) execute tasks. - Delta Extraction: Plugin queries Trendyol for orders created or updated within the last 7 days window (e.g.,
$start = time() - 7 days). - Ingestion & Loop: Retrieves the JSON manifest, paginates via memory-safe loops (
batch_size = 5), matching Items viamerchantSku. - Mutation: Native WooCommerce
wc_get_order/wc_create_orderinterfaces 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
Createdin Trendyol. - A native WooCommerce order is instantly created. Under
WooCommerce > Orders, the row is explicitly marked with a ✔ (Green Checkmark) inside the customis_trendyolcolumn 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 toshipped, 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.