File: /home/luxbsolr/cardsord.store/wp-content/plugins/Csv_Uploader/README.md
# Fast CSV Product Importer for WooCommerce
A high-performance WordPress plugin for importing products from CSV files into WooCommerce stores. Built for speed, efficiency, and ease of use.
## 🔧 Latest Fixes (December 2024)
### ✅ Fixed Field Validation Mapping Issue
- **Problem**: Validation was failing with "Required field 'Product Name' is missing" even when properly mapped
- **Solution**: Updated validator to check mapped WooCommerce field names (`post_title`) instead of original field names (`name`)
- **Impact**: Product imports now validate correctly with proper field mapping
### ✅ Added Brand Field Support
- **Problem**: Brand/Manufacturer field was missing from available mapping options
- **Solution**: Added brand field with WooCommerce attribute mapping (`pa_brand`) and auto-detection for variations
- **Impact**: Users can now map brand/manufacturer columns from CSV files
### ✅ Enhanced HPOS Compatibility
- **Problem**: Plugin triggered WooCommerce HPOS compatibility warnings
- **Solution**: Added proper HPOS compatibility declarations in plugin header
- **Impact**: Plugin works seamlessly with WooCommerce High-Performance Order Storage
### ✅ Fixed Database Table Creation
- **Problem**: Import logs table wasn't created during plugin activation
- **Solution**: Moved table creation to proper WordPress activation hooks
- **Impact**: Import tracking and history features work correctly
## Features
### âš¡ High Performance
- **Batch Processing**: Imports products in optimized batches to prevent timeouts
- **Memory Management**: Efficient memory usage for large CSV files
- **Background Processing**: Non-blocking imports with real-time progress tracking
- **Stream Processing**: Handles large files without loading everything into memory
### 🎯 Smart Auto-Mapping
- **Intelligent Field Detection**: Automatically suggests field mappings based on CSV headers
- **Machine Learning-like Patterns**: Recognizes common field name variations
- **Confidence Scoring**: Shows mapping confidence levels
- **Learning System**: Improves suggestions based on user corrections
### 🛠Advanced Features
- **Mapping Templates**: Save and reuse field mapping configurations
- **Data Validation**: Comprehensive validation with detailed error reporting
- **Duplicate Handling**: Skip, update, or create new products for duplicates
- **Image Import**: Support for importing product images from URLs
- **Category/Tag Management**: Automatic creation of missing categories and tags
- **Progress Tracking**: Real-time import progress with detailed statistics
### 📊 User Experience
- **Step-by-Step Wizard**: Intuitive 3-step import process
- **Drag & Drop Upload**: Easy file uploading with drag and drop support
- **Live Preview**: Preview mapped data before importing
- **Import History**: Track all imports with detailed logs
- **Error Reporting**: Clear error messages with row-level details
## Installation
1. Download the plugin files
2. Upload to your WordPress `/wp-plugins/` directory
3. Activate the plugin through the WordPress admin
4. Navigate to **WooCommerce > CSV Importer**
## Requirements
- WordPress 5.0 or higher
- WooCommerce 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher
## Usage
### Step 1: Upload CSV File
1. Go to **WooCommerce > CSV Importer**
2. Upload your CSV file (drag & drop or click to browse)
3. Click **Analyze CSV** to process the file structure
### Step 2: Map Fields
1. Review auto-suggested field mappings
2. Manually adjust mappings as needed
3. Save mapping as a template for future use
4. Preview the mapped data
### Step 3: Import Products
1. Click **Start Import** to begin processing
2. Monitor real-time progress and statistics
3. Review import log for any errors or warnings
4. Access detailed import history
## CSV File Format
### Required Headers
- **Name/Title**: Product name (required)
### Supported Fields
- **Basic Info**: Name, Description, Short Description, SKU
- **Pricing**: Regular Price, Sale Price
- **Inventory**: Stock Quantity, Stock Status, Manage Stock
- **Shipping**: Weight, Length, Width, Height
- **Categories**: Product Categories (comma-separated)
- **Tags**: Product Tags (comma-separated)
- **Images**: Featured Image URL, Gallery Images (comma-separated URLs)
- **Attributes**: Custom product attributes
- **SEO**: Meta Title, Meta Description
- **Variations**: Variable product support
### Example CSV Structure
```csv
Name,SKU,Regular Price,Sale Price,Description,Categories,Stock Quantity,Weight,Images
"Premium T-Shirt",TS-001,29.99,24.99,"High quality cotton t-shirt","Clothing,T-Shirts",100,0.2,"https://example.com/image1.jpg"
"Running Shoes",RS-002,89.99,,"Comfortable running shoes","Footwear,Sports",50,1.5,"https://example.com/image2.jpg,https://example.com/image3.jpg"
```
## Performance Optimization
### Server Requirements
- **Memory Limit**: Minimum 256MB (512MB recommended)
- **Execution Time**: 300 seconds or more
- **Max Upload Size**: Sufficient for your CSV file size
### Plugin Settings
Access settings under **WooCommerce > CSV Importer > Settings**:
- **Batch Size**: Number of products processed per batch (default: 50)
- **Memory Limit**: PHP memory limit for imports (default: 256M)
- **Execution Time**: Maximum processing time (default: 300 seconds)
- **Duplicate Handling**: How to handle existing products (skip/update/create new)
- **Auto Cleanup**: Automatically clean up temporary files after X days
## Advanced Configuration
### Hooks and Filters
#### Modify Available Fields
```php
add_filter('fcpi_wc_fields', 'custom_wc_fields');
function custom_wc_fields($fields) {
$fields['custom_field'] = array(
'label' => 'Custom Field',
'required' => false,
'type' => 'text'
);
return $fields;
}
```
#### Modify Validation Rules
```php
add_filter('fcpi_validation_rules', 'custom_validation_rules');
function custom_validation_rules($rules) {
$rules['custom_field'] = array(
'required' => true,
'max_length' => 100
);
return $rules;
}
```
#### Custom Data Transformation
```php
add_filter('fcpi_transform_data', 'custom_transform_data', 10, 3);
function custom_transform_data($value, $field, $row_data) {
if ($field === 'price') {
// Remove currency symbols
return preg_replace('/[^0-9.]/', '', $value);
}
return $value;
}
```
### Database Tables
The plugin creates one additional table:
#### `wp_fcpi_import_logs`
Stores import history and statistics:
- `import_id`: Unique import identifier
- `status`: Import status (pending/processing/completed/failed/cancelled)
- `total_rows`: Total number of rows in CSV
- `processed_rows`: Number of processed rows
- `successful_rows`: Number of successfully imported products
- `failed_rows`: Number of failed imports
- `error_log`: Detailed error messages
- `file_path`: Original file information
- `mapping_data`: Field mapping configuration
- `started_at`: Import start timestamp
- `completed_at`: Import completion timestamp
## Troubleshooting
### Common Issues
#### "Memory Limit Exceeded"
- Increase PHP memory_limit in php.ini
- Reduce batch size in plugin settings
- Use the streaming import option for very large files
#### "Maximum Execution Time Exceeded"
- Increase max_execution_time in php.ini
- Enable background processing mode
- Use smaller batch sizes
#### "File Upload Failed"
- Check upload_max_filesize and post_max_size in php.ini
- Ensure proper file permissions
- Verify file format (CSV/TXT only)
#### "Import Stuck/Not Progressing"
- Check for PHP errors in error log
- Verify WooCommerce is properly configured
- Ensure database has sufficient resources
### Debug Mode
Enable debug mode by adding to wp-config.php:
```php
define('FCPI_DEBUG', true);
```
This will:
- Enable detailed logging
- Show additional error information
- Track memory and execution time
## Performance Benchmarks
Based on testing with a standard WordPress/WooCommerce setup:
| Products | File Size | Import Time | Memory Usage |
|----------|-----------|-------------|--------------|
| 1,000 | 2MB | 30 seconds | 64MB |
| 5,000 | 10MB | 2 minutes | 128MB |
| 10,000 | 20MB | 4 minutes | 256MB |
| 50,000 | 100MB | 15 minutes | 512MB |
*Results may vary based on server specifications and product complexity.
## Support
### Getting Help
1. Check the troubleshooting section above
2. Review WordPress and WooCommerce error logs
3. Test with a smaller CSV file to isolate issues
4. Verify server meets minimum requirements
### Reporting Issues
When reporting issues, please include:
- WordPress/WooCommerce versions
- PHP version and memory limit
- Sample CSV file (if possible)
- Error messages from debug log
- Steps to reproduce the issue
## Changelog
### Version 1.0.0
- Initial release
- Batch processing system
- Auto-mapping functionality
- Progress tracking
- Import history
- Template system
- Data validation
- Error handling
## License
This plugin is licensed under GPL v2 or later.
## Credits
Developed with performance and user experience in mind. Special thanks to the WordPress and WooCommerce communities for their excellent documentation and support.