Download the PHP package parisek/timber-kit without Composer

On this page you can find all versions of the php package parisek/timber-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package timber-kit

timber-kit

WordPress/Timber starter kit — configurable base class, ACF helpers, image resizer, dev media proxy, WPForms config bridge, ACF block renderer, WPML Copy-field override.

Installation

What's Included

StarterBase

Extends Timber\Site with dozens of configurable properties. Handles theme setup, Twig extensions, security hardening, Gutenberg blocks, media processing, and admin cleanup — all opt-in via boolean flags.

Helpers

Static methods for formatting ACF data into clean arrays for Twig templates:

Resizer

Image resizing via Spatie/Image. AVIF output, responsive variants with breakpoints, crop positions, and cache management. Exposed as a single polymorphic Twig filter, |resizer, that detects its argument shape and routes to one of two underlying methods.

Tuples mode (positional, variadic)

Caller passes the variant tuples directly, in order. Each tuple is [width, height, media-min-width, image_style, quality?] — same shape Resizer::resizer() consumes:

Orientation-aware mode (single map arg)

When the single argument is an associative array carrying at least one of landscape / portrait / square keys, the filter classifies the source image's aspect (±10 % tolerance band around 1:1, overridable via the timber_kit_resizer_aspect_tolerance WP filter) and dispatches the matching tuple set to the standard resize pipeline:

Lets templates drop the inline image.width >= image.height branch.

Fallbacks. Missing-metadata / non-numeric / zero-dimension sources classify as landscape (preserves the historical wide-crop default for legacy assets). When the matched bucket has no tuples (empty array or absent key), the helper falls through to the landscape bucket; if that's also empty / absent, the source passes through unchanged rather than crashing with an empty <picture>.

Detection (how the two shapes coexist). The dispatch lives in Resizer::isOrientationMap(): a single arg that's an associative array with at least one recognised key flips into orientation mode. Tuples have integer keys (width / height / media / image_style / quality), so the two shapes can't realistically collide. PHP callers wanting the bucket without the resize step can call Resizer::classifyAspect() directly.

DevMediaProxy

Development-only media proxy for projects that do not keep wp-content/uploads synchronized locally. When TIMBERKIT_MEDIA_ORIGIN is configured, missing local media URLs are rewritten to the upstream origin for common WordPress media surfaces and Media Library payloads.

It also integrates with Resizer through the timber_kit_resizer_missing_source_variants filter, so missing local source images can fall back to already-generated remote variants before returning the original image URL.

WPFormsConfigBridge

Bridges wp-config.php constants to entries of the wpforms_settings option, so per-environment values such as Cloudflare Turnstile test keys can be stored in environment config rather than the WordPress database.

A setting key turnstile-site-key is overridden by a constant WPFORMS_TURNSTILE_SITE_KEY (hyphens become underscores, the whole name uppercased). The bridge is activated automatically by StarterBase when WPForms is loaded.

BlockRenderer

Render callback for ACF Gutenberg blocks defined via block.json. Migrated from per-theme functions.php so projects derived from portadesign/wordpress-base carry one versioned source of truth instead of duplicating ~140 lines per theme.

Wire as block.json renderCallback:

Or call from a wrapper in your theme's functions.php for backwards-compatible block.json files:

What it does:

The class is final with three public static methods: render(), isInserterPreview(), flushPostBlockCache().

Filters

Package-level filters (stable across versions, prefixed timber_kit/):

Filter Args Purpose
timber_kit/block_renderer/cache_key (string $key, array $cache_data, string $block_name) Override the cache key composition (e.g. add user role / segment to the variation vectors). Default: 'acf_block_' . md5(wp_json_encode($cache_data)) with $cache_data = [name, data, anchor, className, post_id, lang, paged].
timber_kit/block_renderer/use_cache (bool $enabled, string $block_name, array $attributes) Override the cache-enabled decision per block. Default: true when the block has no registered block_<name>_content filter and the site uses an external object cache with flush_group support.
timber_kit/block_renderer/content_data (?array $content_data, int|string $post_id, bool $is_preview, array $attributes) Override the content data ACF would have hydrated. Return a non-null array to short-circuit Helpers::formatFields() — useful for tests, storybook-style block fixtures, or projects that don't use ACF. Returning null (default) preserves the ACF code path.
timber_kit/block_renderer/context (array $context, string $block_name, bool $is_preview) Last-chance Twig context modification before Timber::compile() runs.
timber_kit/block_renderer/empty_alert_html (string $html, string $block_name, array $attributes) Replace the empty-block warning HTML entirely. Themes can return their own Twig render here (see migration example below).

Per-block legacy filters (preserved from the original timber_block_render_callback for backwards compatibility — <slug> is the block name with acf/ stripped and dashes converted to underscores, e.g. acf/article-featuredarticle_featured):

Filter Args Purpose
block_<slug>_content (array $content_data) Per-block content transform (legacy hook preserved for backwards compatibility). Skipped during inserter-library previews so example data isn't enriched with derived values that would distort thumbnails.
block_<slug>_template (string $template_path, array $content_data) Per-block template path override (legacy hook). Runs in all modes including inserter previews. Default path: @component/<slug>/<slug>.twig.

Twig template

empty-alert.twig is shipped under the @timber-kit/ Twig namespace, registered automatically by StarterBase at priority 20 (so theme paths under the same namespace take precedence). It uses Gutenberg's .block-editor-warning classes for native editor styling and exposes a stable .timber-kit-block-empty class + data-block attribute for theme overrides.

Cache invalidation

BlockRenderer::flushPostBlockCache($post_id) is the handler StarterBase wires to acf/save_post at priority 20. When ACF saves a post, the cache group acf_block_{$post_id} is flushed — invalidating exactly the cached blocks tied to that post without touching others. The handler guards against non-numeric ids (ACF options-page strings, opaque block_* ids) and against environments without wp_cache_supports('flush_group').

Site Health board

Opt-in check-list of Porta recommended settings surfaced in Tools → Site Health ($site_health flag, default false). Read-only by design: the board verifies the real, effective state of each recommendation — it never writes anything, has no options page, and its "Actions" hints point to code fixes. The expected state lives versioned in code; Site Health only reports drift.

Each check declares its verification method: effect (probe the real outcome, plugin-agnostic — survives plugin swaps), config (read stored config when there is no observable effect), or both. Seed set (security): XML-RPC disabled, WP version hidden, author sitemap disabled, file editing disabled, REST users endpoint restricted (anonymous loopback probe).

Customize in the project Base class — conscious exceptions stay visible in code review:

The timber_kit_health_checks filter runs after the override for mu-plugin / per-environment tweaks. Custom checks implement Health\HealthCheck (id, label, category, method, run(): Result) and return Result::good() / Result::recommended() / Result::critical().

utf8mb4 charset audit + conversion

The utf8mb4_tables check (category database) audits every prefix-scoped table via information_schema: non-utf8mb4 tables (plugin tables keep their install-time charset forever), column-collation overrides, and mixed utf8mb4 collations — the classic source of Illegal mix of collations errors and silent ? degradation of 4-byte characters (emoji, some CJK).

Remediation is a separate, explicit WP-CLI command that never converts implicitly--apply requires selecting concrete tables:

The target collation is the dominant utf8mb4 collation already present in the database (majority vote, tie-break toward core tables; --collate= overrides). Tables with COMPACT/REDUNDANT row formats and long indexed columns are flagged (767-byte index-prefix limit) and require --force.

WpmlBlockOverride

Runtime override of Copy field values in ACF Gutenberg blocks for WPML-multilingual sites. Hooks render_block_data at priority 20 (after WPML's own handlers) and, for ACF blocks rendered in a non-default language, overwrites attrs.data.<field> for fields marked wpml_cf_preferences = 1 (Copy) with the source-language post's value. Attachment IDs (image / file / gallery) are remapped to per-language duplicates via wpml_object_id.

Solves the long-standing WPML problem where changing a Copy field (typically an image) in the source language never propagates to translated post_content without a manual ATE re-job. ACF configuration becomes the single source of truth for Copy fields — no DB writes, no admin UI, no drift.

Enable it with the $wpml_block_override flag on your Base extends StarterBase — opt-in (default off) because it changes rendered output. Set it before parent::__construct():

StarterBase then hooks WpmlBlockOverride::register() on init when the flag is on. register() self-guards on WPML + ACF Pro, so it no-ops where they're absent. If you don't extend StarterBase, call it yourself:

Requirements (verified at register()):

What it does

Filters

Filter Args Purpose
timber_kit/wpml_block_override/should_override (bool $default, array $block, string $current_lang, string $default_lang) Per-block veto. Default true after non-ACF / admin / REST / default-language guards have passed.
timber_kit/wpml_block_override/copy_fields (array $copy_fields, string $block_name) Extend or trim the Copy-field discovery for a block. $block_name is the short name (no acf/ prefix). $copy_fields shape: [ ['field' => array, 'path' => array<int, array{name,type}>], … ].

Note the two filters receive the block name differently: should_override gets the full parsed block ($block['blockName'] is acf/foo), while copy_fields gets the short name (foo).

should_override and duplicate blocks. The veto runs before positional pairing, so it must be deterministic per block name, not per instance. If a page has 2+ blocks of the same name and you veto only some instances, the surviving ones' ordinals shift and pair with the wrong source block (silently applying a sibling's Copy value). Decide per block type, as the examples below do — never per individual occurrence.

Disabling / opting out

Per project — the simplest opt-out is to not call register() from the theme. To force it off at runtime even where register() already ran (e.g. a shared bootstrap), veto every block:

Per block — skip specific block types via should_override (full acf/ name here):

Per field — keep the block syncing but drop one field from the Copy set via copy_fields (short block name here; the returned list is re-normalized, so re-indexing isn't required):

Not supported (this iteration)

Known limitations

Stale cache on programmatic field registration. Cache invalidation hooks (acf/update_field_group + save_post_acf-field-group) do not fire for programmatic field registration via acf_add_local_field_group(). Code-only changes to wpml_cf_preferences will serve stale cache for up to 24 hours on production. Under WP_DEBUG the persistent transient is bypassed entirely so dev iteration is unaffected. Production workaround: wp transient delete timber_kit_wpml_copy_fields_index in the deploy script, or include a theme-version constant in the cache key.

Reordered duplicate blocks / rows. Both same-named blocks and a repeater's rows within a matched block are paired by position, relying on source and translation sharing the same order and count. Add/remove is guarded at both levels — if the counts of a block name differ, that name is skipped; if a repeater's row count differs between source and translation, that nested field is skipped (no-op). The one unguarded case is an equal-count manual swap: a translation edited independently (not through ATE, which rebuilds from the source and preserves order) where two same-named blocks — or two rows of the same repeater — are reordered without changing the count. Positional matching would then apply one instance's Copy value to the other. There is no stable per-instance id in post_content to detect this, and the blast radius is bounded — a Copy value from a sibling of the same type, read-time only (no DB writes). If you reorder duplicate blocks or rows in a translation independently, re-run it through the WPML translation editor to restore source order.

ACFML preference sync

WPML packs custom fields into translation jobs by exact meta-key lookup against one global dictionary (custom_fields_translation in icl_sitepress_settings). ACFML fills that dictionary only event-driven — on admin field-group save (never fires for JSON-only groups) or on value save through the ACF pipeline (the only producer of indexed keys like blocks_0_items_1_title). ACF meta written programmatically (importers, WPML post duplication, direct update_post_meta()) therefore never gets dictionary entries and is silently excluded from translation jobs, even when every field declares a correct wpml_cf_preferences in its JSON definition.

wp timber-kit acfml-sync-preferences reconciles the dictionary with the code-defined truth: it walks existing postmeta, resolves each key's field definition via the _<key> field-key companion, and registers the exact key with the definition's preference — the same result a manual admin re-save of every post would produce. Intended as a deploy step after wp timber-kit updates.

Dry-run by default; idempotent (a second run writes nothing); patch-only merge (never rebuilds or prunes the dictionary, existing _<key> companion entries are never overwritten). Keys resolving to different preferences across posts are reported as conflicts and skipped — never guessed. Scope is postmeta of the current site; on multisite run per-site via wp --url=….

Applying newly-translatable keys triggers WPML's ProcessNewTranslatableFields background task — affected translations get flagged as needing update, which is the point: translators see the previously invisible backlog.

Usage

Create a Base class in your theme that extends StarterBase:

Configuration

Override these properties in your child constructor before calling parent::__construct():

Internationalisation

timber-kit treats configurable labels and titles (e.g. $breadcrumb_labels, $options_pages[*]['page_title']) as plain values used verbatim — it never wraps them in __(). Translating them is the consuming theme's responsibility.

Why not in the library: these are assigned in the child __construct() (before parent::__construct()), which runs on setup_themebefore init and before the text domain is loaded. Calling __() there is too early: it returns the string untranslated, and WordPress 6.7+ raises a "Translation loading triggered too early" _doing_it_wrong notice. Wrapping a dynamic config value in __() at use time also defeats string extraction — xgettext/makepot can't read a variable.

Localise at init, with static string literals. Where a config surface has a dedicated setup hook, override it — e.g. setup_breadcrumb_labels() (hooked to init):

For an admin label without a dedicated setup hook (e.g. an options-page page_title), set the value to your already-localised string, or leave the English default.

Theme

Property Type Default Description
$menus array [] Registered navigation menus
$font_stylesheets array [] CSS files to enqueue on the frontend. Also forwarded into the Gutenberg editor canvas (both iframed and non-iframed) via block_editor_settings_all, so custom @font-face declarations render in the editor without falling back to system fonts. Relative paths are resolved under static/ and cache-busted with filemtime; absolute URLs pass through
$theme_script_strategy string 'module' How static/dist/js/script.js is enqueued: 'module'wp_enqueue_script_module() (Vite/ESM); 'defer' → classic deferred wp_enqueue_script() for a webpack IIFE bundle. Override enqueueThemeScript() for finer control
$preload_fonts array [] Font files to preload
$search_post_types array ['post'] Post types for search
$article_post_types array ['post'] Post types treated as articles
$block_category array ['slug' => 'custom', 'title' => 'Custom'] Custom block category
$favicon_path string 'images/touch/favicon.svg' Favicon path
$context_privacy_policy bool false Opt-in: populate the site's privacy-policy URL (get_privacy_policy_url()) into the Timber context under $privacy_policy_context_key. Off by default — the key typically drives a cookie-consent partial, which must not appear on projects that ship without one
$privacy_policy_context_key string 'ccnstL' Context key for the privacy-policy URL. The default is deliberately non-semantic so cookie-consent markup keyed off it stays invisible to ad-block heuristics

Security & Cleanup

Property Type Default Description
$cleanup_wp_head bool true Remove unnecessary wp_head output
$disable_xmlrpc bool true Disable XML-RPC
$disable_emojis bool true Remove emoji scripts/styles
$disable_feeds bool true Disable RSS feeds
$disable_comments bool true Disable comments site-wide: removes comments/trackbacks support from every registered post type (including those registered later via registered_post_type); closes comments_open/pings_open; redirects the Edit Comments admin page and Discussion Settings to the dashboard; unregisters the WP_Widget_Recent_Comments sidebar widget; removes /wp/v2/comments REST routes; rejects REST comment insertion with 403 even if a route is re-registered; removes comment + pingback XML-RPC methods; drops the X-Pingback header; and forces default_comment_status/default_ping_status to closed. Removal of the admin-bar comments node and the dashboard_recent_comments admin widget is controlled separately by $cleanup_admin_bar and $cleanup_dashboard.
$disable_search bool true Disable search
$cleanup_dashboard bool true Remove dashboard widgets
$cleanup_admin_bar bool true Clean up admin bar
$editor_role_enhancements bool true Enhanced editor role caps
$disable_self_pingbacks bool true Disable self-pingbacks
$restrict_rest_users bool true Protect REST API users endpoint
$disable_application_passwords bool true Disable WordPress application passwords so the application-passwords REST endpoint cannot issue long-lived API credentials
$block_author_enumeration bool true Turn numeric ?author=N requests into a 404 on template_redirect (before redirect_canonical), so the /?author=1/author/{username}/ username-disclosure attack is blocked. Path-based /author/{slug}/ URLs, admin author filters, and alphanumeric slugs are left alone
$disable_file_editing bool true Define DISALLOW_FILE_EDIT so the Theme Editor and Plugin Editor screens are removed from wp-admin
$remove_wp_generator bool true Strip the WordPress version from the the_generator filter (covers both <meta name="generator"> and RSS/Atom feed generators)

Media Processing

Property Type Default Description
$clean_image_filenames bool true Sanitize uploaded filenames
$big_image_size_threshold int 2560 Max image dimension (px) for uploads. Drives WordPress core's native big_image_size_threshold filter — images whose longer edge exceeds it are downscaled by core on upload and served as a -scaled derivative. 0 disables scaling entirely. This is the single canonical knob.
$max_upload_width ?int null Deprecated — use $big_image_size_threshold. Honoured only when non-null; the larger of width/height becomes the (square) threshold (explicit 0 disables, preserving the legacy contract).
$max_upload_height ?int null Deprecated — use $big_image_size_threshold.

Why a single dimension, not width × height? WordPress core's big_image_size_threshold is one number — it caps the longer edge and fits the image inside a square box (resize($n, $n)), exactly as the old in-theme resize did. Mirroring it with one property keeps the kit honest and lets downscaling run through core's pipeline, which (unlike the previous wp_handle_upload hook) doesn't fight core's own 2560 cap and covers every upload path (REST, WP-CLI, programmatic), not just the media library. The filter is registered unconditionally and is authoritative — timber-kit owns the threshold across the fleet, overriding any other plugin's big_image_size_threshold filter. The deprecated width/height pair is read for backward compatibility (larger edge wins) until removed in 2.0.

Reclaiming disk space from preserved originals

When core downscales an upload it keeps the full-resolution original on disk (the original_image / "Restore original image" mechanism). timber-kit deliberately does not delete it on upload: WordPress regenerates every thumbnail sub-size from the original (for best quality), so deleting it on upload would silently degrade any later regeneration — a new crop size, retina variant, or wp media regenerate — to double-compressed output sourced from the -scaled file.

Instead, reclaim space with a deliberate, opt-in sweep once the redesign window (when new crop sizes are likely added) has passed:

The command only prunes genuine size-driven -scaled downscales — it leaves originals preserved for EXIF rotation or format conversion untouched, and never strips the original_image pointer unless the file was actually deleted. The trade-off it makes permanent: future regeneration of those images falls back to the -scaled file. See \Parisek\TimberKit\OriginalImagePruner.

Dev Media Proxy

Off by default. Enable it by pointing it at an upstream origin's uploads URL, via either an environment variable or a PHP constant:

Behavior:

Configuration source & safety:

See ADR 0003 for the design rationale.

Available hooks:

WPForms Config Bridge

Define overrides in wp-config.php:

Bridged keys:

The Cloudflare always-pass test sitekey/secret pair above (1x000…AA / 1x000…AA) is recommended for staging/CI to avoid headless detection blocking the challenge widget.

When any override is active, an admin notice on WPForms admin screens lists which setting keys are read from wp-config.php, so values saved through the WP admin do not silently disappear at runtime without explanation.

Gutenberg

Property Type Default Description
$gutenberg_align_wide bool true Enable wide/full alignment
$gutenberg_responsive_embeds bool true Responsive video embeds
$gutenberg_editor_styles bool true Load editor stylesheet
$gutenberg_disable_core_patterns bool true Remove core block patterns
$restrict_allowed_blocks bool true Restrict the editor to $allowed_core_blocks + ACF blocks via allowed_block_types_all. Set false on sites whose existing content pre-dates the allowlist — the filter is then not wired at all, so no no-op allowed_block_types_all() override is needed
$render_block_passthrough_blocks string[] [] Block names render_block() returns unchanged, bypassing the core-block wrapper. Exact names ('wpforms/form-selector'), namespace wildcards ('wpforms/*'), or '*' to disable wrapping entirely. Escape hatch for third-party form/gallery blocks the wrapper would break
$admin_resizable_sidebar bool false Opt-in resizable Gutenberg editor sidebar. Default off — the JS/CSS ship inside the package and are served from its vendor/ dir, which the standard theme .htaccess denies, so enabling it also requires an .htaccess allow rule (see below). Set true to enable

Enabling $admin_resizable_sidebar.htaccess requirement. The sidebar's JS/CSS are served from the package's vendor/ directory (vendor/parisek/timber-kit/assets/…) via packageAssetUrl(). The standard theme .htaccess blanket-denies vendor/ for security (RewriteRule ^vendor/(.*)?$ / [F,L]), so the browser would get 403 for those assets. When you set $admin_resizable_sidebar = true, also allow static assets under vendor/ in the project's theme .htaccess, before the blanket deny:

PHP / source / config under vendor/ stay forbidden. Projects scaffolded from wordpress-base (current starter_theme) already ship this allow rule.

Options Pages

$options_pages declares the ACF options page(s). Each entry requires menu_slug + page_title; optional per-entry keys are parent_slug (sub-page), capability (default edit_posts), icon_url (top-level pages only, default dashicons-admin-generic), and admin_bar (bool, default off — add an admin-bar shortcut to this page; any number of entries may carry this key, including sub-pages).

Property Type Default Description
$options_pages array one "Theme Settings" page List of ACF options pages. parent_slug => sub-page; admin_bar => true => add admin-bar link for this entry; [] disables the feature entirely (no page, no admin-bar link). The default "Theme Settings" entry has admin_bar => true

Breadcrumbs

Breadcrumb data ($context['breadcrumb']) is auto-populated by StarterBase::timber_context() from the properties below — projects only override these to customise behaviour. A legacy compatibility guard (class_exists('\Breadcrumb', false)) skips auto-populate when a project still ships the pre-1.7 global \Breadcrumb class.

Property Type Default Description
$breadcrumb_labels array<string, string> ['home' => 'Home', '404' => 'Page not found', 'search' => 'Search: %s', 'pagination' => 'Page %d', 'author' => 'Author: %s'] Pre-translated labels for typed items. Defaults are English raw strings — override via setup_breadcrumb_labels() (not __construct()), see below.
$breadcrumb_menu_name string 'main-menu' Nav-menu location slug for the menu-trail strategy (by_menu_trail). Set to a different menu's location slug if breadcrumbs should follow a non-main navigation.
$breadcrumb_list_page_map array<string, string> [] Post type → ACF option key for "listing page" injection between Home and a single post of that type. Example: ['post' => 'article_list'] injects links.article_list (from the ACF Global Options Page) as the parent crumb on every single post.
$breadcrumb_menu_trail_post_types ?array null Post types eligible for menu-trail. null = auto-detect via is_post_type_hierarchical(). Pass an explicit list to opt-in / opt-out specific CPTs regardless of hierarchy.
$breadcrumb_include_pagination bool false Append a "Page N" item on paginated archive views. Off by default — opt in per project.
$autopopulate_breadcrumb bool true Auto-populate $context['breadcrumb']. Set false if the theme builds breadcrumbs itself

Localising labels — override setup_breadcrumb_labels(), not __construct()

Calling _x() from Base::__construct() to populate $breadcrumb_labels triggers WordPress 6.7+'s _load_textdomain_just_in_time notice — the constructor runs before init, but the theme's textdomain has not loaded yet. StarterBase registers setup_breadcrumb_labels() on init (priority 1) as the project-side hook for translated labels:

$this->theme_name in both _x() slots is intentional — it doubles as the translation context and the textdomain, so a single project identifier scopes everything. Substitute the source strings with the project's locale (Czech, German, …) and the WPML / Polylang stack picks the right translation at render time.

Projects that don't need translated labels (single-locale English sites) can skip the override entirely — the English defaults declared on $breadcrumb_labels apply unchanged.

Performance

Replaces the standalone Speculation Rules plugin. After upgrading, downstream projects can wp plugin deactivate speculation-rules && wp plugin delete speculation-rules — the same prerender / moderate / logged-out behaviour ships from the theme.

Property Type Default Description
$speculation_rules ?array ['mode' => 'prerender', 'eagerness' => 'moderate', 'authentication' => 'logged_out'] Hooks configure_speculation_rules() onto the WP 6.8+ wp_speculation_rules_configuration filter. Defaults mirror the standalone plugin's defaults — faster than WP core's prefetch / conservative, with rules emitted only for logged-out visitors so editors browsing the frontend from wp-admin don't trigger prerender-driven double-fires of GA / GTM / Productive page-views. Override individual keys per project (e.g. drop to prefetch if Consent Mode v2 is configured for imperative tracking), or set the whole property to null to fall back to WP core defaults (no override, no auth gate).
$warn_speculation_rules_plugin_redundant bool true Registers a Site Health test (Tools > Site Healthtimber_kit_speculation_rules_redundant). Returns status: 'good' when the standalone plugin is inactive; returns status: 'recommended' with a "Manage plugin" link when both code paths are running and would duplicate the wp_speculation_rules_configuration filter. Passive signal only — no admin-notice banner, no auto-deactivation.

The companion wp_speculation_rules_href_exclude_paths filter is intentionally not wrapped — WP 6.8+ core already excludes /wp-login.php, /wp-admin/*, query-string action URLs, etc., and the standalone plugin only re-emitted a legacy plsr_… filter for backwards compatibility. Downstream projects can still hook the WordPress core filter directly when a project-specific URL needs to be excluded.

Block renderer migration guide

If you're upgrading from a theme that carried timber_block_render_callback() inline in functions.php:

  1. Bump the Composer constraint to ^1.5:

  2. Replace the inline timber_block_render_callback() body with a wrapper:

    block.json files referencing the old function name keep working.

  3. Remove the freestanding add_action( 'acf/save_post', … 'acf_block_…' flush ) hook from functions.php — the package now owns it: StarterBase::__construct() wires BlockRenderer::flushPostBlockCache() to acf/save_post at priority 20.

  4. (Optional) If you want to keep your existing Tailwind alert template for the empty-block warning, register an override:

    Without this filter the package renders its own Twig template (@timber-kit/empty-alert.twig) using Gutenberg's native .block-editor-warning classes — no theme styling required.

Testing

The property suite (tests/Property/, powered by giorgiosironi/eris) targets pure functions only and runs under its own phpunit.property.xml config to stay isolated from Brain\Monkey's Patchwork hooks. CI pins ERIS_SEED to the Actions run ID — reproduce a failing build locally with ERIS_SEED=<run-id> composer test:property.

Releasing

Releases are automated through two GitHub Actions workflows:

Per-PR conventions

Add entries under ## [Unreleased] in CHANGELOG.md with Keep a Changelog categories (### Added, ### Changed, ### Deprecated, ### Removed, ### Fixed, ### Security). Squash-merge PRs into main so the merge commit subject ends with (#N) — the auto-release workflow uses that to assemble the Pull Requests section.

Distribution scope

.gitattributes marks CHANGELOG.md, tests/, .github/, .ddev/, phpunit.xml, phpstan.neon, and other dev-only files as export-ignore, so composer require parisek/timber-kit only pulls src/, composer.json, LICENSE, and README.md into the consumer's vendor/ tree. No Composer-side archive.exclude config is needed — .gitattributes covers both composer archive and GitHub source-zip downloads.

License

GPL-3.0-or-later


All versions of timber-kit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-gd Version *
parisek/twig-attribute Version ^1.0
parisek/twig-common Version ^1.0
parisek/twig-typography Version ^1.0
spatie/image Version ^3.8
symfony/twig-bridge Version ^5.4 || ^6.2 || ^7.0
symfony/var-dumper Version ^5.4 || ^6.2 || ^7.0
timber/timber Version ^2.0
twig/string-extra Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package parisek/timber-kit contains the following files

Loading the files please wait ...