KipDev Simple Optimizer
Lightweight performance optimization plugin that speeds up your site by optimizing images, videos, and implementing best practices.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/kanji8210/kipdev_optimizer/archive/refs/heads/main.zipLightweight, high-quality performance plugin for WordPress with Jetpack compatibility.
Features
Dashboard (Admin UI)
- Performance Overview: View recent scan results and optimization metrics
- Optimization Controls: Configure image quality, HTML minification, lazy loading, caching, and more
- Results Dashboard: View optimization logs with severity levels (info, warning, error)
Optimization Engine
-
Image Optimizer:
- Automatic JPEG/PNG compression on upload (using GD)
- WebP generation for modern browsers (30% smaller than JPEG)
- Memory-aware processing to prevent crashes on large images
- Jetpack Photon detection - automatically defers to Jetpack's Image CDN
- Counter tracking for optimized images
-
Asset Minifier:
- HTML output minification (removes comments, whitespace)
- JavaScript deferral for faster page loads
- Lazy loading for images (auto-disabled if Jetpack lazy loading is active)
- Resource hints (preconnect, preload) for critical assets
-
Cache Manager:
- Clear plugin transients and logs
- Page caching for non-logged-in users
- Database optimization (clean revisions, transients, orphaned metadata)
- Auto-clear cache on content updates
- SQL injection vulnerability fixed
Metrics System
- Performance Scanner: Basic page load time measurement
- Progress Tracker: Enhanced logs with severity levels
- Results Reporter: Color-coded admin interface with timestamps
WP-CLI Support
Bulk operations via command line:
wp kipdev optimize-images [--limit=50] [--force]
wp kipdev clear-cache
wp kipdev optimize-db
wp kipdev scan
WPBakery Page Builder Integration
NEW! Seamlessly extends WPBakery Page Builder with advanced elements:
- Advanced Video Embed:
- YouTube & Vimeo support with privacy mode
- Autoplay, mute, loop controls
- 8 entrance animations (fade, slide, zoom)
- Responsive design with multiple aspect ratios
- Custom styling and CSS classes
- GDPR-compliant privacy mode
- Full documentation:
includes/integrations/wpbakery/README.md
Note: Requires WPBakery Page Builder plugin (automatically detected)
Installation
- Upload the
kipdev_optimizerfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to 'Simple Optimizer' in the admin menu
Usage
Basic Configuration
- Go to Simple Optimizer > Optimization Controls
- Configure options:
- Image quality (10-100, default: 82)
- Generate WebP images (recommended)
- Minify HTML output
- Enable lazy loading (auto-disabled with Jetpack)
- Defer JavaScript for faster loads
- Enable page caching (off by default)
- Jetpack compatibility (auto-detect and defer)
- Save settings
Performance Monitoring
- Go to Simple Optimizer > Performance Overview
- Click "Run Performance Scan" to measure current load time
- Click "Optimize Database" to clean up database
- View color-coded results in the Results Dashboard
Image Optimization
- Automatic: Images are optimized when uploaded
- Bulk: Use WP-CLI for existing images:
wp kipdev optimize-images - JPEG: Quality-based compression with WebP generation
- PNG: Level-based compression with transparency preservation
- GIF: Not processed (preserved as-is for animations)
- WebP: 30% smaller than JPEG, generated automatically
Jetpack Compatibility
The plugin automatically detects Jetpack and:
- Defers image optimization to Jetpack Photon/Image CDN
- Disables lazy loading if Jetpack's is active
- Adds preconnect hints for Jetpack CDN domains
- Works alongside Jetpack without conflicts
Technical Notes
Requirements
- WordPress 5.0+
- PHP 7.4+
- GD extension (for image processing)
- Optional: WP-CLI for bulk operations
Security Improvements
- ✅ Fixed SQL injection vulnerability in cache clearing
- ✅ Proper escaping with
$wpdb->esc_like() - ✅ Nonce verification for all AJAX actions
- ✅ Capability checks for admin operations
- PHP 7.4+
- GD extension (for image processing)
File Structure
kipdev_optimizer/
├── kipdev-optimizer.php # Main plugin file + WP-CLI commands
├── includes/
│ ├── helpers.php # Options utilities
│ ├── admin/
│ │ └── class-kipdev-admin.php # Admin interface with enhanced UI
│ ├── engine/
│ │ ├── class-image-optimizer.php # Image processing + WebP + Jetpack detection
│ │ ├── class-asset-minifier.php # HTML/JS optimization + lazy loading
│ │ ├── class-cache-manager.php # Cache + page caching + DB optimization
│ │ └── class-video-processor.php # Video optimization (placeholder)
│ └── metrics/
│ └── class-performance-scanner.php # Performance monitoring
└── assets/
├── css/admin.css # Admin styles with log level colors
└── js/admin.js # Admin JavaScript with DB optimization
Performance Improvements Implemented
✅ WebP Support: 30% smaller images for modern browsers
✅ Lazy Loading: Faster initial page loads
✅ JavaScript Deferral: Non-blocking script loading
✅ Page Caching: Full page caching for guests
✅ Database Optimization: Clean revisions, transients, optimize tables
✅ Resource Hints: Preconnect and preload for critical assets
✅ Memory Protection: Skip large images that could cause crashes
✅ Jetpack Integration: Smart detection and deferral to Jetpack features
✅ Enhanced Logging: Severity levels (info, warning, error)
✅ WP-CLI Commands: Bulk operations via command line
Best Practices for Jetpack Users
- Enable Jetpack Photon/Image CDN: Let Jetpack handle image optimization and CDN delivery
- Enable this plugin's WebP generation: Even with Jetpack, WebP files benefit local storage
- Use page caching carefully: Test with your Jetpack features to avoid conflicts
- Enable lazy loading: Either in Jetpack OR in this plugin (not both)
- Use database optimization monthly:
wp kipdev optimize-dbor via admin panel
Next Steps & Improvements
Future Enhancements
- Advanced Video Processing: FFmpeg integration for video optimization
- Critical CSS: Above-the-fold CSS inlining
- Advanced Caching: WP Object Cache and Redis integration
- CRON Jobs: Scheduled optimization and cleanup tasks
- External Services: Integration with image optimization APIs (Smush, ShortPixel)
- Advanced Image Libraries: ImageMagick support for better quality
- Core Web Vitals: LCP, FID, CLS tracking and reporting
- CDN Integration: Generic CDN support for any provider
Performance Considerations
- Lightweight footprint (< 100KB with all features)
- Minimal database queries (transients for caching)
- On-demand processing with memory checks
- Graceful error handling and logging
- Jetpack-aware to prevent duplicated work
Troubleshooting
Images not optimizing?
- Check if Jetpack Photon is active (plugin defers to Jetpack)
- Verify GD library is installed:
php -m | grep gd - Check logs in Results Dashboard for errors
- Ensure proper file permissions
Page caching issues?
- Caching is disabled by default, enable in settings
- Not active for logged-in users
- Clears automatically on content updates
- Use "Clear Plugin Cache" if needed
WebP not working?
- Verify PHP supports WebP:
php -r "echo function_exists('imagewebp') ? 'yes' : 'no';" - Check server configuration for WebP MIME types
- Use browser DevTools to verify WebP delivery
Support
For issues and feature requests, please visit the plugin repository.
Changelog
Version 0.2.2 (Current)
- ✅ Added WPBakery Page Builder integration
- ✅ Added Advanced Video Embed element (YouTube & Vimeo)
- ✅ Added GIF optimization support (static GIF to WebP)
- ✅ Added animated GIF detection and preservation
- ✅ Added automatic WebP serving to browsers
- ✅ Added interactive PNG/GIF to WebP converter in admin
- ✅ Added visual progress bars and metrics
- ✅ Fixed PHP 8.2 compatibility issues
- ✅ Fixed namespace issues with Jetpack integration
- ✅ Enhanced admin UI with conversion statistics
Version 0.2.0
- ✅ Added WebP generation support
- ✅ Added Jetpack compatibility layer
- ✅ Added lazy loading with Jetpack detection
- ✅ Added JavaScript deferral
- ✅ Added page caching system
- ✅ Added database optimization
- ✅ Added WP-CLI commands
- ✅ Fixed SQL injection vulnerability
- ✅ Enhanced logging system with severity levels
- ✅ Added memory protection for large images
- ✅ Added resource hints (preconnect, preload)
- ✅ Improved HTML minification safety
Version 0.1.0
- Initial release with basic optimization
License
GPL v2 or later