container(); // Don't do anything if page caching is disabled. // NOTE: You should not put any other code above this section, as the updater stops here. if ( ! swpsp_config_get( 'page_cache.enabled' ) ) { return; } try { // 1. If cached file exists, serve it. $cache = $container->get( Cache::class ); $cache->serve_cached_file(); // 2. If no cached file exists, try to save a cached version. $buffer = $container->get( Buffer::class ); $buffer->register(); } catch ( Throwable $e ) { swpsp_log( 'Solid Performance - A critical error occurred: ' . $e->getMessage() ); } } elseif ( __DIR__ === WP_CONTENT_DIR ) { // If the plugin was deleted without deactivation, clean up after ourselves. @unlink( __FILE__ ); }