From c1aabe0ad4926cbdcfb646c65913bb63cd6632cd Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 16:18:43 -0400 Subject: [PATCH 1/7] Exclude built files from repository --- .gitignore | 1 + build/post-type/block.json | 66 ------------------------------- build/post-type/index.asset.php | 1 - build/post-type/index.js | 1 - build/post-type/index.js.map | 1 - build/post-type/render.php | 54 -------------------------- build/taxonomy/block.json | 69 --------------------------------- build/taxonomy/index-rtl.css | 1 - build/taxonomy/index.asset.php | 1 - build/taxonomy/index.css | 1 - build/taxonomy/index.css.map | 1 - build/taxonomy/index.js | 1 - build/taxonomy/index.js.map | 1 - build/taxonomy/render.php | 42 -------------------- build/taxonomy/view.asset.php | 1 - build/taxonomy/view.js | 1 - build/taxonomy/view.js.map | 1 - 17 files changed, 1 insertion(+), 243 deletions(-) delete mode 100644 build/post-type/block.json delete mode 100644 build/post-type/index.asset.php delete mode 100644 build/post-type/index.js delete mode 100644 build/post-type/index.js.map delete mode 100644 build/post-type/render.php delete mode 100644 build/taxonomy/block.json delete mode 100644 build/taxonomy/index-rtl.css delete mode 100644 build/taxonomy/index.asset.php delete mode 100644 build/taxonomy/index.css delete mode 100644 build/taxonomy/index.css.map delete mode 100644 build/taxonomy/index.js delete mode 100644 build/taxonomy/index.js.map delete mode 100644 build/taxonomy/render.php delete mode 100644 build/taxonomy/view.asset.php delete mode 100644 build/taxonomy/view.js delete mode 100644 build/taxonomy/view.js.map diff --git a/.gitignore b/.gitignore index 413ff5b..9136884 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules +/build/ /vendor/ diff --git a/build/post-type/block.json b/build/post-type/block.json deleted file mode 100644 index 89b513f..0000000 --- a/build/post-type/block.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "query-filter/post-type", - "version": "0.1.0", - "title": "Post Type Filter", - "category": "theme", - "icon": "filter", - "description": "Allows users to filter by post type when placed wihin a query loop block", - "ancestor": [ - "core/query" - ], - "usesContext": [ - "queryId", - "query" - ], - "supports": { - "html": false, - "className": true, - "customClassName": true, - "color": { - "background": true, - "text": true - }, - "typography": { - "fontSize": true, - "textAlign": true, - "lineHeight": true, - "__experimentalFontFamily": true, - "__experimentalFontWeight": true, - "__experimentalFontStyle": true, - "__experimentalTextTransform": true, - "__experimentalTextDecoration": true, - "__experimentalLetterSpacing": true, - "__experimentalDefaultControls": { - "fontSize": true - } - }, - "spacing": { - "margin": true, - "padding": true, - "blockGap": true - }, - "interactivity": { - "clientNavigation": true - } - }, - "attributes": { - "emptyLabel": { - "type": "string", - "default": "" - }, - "label": { - "type": "string" - }, - "showLabel": { - "type": "boolean", - "default": true - } - }, - "textdomain": "query-filter", - "editorScript": "file:./index.js", - "viewScriptModule": "query-filter-taxonomy-view-script-module", - "style": "query-filter-view", - "render": "file:./render.php" -} \ No newline at end of file diff --git a/build/post-type/index.asset.php b/build/post-type/index.asset.php deleted file mode 100644 index ff3a7fb..0000000 --- a/build/post-type/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'ad8227c21a432607ccaf'); diff --git a/build/post-type/index.js b/build/post-type/index.js deleted file mode 100644 index 67b97d8..0000000 --- a/build/post-type/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";const e=window.wp.blocks,l=window.wp.i18n,t=window.wp.blockEditor,r=window.wp.components,o=window.wp.data,s=window.ReactJSXRuntime,i=JSON.parse('{"UU":"query-filter/post-type"}');(0,e.registerBlockType)(i.UU,{edit:function({attributes:e,setAttributes:i,context:n}){const{emptyLabel:a,label:p,showLabel:c}=e,u=(0,o.useSelect)((e=>(e("core").getPostTypes({per_page:100})||[]).filter((e=>e.viewable))||[]),[]);let y=(n.query.postType||"").split(",").map((e=>e.trim()));Array.isArray(n.query.multiple_posts)&&(y=y.concat(n.query.multiple_posts));const _=y.map((e=>u.find((l=>l.slug===e))||{slug:e,name:e}));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.InspectorControls,{children:(0,s.jsxs)(r.PanelBody,{title:(0,l.__)("Post Type Settings","query-filter"),children:[(0,s.jsx)(r.TextControl,{label:(0,l.__)("Label","query-filter"),value:p,defaultValue:(0,l.__)("Content Type","query-filter"),help:(0,l.__)("If empty then no label will be shown","query-filter"),onChange:e=>i({label:e})}),(0,s.jsx)(r.ToggleControl,{label:(0,l.__)("Show Label","query-filter"),checked:c,onChange:e=>i({showLabel:e})}),(0,s.jsx)(r.TextControl,{label:(0,l.__)("Empty Choice Label","query-filter"),value:a,placeholder:(0,l.__)("All","query-filter"),onChange:e=>i({emptyLabel:e})})]})}),(0,s.jsxs)("div",{...(0,t.useBlockProps)({className:"wp-block-query-filter"}),children:[c&&(0,s.jsx)("label",{className:"wp-block-query-filter-post-type__label wp-block-query-filter__label",children:p||(0,l.__)("Content Type","query-filter")}),(0,s.jsxs)("select",{className:"wp-block-query-filter-post-type__select wp-block-query-filter__select",inert:!0,children:[(0,s.jsx)("option",{children:a||(0,l.__)("All","query-filter")}),_.map((e=>(0,s.jsx)("option",{children:e.name},e.slug)))]})]})]})}})})(); \ No newline at end of file diff --git a/build/post-type/index.js.map b/build/post-type/index.js.map deleted file mode 100644 index 899ee83..0000000 --- a/build/post-type/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"post-type/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AACG;AAClC;AAAA;AAE7B,SAASa,IAAIA,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAQ,CAAC,EAAG;EACtE,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAEnD,MAAMM,YAAY,GAAGd,0DAAS,CAAIe,MAAM,IAAM;IAC7C,OACC,CAAEA,MAAM,CAAE,MAAO,CAAC,CAACC,YAAY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;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;ACNsD;AAC5B;AACU;AAEpCY,oEAAiB,CAAEC,6CAAa,EAAE;EACjC;AACD;AACA;EACCC,IAAI,EAAExC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/post-type/edit.js","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/post-type/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, ToggleControl } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes, context } ) {\n\tconst { emptyLabel, label, showLabel } = attributes;\n\n\tconst allPostTypes = useSelect( ( select ) => {\n\t\treturn (\n\t\t\t( select( 'core' ).getPostTypes( { per_page: 100 } ) || [] ).filter(\n\t\t\t\t( type ) => type.viewable\n\t\t\t) || []\n\t\t);\n\t}, [] );\n\n\tlet contextPostTypes = ( context.query.postType || '' )\n\t\t.split( ',' )\n\t\t.map( ( type ) => type.trim() );\n\n\t// Support for enhanced query loop block plugin.\n\tif ( Array.isArray( context.query.multiple_posts ) ) {\n\t\tcontextPostTypes = contextPostTypes.concat(\n\t\t\tcontext.query.multiple_posts\n\t\t);\n\t}\n\n\tconst postTypes = contextPostTypes.map( ( postType ) => {\n\t\treturn (\n\t\t\tallPostTypes.find( ( type ) => type.slug === postType ) || {\n\t\t\t\tslug: postType,\n\t\t\t\tname: postType,\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ postTypes.map( ( type ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","context","emptyLabel","label","showLabel","allPostTypes","select","getPostTypes","per_page","filter","type","viewable","contextPostTypes","query","postType","split","map","trim","Array","isArray","multiple_posts","concat","postTypes","find","slug","name","children","title","value","defaultValue","help","onChange","checked","placeholder","className","inert","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/post-type/render.php b/build/post-type/render.php deleted file mode 100644 index 70d43f2..0000000 --- a/build/post-type/render.php +++ /dev/null @@ -1,54 +0,0 @@ -context['query']['inherit'] ) { - $query_var = 'query-post_type'; - $page_var = 'page'; - $base_url = str_replace( '/page/' . get_query_var( 'paged' ), '', remove_query_arg( [ $query_var, $page_var ] ) ); -} else { - $query_id = $block->context['queryId'] ?? 0; - $query_var = sprintf( 'query-%d-post_type', $query_id ); - $page_var = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; - $base_url = remove_query_arg( [ $query_var, $page_var ] ); -} - -$post_types = array_map( 'trim', explode( ',', $block->context['query']['postType'] ?? 'post' ) ); - -// Support for enhanced query block. -if ( isset( $block->context['query']['multiple_posts'] ) && is_array( $block->context['query']['multiple_posts'] ) ) { - $post_types = array_merge( $post_types, $block->context['query']['multiple_posts'] ); -} - -// Fill in inherited query types. -if ( $block->context['query']['inherit'] ) { - $inherited_post_types = $wp_query->get( 'query-filter-post_type' ) === 'any' - ? get_post_types( [ 'public' => true, 'exclude_from_search' => false ] ) - : (array) $wp_query->get( 'query-filter-post_type' ); - - $post_types = array_merge( $post_types, $inherited_post_types ); - if ( ! get_option( 'wp_attachment_pages_enabled' ) ) { - $post_types = array_diff( $post_types, [ 'attachment' ] ); - } -} - -$post_types = array_unique( $post_types ); -$post_types = array_map( 'get_post_type_object', $post_types ); - -if ( empty( $post_types ) ) { - return; -} -?> - -
'wp-block-query-filter' ] ); ?> data-wp-interactive="query-filter" data-wp-context="{}"> - - -
diff --git a/build/taxonomy/block.json b/build/taxonomy/block.json deleted file mode 100644 index 6cdb93d..0000000 --- a/build/taxonomy/block.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 3, - "name": "query-filter/taxonomy", - "version": "0.1.0", - "title": "Taxonomy Filter", - "category": "theme", - "icon": "filter", - "description": "Allows users to filter by taxonomy terms when placed wihin a query loop block", - "ancestor": [ - "core/query" - ], - "usesContext": [ - "queryId", - "query" - ], - "supports": { - "html": false, - "className": true, - "customClassName": true, - "color": { - "background": true, - "text": true - }, - "typography": { - "fontSize": true, - "textAlign": true, - "lineHeight": true, - "__experimentalFontFamily": true, - "__experimentalFontWeight": true, - "__experimentalFontStyle": true, - "__experimentalTextTransform": true, - "__experimentalTextDecoration": true, - "__experimentalLetterSpacing": true, - "__experimentalDefaultControls": { - "fontSize": true - } - }, - "spacing": { - "margin": true, - "padding": true, - "blockGap": true - }, - "interactivity": { - "clientNavigation": true - } - }, - "attributes": { - "taxonomy": { - "type": "string" - }, - "emptyLabel": { - "type": "string", - "default": "" - }, - "label": { - "type": "string" - }, - "showLabel": { - "type": "boolean", - "default": true - } - }, - "textdomain": "query-filter", - "editorScript": "file:./index.js", - "style": "query-filter-view", - "viewScriptModule": "file:./view.js", - "render": "file:./render.php" -} \ No newline at end of file diff --git a/build/taxonomy/index-rtl.css b/build/taxonomy/index-rtl.css deleted file mode 100644 index 39bc4f5..0000000 --- a/build/taxonomy/index-rtl.css +++ /dev/null @@ -1 +0,0 @@ -@view-transition{navigation:auto}.wp-block-query-filter{display:flex;flex-direction:column;justify-content:stretch} diff --git a/build/taxonomy/index.asset.php b/build/taxonomy/index.asset.php deleted file mode 100644 index 4b3ef34..0000000 --- a/build/taxonomy/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'f1456d24ac8e3da497aa'); diff --git a/build/taxonomy/index.css b/build/taxonomy/index.css deleted file mode 100644 index 39bc4f5..0000000 --- a/build/taxonomy/index.css +++ /dev/null @@ -1 +0,0 @@ -@view-transition{navigation:auto}.wp-block-query-filter{display:flex;flex-direction:column;justify-content:stretch} diff --git a/build/taxonomy/index.css.map b/build/taxonomy/index.css.map deleted file mode 100644 index 296b941..0000000 --- a/build/taxonomy/index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"taxonomy/index.css","mappings":";;;AAAA;CACC,gBAAgB;AACjB;;AAEA;CACC,aAAa;CACb,sBAAsB;CACtB,wBAAwB;AACzB","sources":["webpack://query-loop-filter/./src/taxonomy/style-index.css"],"sourcesContent":["@view-transition {\n\tnavigation: auto;\n}\n\n.wp-block-query-filter {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: stretch;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/taxonomy/index.js b/build/taxonomy/index.js deleted file mode 100644 index 5868836..0000000 --- a/build/taxonomy/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";const e=window.wp.blocks,l=window.wp.i18n,t=window.wp.blockEditor,o=window.wp.components,n=window.wp.data,r=window.ReactJSXRuntime,a=JSON.parse('{"UU":"query-filter/taxonomy"}');(0,e.registerBlockType)(a.UU,{edit:function({attributes:e,setAttributes:a}){const{taxonomy:i,emptyLabel:s,label:c,showLabel:u}=e,b=(0,n.useSelect)((e=>{const l=(e("core").getTaxonomies({per_page:100})||[]).filter((e=>e.visibility.publicly_queryable));return l&&l.length>0&&!i&&a({taxonomy:l[0].slug,label:l[0].name}),l}),[i]),y=(0,n.useSelect)((e=>e("core").getEntityRecords("taxonomy",i,{number:50})||[]),[i]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.InspectorControls,{children:(0,r.jsxs)(o.PanelBody,{title:(0,l.__)("Taxonomy Settings","query-filter"),children:[(0,r.jsx)(o.SelectControl,{label:(0,l.__)("Select Taxonomy","query-filter"),value:i,options:(b||[]).map((e=>({label:e.name,value:e.slug}))),onChange:e=>a({taxonomy:e,label:b.find((l=>l.slug===e)).name})}),(0,r.jsx)(o.TextControl,{label:(0,l.__)("Label","query-filter"),value:c,help:(0,l.__)("If empty then no label will be shown","query-filter"),onChange:e=>a({label:e})}),(0,r.jsx)(o.ToggleControl,{label:(0,l.__)("Show Label","query-filter"),checked:u,onChange:e=>a({showLabel:e})}),(0,r.jsx)(o.TextControl,{label:(0,l.__)("Empty Choice Label","query-filter"),value:s,placeholder:(0,l.__)("All","query-filter"),onChange:e=>a({emptyLabel:e})})]})}),(0,r.jsxs)("div",{...(0,t.useBlockProps)({className:"wp-block-query-filter"}),children:[u&&(0,r.jsx)("label",{className:"wp-block-query-filter-taxonomy__label wp-block-query-filter__label",children:c}),(0,r.jsxs)("select",{className:"wp-block-query-filter-taxonomy__select wp-block-query-filter__select",inert:!0,children:[(0,r.jsx)("option",{children:s||(0,l.__)("All","query-filter")}),y.map((e=>(0,r.jsx)("option",{children:e.name},e.slug)))]})]})]})}})})(); \ No newline at end of file diff --git a/build/taxonomy/index.js.map b/build/taxonomy/index.js.map deleted file mode 100644 index 4898e71..0000000 --- a/build/taxonomy/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"taxonomy/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AAM5C;AACa;AAAA;AAE7B,SAASc,IAAIA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EAC7D,MAAM;IAAEC,QAAQ;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAE7D,MAAMM,UAAU,GAAGd,0DAAS,CACzBe,MAAM,IAAM;IACb,MAAMC,OAAO,GAAG,CACfD,MAAM,CAAE,MAAO,CAAC,CAACE,aAAa,CAAE;MAAEC,QAAQ,EAAE;IAAI,CAAE,CAAC,IAAI,EAAE,EACxDC,MAAM,CAAIT,QAAQ,IAAMA,QAAQ,CAACU,UAAU,CAACC,MAAO,CAAC;IAEtD,IAAKL,OAAO,IAAIA,OAAO,CAACM,MAAM,GAAG,CAAC,IAAI,CAAEZ,QAAQ,EAAG;MAClDD,aAAa,CAAE;QACdC,QAAQ,EAAEM,OAAO,CAAE,CAAC,CAAE,CAACO,IAAI;QAC3BX,KAAK,EAAEI,OAAO,CAAE,CAAC,CAAE,CAACQ;MACrB,CAAE,CAAC;IACJ;IAEA,OAAOR,OAAO;EACf,CAAC,EACD,CAAEN,QAAQ,CACX,CAAC;EAED,MAAMe,KAAK,GAAGzB,0DAAS,CACpBe,MA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WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACNsD;AAC5B;AACU;AACT;AAE3BmB,oEAAiB,CAAEC,6CAAa,EAAE;EACjC;AACD;AACA;EACCC,IAAI,EAAErC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/taxonomy/edit.js","webpack://query-loop-filter/./src/taxonomy/style-index.css?27a5","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tSelectControl,\n\tTextControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes } ) {\n\tconst { taxonomy, emptyLabel, label, showLabel } = attributes;\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst results = (\n\t\t\t\tselect( 'core' ).getTaxonomies( { per_page: 100 } ) || []\n\t\t\t).filter( ( taxonomy ) => taxonomy.visibility.public );\n\n\t\t\tif ( results && results.length > 0 && ! taxonomy ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ttaxonomy: results[ 0 ].slug,\n\t\t\t\t\tlabel: results[ 0 ].name,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn results;\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\tconst terms = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\tselect( 'core' ).getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tnumber: 50,\n\t\t\t\t} ) || []\n\t\t\t);\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t ( {\n\t\t\t\t\t\t\tlabel: taxonomy.name,\n\t\t\t\t\t\t\tvalue: taxonomy.slug,\n\t\t\t\t\t\t} ) ) }\n\t\t\t\t\t\tonChange={ ( taxonomy ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\ttaxonomy,\n\t\t\t\t\t\t\t\tlabel: taxonomies.find(\n\t\t\t\t\t\t\t\t\t( tax ) => tax.slug === taxonomy\n\t\t\t\t\t\t\t\t).name,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\nimport './style-index.css';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","SelectControl","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","taxonomy","emptyLabel","label","showLabel","taxonomies","select","results","getTaxonomies","per_page","filter","visibility","public","length","slug","name","terms","getEntityRecords","number","children","title","value","options","map","onChange","find","tax","help","checked","placeholder","className","inert","term","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/taxonomy/render.php b/build/taxonomy/render.php deleted file mode 100644 index 97258b4..0000000 --- a/build/taxonomy/render.php +++ /dev/null @@ -1,42 +0,0 @@ -context['query']['inherit'] ) ) { - $query_id = $block->context['queryId'] ?? 0; - $query_var = sprintf( 'query-%d-%s', $query_id, $attributes['taxonomy'] ); - $page_var = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; - $base_url = remove_query_arg( [ $query_var, $page_var ] ); -} else { - $query_var = sprintf( 'query-%s', $attributes['taxonomy'] ); - $page_var = 'page'; - $base_url = str_replace( '/page/' . get_query_var( 'paged' ), '', remove_query_arg( [ $query_var, $page_var ] ) ); -} - -$terms = get_terms( [ - 'hide_empty' => true, - 'taxonomy' => $attributes['taxonomy'], - 'number' => 100, -] ); - -if ( is_wp_error( $terms ) || empty( $terms ) ) { - return; -} -?> - -
'wp-block-query-filter' ] ); ?> data-wp-interactive="query-filter" data-wp-context="{}"> - - -
diff --git a/build/taxonomy/view.asset.php b/build/taxonomy/view.asset.php deleted file mode 100644 index b7d71e1..0000000 --- a/build/taxonomy/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'e7ba522c0e73d74a56f1', 'type' => 'module'); diff --git a/build/taxonomy/view.js b/build/taxonomy/view.js deleted file mode 100644 index bf1481b..0000000 --- a/build/taxonomy/view.js +++ /dev/null @@ -1 +0,0 @@ -import*as e from"@wordpress/interactivity";var t={438:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function a(e){var o=r[e];if(void 0!==o)return o.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,a),s.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=(n={getElement:()=>e.getElement,store:()=>e.store},i={},a.d(i,n),i),{state:s}=(0,o.store)("query-filter",{actions:{*navigate(e){e.preventDefault();const{actions:t}=yield Promise.resolve().then(a.bind(a,438));yield t.navigate(e.target.value)},*search(e){e.preventDefault();const{ref:t}=(0,o.getElement)();let r,n,i;if("FORM"===t.tagName){const e=t.querySelector('input[type="search"]');r=t.action,n=e.name,i=e.value}else r=t.closest("form").action,n=t.name,i=t.value;i!==s.searchValue&&(s.searchValue=i,yield(async(e,t,r)=>{const o=new URL(e);t||"s"===r?o.searchParams.set(r,t):o.searchParams.delete(r);const{actions:s}=await Promise.resolve().then(a.bind(a,438));await s.navigate(o.toString())})(r,i,n))}}});var n,i; \ No newline at end of file diff --git a/build/taxonomy/view.js.map b/build/taxonomy/view.js.map deleted file mode 100644 index 3396a07..0000000 --- a/build/taxonomy/view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"taxonomy/view.js","mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;ACN6D;AAE7D,MAAME,SAAS,GAAG,MAAAA,CAAQC,MAAM,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAClD,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAEJ,MAAO,CAAC;EAC7B,IAAKC,KAAK,IAAIC,IAAI,KAAK,GAAG,EAAG;IAC5BC,GAAG,CAACE,YAAY,CAACC,GAAG,CA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zB,MAAMF,SAAS,CAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAK,CAAC;IACvC;EACD;AACD,CAAE,CAAC,C","sources":["webpack://query-loop-filter/external import \"@wordpress/interactivity-router\"","webpack://query-loop-filter/external module \"@wordpress/interactivity\"","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/view.js"],"sourcesContent":["module.exports = import(\"@wordpress/interactivity-router\");;","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { store, getElement } from '@wordpress/interactivity';\n\nconst updateURL = async ( action, value, name ) => {\n\tconst url = new URL( action );\n\tif ( value || name === 's' ) {\n\t\turl.searchParams.set( name, value );\n\t} else {\n\t\turl.searchParams.delete( name );\n\t}\n\tconst { actions } = await import( '@wordpress/interactivity-router' );\n\tawait actions.navigate( url.toString() );\n};\n\nconst { state } = store( 'query-filter', {\n\tactions: {\n\t\t*navigate( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { actions } = yield import(\n\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t);\n\t\t\tyield actions.navigate( e.target.value );\n\t\t},\n\t\t*search( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { ref } = getElement();\n\t\t\tlet action, name, value;\n\t\t\tif ( ref.tagName === 'FORM' ) {\n\t\t\t\tconst input = ref.querySelector( 'input[type=\"search\"]' );\n\t\t\t\taction = ref.action;\n\t\t\t\tname = input.name;\n\t\t\t\tvalue = input.value;\n\t\t\t} else {\n\t\t\t\taction = ref.closest( 'form' ).action;\n\t\t\t\tname = ref.name;\n\t\t\t\tvalue = ref.value;\n\t\t\t}\n\n\t\t\t// Don't navigate if the search didn't really change.\n\t\t\tif ( value === state.searchValue ) return;\n\n\t\t\tstate.searchValue = value;\n\n\t\t\tyield updateURL( action, value, name );\n\t\t},\n\t},\n} );\n"],"names":["store","getElement","updateURL","action","value","name","url","URL","searchParams","set","delete","actions","navigate","toString","state","e","preventDefault","target","search","ref","tagName","input","querySelector","closest","searchValue"],"sourceRoot":""} \ No newline at end of file From f969e9463e0aabfc29fc70cc79b73fa1a3395a3e Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 16:19:28 -0400 Subject: [PATCH 2/7] CI: Implement HM-standard lightweight build and release process --- .github/workflows/build-release-branch.yml | 20 +++++++++ .github/workflows/tag-and-release.yml | 47 ++++++++++++++++++++++ README.md | 22 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 .github/workflows/build-release-branch.yml create mode 100644 .github/workflows/tag-and-release.yml diff --git a/.github/workflows/build-release-branch.yml b/.github/workflows/build-release-branch.yml new file mode 100644 index 0000000..871b3d1 --- /dev/null +++ b/.github/workflows/build-release-branch.yml @@ -0,0 +1,20 @@ +name: Build to "release" branch + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + release: + name: "Update release branch" + uses: humanmade/hm-github-actions/.github/workflows/build-and-release-node.yml@0813c0d62e0657037f42da83bc6804b0fc8ec9af # v0.4.0 + with: + node_version: 22 + source_branch: main + release_branch: release + built_asset_paths: build diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml new file mode 100644 index 0000000..a7b4917 --- /dev/null +++ b/.github/workflows/tag-and-release.yml @@ -0,0 +1,47 @@ +name: Tag and Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version tag (e.g., v1.0.0)' + required: true + +jobs: + tag_and_release: + name: Tag and Release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Check if tag already exists + id: check_tag + run: | + if git rev-parse "refs/tags/${{ github.event.inputs.version }}" >/dev/null 2>&1; then + echo "Tag already exists" + echo "tag_exists=true" >> "$GITHUB_OUTPUT" + fi + + - name: Abort if tag exists + if: steps.check_tag.outputs.tag_exists == 'true' + run: exit 1 + + - name: Create and push tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git fetch origin release + git checkout release + git tag ${{ github.event.inputs.version }} + git push origin ${{ github.event.inputs.version }} + + - name: Create GitHub Release + uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0 + with: + tag: ${{ github.event.inputs.version }} + name: ${{ github.event.inputs.version }} + body: "Automated release of version ${{ github.event.inputs.version }}" + draft: false + prerelease: false diff --git a/README.md b/README.md index f543ef9..817a87f 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,25 @@ This plugin is available on packagist. 1. Download the plugin from the [GitHub repository](https://github.com/humanmade/query-filter). 2. Upload the plugin to your site's `wp-content/plugins` directory. 3. Activate the plugin from the WordPress admin. + +Built assets are not committed to `main`. Manual or Composer installs should track the `release` branch (or a tagged release), which contains the compiled `build` directory. + +## Release Process + +Merges to `main` automatically [build](https://github.com/humanmade/query-filter/actions/workflows/build-release-branch.yml) to the `release` branch. A project may track the `release` branch using [Composer](https://getcomposer.org/) to pull in the latest built beta version. + +Commits on the `release` branch may be tagged for installation via [Packagist](https://packagist.org/packages/humanmade/query-filter) and marked as releases in GitHub for manual download, using a manually-dispatched ["Tag and Release" GH Actions workflow](https://github.com/humanmade/query-filter/actions/workflows/tag-and-release.yml). + +To tag a new release: + +1. Choose the target version number using [semantic versioning](https://semver.org/). +2. Check out a `prepare-v#.#.#` branch and bump the `Version` in the [query-filter.php](./query-filter.php) PHPDoc header. +3. Open a pull request titled "Prepare release v#.#.#". +4. Review and merge the "Prepare release" pull request. +5. Wait for the `release` branch to [update](https://github.com/humanmade/query-filter/actions/workflows/build-release-branch.yml) with the build that includes the new version number. +6. On the ["Tag and Release" GH Action page](https://github.com/humanmade/query-filter/actions/workflows/tag-and-release.yml): + - Click "Run workflow" in the `workflow_dispatch` banner. + - Fill out the "Version tag" field with your target version number. This must match the `Version` in `query-filter.php`. Use the format `v#.#.#`. + - Click "Run workflow" to apply the specified tag to the `release` branch. + +Once the workflow completes, the new version is [tagged](https://github.com/humanmade/query-filter/tags) and listed in [releases](https://github.com/humanmade/query-filter/releases). From 605f3f806fa0681ef8d90c7d9a28e72310de7f78 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 16:21:29 -0400 Subject: [PATCH 3/7] Add HMCS 2.2 --- composer.json | 11 +- composer.lock | 972 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 982 insertions(+), 1 deletion(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 07f6699..ec16174 100644 --- a/composer.json +++ b/composer.json @@ -11,5 +11,14 @@ "name": "Human Made Limited", "email": "hello@humanmade.com" } - ] + ], + "require-dev": { + "humanmade/coding-standards": "^2.2" + }, + "config": { + "allow-plugins": { + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } + } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..18989e0 --- /dev/null +++ b/composer.lock @@ -0,0 +1,972 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "92a7e4ecda3c4dcefe50a97198d7631b", + "packages": [ + { + "name": "composer/installers", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/12fb2dfe5e16183de69e784a7b84046c43d97e8e", + "reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "composer/composer": "^1.10.27 || ^2.7", + "composer/semver": "^1.7.2 || ^3.4.0", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-phpunit": "^1", + "symfony/phpunit-bridge": "^7.1.1", + "symfony/process": "^5 || ^6 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "2.x-dev" + }, + "plugin-modifies-install-path": true + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "concreteCMS", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "matomo", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "tastyigniter", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-06-24T20:46:46+00:00" + } + ], + "packages-dev": [ + { + "name": "automattic/vipwpcs", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/Automattic/VIP-Coding-Standards.git", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.11", + "sirbrillig/phpcs-variable-analysis": "^2.11.18", + "squizlabs/php_codesniffer": "^3.9.2", + "wp-coding-standards/wpcs": "^3.1.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7 || ^8 || ^9" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", + "keywords": [ + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/Automattic/VIP-Coding-Standards/issues", + "source": "https://github.com/Automattic/VIP-Coding-Standards", + "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" + }, + "time": "2024-05-10T20:31:09+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, + { + "name": "fig-r/psr2r-sniffer", + "version": "0.5.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig-rectified/psr2r-sniffer.git", + "reference": "7eb462bcf19abcae122855a6d79cc8f768c77880" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/7eb462bcf19abcae122855a6d79cc8f768c77880", + "reference": "7eb462bcf19abcae122855a6d79cc8f768c77880", + "shasum": "" + }, + "require": { + "php": ">=5.4.16", + "squizlabs/php_codesniffer": "^3.0" + }, + "bin": [ + "bin/tokenize", + "bin/sniff" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PSR2R\\": "PSR2R" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Scherer", + "homepage": "http://www.dereuromark.de", + "role": "Contributor" + } + ], + "description": "Code-Sniffer, Auto-Fixer and Tokenizer for PSR2-R", + "keywords": [ + "codesniffer", + "cs" + ], + "support": { + "issues": "https://github.com/php-fig-rectified/psr2r-sniffer/issues", + "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/0.5.2" + }, + "time": "2019-07-30T11:13:07+00:00" + }, + { + "name": "humanmade/coding-standards", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/humanmade/coding-standards.git", + "reference": "96fb170e1b81307ca4e73dbc22b44a62fe5f8534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/humanmade/coding-standards/zipball/96fb170e1b81307ca4e73dbc22b44a62fe5f8534", + "reference": "96fb170e1b81307ca4e73dbc22b44a62fe5f8534", + "shasum": "" + }, + "require": { + "automattic/vipwpcs": "^3.0.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "fig-r/psr2r-sniffer": "^0.5.0", + "php": ">=8.2", + "phpcompatibility/phpcompatibility-wp": "^2.0.0", + "squizlabs/php_codesniffer": "^3.13.4", + "wp-coding-standards/wpcs": "^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Human Made Coding Standards", + "support": { + "issues": "https://github.com/humanmade/coding-standards/issues", + "source": "https://github.com/humanmade/coding-standards/tree/v2.2.0" + }, + "time": "2026-06-22T17:25:44+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-09-19T17:43:28+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.8", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-10-18T00:05:59+00:00" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "b598aa890815b8df16363271b659d73280129101" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101", + "reference": "b598aa890815b8df16363271b659d73280129101", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.2.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-11-12T23:06:57+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "phpcs4", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-12-08T14:27:58+00:00" + }, + { + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.13.0", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/a15e970b8a0bf64cfa5e86d941f5e6b08855f369", + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpstan/phpstan": "^1.7 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A PHPCS sniff to detect problems with variables.", + "keywords": [ + "phpcs", + "static analysis" + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + }, + "time": "2025-09-30T22:22:48+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.13.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-11-04T16:30:35+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.4" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "suggest": { + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, + "funding": [ + { + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" + } + ], + "time": "2025-11-25T12:08:04+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +} From 5f7e3ad1d167a2fead10b973282b151b1a6b0aef Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 16:39:13 -0400 Subject: [PATCH 4/7] PHPCS: Add "composer phpcs" command and apply non-stylistic HMCS standard --- .phpcs.xml | 37 +++++++++++++++++++++++++++++++++++++ composer.json | 3 +++ 2 files changed, 40 insertions(+) create mode 100644 .phpcs.xml diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 0000000..11586e9 --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,37 @@ + + + Human Made Coding Standards + + + ./inc/ + ./src/ + query-filter.php + + ./build/ + ./vendor/ + + + + + + + + + + + + + + + + + + + + + + + + query-filter.php + + diff --git a/composer.json b/composer.json index ec16174..c0d3b88 100644 --- a/composer.json +++ b/composer.json @@ -20,5 +20,8 @@ "composer/installers": true, "dealerdirect/phpcodesniffer-composer-installer": true } + }, + "scripts": { + "phpcs": "phpcs" } } From 714aff94384bc3d6482b987ff3fed1a1bdeed194 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 22:14:51 -0400 Subject: [PATCH 5/7] CI: Add PHPCS GitHub Action --- .github/workflows/php.yml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..5a2d753 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,46 @@ +name: PHP Code Quality + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + # Only run when PHP or the coding standards configuration change. + paths: + - '**.php' + - '.phpcs.xml' + - 'composer.json' + - 'composer.lock' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + phpcs: + name: PHPCS + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Set up PHP + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: '8.2' + coverage: none + tools: cs2pr + + - name: Install Composer dependencies + run: composer install --no-progress --no-interaction --no-ansi + + - name: Run PHPCS + id: phpcs + run: composer phpcs -- -q --report-full --report-checkstyle=phpcs-report.xml + + - name: Annotate PR with PHPCS results + if: ${{ always() && steps.phpcs.outcome == 'failure' }} + run: cs2pr phpcs-report.xml From cb6f84004b944cc6c3227c1809ad79408d6da26c Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Mon, 22 Jun 2026 22:19:53 -0400 Subject: [PATCH 6/7] CI: Remove -q flag PHPCS run, not recommended when separating cs2pr command into two steps --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5a2d753..fb79bc3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -39,8 +39,8 @@ jobs: - name: Run PHPCS id: phpcs - run: composer phpcs -- -q --report-full --report-checkstyle=phpcs-report.xml + run: composer phpcs -- --report-full --report-checkstyle=phpcs-report.xml - name: Annotate PR with PHPCS results if: ${{ always() && steps.phpcs.outcome == 'failure' }} - run: cs2pr phpcs-report.xml + run: cs2pr ./phpcs-report.xml From 5de78507f43a843ae85e69b0869828e159e0c82b Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Tue, 23 Jun 2026 13:57:01 -0400 Subject: [PATCH 7/7] Update HMCS to 2.2.1 to fix false-positive on get_block_wrapper_attributes --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 18989e0..940544f 100644 --- a/composer.lock +++ b/composer.lock @@ -335,16 +335,16 @@ }, { "name": "humanmade/coding-standards", - "version": "v2.2.0", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/humanmade/coding-standards.git", - "reference": "96fb170e1b81307ca4e73dbc22b44a62fe5f8534" + "reference": "601ff015e90254a7be77c5b1ce262df6df089fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/humanmade/coding-standards/zipball/96fb170e1b81307ca4e73dbc22b44a62fe5f8534", - "reference": "96fb170e1b81307ca4e73dbc22b44a62fe5f8534", + "url": "https://api.github.com/repos/humanmade/coding-standards/zipball/601ff015e90254a7be77c5b1ce262df6df089fdb", + "reference": "601ff015e90254a7be77c5b1ce262df6df089fdb", "shasum": "" }, "require": { @@ -367,9 +367,9 @@ "description": "Human Made Coding Standards", "support": { "issues": "https://github.com/humanmade/coding-standards/issues", - "source": "https://github.com/humanmade/coding-standards/tree/v2.2.0" + "source": "https://github.com/humanmade/coding-standards/tree/v2.2.1" }, - "time": "2026-06-22T17:25:44+00:00" + "time": "2026-06-23T13:24:51+00:00" }, { "name": "phpcompatibility/php-compatibility",