=== KDS & Report for Orderable ===
Contributors: codeonch, codeon
Tags: woocommerce, restaurant, orders, orderable, kds
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 3.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WC requires at least: 7.0
WC tested up to: 10.0.0

Tablet-optimized restaurant order management system for WooCommerce with real-time tracking, French interface, and Orderable integration.

== Description ==

**KDS & Report for Orderable** transforms your WooCommerce store into a professional restaurant order management system. Designed specifically for tablet use, it provides real-time order tracking with a beautiful French interface and seamless Orderable integration.

Note: This plugin provides an unofficial integration with the Orderable plugin and is not affiliated with or endorsed by the Orderable team.

### 🍽️ **Perfect for Restaurants**

* **Real-time Order Tracking** - See new orders instantly without page refresh
* **Tablet Optimized Interface** - Large buttons and touch-friendly design
* **Complete French Translation** - Full French interface with restaurant terminology
* **Orderable Integration** - Seamless compatibility with Orderable plugin
* **Multiple Delivery Types** - Livraison (Delivery), À Emporter (Takeaway), Sur Place (Dine-in)
* **Smart Status Management** - Visual status progression with color coding
* **No User Interruption** - Auto-refresh pauses during staff interactions

### 🎯 **Key Features**

**Dashboard Interface:**
* Clean, modern design optimized for restaurant use
* Real-time statistics showing pending, preparing, ready, and completed orders
* Advanced filtering by status and delivery type
* Quick search by customer name or order number
* One-click status updates with confirmation
* Fullscreen mode for kitchen displays

**Order Management:**
* Custom order statuses: En Attente, En Préparation, Prêt, Terminé
* Visual delivery type indicators with icons
* Order time tracking with "time ago" display
* Customer information clearly displayed
* Order items with quantities and customizations
* Special instructions and notes support
* Table number management for dine-in orders

**Restaurant-Specific Features:**
* Table number management for dine-in orders
* Pickup time scheduling for takeaway orders
* Delivery address display for delivery orders
* Sound notifications for new orders (optional)
* Bulk order status updates
* Export orders to CSV
* Monthly reports and analytics
* Custom workflow management

### 💻 **Technical Features**

* **Intelligent Auto-refresh** - Updates every 15 seconds without disturbing user work
* **User Interaction Detection** - Automatically pauses updates during staff interactions
* **AJAX-powered Interface** - No page reloads, smooth user experience
* **Mobile Responsive** - Works on tablets, phones, and desktop
* **WordPress Standards** - Follows WordPress coding and security standards
* **WooCommerce Integration** - Uses WooCommerce hooks and filters properly
* **Orderable Compatibility** - Full integration with Orderable plugin
* **HPOS Compatible** - High-Performance Order Storage support

### 🚀 **Easy Setup**

1. Install and activate the plugin
2. Go to Restaurant Orders → Settings
3. Configure your preferences (auto-refresh interval, default delivery type, etc.)
4. Start managing orders from Restaurant Orders → Dashboard

### 🎨 **Customizable**

* Adjustable auto-refresh intervals (5-300 seconds)
* Configurable maximum orders display (10-500)
* Toggle tablet mode for larger touch targets
* Enable/disable sound notifications
* Choose default delivery types
* Custom order statuses and workflows
* Color customization for delivery type badges

### 🔧 **Developer Friendly**

* Well-documented code with hooks and filters
* REST API endpoints for external integrations
* Customizable templates
* Translation ready with complete French translation
* Extensive action and filter hooks for customization
* Orderable integration hooks

### 🏆 **Why Choose This Plugin?**

Unlike generic order management plugins, this is built specifically for restaurants with features that matter:

* **No Learning Curve** - Intuitive interface that staff can use immediately
* **Tablet First** - Designed for kitchen tablet use, not just desktop
* **French Restaurant Focus** - Perfect terminology and workflow for French establishments
* **Real Performance** - Handles busy restaurant loads without slowing down
* **Professional Support** - Active development and support
* **Orderable Integration** - Seamless compatibility with popular restaurant plugin

### 📱 **Perfect For:**

* Pizza restaurants and pizzerias
* Cafés and bistros
* Food trucks and takeaway shops
* Bakeries with delivery service
* Any restaurant using WooCommerce for online orders
* Restaurants using Orderable plugin

== Installation ==

### Automatic Installation

1. Go to Plugins → Add New in your WordPress admin
2. Search for "KDS & Report for Orderable"
3. Click "Install Now" and then "Activate"
4. Go to Restaurant Orders → Settings to configure

### Manual Installation

1. Download the plugin zip file
2. Go to Plugins → Add New → Upload Plugin
3. Choose the zip file and click "Install Now"
4. Activate the plugin
5. Go to Restaurant Orders → Settings to configure

### Requirements

* WordPress 5.0 or higher
* WooCommerce 7.0 or higher
* PHP 7.4 or higher
* Modern web browser with JavaScript enabled

### First Time Setup

1. After activation, go to **Restaurant Orders → Settings**
2. Configure your auto-refresh interval (recommended: 15 seconds)
3. Set your default delivery type
4. Enable tablet mode if using on tablets
5. Save settings and go to **Restaurant Orders → Dashboard**

== Frequently Asked Questions ==

= Does this work with any WooCommerce theme? =

Yes! This plugin works with any WooCommerce-compatible theme. The restaurant dashboard is a separate admin interface that doesn't depend on your theme.

= Can I use this on mobile devices? =

Absolutely! While optimized for tablets, the interface is fully responsive and works great on phones and desktop computers.

= Does it work in real-time? =

Yes! Orders update automatically every 15 seconds (configurable) without page refresh. The system intelligently pauses updates when staff are interacting with orders.

= Is it translated to French? =

Yes! Complete French translation is included. All interface elements, order statuses, and messages are in French.

= Can I customize the order statuses? =

Yes! The plugin includes custom status management. You can create, edit, and delete custom order statuses to match your restaurant workflow.

= Does it work with Orderable plugin? =

Yes! Full integration with Orderable plugin. The plugin automatically detects Orderable and switches to Orderable mode for enhanced functionality.

= Does it slow down my website? =

No! The dashboard uses efficient AJAX calls and only loads in the admin area. Your public website performance is not affected.

= Can multiple staff members use it simultaneously? =

Yes! Multiple users can access the dashboard at the same time. All updates are synchronized in real-time.

= What delivery types are supported? =

Three types: Livraison (Delivery), À Emporter (Takeaway), and Sur Place (Dine-in). Each has specific fields like table numbers or pickup times.

= Can I export order data? =

Yes! You can export orders to CSV format with all relevant information including customer details, items, and delivery information.

= Is there an API for integrations? =

Yes! The plugin provides REST API endpoints for external integrations with kitchen displays or custom applications.

= Does it support HPOS? =

Yes! The plugin is fully compatible with WooCommerce's High-Performance Order Storage (HPOS) feature.

= Can I create custom workflows? =

Yes! The plugin includes a workflow management system where you can define custom order status flows for your restaurant.

== Screenshots ==

1. **Main Dashboard** - Real-time order tracking with status cards and filters
2. **Order Cards** - Detailed order information with delivery types and customer details
3. **Status Updates** - One-click status changes with visual feedback
4. **Settings Page** - Configure auto-refresh, delivery types, and tablet optimization
5. **Tablet Interface** - Optimized layout for tablet use in restaurant kitchens
6. **Order Details Modal** - Complete order information and special instructions
7. **Statistics Overview** - Real-time order counts by status
8. **Mobile Responsive** - Works perfectly on all device sizes
9. **Custom Statuses** - Manage custom order statuses for your workflow
10. **Monthly Reports** - Detailed analytics and reporting features

== Changelog ==

= 3.0.1 - 2025-08-25 =

**WordPress.org Plugin Review - Critical Security Fixes**

* 🔒 **Enhanced Security Compliance:**
  * Fixed all remaining unsanitized POST data access in AJAX handlers
  * Added proper `isset()` checks and `wp_unslash()` to all user input handling
  * Enhanced sanitization for POS user management functions
  * Improved input validation for admin settings forms
  * Fixed boolean POST value handling with proper sanitization
  * Comprehensive security audit completed and passed

* 🛡️ **WordPress Standards Compliance:**
  * Verified all CSS/JS assets are properly enqueued (no manual echo statements)
  * Confirmed all JSON output uses `wp_json_encode()` instead of `json_encode()`
  * Validated all nonce verifications use proper sanitization
  * Ensured all output is properly escaped with WordPress functions
  * Confirmed all function/class names use unique `kdsamref_` prefix

* 🔧 **Code Quality Improvements:**
  * Applied WordPress coding standards across all files
  * Enhanced error handling and logging mechanisms  
  * Improved input validation with proper bounds checking
  * Added comprehensive inline documentation
  * Optimized database queries for better performance

* ✅ **WordPress.org Compliance Verified:**
  * All automated plugin check issues resolved
  * Manual code review security issues addressed
  * Plugin ready for official WordPress.org submission
  * No external dependencies or CDN usage
  * GPL v2 license compliance confirmed

= 2.5.8 - 2025-08-17 =

**WordPress.org Compliance & Security Fixes**

* 🔒 **Security Enhancements:**
  * Fixed WordPress.org automated plugin scanning issues
  * Removed invalid "Network" header from plugin file
  * Removed deprecated load_plugin_textdomain() function (WordPress.org auto-loads translations)
  * Enhanced input sanitization for all superglobal data
  * Improved output escaping with WordPress functions
  * Comprehensive nonce verification implementation
  * Added proper capability checks for all admin operations
  * Removed external CDN dependencies for security
  * Implemented proper prefix usage (kdsamref_ for functions, KDSAMREF_ for classes)

* 🔧 **Technical Improvements:**
  * WordPress.org submission ready
  * GPL v2 license compliance
  * No external dependencies
  * Proper WordPress coding standards
  * Enhanced security logging
  * Rate limiting implementation
  * Improved error handling

= 2.5.5 - 2025-08-09 =

**Stability & UX Improvements**

* Fixed status normalization so dashboard status matches WooCommerce exactly
* Corrected workflow-based filtering; only configured workflow steps appear and in exact order
* Fixed "next step" button to respect real workflow, removed off-by-one behavior
* Removed full-screen loaders; added minimal non-intrusive toasts
* Notification button state fixes; added throttling, badge counter, quick sound toggle
* Orderable custom statuses supported end-to-end (e.g., pret-pour-livre)
* HPOS-safe monthly reports queries and date handling
* General code cleanup and WordPress.org compliance adjustments

= 2.2.2 - 2024-07-29 =

**Major Update - Complete French Translation & Orderable Integration**

* 🌍 **New Features:**
  * Complete French translation with 200+ translated strings
  * Full Orderable plugin integration and compatibility
  * Custom order status management system
  * Workflow management for custom order flows
  * Monthly reports and analytics
  * Enhanced delivery type detection
  * Improved user interface with better UX
  * Fullscreen mode for kitchen displays
  * Advanced filtering and search capabilities
  * Real-time notifications with sound support
  * Export functionality for order data
  * REST API endpoints for integrations
  * HPOS (High-Performance Order Storage) compatibility
  * Tablet-optimized interface improvements
  * Custom meta boxes for order information
  * Bulk order operations
  * Modal order details view
  * Responsive design for all devices

* 🔧 **Technical Improvements:**
  * WordPress 6.8 compatibility
  * WooCommerce 9.5.0 compatibility
  * PHP 7.4+ support
  * Improved AJAX performance
  * Better error handling and logging
  * Enhanced security with nonce verification
  * Optimized database queries
  * Translation-ready architecture
  * Extensive hooks and filters for developers
  * Clean, documented codebase
  * Performance optimizations for busy restaurants

* 🎨 **Design Features:**
  * Modern, clean interface design
  * Color-coded order statuses
  * Pulse animations for new orders
  * Smooth transitions and hover effects
  * Professional typography and spacing
  * Intuitive iconography
  * Dark mode support preparation
  * Print-friendly order layouts
  * Touch-optimized interface for tablets

* 🐛 **Bug Fixes:**
  * Fixed delivery type detection issues
  * Resolved empty value display problems
  * Removed excessive console logging
  * Fixed date system compatibility
  * Improved CSS styling consistency
  * Enhanced error handling for edge cases

= 2.0.0 - 2024-01-01 =

**Major Release - Orderable Integration**

* ✨ **New Features:**
  * Orderable plugin integration
  * Custom order status management
  * Workflow management system
  * Monthly reports and analytics
  * Enhanced delivery type detection
  * Improved user interface
  * Fullscreen mode
  * Advanced filtering
  * Real-time notifications
  * Export functionality
  * REST API endpoints
  * HPOS compatibility

* 🔧 **Technical Improvements:**
  * WordPress 6.4 compatibility
  * WooCommerce 9.0 compatibility
  * Performance optimizations
  * Better error handling
  * Enhanced security
  * Improved code structure

= 1.0.0 - 2023-12-01 =

**Initial Release**

* ✨ **Core Features:**
  * Real-time order dashboard
  * Tablet-optimized interface
  * French translation
  * Multiple delivery types
  * Custom order statuses
  * Smart user interaction detection
  * Advanced filtering
  * Quick search functionality
  * Order statistics
  * One-click status updates
  * Customer information display
  * Order items with quantities
  * Special instructions support
  * Time tracking
  * Sound notifications
  * Settings page
  * Export functionality
  * Custom meta boxes
  * Bulk operations
  * Modal order details
  * Responsive design

== Changelog ==

= 3.0.0 =
* 🎉 **WordPress.org Compliance Release**
* 🔧 **Prefix Standardization:**
  * Complete prefix overhaul from "wro" to "kdsamref" (8+ characters)
  * Updated all function names, class names, constants, and file names
  * Standardized AJAX handlers: `wp_ajax_kdsamref_*`
  * Standardized settings: `kdsamref_*`
  * Standardized classes: `KDSAMREF_*`
  * Standardized constants: `KDSAMREF_*`
  * Renamed all include files to use proper prefix
* 🔒 **Security Enhancements:**
  * Fixed all `wp_die()` calls to use `esc_html__()` for proper escaping
  * Enhanced input sanitization across all AJAX endpoints
  * Improved nonce verification with proper error handling
  * Added comprehensive capability checks for all admin functions
* 🌍 **Translation Improvements:**
  * Fixed placeholder ordering in all translation strings
  * Added missing "translators:" comments for better localization
  * Ensured all user-facing strings are properly escaped
  * Completed French translation coverage
* 🎨 **UI/UX Enhancements:**
  * Optimized template rendering for better performance
  * Enhanced mobile responsiveness
  * Improved accessibility with proper ARIA labels
  * Better error message display
* 🔧 **Technical Improvements:**
  * Enhanced AJAX request handling with rate limiting
  * Improved database query optimization
  * Better memory management for large order lists
  * Enhanced compatibility with latest WordPress versions
* 🛠️ **WordPress.org Compatibility:**
  * Removed deprecated `load_plugin_textdomain()` function
  * Fixed all WordPress coding standards violations
  * Enhanced error handling and logging
  * Improved plugin header compliance
* 🎨 **UI/UX Enhancements:**
  * Optimized template rendering for better performance
  * Enhanced mobile responsiveness
  * Improved accessibility with proper ARIA labels
  * Better error message display
* 🔧 **Technical Improvements:**
  * Enhanced AJAX request handling with rate limiting
  * Improved database query optimization
  * Better memory management for large order lists
  * Enhanced compatibility with latest WordPress versions

= 2.5.8 =
* Initial WordPress.org preparation release
* Basic security improvements
* Translation framework setup

== Upgrade Notice ==

= 3.0.1 =
CRITICAL SECURITY UPDATE: This release addresses all WordPress.org plugin review security issues. Essential update for all users - fixes input sanitization, enhances security compliance, and ensures WordPress.org standards. Update immediately!

= 3.0.0 =
Major WordPress.org compliance release! Complete prefix standardization, enhanced security, and improved compatibility. This version fully meets WordPress.org requirements and is ready for official repository submission. Update now for the most secure and compliant version!

= 2.2.2 =
Major update with modern interface, complete French translation, Orderable integration, and enhanced features. Update now for the best restaurant management experience!

= 2.0.0 =
Major release with Orderable integration, custom status management, and workflow features. Recommended update for all users.

= 1.0.0 =
Initial release of KDS & Report for Orderable. Install now to transform your WooCommerce store into a professional restaurant order management system!

== Support ==

**Need Help?**

* 📧 **Email Support:** info@codeon.ch
* 🌐 **Documentation:** [Full Documentation](https://codeon.ch/orderable-kds/docs)
* 💬 **Community Forum:** [WordPress Support Forum](https://wordpress.org/support/plugin/kds-report-for-orderable)
* 🐛 **Bug Reports:** [GitHub Issues](https://github.com/codeon/kds-report-for-orderable/issues)

**Getting Started:**

1. Check our [Quick Start Guide](https://codeon.ch/orderable-kds/quick-start)
2. Watch our [Video Tutorials](https://codeon.ch/orderable-kds/tutorials)
3. Join our [Community](https://codeon.ch/community)

== Privacy and Data ==

All order information remains on your WordPress installation. The plugin only uses data that WooCommerce already collects and stores.

Optional license validation may contact our license server to verify your license key. This happens only if you enter a license key. The request may include basic site data (WordPress, PHP, WooCommerce versions, site URL), and admin contact email, solely for license management. No order/customer content is sent.

Usage tracking/telemetry is disabled by default in the .org version. We do not collect analytics unless you explicitly enable it (if available in a future version).

**Data Stored:**
* Custom order meta: delivery type, table number, pickup time, special instructions
* External API calls only occur for optional license validation
* No tracking or analytics data collection by default

== Credits ==

* **Developed by:** Codeon
* **French Translation:** Native French speakers
* **Icons:** Custom restaurant-themed iconography
* **Inspired by:** Real restaurant workflows and staff feedback
* **Special Thanks:** WooCommerce team for excellent API documentation

== License ==

This plugin is licensed under the GPL v2 or later.

    Copyright (C) 2024 Codeon

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

== Contributing ==

We welcome contributions! Please see our [Contributing Guidelines](https://github.com/codeon/kds-report-for-orderable/blob/main/CONTRIBUTING.md) for details.

**Ways to Contribute:**
* 🐛 Report bugs
* 💡 Suggest features  
* 🔧 Submit code improvements
* 🌍 Help with translations
* 📖 Improve documentation
* ⭐ Rate and review the plugin
