=== BlinkSpeed ===

Version: 1.0.4
Author: BlinkSpeed
Author URI: https://blinkspeed.ai/
License: GPLv2 or later
Text Domain: blinkspeed
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.9
Stable Tag: 1.0.4
Requires PHP: 7.4
Network: true
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Boost your WordPress site speed with advanced AI optimization techniques.

== Description ==

Boost your WordPress site speed with advanced AI optimization techniques. Improve Core Web Vitals, achieve higher scores on Google PageSpeed Insights and GTmetrix, and deliver a faster, smoother browsing experience for your visitors.

== Features ==

*CSS Optimization: Minification, combination, and critical CSS loading
*JavaScript Optimization: Minification, combination, and deferred loading
*HTML Caching: Page-level caching for improved performance
*Image Optimization: WebP conversion and lazy loading
*CDN Support: Content Delivery Network integration
*Lazy Loading: Images, iframes, and videos
*Admin Bar Integration: Quick cache purge from admin bar
*Multisite Support: Network-wide and individual site management
*Web Vitals Monitoring: Core Web Vitals tracking and logging
*Change Logging: Track all settings changes

== Requirements ==

*WordPress 5.0 or higher
*PHP 7.4 or higher
*PHP-XML extension
*PHP-GD extension

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/` directory, or install via WordPress admin
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to 'BlinkSpeed' in the admin menu to configure settings

== Plugin Architecture ==

The plugin has been restructured following WordPress coding standards and best practices:

== Main Files ==

- `blinkspeed.php` - Main plugin file with header and initialization
- `includes/Plugin.php` - Main plugin class orchestrating all functionality
- `includes/Core.php` - Core functionality and settings management
- `includes/Frontend.php` - Frontend optimization handling
- `includes/Database.php` - Database operations and table management

== Admin Structure ==

- `admin/Admin.php` - Main admin class handling menu and settings
- `admin/Admin_Bar.php` - Admin bar cache purge functionality
- `admin/Settings.php` - Settings management and form handling
- `admin/admin-page.php` - Admin page template

== Namespace Structure ==

```
BlinkSpeed\
├── Plugin (Main plugin class)
├── Core (Core functionality)
├── Frontend (Frontend optimization)
├── Database (Database operations)
├── Options (Options management)
└── Admin\
    ├── Admin (Main admin class)
    ├── Admin_Bar (Admin bar functionality)
    └── Settings (Settings management)
```

== Configuration ==

= General Settings =

- **Enable Optimization**: Turn on/off all optimization features
- **License Key**: Enter your BlinkSpeed license key

= CSS Optimization =

- **CSS Optimization**: Enable CSS minification and combination
- **Load Critical CSS**: Inline critical CSS for above-the-fold content

= JavaScript Optimization =

- **JavaScript Optimization**: Enable JS minification and combination
- **Load Combined JS**: Choose when to load combined JavaScript files

= HTML Caching =

- **HTML Caching**: Enable page-level caching
- **Cache Expiry Time**: Set cache expiration time in seconds

= Image Optimization =

- **Convert JPG to WebP**: Automatically convert JPG images to WebP
- **Convert PNG to WebP**: Automatically convert PNG images to WebP
- **Lazy Loading**: Enable lazy loading for images

== Usage ==

= Basic Setup =

1. Activate the plugin
2. Go to BlinkSpeed settings page
3. Configure your optimization preferences
4. Save settings

= Cache Management =

- Use the admin bar to quickly purge different types of cache
- CSS/JS cache can be purged globally or per page
- HTML cache can be purged globally or per page
- Critical CSS cache can be purged per page

= Monitoring =

- Check Web Vitals logs for performance insights
- Review change logs for settings modifications
- Monitor cache file sizes and performance

== Actions ==

- `blinkspeed_init` - Plugin initialization
- `blinkspeed_settings_saved` - Settings saved
- `blinkspeed_cache_cleared` - Cache cleared

== Filters ==

- `blinkspeed_settings` - Modify plugin settings
- `blinkspeed_cache_path` - Customize cache paths
- `blinkspeed_exclude_urls` - Exclude URLs from optimization

== Database Tables ==

The plugin creates the following database tables:

- `wp_blinkspeed_core_web_vitals` - Web Vitals performance data
- `wp_blinkspeed_change_logs` - Settings change logging
- `wp_blinkspeed_site_urls` - Site URL management

== Cache Structure ==

```
wp-content/uploads/blinkspeed-cache/
├── critical-css/     # Critical CSS files
├── html/            # HTML cache files
├── webp/            # WebP converted images
└── [other cache]    # CSS/JS optimization cache
```

= Performance Impact =

- **CSS/JS Optimization**: Reduces file sizes by 20-40%
- **HTML Caching**: Improves page load times by 50-80%
- **Image Optimization**: Reduces image file sizes by 25-50%
- **Lazy Loading**: Improves initial page load performance

== Common Issues ==

1. **Permission Errors**: Ensure proper file permissions on cache directories
2. **Cache Not Working**: Check if optimization is enabled in settings
3. **Images Not Converting**: Verify GD extension is installed
4. **Admin Bar Missing**: Check user capabilities and admin bar settings

== Debug Mode ==

Enable WordPress debug mode to see detailed error messages:

```php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
```

== Security ==

- All user inputs are properly sanitized
- Nonce verification for all forms
- Capability checks for admin functions
- Secure file operations

== Multisite Support ==

- Network-wide settings management
- Individual site settings override
- Centralized cache management
- Site-specific optimization rules

== API Integration ==

The plugin provides REST API endpoints for:

- Cache management
- Performance monitoring
- Settings management
- Web Vitals data

== Support ==

- **Documentation**: [BlinkSpeed Documentation](https://blinkspeed.ai/)
- **Support**: [Contact Support](https://blinkspeed.ai/)
- **Website**: [BlinkSpeed](https://blinkspeed.ai/)

== License  ==

GPL v2 or later

== External Services ==

This plugin connects to the BlinkSpeed API service (https://rest.blinkspeed.ai) to provide CSS optimization, image optimization, and license verification features. These services are required for the plugin's core functionality.

**What data is sent and when:**
- **CSS Optimization**: When CSS optimization is enabled, the plugin sends CSS file URLs and content to the API for minification, combination, and critical CSS extraction. This occurs when pages are loaded and CSS files need to be optimized.
- **Image Optimization**: When image optimization is enabled, image URLs are sent to the API for WebP conversion and optimization. This occurs when images are requested and need to be optimized.
- **License Verification**: Your license key is sent to the API to verify activation status. This occurs when settings are saved or when the plugin checks license validity.

**Service Information:**
- **Service Provider**: BlinkSpeed (https://blinkspeed.ai/)
- **SUPPORT POLICY**: https://blinkspeed.ai/support-policy/
- **Terms of Service**: https://blinkspeed.ai/term-of-service/

All data transmission is done securely over HTTPS. The plugin only sends data necessary for optimization services and does not transmit personal user data beyond what is required for the optimization process.

== Minified Assets and Source Code ==

This plugin ships a small number of minified JavaScript files for performance reasons. The complete, human-readable source code for all minified files is publicly available:

**Third-party libraries:**
- `assets/js/web-vitals.iife.js` – Source: [GoogleChrome/web-vitals](https://github.com/GoogleChrome/web-vitals) (official repository)
- `assets/js/diff.min.js` – Source: [kpdecker/jsdiff](https://github.com/kpdecker/jsdiff) (official repository)

**Plugin-specific minified files:**
- `assets/js/img-lazyload.js` – Unminified source: https://blinkspeed.ai/resources/js/img-lazyload.js
- `assets/js/script-load.min.js` – Unminified source: https://blinkspeed.ai/resources/js/script-load.js

All source code is maintained in publicly accessible repositories and can be reviewed, studied, and forked as needed.

== Credits ==

Developed by [BlinkSpeed](https://blinkspeed.ai/)
