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/tabshhh5/tabesh_v2/archive/refs/heads/main.zipTabesh v2 - Print Shop Order Management Plugin
پلتفرم جامع ثبت سفارشات چاپخانه
A comprehensive WordPress plugin for managing print shop orders with a modern React-based interface, modular architecture, and multi-role support.
🌟 Features
Core Features
- Modular Architecture: Independent, interconnected classes for easy development and maintenance
- React-Based UI: Modern, responsive interface using React and WordPress components
- Multi-Role Support: Separate panels for customers, managers, employees, and administrators
- REST API Integration: Complete RESTful API for seamless data management
- Security First: Built-in security features including nonce verification and capability checks
- Internationalization Ready: Full i18n support for multiple languages
User Panels
- Customer Panel: View and manage personal orders
- Manager Panel: Comprehensive order management and reporting
- Employee Panel: View and update assigned orders
- Settings Panel: Configurable plugin settings
📋 Requirements
- WordPress 6.0 or higher
- PHP 8.0 or higher
- MySQL 5.7 or higher
- Node.js 16+ and npm (for development)
🚀 Installation
Automatic Installation
- Download the plugin zip file
- Go to WordPress Admin → Plugins → Add New
- Click "Upload Plugin"
- Choose the downloaded zip file
- Click "Install Now"
- Activate the plugin
Manual Installation
- Upload the
tabesh-v2folder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to "Tabesh v2" in the admin menu
Development Installation
# Clone the repository
git clone https://github.com/tabshhh4-sketch/Tabesh_v2.git
# Navigate to the plugin directory
cd Tabesh_v2
# Install npm dependencies
npm install
# Build the React application
npm run build
# For development with hot reload
npm run start
🏗️ Architecture
Directory Structure
tabesh-v2/
├── assets/
│ ├── css/ # Stylesheets
│ │ └── admin.css
│ └── js/
│ ├── src/ # React source files
│ │ ├── components/ # React components
│ │ ├── panels/ # Panel components
│ │ └── index.js # Main entry point
│ └── build/ # Compiled JavaScript
├── includes/
│ ├── admin/ # Admin-specific classes
│ │ └── class-admin.php
│ ├── api/ # REST API classes
│ │ └── class-rest-api.php
│ ├── core/ # Core plugin classes
│ │ ├── class-assets.php
│ │ ├── class-database.php
│ │ └── class-plugin.php
│ ├── helpers/ # Helper classes
│ │ └── class-security.php
│ ├── panels/ # Panel-specific classes
│ │ ├── class-customer-panel.php
│ │ ├── class-employee-panel.php
│ │ ├── class-manager-panel.php
│ │ └── class-settings-panel.php
│ └── class-autoloader.php # PSR-4 autoloader
├── languages/ # Translation files
├── package.json # npm dependencies
├── tabesh-v2.php # Main plugin file
└── README.md # This file
Class Structure
Core Classes
Plugin (Tabesh_v2\Core\Plugin)
- Main plugin singleton
- Initializes all components
- Handles activation/deactivation
Assets (Tabesh_v2\Core\Assets)
- Manages JavaScript and CSS enqueuing
- Localizes scripts with settings and translations
Database (Tabesh_v2\Core\Database)
- Creates and manages custom database tables
- Provides table name getters
Autoloader (Tabesh_v2\Autoloader)
- PSR-4 compliant autoloader
- Automatically loads classes
Admin Classes
Admin (Tabesh_v2\Admin\Admin)
- Registers admin menu pages
- Handles admin area functionality
- Renders React root elements
API Classes
Rest_Api (Tabesh_v2\Api\Rest_Api)
- Registers REST API endpoints
- Handles CRUD operations
- Implements permission checks
Panel Classes
Customer_Panel (Tabesh_v2\Panels\Customer_Panel)
- Customer role management
- Customer-specific functionality
Manager_Panel (Tabesh_v2\Panels\Manager_Panel)
- Manager role management
- Order statistics and reporting
Employee_Panel (Tabesh_v2\Panels\Employee_Panel)
- Employee role management
- Assigned orders functionality
Settings_Panel (Tabesh_v2\Panels\Settings_Panel)
- Plugin settings management
- Configuration options
Helper Classes
Security (Tabesh_v2\Helpers\Security)
- Nonce verification
- Input sanitization
- Data validation
- Security utilities
📊 Database Schema
Tables
wp_tabesh_orders
id: Primary keyorder_number: Unique order identifiercustomer_id: Customer referencestatus: Order status (pending, completed, cancelled)total_amount: Order totalcurrency: Currency codepriority: Order prioritydeadline: Order deadlineassigned_to: Assigned employeenotes: Additional notescreated_at: Creation timestampupdated_at: Last update timestampcompleted_at: Completion timestamp
wp_tabesh_order_meta
meta_id: Primary keyorder_id: Order referencemeta_key: Meta keymeta_value: Meta value
wp_tabesh_order_items
id: Primary keyorder_id: Order referenceitem_name: Item nameitem_type: Item typequantity: Quantityunit_price: Unit pricetotal_price: Total pricespecifications: Item specifications
wp_tabesh_customers
id: Primary keyuser_id: WordPress user referencecompany_name: Company namecontact_name: Contact person nameemail: Email addressphone: Phone numberaddress: Addresscity: Citypostal_code: Postal codenotes: Additional notes
🔌 REST API
Endpoints
Orders
GET /wp-json/tabesh/v2/orders
- Get all orders (paginated)
- Parameters:
page,per_page
POST /wp-json/tabesh/v2/orders
- Create new order
- Required:
order_number,customer_id
GET /wp-json/tabesh/v2/orders/{id}
- Get single order
PUT /wp-json/tabesh/v2/orders/{id}
- Update order
DELETE /wp-json/tabesh/v2/orders/{id}
- Delete order
Customers
GET /wp-json/tabesh/v2/customers
- Get all customers
POST /wp-json/tabesh/v2/customers
- Create new customer
- Required:
contact_name,email
Settings
GET /wp-json/tabesh/v2/settings
- Get plugin settings
POST /wp-json/tabesh/v2/settings
- Update plugin settings
Authentication
All API endpoints require authentication and appropriate capabilities. Include the X-WP-Nonce header with your requests.
🛠️ Development
Building the React App
# Install dependencies
npm install
# Development mode (with hot reload)
npm run start
# Production build
npm run build
# Linting
npm run lint:js
npm run lint:css
# Format code
npm run format
PHP Coding Standards
The plugin follows WordPress Coding Standards. To check your code:
# Install PHP_CodeSniffer with WordPress standards
composer require --dev wp-coding-standards/wpcs
# Check coding standards
phpcs --standard=WordPress includes/
Adding New Features
- New Class: Create in appropriate directory under
includes/ - React Component: Add to
assets/js/src/components/orassets/js/src/panels/ - API Endpoint: Add to
includes/api/class-rest-api.php - Database Table: Update
includes/core/class-database.php
🔒 Security
Built-in Security Features
- Nonce Verification: All form submissions verified
- Capability Checks: Permission checks on all actions
- Input Sanitization: All user input sanitized
- Output Escaping: All output properly escaped
- Prepared Statements: SQL injection prevention
- CSRF Protection: Cross-site request forgery prevention
Security Best Practices
- Always use the Security helper class for validation
- Never trust user input
- Escape all output
- Use WordPress functions for security operations
- Keep the plugin updated
🌐 Internationalization
The plugin is fully internationalized and ready for translation.
Text Domain
tabesh-v2
Creating Translations
-
Generate POT file:
wp i18n make-pot . languages/tabesh-v2.pot -
Create PO file for your language
-
Compile to MO file
-
Place in
languages/directory
🤝 Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Follow WordPress coding standards
- Write clear commit messages
- Submit a pull request
📝 Changelog
Version 1.0.0
- Initial release
- Core plugin structure
- React-based UI
- Multi-panel support
- REST API implementation
- Database schema
- Security features
- Internationalization support
📄 License
This plugin is licensed under the GPL v2 or later.
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.
👥 Authors
- Tabesh Team
🔗 Links
📞 Support
For support, please:
- Check the documentation
- Search existing issues
- Create a new issue on GitHub
Made with ❤️ for the print shop industry