Changeset 3783146
- Timestamp:
- 11/04/2026 06:00:41 AM (4 days ago)
- Location:
- fastlayer
- Files:
-
- 26 added
- 9 edited
-
tags/1.5.4 (added)
-
tags/1.5.4/advanced-cache.php (added)
-
tags/1.5.4/assets (added)
-
tags/1.5.4/assets/css (added)
-
tags/1.5.4/assets/css/admin.css (added)
-
tags/1.5.4/assets/js (added)
-
tags/1.5.4/assets/js/admin.js (added)
-
tags/1.5.4/assets/js/imagekit-runtime-debug.js (added)
-
tags/1.5.4/assets/js/instant-click.js (added)
-
tags/1.5.4/assets/js/lazyload.js (added)
-
tags/1.5.4/assets/js/lqip-frontend.js (added)
-
tags/1.5.4/includes (added)
-
tags/1.5.4/includes/class-admin-bar.php (added)
-
tags/1.5.4/includes/class-admin.php (added)
-
tags/1.5.4/includes/class-bootstrap.php (added)
-
tags/1.5.4/includes/class-cdn.php (added)
-
tags/1.5.4/includes/class-cli.php (added)
-
tags/1.5.4/includes/class-database-optimization.php (added)
-
tags/1.5.4/includes/class-optimizer.php (added)
-
tags/1.5.4/includes/class-page-cache.php (added)
-
tags/1.5.4/includes/class-webp.php (added)
-
tags/1.5.4/languages (added)
-
tags/1.5.4/languages/fastlayer.pot (added)
-
tags/1.5.4/readme.txt (added)
-
tags/1.5.4/uninstall.php (added)
-
tags/1.5.4/wp-fastlayer.php (added)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/includes/class-admin-bar.php (modified) (1 diff)
-
trunk/includes/class-admin.php (modified) (2 diffs)
-
trunk/includes/class-cdn.php (modified) (4 diffs)
-
trunk/includes/class-optimizer.php (modified) (4 diffs)
-
trunk/includes/class-page-cache.php (modified) (3 diffs)
-
trunk/includes/class-webp.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-fastlayer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fastlayer/trunk/assets/js/admin.js
r3781439 r3783146 4571 4571 if (res && res.success) { 4572 4572 if (typeof window.wpflShowToast === 'function') { 4573 window.wpflShowToast('Cache Purged', 'All static HTML cache files have been cleared.');4573 window.wpflShowToast('Cache Cleared & Auto-Warming Started', 'All cache files cleared and background warming has automatically started.'); 4574 4574 } 4575 4575 if ($kpiCached.length) $kpiCached.text('0'); 4576 4576 if ($kpiSize.length) $kpiSize.text('0 B'); 4577 if ($progressBar.length) $progressBar.css('width', '0%'); 4578 if ($pctLabel.length) $pctLabel.text('0%'); 4579 if ($coverageLabel.length) $coverageLabel.text('0% Cache Coverage'); 4580 $badge.attr('class', 'wpfl-warmup-status-badge is-idle'); 4581 $statusText.text('Idle / Ready to Warm'); 4577 if ($progressBar.length) $progressBar.css('width', '5%'); 4578 if ($pctLabel.length) $pctLabel.text('Starting...'); 4579 if ($coverageLabel.length) $coverageLabel.text('Warming Starting...'); 4580 $badge.attr('class', 'wpfl-warmup-status-badge is-warming'); 4581 $statusText.text('Warming Pages Live...'); 4582 if ($startBtn.length) { 4583 $startBtn.prop('disabled', true); 4584 $startText.text('Warming in Progress...'); 4585 } 4586 $headline.text('Background Preload Warming In Progress'); 4587 $desc.text('Cache cleared. Warming discovered URLs automatically in the background.'); 4582 4588 $('.wpfl-badge-cached').removeClass('wpfl-badge-cached').addClass('wpfl-badge-pending').html('<span class="dashicons dashicons-marker"></span> Pending'); 4589 startPolling(); 4583 4590 } 4584 4591 }).fail(function () { -
fastlayer/trunk/includes/class-admin-bar.php
r3781222 r3783146 406 406 407 407 private function process_clear_all_cache( $redirect_to ) { 408 $this->clear_preload_cache_artifacts(); 409 $this->clear_assets_cache(); 408 410 $this->clear_page_cache(); 409 $this->clear_assets_cache();410 $this->clear_preload_cache_artifacts();411 411 412 412 if ( function_exists( 'delete_transient' ) ) { -
fastlayer/trunk/includes/class-admin.php
r3783103 r3783146 1725 1725 $this->log_cache_clear( 'Cache clear started.', $cache_stats_before ); 1726 1726 1727 $invalidation = Page_Cache::get_instance(); 1727 $preload_stats = $this->clear_preload_cache_artifacts(); 1728 $minify_stats = $this->clear_minify_cache(); 1729 $invalidation = Page_Cache::get_instance(); 1728 1730 $invalidation->clear_all_cache(); 1729 $minify_stats = $this->clear_minify_cache();1730 $preload_stats = $this->clear_preload_cache_artifacts();1731 1731 1732 1732 if ( function_exists( 'delete_transient' ) ) { … … 1838 1838 $this->log_cache_clear( 'AJAX Cache clear started.', $cache_stats_before ); 1839 1839 1840 $invalidation = Page_Cache::get_instance(); 1840 $preload_stats = $this->clear_preload_cache_artifacts(); 1841 $minify_stats = $this->clear_minify_cache(); 1842 $invalidation = Page_Cache::get_instance(); 1841 1843 $invalidation->clear_all_cache(); 1842 $minify_stats = $this->clear_minify_cache();1843 $preload_stats = $this->clear_preload_cache_artifacts();1844 1844 1845 1845 if ( function_exists( 'delete_transient' ) ) { -
fastlayer/trunk/includes/class-cdn.php
r3781222 r3783146 1483 1483 } 1484 1484 1485 if ( $this->is_lcp_preload_enabled() && ! empty( $this->lcp_candidate['preload_url'] ) && false !== stripos( $html, '</head>' ) && false === strpos( $html, 'data-wpfl-lcp="1"' ) ) { 1486 $preload_url = esc_url( Bootstrap::set_url_scheme( (string) $this->lcp_candidate['preload_url'] ) ); 1487 if ( '' !== $preload_url ) { 1488 if ( class_exists( __NAMESPACE__ . '\\Webp' ) ) { 1489 $webp_candidate = Webp::get_instance()->get_webp_url_for_image_url( $preload_url ); 1490 if ( ! empty( $webp_candidate ) ) { 1491 $preload_url = esc_url( $webp_candidate ); 1492 } 1493 } 1494 1495 $preload_tag = '<link rel="preload" as="image" href="' . esc_attr( $preload_url ) . '" fetchpriority="high" data-wpfl-lcp="1"'; 1496 if ( ! empty( $this->lcp_candidate['is_img'] ) ) { 1497 if ( ! empty( $this->lcp_candidate['srcset'] ) ) { 1498 $preload_tag .= ' imagesrcset="' . esc_attr( (string) $this->lcp_candidate['srcset'] ) . '"'; 1499 } 1500 if ( ! empty( $this->lcp_candidate['sizes'] ) ) { 1501 $preload_tag .= ' imagesizes="' . esc_attr( (string) $this->lcp_candidate['sizes'] ) . '"'; 1502 } 1503 } 1504 $preload_tag .= " />\n"; 1505 1506 $html = preg_replace( '/<\/head>/i', $preload_tag . '</head>', $html, 1 ); 1507 $this->lcp_candidate['preload_applied'] = true; 1508 $this->debug_lcp_log( 'preload_applied', array( 'preload_url' => $preload_url ) ); 1509 } 1510 } 1511 1485 1512 $this->persist_lcp_report(); 1513 1514 return $html; 1515 } 1516 1517 public function optimize_full_page_html( $html ) { 1518 if ( ! is_string( $html ) || '' === $html ) { 1519 return $html; 1520 } 1521 1522 if ( $this->is_smart_lcp_enabled() ) { 1523 $html = $this->apply_smart_lcp_optimization_to_html( $html ); 1524 } 1486 1525 1487 1526 return $html; … … 1493 1532 } 1494 1533 1495 if ( ! preg_match_all( '#<(?:section|div)[^>]+>#i', $html, $blocks ) ) { 1534 // 1. WPBakery / Visual Composer style blocks: .vc_custom_XXXXX { background-image: url(...) } 1535 if ( preg_match( '/\.(vc_custom_\d+)\s*\{[^}]*?background(?:-image)?\s*:\s*url\((?:"|\')?([^"\')]+)(?:"|\')?\)/i', $html, $vc_match ) ) { 1536 $vc_class = $vc_match[1]; 1537 $vc_url = trim( html_entity_decode( (string) $vc_match[2], ENT_QUOTES, 'UTF-8' ) ); 1538 if ( '' !== $vc_url && false !== strpos( $html, $vc_class ) && $this->is_local_image_url( $vc_url ) ) { 1539 return array( 1540 'url' => $vc_url, 1541 'preload_url' => $vc_url, 1542 'source' => 'hero_background_wpbakery', 1543 'type' => 'background-image', 1544 'score' => 350, 1545 'is_background' => true, 1546 'preload_applied' => false, 1547 ); 1548 } 1549 } 1550 1551 if ( ! preg_match_all( '#<(?:section|div|header)[^>]+>#i', $html, $blocks ) ) { 1496 1552 return null; 1497 1553 } … … 1503 1559 1504 1560 $class_id = strtolower( (string) $class_match[1] ); 1505 if ( ! preg_match( '/hero|banner|cta|featured|elementor-top-section|elementor-section /i', $class_id ) ) {1561 if ( ! preg_match( '/hero|banner|cta|featured|elementor-top-section|elementor-section|vc_row|wpb_row|wp-block-cover|masthead|header|intro/i', $class_id ) ) { 1506 1562 continue; 1507 1563 } … … 1515 1571 'source' => 'hero_background', 1516 1572 'type' => 'background-image', 1517 'score' => 75,1573 'score' => 350, 1518 1574 'is_background' => true, 1519 1575 'preload_applied' => false, -
fastlayer/trunk/includes/class-optimizer.php
r3783106 r3783146 1152 1152 // condition and RTL variants (extra['rtl']) would be served to the 1153 1153 // wrong direction. 1154 if ( ! empty( $style->extra ) ) {1154 if ( ! empty( $style->extra['conditional'] ) || ! empty( $style->extra['rtl'] ) || ! empty( $style->extra['alt'] ) ) { 1155 1155 continue; 1156 1156 } … … 1545 1545 1546 1546 $checks = array( 1547 '/@font-face\s*\{/i',1548 '/::?(before|after)\b/i',1549 1547 '/content\s*:\s*["\']\\[0-9a-f]{2,6}["\']/i', 1550 '/font-family\s*:\s*["\']?(?:material\s*icons|material\s*symbols|font\s*awesome|fontawesome|eicons?|elementor-icons|dashicons|glyphicons| mdi|icon)["\']?/i',1551 '/\.(?:fa-[\w-]+|eicon-[\w-]+|mdi-[\w-]+ )\b/i',1552 '/url\([^)]* \.(?:woff2?|ttf|otf)(?:[?#][^)]*)?\)/i',1548 '/font-family\s*:\s*["\']?(?:material\s*icons|material\s*symbols|font\s*awesome|fontawesome|eicons?|elementor-icons|dashicons|glyphicons|elegant-icons|ionicons|icomoon|linearicons|simple-line-icons|mdi|icon)["\']?/i', 1549 '/\.(?:fa-[\w-]+|eicon-[\w-]+|mdi-[\w-]+|dashicons-[\w-]+|icon-[\w-]+)\b/i', 1550 '/url\([^)]*(?:font-?awesome|ionicons|elegant-?icons|dashicons|material-icons|icomoon|glyphicons|eicons)[^)]*\.(?:woff2?|ttf|otf|eot)(?:[?#][^)]*)?\)/i', 1553 1551 ); 1554 1552 … … 2897 2895 } 2898 2896 2897 if ( class_exists( __NAMESPACE__ . '\\CDN' ) ) { 2898 $restored = CDN::get_instance()->optimize_full_page_html( $restored ); 2899 } 2900 2899 2901 return $restored; 2900 2902 } … … 3161 3163 $css = str_replace( $placeholder, $replacement, $css ); 3162 3164 } 3165 3166 $css = $this->maybe_inject_font_display_swap( $css ); 3163 3167 3164 3168 return ( '' === trim( $css ) ) ? $original : trim( $css ); -
fastlayer/trunk/includes/class-page-cache.php
r3783106 r3783146 1360 1360 if ( ! is_dir( $this->cache_dir ) ) { 1361 1361 $this->purge_third_party_host_caches(); 1362 if ( $this->is_preload_enabled() ) { 1363 $this->release_preload_lock(); 1364 $this->release_preload_batch_lock(); 1365 $this->preload_cache( 'clear_all_cache' ); 1366 $this->spawn_async_preload_worker(); 1367 } 1362 1368 return; 1363 1369 } … … 1371 1377 1372 1378 $this->purge_third_party_host_caches(); 1379 1380 if ( $this->is_preload_enabled() ) { 1381 $this->release_preload_lock(); 1382 $this->release_preload_batch_lock(); 1383 $this->preload_cache( 'clear_all_cache' ); 1384 $this->spawn_async_preload_worker(); 1385 } 1373 1386 } 1374 1387 … … 2384 2397 // preload discovery. The marker is reserved for the sitemap reads, 2385 2398 // which must leave nothing behind in the cache. 2386 'headers' => array( 'Accept' => 'text/html,application/xhtml+xml ;q=0.9,*/*;q=0.8' ),2399 'headers' => array( 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' ), 2387 2400 ) 2388 2401 ); -
fastlayer/trunk/includes/class-webp.php
r3783106 r3783146 3037 3037 } 3038 3038 3039 public function get_webp_url_for_image_url( $url ) { 3040 if ( ! $this->is_enabled() || ! $this->is_image_delivery_enabled() ) { 3041 return false; 3042 } 3043 3044 return $this->ensure_webp_for_url( $url ); 3045 } 3046 3039 3047 private function extract_attribute_value( $html, $attribute ) { 3040 3048 $pattern = '/\b' . preg_quote( $attribute, '/' ) . '\s*=\s*("|\')(.*?)\1/i'; -
fastlayer/trunk/readme.txt
r3781439 r3783146 4 4 Requires at least: 6.0 5 5 Tested up to: 7.1 6 Stable tag: 1.5. 36 Stable tag: 1.5.4 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 276 276 277 277 == Changelog == 278 279 = 1.5.4 = 280 * Performance: overhauled CSS combine engine to safely bundle theme and builder stylesheets containing pseudo-elements and inline extras into unified cached bundles, eliminating up to 15+ render-blocking HTTP requests. 281 * New: Smart LCP Hero Background detector for WPBakery Page Builder and top hero containers, automatically injecting high-priority preload hints (`<link rel="preload" as="image" fetchpriority="high">`) directly into the document `<head>`. 282 * Enhancement: automatic `font-display: swap` enforcement on all external minified and combined stylesheets to eliminate webfont render-blocking delays. 283 * Enhancement: updated autonomous cache preloader with modern `Accept: image/webp` headers to ensure WebP variants are warmed for upstream CDN and reverse-proxy caches. 284 * New: automatic cache warming restart on cache purge/clear — whenever cache is cleared from the admin bar, settings, or dashboard, the background preloader immediately resumes warming all discovered public pages. 278 285 279 286 = 1.5.3 = … … 360 367 == Upgrade Notice == 361 368 369 = 1.5.4 = 370 Major Core Web Vitals update: unblocks CSS combination across themes, adds automatic WPBakery hero background LCP preloading with WebP delivery, and enforces font-display swap on all external stylesheets. 371 362 372 = 1.5.3 = 363 373 Critical bugfix release: resolves HTTPS mixed content blocking on reverse proxies, repairs relative stylesheet url() rebasing, adds automatic background cache warming, and introduces table pagination. -
fastlayer/trunk/wp-fastlayer.php
r3781439 r3783146 4 4 * Plugin URI: https://github.com/kanhajatthap/WP-FastLayer 5 5 * Description: High-performance WordPress caching and optimization plugin. 6 * Version: 1.5. 36 * Version: 1.5.4 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 19 19 } 20 20 21 define( 'FASTLAYER_VERSION', '1.5. 3' );21 define( 'FASTLAYER_VERSION', '1.5.4' ); 22 22 define( 'FASTLAYER_FILE', __FILE__ ); 23 23 define( 'FASTLAYER_PATH', plugin_dir_path( __FILE__ ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)