File: /home/luxbsolr/cardsord.store/wp-content/plugins/product-modifier/README.md
# Product Modifier - WordPress Plugin
A powerful WordPress plugin that provides a dynamic interface to bulk edit WooCommerce products with ease. Modify prices, SKUs, titles, tags, and more in one convenient page.
## 🚀 Features
### Core Functionality
- **Bulk Product Editing**: Edit multiple products simultaneously without page reloads
- **Inline Editing**: All product fields are editable directly in the table
- **Real-time Updates**: Changes are applied instantly with visual feedback
- **Auto-save**: Automatic saving of changes (configurable)
- **Advanced Search**: Search products by name, SKU, or other criteria
- **Category Filtering**: Filter products by categories
- **Pagination**: Handle large product catalogs efficiently
### Editable Fields
- Product Name
- SKU (with uniqueness validation)
- Regular Price
- Sale Price
- Stock Quantity
- Stock Status (In Stock, Out of Stock, On Backorder)
- Product Weight
- Product Dimensions (Length, Width, Height)
- Product Categories
- Product Tags
- Product Status
### Bulk Operations
- **Price Adjustments**: Increase/decrease prices by percentage
- **Category Assignment**: Bulk assign categories
- **Stock Status Updates**: Bulk update stock status
- **Custom Bulk Actions**: Extensible system for custom operations
### User Experience
- **Responsive Design**: Works on desktop and mobile devices
- **Keyboard Shortcuts**: Tab navigation, Enter to save
- **Visual Feedback**: Color-coded status indicators
- **Error Handling**: Real-time validation and error messages
- **Undo Support**: Track and revert changes
## 📋 Requirements
- WordPress 5.0 or higher
- WooCommerce 5.0 or higher (with HPOS support)
- PHP 7.4 or higher
## 🔌 HPOS Compatibility
This plugin is **fully compatible** with WooCommerce's High-Performance Order Storage (HPOS):
- ✅ Uses modern WooCommerce CRUD methods
- ✅ Compatible with custom order tables
- ✅ Optimized for high-performance stores
- ✅ No legacy REST API dependencies
- ✅ Future-proof architecture
## 🔧 Installation
1. Download the plugin files
2. Upload to `/wp-content/plugins/product-modifier/` directory
3. Activate the plugin through the 'Plugins' menu in WordPress
4. Navigate to **Product Modifier** in your WordPress admin menu
## ⚙️ Configuration
### Settings Page
Access the settings page at **Product Modifier > Settings**:
- **Products Per Page**: Set how many products to display (Default: 100, Min: 10, Max: 500)
- **Auto Save**: Enable/disable automatic saving of changes
- **Show Product Images**: Toggle product thumbnail display
### User Permissions
The plugin respects WordPress user roles:
- **Administrator**: Full access to all features
- **Shop Manager**: Full access to all features
- **Editor**: Limited access (configurable)
## 🎯 Usage
### Basic Usage
1. Go to **Product Modifier > Bulk Editor**
2. Use search and filters to find products
3. Click on any field to edit it
4. Changes are saved automatically (if enabled) or click "Save All Changes"
### Bulk Operations
1. Select products using checkboxes
2. Choose a bulk action from the dropdown
3. Enter required values (e.g., percentage for price changes)
4. Click "Apply" to execute the bulk action
### Search and Filtering
- **Search**: Enter product name, SKU, or other criteria in the search box
- **Category Filter**: Select a category to filter products
- **Pagination**: Navigate through large product catalogs
## 🔌 Developer Information
### Plugin Structure
```
product-modifier/
├── product-modifier.php # Main plugin file
├── includes/
│ ├── class-admin.php # Admin interface
│ ├── class-ajax.php # AJAX handlers
│ ├── class-settings.php # Settings management
│ └── class-product-handler.php # Product operations
├── templates/
│ ├── admin-page.php # Main interface template
│ └── settings-page.php # Settings page template
├── assets/
│ ├── css/
│ │ └── admin.css # Admin styles
│ └── js/
│ └── admin.js # Admin JavaScript
└── README.md
```
### Hooks and Filters
The plugin provides several hooks for customization:
```php
// Modify product data before display
add_filter('product_modifier_product_data', 'your_function');
// Add custom bulk actions
add_filter('product_modifier_bulk_actions', 'your_function');
// Validate field updates
add_filter('product_modifier_validate_field', 'your_function', 10, 3);
```
### AJAX Endpoints
- `pm_get_products`: Load products with pagination and filtering
- `pm_update_product`: Update single product field
- `pm_bulk_update`: Update multiple products
- `pm_delete_product`: Delete a product
- `pm_save_settings`: Save plugin settings
## 🛡️ Security
- All AJAX requests are protected with WordPress nonces
- User capability checks on all operations
- Input sanitization and validation
- SQL injection prevention
- XSS protection
## 🐛 Troubleshooting
### Common Issues
**Products not loading**
- Check WooCommerce is installed and active
- Verify user permissions
- Check browser console for JavaScript errors
**Changes not saving**
- Verify nonce tokens are valid
- Check server error logs
- Ensure proper user capabilities
**Performance issues**
- Reduce products per page in settings
- Check server memory limits
- Optimize database queries
### Debug Mode
Enable WordPress debug mode for detailed error information:
```php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
```
## 📝 Changelog
### Version 1.0.0
- Initial release
- Bulk product editing interface
- AJAX-powered real-time updates
- Advanced search and filtering
- Configurable settings
- Responsive design
- Security implementation
## 👨💻 Developer
**Adnane**
- Plugin Development
- User Experience Design
- Performance Optimization
## 📄 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.
```
## 🤝 Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
## 📞 Support
For support, feature requests, or bug reports, please contact the developer.
---
**Made with ❤️ by Adnane**