Linux 软件免费装
Banner图

Static Cache Wrangler

开发者 derickschaefer
更新时间 2026年1月8日 06:27
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

cache static site static site generator html export static site export

下载

2.0.7 2.1.2 2.1.4 2.1.0 2.0.6 2.1.1 2.1.3

详情介绍:

Static Cache Wrangler is a lightweight, low‑resource static site generator and HTML export engine for WordPress. It automatically creates self‑contained, URL‑agnostic static pages of your site — perfect for anyone who needs to preserve, distribute, or accelerate WordPress content. Originally developed as a command‑line tool for WP‑CLI, it has evolved into composable, zero‑impact tooling that supports administrators, developers, and site owners alike. Whether you're archiving a client project, deploying to a CDN, or creating a portable offline version that runs anywhere, Static Cache Wrangler delivers fast, CDN‑ready HTML output without complex setup. Technically, the plugin uses an asynchronous, lazy‑loading build mechanism that generates static pages as visitors browse your site. Over time, your entire site is exported as lightweight static HTML.\ Free companion plugin STCW Coverage Assistant adds real‑time build monitoring and manually triggered full‑site generation for any uncached pages. Unlike traditional static‑site plugins that require full crawls or database schema changes, Static Cache Wrangler is zero‑impact: Static Cache Wrangler turns WordPress into a fast, secure, and portable static‑site generator — with no database changes, no vendor lock‑in, and no maintenance overhead. Detailed Testing and Profiling: How It Works
  1. Enable static site generation using the toggle in the sidebar.
  2. As users browse your site normally, each page visit creates a static HTML file.
  3. Assets (CSS, JS, images, fonts) are automatically are queued and asyncronously downloaded and localized.
  4. Processing happens in the background and can be paused anytime.
  5. Use free companion plugin to monitor and accelerate cache creation STCW Coverage Assistant
  6. Download the complete static site as a ZIP file.
  7. Extract and open index.html in any browser — it works completely offline.
Key Features What's New in 2.1.2: 2.1.4 Version 2.1.4 adds STCW_META comment injection with WordPress post data (ID, post_type, permalink, dates, template) to support upcoming Headless Assistant companion plugin. What's Fixed in 2.1.3: 2.1.3 Version 2.1.3 fixes errantly cached files and directories related to index.php and admin in URLs. What's New in 2.1.2: 2.1.2 Version 2.1.2 introduces configuration details in addition to file locations on a key admin card. What's New in 2.1.1: 2.1.1 Version 2.1.1 introduces cache file timestamps, staleness checks, and adds sitemap creation to both the GUI and CLI zip file creation. What's New in 2.1.0: 2.1.0 Version 2.1.0 introduces static sitemap generation - a file system-based approach that creates sitemaps from your actual cached files rather than the WordPress database. This update enables true static sitemaps that work in exported sites without WordPress, PHP, or a database connection - perfect for deployments to S3, Netlify, GitHub Pages, or any static hosting platform. New WP-CLI Commands Why File System-Based? Traditional WordPress sitemap plugins (Yoast SEO, Rank Math) query the database dynamically. This works great for live sites, but fails for static exports because there's no PHP or database available. Static Cache Wrangler scans your actual cached index.html files to build the sitemap, ensuring: Sitemap Features Typical Workflow ``` wp scw enable # Enable generation Browse your site... wp scw process # Process assets wp scw sitemap # Generate sitemap (NEW!) wp scw zip # Export with sitemap included Deploy to S3/Netlify... ``` View in Browser Open https://your-site.com/sitemap.xml - the XSL stylesheet transforms it into a readable HTML table with color-coded priorities and sortable columns. Technical Implementation GUI Coming Soon This release is CLI-only to validate the approach and gather user feedback. A visual interface in WordPress admin is planned for version 2.2.0. Compatibility What's New in 2.0.7: 2.0.7 Version 2.0.7 is a major compatibility enhancement release, focused on improving support for Kadence Blocks and all Gutenberg block plugins that rely on dynamic JavaScript and CSS enqueues. This update improves the accuracy of static exports by capturing all front-end assets that WordPress prints dynamically—including those output by wp_print_scripts() and wp_print_footer_scripts()—ensuring that interactive block functionality is preserved outside of WordPress. Compatibility Improvements Technical Enhancements WP-CLI Commands Full control without the dashboard:

安装:

  1. Upload the plugin files to /wp-content/plugins/static-cache-wrangler/ or install via Plugins > Add New.
  2. Activate the plugin from the Plugins screen.
  3. Navigate to Settings → Static Cache to enable generation.
  4. Browse your site normally — pages are cached as they load.
  5. Click Download ZIP to export the complete static version.

屏幕截图:

  • Admin bar actions and stats
  • Background asset queue with progress indicator
  • Paused status with ability to resume

升级注意事项:

2.1.4 Adds WordPress metadata injection to cached HTML files for improved headless CMS migration support. Backward compatible. 2.0.6 Change all standard template variables to include the prefix stcw_ for WordPress.Org WordPress.NamingConventions.PrefixAllGlobals compliance. 2.0.5 Enhanced multisite support with isolated directories per site. Storage moved to wp-content/cache/stcw_static/ with unique namespace. Fully backward compatible for new installs. WordPress.org compliant. 2.0.4 Major compliance update. Plugin renamed to Static Cache Wrangler. Clear old plugin before installing. All prefixes changed from SCG to STCW. No data migration needed as plugin not yet published. 2.0.3 WordPress.org compliance. All prefixes changed to STCW (4+ characters). Clear and regenerate static files after update. WP-CLI commands unchanged. 2.0 Major rewrite with modern standards, WP_Filesystem support, and enhanced security. Recommended for all users.

常见问题:

Does it work with any theme or builder?

Yes — Static Cache Wrangler captures the final rendered HTML, so it works with any theme, builder, or framework (Elementor®, Divi®, Gutenberg®, etc.).

Does it use a lot of resources?

No — it's designed as a lazy loader, generating static pages only on demand with minimal memory and CPU impact.

Does it modify my database?

No — it never alters your WordPress database schema or adds tables.\ All plugin-related options, transients, and scheduled events are automatically removed upon uninstall.

Can I use the exported site on any server?

Absolutely. The output is plain HTML and assets — deploy it on any web server, CDN, or open it directly in a browser.

Does it handle dynamic content?

Dynamic features like forms, comments, or live feeds won't function in the static version, but all rendered content and assets are preserved exactly.

How do I update after making changes?

Revisit the updated pages while generation is enabled, or run wp scw process to rebuild all static content.

Can I customize the configuration?

Yes! You can customize file locations and behavior using constants in wp-config.php: Change static files location: define('STCW_STATIC_DIR', WP_CONTENT_DIR . '/my-static-files/'); Change assets location: define('STCW_ASSETS_DIR', WP_CONTENT_DIR . '/my-assets/'); Disable async asset processing (process immediately): define('STCW_ASYNC_ASSETS', false);

What if I need advanced customization?

You can use WordPress filters to customize behavior: Exclude specific URLs from generation: add_filter('stcw_should_generate', function($should, $url) { if (strpos($url, '/private/') !== false) { return false; } return $should; }, 10, 2); Modify HTML before saving: add_filter('stcw_before_save_html', function($html) { return str_replace('</body>', '<footer>Generated: ' . date('Y-m-d') . '</footer></body>', $html); });

What WordPress meta tags are removed in version 2.0.5?

Version 2.0.5 removes the following WordPress-specific meta tags from static HTML:

  • RSD (Really Simple Discovery) links for XML-RPC
  • Windows Live Writer manifest links
  • WordPress shortlink tags
  • Generator meta tags (WordPress version)
  • REST API discovery links
  • oEmbed discovery links
  • REST API HTTP headers
  • data-wp-strategy attributes on script tags These tags serve no purpose in static sites and removing them improves portability and security.

How do I use the new developer hooks?

Remove additional WordPress tags: add_action('stcw_remove_wp_head_tags', function() { remove_action('wp_head', 'your_custom_action'); }); Modify HTML before saving: add_filter('stcw_process_static_html', function($html) { // Add custom footer, remove tracking, etc. return $html; }); See the plugin documentation for 15+ complete examples.

Do I need to regenerate my static files after upgrading?

No, but it's recommended. Existing static files will continue to work, but regenerating will give you the cleanest output with all WordPress meta tags removed: wp scw clear wp scw enable Then browse your site to regenerate pages.

Can I create companion plugins for Static Cache Wrangler?

Yes! Version 2.0.5 introduces two hooks specifically designed for companion plugins:

  • stcw_remove_wp_head_tags - Remove additional WordPress tags
  • stcw_process_static_html - Modify final HTML output These enable agencies, developers, and SaaS providers to build specialized extensions without modifying core plugin code.

Will this work with my SEO plugin?

Yes! Version 2.0.5 is fully compatible with:

  • Yoast SEO
  • Rank Math
  • All in One SEO Pack
  • SEOPress
  • The SEO Framework The meta tag removal only affects WordPress core tags, not SEO plugin meta tags that contain important information.

更新日志:

2.1.4 2.1.3 2.1.2 2.1.1 Version 2.1.1 introduces intelligent cache freshness management that dramatically reduces server load by avoiding unnecessary page regeneration. Every generated HTML file now includes a metadata stamp tracking when it was created and which plugin version generated it. How It Works: ```php // In wp-config.php // Set cache lifetime (default: 86400 = 24 hours) define('STCW_CACHE_TTL', 86400); // 24 hours (default) define('STCW_CACHE_TTL', 3600); // 1 hour (aggressive) define('STCW_CACHE_TTL', 604800); // 1 week (conservative) define('STCW_CACHE_TTL', 0); // Never expire (version check only) // Set sitemap URL for deployment (default: uses site URL) define('STCW_SITEMAP_URL', 'https://static.example.com'); define('STCW_SITEMAP_URL', 'https://cdn.mysite.com'); ``` Automatic Sitemap in ZIP Exports: ZIP exports now automatically generate fresh sitemaps before packaging: Typical production behavior over 24-hour cycle: ``` [04-Dec-2025 11:21:57 UTC] TTL exceeded, marking stale: index.html (age: 121938s, ttl: 86400s) [04-Dec-2025 11:21:57 UTC] Cache stale, regenerating: index.html [04-Dec-2025 11:21:57 UTC] Successfully saved: index.html [04-Dec-2025 11:22:29 UTC] Cache fresh, skipping regeneration: index.html [04-Dec-2025 11:24:11 UTC] Cache fresh, skipping regeneration: index.html [04-Dec-2025 11:45:06 UTC] Cache fresh, skipping regeneration: index.html ... (50+ cache hits before next regeneration) ``` Migration Notes: Before v2.1.1: Every page request regenerated HTML even when nothing changed\ After v2.1.1: Only regenerate when content is actually stale (24h+ old or plugin upgraded) Result: Massive reduction in CPU usage, memory consumption, and page generation time for sites with moderate to high traffic. Use Cases: Development (1-hour TTL): php define('STCW_CACHE_TTL', 3600); // See changes within an hour Staging (6-hour TTL): php define('STCW_CACHE_TTL', 21600); // Balance freshness vs. performance Production (24-hour TTL - default): php // No configuration needed - 24 hours is sensible default High-availability failover (1-week TTL): php define('STCW_CACHE_TTL', 604800); // Very stable, rarely regenerate Archive/preservation (never expire): php define('STCW_CACHE_TTL', 0); // Only regenerate on plugin upgrades Technical Implementation: Staleness detection is highly optimized: The cache freshness system enables sophisticated workflows: = 2.1.0 = 2.1.0 Sitemap Features wp scw enable # Enable generation wp scw process # Process assets wp scw sitemap # Generate sitemap (NEW!) wp scw zip # Export with sitemap included View your sitemap at https://your-site.com/sitemap.xml - the XSL stylesheet transforms it into a readable HTML table. Technical Implementation = 2.0.7 = 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0 1.0