## Troubleshooting Performance Issues

Having slow reports or performance issues? This comprehensive troubleshooting guide helps you diagnose and fix common performance problems.

### Common Performance Issues

### Issue: Reports Take Long to Load

Symptoms: Reports take 15+ seconds to load

Diagnostic steps:

1. Check date range - is it "All Time"?
2. Count widgets - more than 10?
3. Check data table row limits - unlimited?
4. View system status - low memory?

Solutions (in order of impact):

1. Reduce date range to Last 30 Days (biggest impact)
2. Limit data tables to 500 records max
3. Remove unnecessary widgets (keep 5-8)
4. Optimize database tables

### Issue: Dashboard Very Slow

Solutions:

1. Settings → General → Dashboard Widgets
2. Disable widgets you don't use daily
3. Set default date range to Last 7 Days

### Issue: Timeout Errors

Error message:"Request timeout" or "Maximum execution time exceeded"

Causes:

- PHP max execution time too low (under 60 seconds)
- Very large data set being processed
- Server under heavy load

Solutions:

1. Contact host to increase PHP max_execution_time to 120-300 seconds
2. Reduce report complexity
3. Enable background processing
4. Upgrade hosting if consistently timing out

### Issue: Memory Limit Errors

Error:"Allowed memory size exhausted"

Solutions:

1. Check Tools → System Status → PHP Memory Limit
2. Should be 256MB minimum, 512MB recommended
3. Contact host to increase memory limit
4. Or add to wp-config.php:`define('WP_MEMORY_LIMIT', '512M');`

### Issue: Background Tasks Not Processing

Symptoms: Historical data not processing, tasks queued but not completing

Check:

1. Tools → Background Tasks
2. See task queue status
3. Check last processed time

Solutions:

1. Verify WP-Cron is enabled
2. Check server can make loopback requests
3. Contact host to enable system cron
4. Try manual trigger: Tools → Force Process Background Tasks

#### Diagnostic Tools

### System Status Check

1. Alpha Insights → Tools → System Status
2. - PHP version and settings
   - WordPress environment
   - Database information
   - Active plugins
   - Server configuration
3. Look for red X marks (issues)

### Performance Test

1. Tools → Performance Test
2. Click Run Test
3. - Database query speed
   - Report generation time
   - Widget rendering speed
4. See results and recommendations

#### Slow Query Log

1. Tools → Debug → Slow Query Log
2. See which queries take longest
3. Identify problematic reports or widgets

### Server-Level Issues

### Shared Hosting Limitations

Common problems:

- Limited CPU resources
- Low memory limits
- Restricted execution time

Solutions:

- Optimize aggressively (reduce date ranges, limit data)
- Or upgrade to VPS/managed WordPress hosting

### Resource Conflicts

Other plugins using resources:

1. Disable other plugins temporarily
2. Test Alpha Insights performance
3. Re-enable plugins one at a time
4. Identify conflicting plugin

#### Database Server Performance

If database itself is slow:

- Contact host about MySQL/MariaDB optimization
- Consider dedicated database server

### Plugin-Specific Solutions

### Background Processing

If server has limited resources:

- Set to "Conservative" mode
- Reduces simultaneous tasks
- Slower but more stable

#### Disable Unnecessary Features

If you don't use certain features:

- Disable real-time analytics
- Disable unused integrations
- Turn off features you don't need

### Fixing Specific Slow Reports

### Slow Product Report

If Products report very slow:

1. Filter to specific category
2. Limit to top 100 products
3. Remove complex calculated columns
4. Use simpler widgets

#### Slow Customer Report

Solutions:

- Limit to customers with orders in date range
- Don't calculate LTV for all customers (only top customers)
- Set max records to 500

### Slow Campaign Report

Solutions:

- Filter to active campaigns only
- Exclude ended campaigns older than 90 days
- Reduce date range

#### Network and API Issues

### Slow Ad Integration Syncs

If Facebook/Google sync very slow:

- Reduce sync frequency (hourly → every 6 hours)
- Limit campaigns being synced
- Check API quota usage

#### External API Timeouts

Solutions:

- Verify server can make outbound HTTPS requests
- Check firewall not blocking API calls
- Temporarily disable and re-enable integration

### Browser-Side Performance

### Slow Dashboard Rendering

If dashboard loads but displays slowly:

- Clear browser cache
- Disable browser extensions
- Try different browser
- Update to latest browser version

#### Charts Not Rendering

Solutions:

- Disable ad blockers (they can interfere)
- Allow JavaScript for your site
- Check browser console for errors (F12)

### Getting Help

### Before Contacting Support

Gather this information:

1. Screenshot of System Status page
2. Which specific reports are slow
3. Approximate number of orders in store
4. Hosting provider name
5. What you've tried already

### Enable Debug Mode

1. Settings → Advanced → Debug Mode
2. Enable debug logging
3. Reproduce slow issue
4. Check debug logs (Tools → Logs)
5. Include log excerpt when contacting support

### Contact Support

Open support ticket with:

- Detailed description of issue
- System status screenshot
- Steps to reproduce
- Any error messages

### Prevention Tips

- Start with reasonable date ranges
- Don't create overly complex reports
- Optimize database monthly
- Monitor performance trends
- Keep hosting resources adequate for store size
- Clean up data regularly