=== SmartSite Optimizer ===
Contributors: devkamran
Tags: performance, optimization, caching, analytics, images
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A comprehensive all-in-one performance and user experience optimization solution for WordPress.

== Description ==

SmartSite Optimizer is a powerful WordPress plugin that provides enterprise-level performance optimization and analytics features to help you deliver the fastest possible user experience.

= Key Features =

**Intelligent Asset Management**
* Automatic CSS/JS deferral with intelligent dependency mapping
* Critical CSS inlining for above-the-fold content
* Image lazy loading with blur-up placeholder effects
* Font display optimization with preloading support

**Advanced Caching System**
* Page caching with smart invalidation rules
* Database query optimization with result caching
* Object cache support for Redis and Memcached
* Browser caching headers with optimal expiry times

**Real-time Analytics Dashboard**
* Core Web Vitals monitoring (LCP, FID, CLS, TTFB, FCP)
* Performance score tracking with historical data
* User behavior metrics without external dependencies
* Custom event tracking API for developers

**Automated Optimization Features**
* Image compression on upload with quality settings
* WebP conversion for modern browsers
* Code minification for HTML, CSS, and JavaScript
* DNS prefetching for external domains
* Resource preloading for critical assets

= Technical Highlights =

* Object-oriented PHP with proper namespace structure
* WordPress coding standards compliant
* Modular architecture with enable/disable controls
* Comprehensive error handling and logging
* WP-CLI commands for automation
* Extensible hooks and filters API
* Multisite compatible

== Installation ==

1. Upload the `smartsite-optimizer` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Navigate to SmartSite in the admin menu to configure settings
4. Click "Run One-Click Optimization" to get started

== Frequently Asked Questions ==

= Will this plugin slow down my site? =

No! SmartSite Optimizer is designed to be extremely efficient. The plugin's overhead is minimal compared to the performance gains it provides.

= Is it compatible with other caching plugins? =

SmartSite Optimizer includes its own caching system. We recommend disabling other caching plugins to avoid conflicts.

= Does it work with page builders? =

Yes! SmartSite Optimizer is compatible with all major page builders including Elementor, Beaver Builder, and Divi.

= Can I disable specific features? =

Absolutely! The plugin has a modular architecture. You can enable or disable individual features from the Settings page.

= Does it support multisite? =

Yes! SmartSite Optimizer is fully compatible with WordPress multisite installations.

== Screenshots ==

1. Dashboard with performance metrics and Core Web Vitals
2. Asset Manager configuration
3. Cache settings and management
4. Analytics page with interactive charts
5. Image optimization settings

== Changelog ==

= 1.0.0 =
* Initial release
* Intelligent Asset Management module
* Advanced Caching System
* Real-time Analytics Dashboard
* Automated Image Optimization
* WP-CLI commands
* Multisite support

== Upgrade Notice ==

= 1.0.0 =
Initial release of SmartSite Optimizer.

== Advanced Usage ==

= WP-CLI Commands =

Clear all caches:
`wp sso cache clear`

Clear page cache only:
`wp sso cache clear-pages`

View cache statistics:
`wp sso cache stats`

Optimize all images:
`wp sso optimize images`

Optimize with limit:
`wp sso optimize images --limit=50`

Run all optimizations:
`wp sso optimize all`

= Custom Event Tracking =

Track custom events in your theme or plugin:

`
if ( function_exists( 'sso' ) && sso()->analytics ) {
    sso()->analytics->track_event( 'button_click', array(
        'url' => get_permalink(),
        'value' => 1
    ) );
}
`

= Hooks and Filters =

Exclude URLs from asset optimization:
`
add_filter( 'sso_exclude_asset_optimization', function( $exclude ) {
    if ( is_page( 'special-page' ) ) {
        return true;
    }
    return $exclude;
} );
`

Exclude scripts from deferral:
`
add_filter( 'sso_defer_js_excluded', function( $excluded ) {
    $excluded[] = 'my-critical-script';
    return $excluded;
} );
`

Modify critical CSS:
`
add_filter( 'sso_critical_css', function( $css, $page_type ) {
    // Add your custom critical CSS
    return $css . 'body { font-display: swap; }';
}, 10, 2 );
`

== Support ==

For support, feature requests, or bug reports, please visit our support forum or contact us at support@devkamran.com

== Credits ==

Developed by devkamran
