Synced Pattern Popups helps you create popups using the WordPress editor you already know, not yet another builder.
Developer-focused docs for the Synced Pattern Popups WordPress plugin.
This plugin lets you open a lightweight modal popup whose content comes from a WordPress Synced Pattern (wp_block), using simple triggers like spp-trigger-{id}.
Synced Patterns are reusable block layouts stored as wp_block posts. You can create them once and reuse them across your site. When you edit a synced pattern, every place it’s used updates automatically.
This plugin surfaces synced patterns with a dedicated admin screen at Appearance → Synced Patterns, where you can:
- Find pattern IDs at a glance
- Copy trigger snippets
- Edit/delete patterns
- Clear cached popup output per-pattern
These images live in .wordpress-org/ for WordPress.org assets.
- You create popup content as a Synced Pattern (a
wp_blockpost). - You place a trigger in content (
class="spp-trigger-{id}"orhref="#spp-trigger-{id}"). - When triggered, the plugin fetches the pattern content via AJAX and renders it in a modal.
- The plugin collects and injects required block styles so the pattern renders correctly inside the modal.
- Rendered output is cached (transients + object cache when available) and invalidated when patterns change.
- Class trigger:
spp-trigger-{id} - Href trigger:
#spp-trigger-{id}(useful in the Block Editor)
Use spp-trigger-{id}-{width} where width is in pixels (100-5000).
Trigger TLDR generation with spp-trigger-tldr (class) or #spp-trigger-tldr (href).
The plugin is intentionally “no build” (vanilla JS/CSS, no bundler). Key responsibilities are split into small services:
SPPopups_Plugin: front-end bootstrapping, asset enqueueing, modal output, cache invalidation hooksSPPopups_Ajax: AJAX endpoints (pattern render + TLDR), nonce + rate limitingSPPopups_Pattern: retrieves and renders synced patternsSPPopups_Asset_Collector: collects styles/scripts needed by rendered blocks so the modal looks correctSPPopups_Cache: transient/object-cache wrapper for rendered pattern outputSPPopups_Admin: Appearance → Synced Patterns screen (tabs, list table, actions)SPPopups_Settings: TLDR settings UI and AI Experiments dependency checksSPPopups_TLDR: prompt composition, AI client call, TLDR cachingSPPopups_Abilities: Abilities API registration (WordPress 6.9+)
Common extension points you can use from a theme or plugin:
add_filter( 'sppopups_cache_ttl', function ( $ttl ) {
return 6 * HOUR_IN_SECONDS;
} );Useful when triggers are injected dynamically (AJAX/page builders/forms).
add_filter( 'sppopups_force_assets', function ( $force, $post_id ) {
if ( 123 === (int) $post_id ) {
return true;
}
return $force;
}, 10, 2 );TLDR requires the AI Experiments plugin (ai/ai.php) to be installed/active and configured with credentials. The plugin provides a guided checklist UI in the TLDR tab.
If the WordPress Abilities API is available, the plugin registers abilities (e.g. render popup content programmatically).
Example:
$result = wp_execute_ability(
'sppopups/render-popup',
array(
'pattern_id' => 123,
)
);If the Abilities API isn’t available, the plugin skips registration without error.
- Text domain:
synced-pattern-popups - Translation templates live in
languages/.
Generate/update the POT file with WP-CLI:
wp i18n make-pot . languages/synced-pattern-popups.potNo build step required.
- Copy/clone into
wp-content/plugins/synced-pattern-popups/ - Activate in wp-admin
- Create a synced pattern and add a trigger to any post/page
Relevant files:
includes/- PHPassets/js/modal.js- front-end behaviorassets/js/admin.js- admin UI behaviorassets/css/modal.css/assets/css/admin.css- styling
Before pushing to GitHub, run tests locally to catch issues early:
.\test.ps1.\test.ps1 -PHPOnly.\test.ps1 -JSOnlyPHP Tests:
composer install
php vendor/bin/phpunitJavaScript Tests:
npm install
npm run test:jsThe test script automatically installs dependencies if needed and provides clear pass/fail feedback.
- WordPress.org support forum: https://wordpress.org/support/plugin/synced-pattern-popups/


