跳到内容

Capo – Head Optimizer

v0.1.4

Rick Viscomi · 2026年8月19日 上架

Automatically reorders the HTML head of your WordPress pages for optimal browser rendering performance using the Capo.js methodology.

正在使用
30+
评分
暂无
累计下载
408
最近更新
2026年8月24日
需要 WordPress 6.0+已测试到 7.0.9PHP 7.4+

贡献者

截图

Capo reordering status visible in WordPress Site Health diagnostics.
Capo reordering status visible in WordPress Site Health diagnostics.
Debug performance metrics comment in HTML source code.
Debug performance metrics comment in HTML source code.

In standard WordPress sites, WordPress Core, themes, SEO plugins, analytics scripts, and third-party plugins inject elements into wp_head() in arbitrary order. This can lead to critical performance pitfalls:

  • Delayed Title Tag Rendering: SEO metadata and large JSON-LD blocks placed before <title>.
  • Delayed Resource Discovery: Preconnects, preloads, and async scripts pushed below dozens of CSS stylesheets.
  • Render-Blocking Bottlenecks: External synchronous scripts blocking CSS and parser execution.

Capo solves this automatically. By intercepting the page response via output buffering, Capo uses a deterministic, stable sorting algorithm to reorder <head> elements strictly according to browser critical rendering path priorities.

The Capo Head Priority Spectrum

Capo organizes elements into 11 strict priority tiers (Weight 10 down to 0):

  1. Weight 10 (Critical Meta & Viewport): <base>, <meta charset>, <meta name="viewport">, critical http-equiv headers (CSP, origin-trial, accept-ch).
  2. Weight 9 (Title): <title>.
  3. Weight 8 (Critical Resource Hints): <link rel="preconnect">, <link rel="preload" fetchpriority="high">, <link rel="modulepreload" fetchpriority="high">.
  4. Weight 7 (Async Script): <script src="..." async>.
  5. Weight 6 (CSS @import Styles): <style> blocks containing @import rules.
  6. Weight 5 (Sync / Inline Scripts): Synchronous/inline JavaScript (<script> without defer/async).
  7. Weight 4 (Stylesheets & Style Blocks): <link rel="stylesheet">, <style> blocks.
  8. Weight 3 (Standard Preload): <link rel="preload">, <link rel="modulepreload"> (without fetchpriority="high").
  9. Weight 2 (Defer Script): <script src="..." defer>, <script src="..." type="module">.
  10. Weight 1 (Prefetch / Prerender): <link rel="prefetch">, <link rel="dns-prefetch">, <link rel="prerender">, <script type="speculationrules">.
  11. Weight 0 (Other Metadata): OpenGraph, Twitter cards, Schema JSON-LD, RSS feeds, favicons, robots metadata.

Features

  • Zero Configuration: Activate the plugin and your <head> is immediately optimized.
  • Deterministic Stable Sort: Equal-weight elements retain their exact relative order, preserving CSS cascade specificity and JavaScript dependencies.
  • Full Cache Compatibility: Works seamlessly with WP Super Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache, and Cloudflare.
  • Safe HTML Tokenizer: Respects HTML comments, conditional comments (<!--[if ...]>), CDATA blocks, and inline script markup.
  • Site Health & Admin Diagnostics: Real-time <head> hygiene warnings and diagnostic status in Tools > Site Health and Admin Toolbar.
  • Testing & Bypass Mode: Append ?capo=off to any frontend URL to inspect the un-reordered head.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums