{"id":401877,"date":"2026-11-12T09:21:22","date_gmt":"2026-11-12T09:21:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/patterns-debug\/"},"modified":"2026-11-12T09:20:55","modified_gmt":"2026-11-12T09:20:55","slug":"patterndex","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/patterndex\/","author":16029789,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1.2","stable_tag":"0.1.2","tested":"7.1.4","requires":"6.6","requires_php":"8.1","requires_plugins":null,"header_name":"Patterndex \u2013 Pattern & Block Debugger","header_author":"Dan Lapteacru","header_description":"Adds a pattern registry browser and a block\/pattern debug panel to the block editor.","last_updated":"2026-11-12 09:20:55","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/danlapteacru\/patterndex","header_author_uri":"https:\/\/github.com\/danlapteacru","rating":0,"author_block_rating":0,"active_installs":0,"downloads":128,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1.2":{"tag":"0.1.2","author":"d1sabled","date":"2026-11-12 09:20:55","revision":3797910}},"upgrade_notice":{"0.1.2":"<p>First public release.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3797910,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3797910,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3797910,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3797910,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3797910,"resolution":"1","location":"assets","locale":"","width":1372,"height":895},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3797910,"resolution":"2","location":"assets","locale":"","width":1372,"height":895},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3797910,"resolution":"3","location":"assets","locale":"","width":1372,"height":895},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3797910,"resolution":"4","location":"assets","locale":"","width":1372,"height":895},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3797910,"resolution":"5","location":"assets","locale":"","width":1372,"height":895}},"screenshots":{"1":"Debug panel in the block inspector: overview, dumps, serialized HTML and the raw JSON attributes editor.","2":"Dump modal with a pretty-printed, copyable block instance.","3":"Pattern browser with search, filters, metadata, block counts and live previews.","4":"Selected block panel showing synced pattern provenance for a <code>core\/block<\/code> instance.","5":"Server registry dump, including patterns hidden from the inserter."}},"plugin_section":[],"plugin_tags":[148857,94,2275,148076,18850],"plugin_category":[59],"plugin_contributors":[291115],"plugin_business_model":[],"class_list":["post-401877","plugin","type-plugin","status-publish","hentry","plugin_tags-block-editor","plugin_tags-debug","plugin_tags-developer","plugin_tags-gutenberg","plugin_tags-patterns","plugin_category-utilities-and-tools","plugin_contributors-d1sabled","plugin_committers-d1sabled"],"banners":{"banner":"https:\/\/ps.w.org\/patterndex\/assets\/banner-772x250.png?rev=3797910","banner_2x":"https:\/\/ps.w.org\/patterndex\/assets\/banner-1544x500.png?rev=3797910","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/patterndex\/assets\/icon-128x128.png?rev=3797910","icon_2x":"https:\/\/ps.w.org\/patterndex\/assets\/icon-256x256.png?rev=3797910","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/patterndex\/assets\/screenshot-1.png?rev=3797910","caption":"Debug panel in the block inspector: overview, dumps, serialized HTML and the raw JSON attributes editor."},{"src":"https:\/\/ps.w.org\/patterndex\/assets\/screenshot-2.png?rev=3797910","caption":"Dump modal with a pretty-printed, copyable block instance."},{"src":"https:\/\/ps.w.org\/patterndex\/assets\/screenshot-3.png?rev=3797910","caption":"Pattern browser with search, filters, metadata, block counts and live previews."},{"src":"https:\/\/ps.w.org\/patterndex\/assets\/screenshot-4.png?rev=3797910","caption":"Selected block panel showing synced pattern provenance for a <code>core\/block<\/code> instance."},{"src":"https:\/\/ps.w.org\/patterndex\/assets\/screenshot-5.png?rev=3797910","caption":"Server registry dump, including patterns hidden from the inserter."}],"raw_content":"<!--section=description-->\n<p>A developer tool that adds two debugging surfaces to the block editor (post editor and site editor). Nothing is loaded on the front end, and nothing is loaded for users without the <code>edit_posts<\/code> capability.<\/p>\n\n<p><strong>Pattern browser<\/strong><\/p>\n\n<p>A pinnable <em>Patterndex<\/em> sidebar listing every pattern the editor knows about:<\/p>\n\n<ul>\n<li>Registered patterns from the client stores (core, theme, plugin, pattern directory), plus user patterns (<code>wp_block<\/code> posts) with their sync status.<\/li>\n<li>Search, plus source and category filters.<\/li>\n<li>Per pattern: metadata (source, categories, block types, sync status, inserter visibility), a recursive block-usage count, copy name or content, a JSON dump, and a live preview.<\/li>\n<li>A <em>Server registry<\/em> section backed by a REST endpoint that dumps the raw server-side <code>WP_Block_Patterns_Registry<\/code> and category registry, including patterns hidden from the inserter, exactly as PHP registered them.<\/li>\n<\/ul>\n\n<p><strong>Block debug panel<\/strong><\/p>\n\n<p>A <em>Debug<\/em> panel in the block inspector for the selected block, and the same panel as <em>Selected block<\/em> at the top of the sidebar. The sidebar copy matters: the block inspector renders no panels at all for synced pattern instances (<code>core\/block<\/code>), so the sidebar is the only place they can be debugged.<\/p>\n\n<ul>\n<li>Overview (name, client ID) with copy actions.<\/li>\n<li>Dumps: block instance, block type, the wrapper element's rendered DOM attributes, serialized block HTML.<\/li>\n<li>Attributes editor: the block's attributes as raw, validated JSON. Apply or reset; deleting a key removes the attribute; keys outside the block type's attribute schema are flagged but allowed.<\/li>\n<li>Pattern provenance: shows when the selected block is a synced pattern instance (<code>core\/block<\/code> ref, <code>wp_block<\/code> record, per-instance overrides) or was inserted from a pattern (<code>metadata.patternName<\/code>), with dumps of the source pattern.<\/li>\n<\/ul>\n\n<p><strong>Access control<\/strong><\/p>\n\n<p>Every debug surface (editor assets and the REST endpoint) requires the <code>view_patterndex<\/code> capability, mapped to <code>edit_posts<\/code> by default. Remap it by filtering <code>map_meta_cap<\/code> at a priority above <code>0<\/code>:<\/p>\n\n<pre><code>add_filter( 'map_meta_cap', function ( $caps, $cap ) {\n    if ( 'view_patterndex' === $cap ) {\n        $caps = [ 'manage_options' ];\n    }\n    return $caps;\n}, 10, 2 );\n<\/code><\/pre>\n\n<p><strong>Source code<\/strong><\/p>\n\n<p>The editor script is built from TypeScript with <code>@wordpress\/scripts<\/code>. The source is included in this plugin under <code>entries\/<\/code>, and the full project with build tooling is at <a href=\"https:\/\/github.com\/danlapteacru\/patterndex\">github.com\/danlapteacru\/patterndex<\/a>. To rebuild: <code>npm install &amp;&amp; npm run build<\/code>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin folder to <code>\/wp-content\/plugins\/<\/code> or install it from the Plugins screen.<\/li>\n<li>Activate it.<\/li>\n<li>Open any post or template in the block editor. The <em>Patterndex<\/em> sidebar is in the editor's plugins menu (the puzzle-piece icon), and the <em>Debug<\/em> panel appears in the block inspector when a block is selected.<\/li>\n<\/ol>\n\n<p>No settings page. Deactivate the plugin to remove everything; it stores no options.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20this%20affect%20the%20front%20end%20of%20my%20site%3F\"><h3>Does this affect the front end of my site?<\/h3><\/dt>\n<dd><p>No. Assets are only enqueued in the block editor, and only for users with the required capability.<\/p><\/dd>\n<dt id=\"who%20can%20see%20the%20debug%20tools%3F\"><h3>Who can see the debug tools?<\/h3><\/dt>\n<dd><p>By default anyone who can edit posts. Filter <code>map_meta_cap<\/code> for the <code>view_patterndex<\/code> capability to restrict it further, for example to administrators only.<\/p><\/dd>\n<dt id=\"why%20is%20there%20a%20separate%20sidebar%20as%20well%20as%20the%20inspector%20panel%3F\"><h3>Why is there a separate sidebar as well as the inspector panel?<\/h3><\/dt>\n<dd><p>Because the block inspector shows nothing for synced pattern instances (<code>core\/block<\/code>). The sidebar's <em>Selected block<\/em> panel works for every block, including those.<\/p><\/dd>\n<dt id=\"what%20does%20the%20rest%20endpoint%20expose%3F\"><h3>What does the REST endpoint expose?<\/h3><\/dt>\n<dd><p>patterndex\/v1\/registry returns the server-side pattern and category registries. It is read-only and requires the same capability as the editor UI.<\/p><\/dd>\n<dt id=\"does%20it%20store%20any%20data%3F\"><h3>Does it store any data?<\/h3><\/dt>\n<dd><p>No options, no post meta, no transients. Uninstalling leaves nothing behind.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Initial release on WordPress.org.<\/li>\n<\/ul>","raw_excerpt":"Pattern registry browser and block debug panel for the block editor. See every registered pattern, dump any block, and edit raw attributes.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/401877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=401877"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/d1sabled"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=401877"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=401877"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=401877"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=401877"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=401877"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=401877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}