Debug Logging
How to enable and use debug logging for troubleshooting.
WordPress Plugin Logging
The Picture Optimizer plugin includes a built-in process log that captures every step of the processing pipeline.
Viewing the Process Log
During processing, click the View Log button in the modal footer to open a detailed log showing:
- Timestamps for each operation
- Upload progress and session creation
- AI analysis events per image
- Export progress and file details
- Replacement results and URL updates
- Any errors with full error messages
Browser Console
The plugin logs key events to the browser console with the prefix [PO Log]. Open your browser's developer tools (F12 → Console) to see:
Errors are logged with console.error for easy filtering.
Server-Side Logging
WordPress Debug Log
Enable WordPress debug logging to capture PHP errors:
Logs are written to wp-content/debug.log. Look for entries from the plugin's PHP classes.
Flask API Gateway Logs
The Flask API gateway logs requests and errors. Check the process manager output:
SaaS Platform Logs
The Next.js SaaS platform logs are available through the process manager:
Common Log Patterns
Successful Processing
Credit Error
Network Error
Reporting Issues
When reporting issues to support, include:
- The process log from the modal (copy/paste the full log)
- The browser console output (screenshot or copy)
- Your WordPress version and PHP version
- The plugin version (visible in Plugins → Installed Plugins)
- Any server error logs if accessible
