---
title: Performance Optimization
description: "If your site is experiencing slowness related to Smart Cycle Discounts, this guide covers optimization strategies and performance troubleshooting for stores of all sizes. --- ## Performance Factors ### What Affects Performance | Factor | Impact | Controllable? | |…"
url: "https://webstepper.io/docs/smart-cycle-discounts/troubleshooting/performance-optimization/"
updated: "2026-02-14"
category: Troubleshooting
---

# Performance Optimization

If your site is experiencing slowness related to Smart Cycle Discounts, this guide covers optimization strategies and performance troubleshooting for stores of all sizes.

---

## Performance Factors

### What Affects Performance

| Factor | Impact | Controllable? |
| --- | --- | --- |
| Number of products | High | Limited |
| Number of campaigns | Medium | Yes |
| Campaign complexity | Medium | Yes |
| Server resources | High | Yes (hosting) |
| Caching configuration | High | Yes |
| Database optimization | Medium | Yes |

---

## Recommended Settings by Store Size

### Small Store (<1,000 products)

- Default settings work well
- Basic caching plugin recommended
- No special optimization needed

### Medium Store (1,000-10,000 products)

- Enable plugin caching
- Use page caching plugin
- Optimize database periodically
- Consider object caching

### Large Store (10,000+ products)

- Required: Object caching (Redis/Memcached)
- Required: Page caching
- Recommended: CDN
- Recommended: Server-level cron
- Enable optimized query mode

---

## Caching Optimization

### Plugin Cache Settings

1. Go to **SC Discounts → Settings → Advanced**
2. Enable Caching: **Yes**
3. Set appropriate cache duration:
   - Small stores: 12-24 hours
   - Medium stores: 6-12 hours
   - Large stores: 1-6 hours

### Object Caching

For best performance, use persistent object caching:

| Option | Best For |
| --- | --- |
| Redis | High-traffic sites, best performance |
| Memcached | Shared hosting with Memcached support |
| APCu | Single-server setups |

### Page Caching

Use a page caching plugin:

- WP Rocket (premium, excellent)
- WP Super Cache (free)
- W3 Total Cache (free, complex)
- LiteSpeed Cache (if using LiteSpeed server)

**Important:** Ensure cart and checkout pages are excluded from caching.

---

## Database Optimization

### Optimize Plugin Tables

1. Go to **SC Discounts → Tools**
2. Click **"Optimize Database"**
3. Tables are analyzed and optimized

Run monthly or after bulk changes.

### Clean Old Data

1. Go to **SC Discounts → Settings → Advanced**
2. Set reasonable data retention periods:
   - Analytics: 180-365 days
   - Debug logs: 7-14 days
   - Draft cleanup: 7 days

### WordPress Database Optimization

- Clean post revisions
- Remove spam comments
- Optimize all tables periodically
- Use a plugin like WP-Optimize

---

## Campaign Optimization

### Reduce Active Campaigns

- Fewer active campaigns = faster price calculations
- Pause campaigns you're not using
- Delete expired campaigns you don't need

### Simplify Product Selection

More efficient (faster):

- "All Products" with simple exclusions
- Category-based selection
- Tag-based selection

Less efficient (slower):

- Many specific products selected individually
- Complex nested conditions
- Multiple OR conditions

### Optimize Conditions

```
Efficient:
- Category equals "Sale"
- Tag equals "discount"

Less Efficient:
- Category equals "A" OR Category equals "B" OR Category equals "C" OR...
- Price greater than X AND less than Y AND...
```

---

## Query Optimization

### For Large Catalogs

1. Go to **SC Discounts → Settings → Advanced**
2. Set Query Mode: **Optimized**
3. Adjust Batch Size as needed:
   - Higher batch size = fewer queries, more memory
   - Lower batch size = more queries, less memory

### Recommended Batch Sizes

| Products | Batch Size |
| --- | --- |
| <5,000 | 100 |
| 5,000-20,000 | 200-300 |
| 20,000+ | 500 |

---

## Server Optimization

### PHP Settings

Recommended PHP configuration:

```
memory_limit = 256M (or higher for large stores)
max_execution_time = 300
max_input_vars = 3000
```

### Hosting Considerations

| Hosting Type | Performance | Recommendation |
| --- | --- | --- |
| Shared | Limited | OK for small stores |
| Managed WP | Good | Good for medium stores |
| VPS | Very Good | Good for large stores |
| Dedicated | Excellent | Best for high-traffic |

### Enable OPcache

Ensure PHP OPcache is enabled (usually is by default on modern hosting).

---

## Frontend Performance

### Price Calculation Caching

Discounted prices are cached to avoid recalculation:

- First load calculates and caches
- Subsequent loads use cache
- Cache invalidates when campaigns change

### Minimize Displayed Products

- Limit products per page (24-36 typical)
- Use pagination, not infinite scroll
- Lazy load product images

### Cart Fragment Optimization

If cart fragments are slow:

- Check caching plugin settings
- Ensure cart fragments not cached
- Consider cart fragment optimization plugins

---

## Diagnosing Slowness

### Identify the Bottleneck

1. **Is it database-related?**

   - Check query monitor plugin
   - Look for slow queries
2. **Is it PHP-related?**

   - Check PHP execution time
   - Enable WP_DEBUG_LOG temporarily
3. **Is it server-related?**

   - Check server resource usage
   - Contact hosting for insights

### Query Monitor Plugin

Install Query Monitor to identify slow queries:

1. Install "Query Monitor" plugin
2. Visit slow pages
3. Check for slow or duplicate queries
4. Look for queries related to SCD tables

### Enable Debug Mode

1. Go to **SC Discounts → Settings → Advanced**
2. Enable Debug Mode
3. Set Log Level to "Debug"
4. Check logs for timing information

---

## Performance Testing

### Before and After

When making optimizations, measure:

1. Page load time (use browser developer tools)
2. Time to first byte (TTFB)
3. Database query count and time

### Testing Tools

- GTmetrix
- Google PageSpeed Insights
- Pingdom
- WebPageTest

### Load Testing

For high-traffic preparation:

- Use tools like Loader.io or k6
- Test with realistic traffic patterns
- Monitor server during tests

---

## Quick Wins

### Immediate Improvements

1. Clear all caches
2. Optimize plugin database tables
3. Pause unused campaigns
4. Enable plugin caching if disabled

### Medium-Term Improvements

1. Install a page caching plugin
2. Set up object caching
3. Optimize database regularly
4. Clean old analytics data

### Long-Term Improvements

1. Upgrade hosting if needed
2. Implement CDN
3. Set up server-level cron
4. Regular performance monitoring

---

## When to Contact Support

Contact support if:

- Slowness started after plugin update
- Specific pages consistently slow
- Database queries seem abnormal
- Error messages appearing

Include in support request:

- System report
- Query Monitor data (if available)
- Specific slow pages/actions
- What optimizations you've tried
