├── .wp-env.json ├── src ├── single-post-picker │ ├── index.ts │ └── SinglePostPicker.tsx └── index.tsx ├── composer.json ├── .editorconfig ├── .gitignore ├── .eslintrc.js ├── readme.md ├── package.json ├── readme.txt ├── tsconfig.json ├── single-post-query-loop-selector.php └── composer.lock /.wp-env.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ "." ] 3 | } 4 | -------------------------------------------------------------------------------- /src/single-post-picker/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SinglePostPicker'; 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "creativeandrew/single-post-query-loop-selector", 3 | "config": { 4 | "allow-plugins": { 5 | "dealerdirect/phpcodesniffer-composer-installer": true 6 | } 7 | }, 8 | "require-dev": { 9 | "wp-coding-standards/wpcs": "^3.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | # WordPress Coding Standards 5 | # https://make.wordpress.org/core/handbook/coding-standards/ 6 | 7 | root = true 8 | 9 | [*] 10 | charset = utf-8 11 | end_of_line = lf 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | indent_style = tab 15 | 16 | [*.{yml,yaml}] 17 | indent_style = space 18 | indent_size = 2 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Coverage directory used by tools like istanbul 9 | coverage 10 | 11 | # Compiled binary addons (https://nodejs.org/api/addons.html) 12 | build/Release 13 | 14 | # Dependency directories 15 | node_modules/ 16 | 17 | # Optional npm cache directory 18 | .npm 19 | 20 | # Optional eslint cache 21 | .eslintcache 22 | 23 | # Output of `npm pack` 24 | *.tgz 25 | 26 | # Output of `wp-scripts plugin-zip` 27 | *.zip 28 | 29 | # dotenv environment variables file 30 | .env 31 | 32 | /vendor/ 33 | 34 | /.DS_Store 35 | 36 | .vscode 37 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2021: true, 5 | }, 6 | extends: [ 7 | 'eslint:recommended', 8 | 'plugin:@typescript-eslint/recommended', 9 | 'plugin:react/recommended', 10 | 'plugin:@wordpress/eslint-plugin/recommended', 11 | ], 12 | overrides: [ 13 | { 14 | env: { 15 | node: true, 16 | }, 17 | files: [ '.eslintrc.{js,cjs}' ], 18 | parserOptions: { 19 | sourceType: 'script', 20 | }, 21 | }, 22 | ], 23 | parser: '@typescript-eslint/parser', 24 | parserOptions: { 25 | ecmaVersion: 'latest', 26 | sourceType: 'module', 27 | }, 28 | plugins: [ '@typescript-eslint', 'react' ], 29 | rules: {}, 30 | }; 31 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Single Post Query Loop Selector 2 | 3 | ![Recording #92](https://github.com/creative-andrew/single-post-query-loop-selector/assets/18492002/c9dc5594-8565-4510-b042-017ff35d5306) 4 | 5 | 6 | **Contributors:** geisthanen 7 | **Tags:** Query Loop, Single Post, Variation 8 | **Requires at least:** 6.1 9 | **Tested up to:** 6.4.3 10 | **Stable tag:** 0.1.1 11 | **Requires PHP:** 7.2 12 | **License:** GPL-2.0-or-later 13 | **License URI:** [GPL-2.0](https://www.gnu.org/licenses/gpl-2.0.html) 14 | **Donate link:** [Support the Plugin](https://paypal.me/creativeandrewdev) 15 | 16 | ## Description 17 | 18 | This plugin introduces a Query Loop block variation that allows you to search and select a single post. 19 | 20 | ## Installation 21 | 22 | 1. Upload the plugin files to the `/wp-content/plugins/` directory. 23 | 2. Activate the plugin through the 'Plugins' screen in WordPress. 24 | 25 | ## Changelog 26 | 27 | = 0.1.2 = 28 | * Fixed wrong version bumped 29 | 30 | = 0.1.1 = 31 | * Fixed filter affecting other queries 32 | 33 | ### 0.1.0 34 | 35 | - Initial release 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "single-post-query-loop-selector", 3 | "version": "0.1.2", 4 | "description": "A Query Loop block variation that allow to search and select a single post to be displayed.", 5 | "license": "GPL-2.0-or-later", 6 | "main": "build/index.js", 7 | "scripts": { 8 | "build": "wp-scripts build", 9 | "format": "wp-scripts format", 10 | "lint:css": "wp-scripts lint-style", 11 | "lint:js": "wp-scripts lint-js", 12 | "packages-update": "wp-scripts packages-update", 13 | "plugin-zip": "wp-scripts plugin-zip", 14 | "start": "wp-scripts start" 15 | }, 16 | "prettier": "@wordpress/prettier-config", 17 | "devDependencies": { 18 | "@types/wordpress__block-editor": "^11.5.6", 19 | "@types/wordpress__blocks": "^12.5.7", 20 | "@types/wordpress__components": "^23.0.5", 21 | "@typescript-eslint/eslint-plugin": "^6.9.0", 22 | "@typescript-eslint/parser": "^6.9.0", 23 | "@wordpress/core-data": "^6.21.0", 24 | "@wordpress/eslint-plugin": "^17.1.0", 25 | "@wordpress/prettier-config": "^3.1.0", 26 | "@wordpress/scripts": "^26.15.0", 27 | "eslint": "^8.52.0", 28 | "eslint-plugin-react": "^7.33.2", 29 | "wp-types": "^3.63.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Single Post Query Loop Selector === 2 | Contributors: geisthanen 3 | Tags: Query Loop, Single Post, Variation 4 | Requires at least: 6.1 5 | Tested up to: 6.4.3 6 | Stable tag: 0.1.2 7 | Requires PHP: 7.2 8 | License: GPL-2.0-or-later 9 | License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 | Donate link: https://paypal.me/creativeandrewdev 11 | 12 | A Query Loop block variation that allows to search and select a single post to be displayed. 13 | 14 | == Description == 15 | 16 | This plugin introduces a Query Loop block variation that allows you to search and select a single post. 17 | 18 | == Installation == 19 | 20 | 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly. 21 | 2. Activate the plugin through the 'Plugins' screen in WordPress 22 | 23 | == Screenshots == 24 | 1. Single post loop selector inserter and controls. 25 | 2. Single post query loop in action showing one post. 26 | 27 | == Changelog == 28 | 29 | = 0.1.2 = 30 | * Fixed wrong version bumped 31 | 32 | = 0.1.1 = 33 | * Fixed filter affecting other queries 34 | 35 | = 0.1.0 = 36 | * Release 37 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 4 | "jsx": "preserve", /* Specify what JSX code is generated. */ /* Control what method is used to detect module-format JS files. */ 5 | "module": "commonjs", /* Specify what module code is generated. */ 6 | "rootDir": "./src", 7 | "outDir": "./build", /* Specify the root folder within your source files. */ 8 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 9 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 10 | "strict": true, /* Enable all strict type-checking options. */ 11 | "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ /* Disable error reporting for unreachable code. */ 12 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { registerBlockVariation } from '@wordpress/blocks'; 5 | import type { BlockVariation } from '@wordpress/blocks'; 6 | import { __ } from '@wordpress/i18n'; 7 | import { addFilter } from '@wordpress/hooks'; 8 | 9 | import { SinglePostPicker } from './single-post-picker'; 10 | const VARIATION_NAME = 'creativeandrew/single-post-query-loop-selector'; 11 | 12 | interface BlockCoreQueryAttributes extends BlockVariation { 13 | allowedControls: []; 14 | } 15 | 16 | registerBlockVariation( 'core/query', { 17 | name: VARIATION_NAME, 18 | title: __( 'Single Post Query Loop', 'single-post-query-loop-selector' ), 19 | description: __( 20 | 'Allow you to search and select a single post.', 21 | 'single-post-query-loop-selector' 22 | ), 23 | category: 'theme', 24 | isActive: [ 'namespace' ], 25 | attributes: { 26 | namespace: VARIATION_NAME, 27 | query: { 28 | perPage: 1, 29 | postType: 'post', 30 | sticky: 'exclude', 31 | }, 32 | className: 'is-style-single-post-query-loop-selector', 33 | }, 34 | allowedControls: [], 35 | innerBlocks: [ 36 | [ 37 | 'core/post-template', 38 | {}, 39 | [ [ 'core/post-title' ], [ 'core/post-excerpt' ] ], 40 | ], 41 | ], 42 | scope: [ 'inserter' ], 43 | } as BlockCoreQueryAttributes ); 44 | 45 | const isSingePostPicker = ( props: { attributes: { namespace: string } } ) => { 46 | const { 47 | attributes: { namespace }, 48 | } = props; 49 | return namespace && namespace === VARIATION_NAME; 50 | }; 51 | 52 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 53 | const withAdvancedQueryControls = ( BlockEdit: React.FC ) => ( props: any ) => { 54 | if ( isSingePostPicker( props ) ) { 55 | const { setAttributes, attributes } = props; 56 | return ( 57 | <> 58 | 62 | 63 | 64 | ); 65 | } 66 | return ; 67 | }; 68 | 69 | addFilter( 'editor.BlockEdit', 'core/query', withAdvancedQueryControls ); 70 | -------------------------------------------------------------------------------- /src/single-post-picker/SinglePostPicker.tsx: -------------------------------------------------------------------------------- 1 | import { InspectorControls } from '@wordpress/block-editor'; 2 | import { ComboboxControl, PanelBody } from '@wordpress/components'; 3 | import { useEntityRecords } from '@wordpress/core-data'; 4 | import { useState } from '@wordpress/element'; 5 | import type { WP_REST_API_Post as WPRestAPIPost } from 'wp-types'; 6 | import { useDebounce } from '@wordpress/compose'; 7 | import { __ } from '@wordpress/i18n'; 8 | 9 | type SinglePostPickerProps = { 10 | attributes: { 11 | [ key: string ]: unknown; 12 | query: { 13 | [ key: string ]: unknown; 14 | selectedPostId: string; 15 | }; 16 | }; 17 | setAttributes: ( attributes: { [ key: string ]: unknown } ) => void; 18 | }; 19 | 20 | const SinglePostPicker: React.FC< SinglePostPickerProps > = ( { 21 | setAttributes, 22 | attributes, 23 | } ) => { 24 | const [ search, setSearch ] = useState( '' ); 25 | const { isResolving, records: posts } = useEntityRecords< WPRestAPIPost >( 26 | 'postType', 27 | 'post', 28 | { 29 | per_page: 10, 30 | search, 31 | } 32 | ); 33 | 34 | const setSearchDebounced = useDebounce( ( value ) => { 35 | setSearch( value ); 36 | }, 300 ); 37 | 38 | return ( 39 | <> 40 | 41 | 42 | { 48 | const newAttributes = { 49 | attributes, 50 | query: { 51 | ...attributes.query, 52 | include: [ value ], 53 | selectedPostId: value, 54 | }, 55 | }; 56 | setAttributes( newAttributes ); 57 | } } 58 | onFilterValueChange={ ( value ) => { 59 | setSearchDebounced( value ); 60 | } } 61 | options={ 62 | isResolving 63 | ? [ 64 | { 65 | label: __( 66 | 'Loading…', 67 | 'single-post-query-loop-selector' 68 | ), 69 | value: 'loading', 70 | }, 71 | ] 72 | : posts?.map( ( post ) => ( { 73 | label: post?.title?.rendered, 74 | value: String( post?.id ), 75 | } ) ) || [] 76 | } 77 | value={ attributes?.query?.selectedPostId || 'loading' } 78 | /> 79 | 80 | 81 | 82 | ); 83 | }; 84 | 85 | export { SinglePostPicker }; 86 | -------------------------------------------------------------------------------- /single-post-query-loop-selector.php: -------------------------------------------------------------------------------- 1 | context['queryId'] ) 63 | && $block->context['queryId'] === $parsed_block['attrs']['queryId'] ) { 64 | $default_query['post__in'] = $parsed_block['attrs']['query']['include']; 65 | } 66 | 67 | return $default_query; 68 | }, 69 | 10, 70 | 2 71 | ); 72 | 73 | } 74 | return $pre_render; 75 | } 76 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "96439b92287c3ed4367a162cabda9c62", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "dealerdirect/phpcodesniffer-composer-installer", 12 | "version": "v1.0.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/PHPCSStandards/composer-installer.git", 16 | "reference": "4be43904336affa5c2f70744a348312336afd0da" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", 21 | "reference": "4be43904336affa5c2f70744a348312336afd0da", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "composer-plugin-api": "^1.0 || ^2.0", 26 | "php": ">=5.4", 27 | "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" 28 | }, 29 | "require-dev": { 30 | "composer/composer": "*", 31 | "ext-json": "*", 32 | "ext-zip": "*", 33 | "php-parallel-lint/php-parallel-lint": "^1.3.1", 34 | "phpcompatibility/php-compatibility": "^9.0", 35 | "yoast/phpunit-polyfills": "^1.0" 36 | }, 37 | "type": "composer-plugin", 38 | "extra": { 39 | "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 40 | }, 41 | "autoload": { 42 | "psr-4": { 43 | "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 44 | } 45 | }, 46 | "notification-url": "https://packagist.org/downloads/", 47 | "license": [ 48 | "MIT" 49 | ], 50 | "authors": [ 51 | { 52 | "name": "Franck Nijhof", 53 | "email": "franck.nijhof@dealerdirect.com", 54 | "homepage": "http://www.frenck.nl", 55 | "role": "Developer / IT Manager" 56 | }, 57 | { 58 | "name": "Contributors", 59 | "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" 60 | } 61 | ], 62 | "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 63 | "homepage": "http://www.dealerdirect.com", 64 | "keywords": [ 65 | "PHPCodeSniffer", 66 | "PHP_CodeSniffer", 67 | "code quality", 68 | "codesniffer", 69 | "composer", 70 | "installer", 71 | "phpcbf", 72 | "phpcs", 73 | "plugin", 74 | "qa", 75 | "quality", 76 | "standard", 77 | "standards", 78 | "style guide", 79 | "stylecheck", 80 | "tests" 81 | ], 82 | "support": { 83 | "issues": "https://github.com/PHPCSStandards/composer-installer/issues", 84 | "source": "https://github.com/PHPCSStandards/composer-installer" 85 | }, 86 | "time": "2023-01-05T11:28:13+00:00" 87 | }, 88 | { 89 | "name": "phpcsstandards/phpcsextra", 90 | "version": "1.1.2", 91 | "source": { 92 | "type": "git", 93 | "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", 94 | "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" 95 | }, 96 | "dist": { 97 | "type": "zip", 98 | "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", 99 | "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", 100 | "shasum": "" 101 | }, 102 | "require": { 103 | "php": ">=5.4", 104 | "phpcsstandards/phpcsutils": "^1.0.8", 105 | "squizlabs/php_codesniffer": "^3.7.1" 106 | }, 107 | "require-dev": { 108 | "php-parallel-lint/php-console-highlighter": "^1.0", 109 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 110 | "phpcsstandards/phpcsdevcs": "^1.1.6", 111 | "phpcsstandards/phpcsdevtools": "^1.2.1", 112 | "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" 113 | }, 114 | "type": "phpcodesniffer-standard", 115 | "extra": { 116 | "branch-alias": { 117 | "dev-stable": "1.x-dev", 118 | "dev-develop": "1.x-dev" 119 | } 120 | }, 121 | "notification-url": "https://packagist.org/downloads/", 122 | "license": [ 123 | "LGPL-3.0-or-later" 124 | ], 125 | "authors": [ 126 | { 127 | "name": "Juliette Reinders Folmer", 128 | "homepage": "https://github.com/jrfnl", 129 | "role": "lead" 130 | }, 131 | { 132 | "name": "Contributors", 133 | "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" 134 | } 135 | ], 136 | "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", 137 | "keywords": [ 138 | "PHP_CodeSniffer", 139 | "phpcbf", 140 | "phpcodesniffer-standard", 141 | "phpcs", 142 | "standards", 143 | "static analysis" 144 | ], 145 | "support": { 146 | "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", 147 | "source": "https://github.com/PHPCSStandards/PHPCSExtra" 148 | }, 149 | "time": "2023-09-20T22:06:18+00:00" 150 | }, 151 | { 152 | "name": "phpcsstandards/phpcsutils", 153 | "version": "1.0.8", 154 | "source": { 155 | "type": "git", 156 | "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", 157 | "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" 158 | }, 159 | "dist": { 160 | "type": "zip", 161 | "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", 162 | "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", 163 | "shasum": "" 164 | }, 165 | "require": { 166 | "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", 167 | "php": ">=5.4", 168 | "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" 169 | }, 170 | "require-dev": { 171 | "ext-filter": "*", 172 | "php-parallel-lint/php-console-highlighter": "^1.0", 173 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 174 | "phpcsstandards/phpcsdevcs": "^1.1.6", 175 | "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" 176 | }, 177 | "type": "phpcodesniffer-standard", 178 | "extra": { 179 | "branch-alias": { 180 | "dev-stable": "1.x-dev", 181 | "dev-develop": "1.x-dev" 182 | } 183 | }, 184 | "autoload": { 185 | "classmap": [ 186 | "PHPCSUtils/" 187 | ] 188 | }, 189 | "notification-url": "https://packagist.org/downloads/", 190 | "license": [ 191 | "LGPL-3.0-or-later" 192 | ], 193 | "authors": [ 194 | { 195 | "name": "Juliette Reinders Folmer", 196 | "homepage": "https://github.com/jrfnl", 197 | "role": "lead" 198 | }, 199 | { 200 | "name": "Contributors", 201 | "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" 202 | } 203 | ], 204 | "description": "A suite of utility functions for use with PHP_CodeSniffer", 205 | "homepage": "https://phpcsutils.com/", 206 | "keywords": [ 207 | "PHP_CodeSniffer", 208 | "phpcbf", 209 | "phpcodesniffer-standard", 210 | "phpcs", 211 | "phpcs3", 212 | "standards", 213 | "static analysis", 214 | "tokens", 215 | "utility" 216 | ], 217 | "support": { 218 | "docs": "https://phpcsutils.com/", 219 | "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", 220 | "source": "https://github.com/PHPCSStandards/PHPCSUtils" 221 | }, 222 | "time": "2023-07-16T21:39:41+00:00" 223 | }, 224 | { 225 | "name": "squizlabs/php_codesniffer", 226 | "version": "3.7.2", 227 | "source": { 228 | "type": "git", 229 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 230 | "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" 231 | }, 232 | "dist": { 233 | "type": "zip", 234 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", 235 | "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", 236 | "shasum": "" 237 | }, 238 | "require": { 239 | "ext-simplexml": "*", 240 | "ext-tokenizer": "*", 241 | "ext-xmlwriter": "*", 242 | "php": ">=5.4.0" 243 | }, 244 | "require-dev": { 245 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 246 | }, 247 | "bin": [ 248 | "bin/phpcs", 249 | "bin/phpcbf" 250 | ], 251 | "type": "library", 252 | "extra": { 253 | "branch-alias": { 254 | "dev-master": "3.x-dev" 255 | } 256 | }, 257 | "notification-url": "https://packagist.org/downloads/", 258 | "license": [ 259 | "BSD-3-Clause" 260 | ], 261 | "authors": [ 262 | { 263 | "name": "Greg Sherwood", 264 | "role": "lead" 265 | } 266 | ], 267 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 268 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 269 | "keywords": [ 270 | "phpcs", 271 | "standards", 272 | "static analysis" 273 | ], 274 | "support": { 275 | "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", 276 | "source": "https://github.com/squizlabs/PHP_CodeSniffer", 277 | "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" 278 | }, 279 | "time": "2023-02-22T23:07:41+00:00" 280 | }, 281 | { 282 | "name": "wp-coding-standards/wpcs", 283 | "version": "3.0.1", 284 | "source": { 285 | "type": "git", 286 | "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 287 | "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" 288 | }, 289 | "dist": { 290 | "type": "zip", 291 | "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", 292 | "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", 293 | "shasum": "" 294 | }, 295 | "require": { 296 | "ext-filter": "*", 297 | "ext-libxml": "*", 298 | "ext-tokenizer": "*", 299 | "ext-xmlreader": "*", 300 | "php": ">=5.4", 301 | "phpcsstandards/phpcsextra": "^1.1.0", 302 | "phpcsstandards/phpcsutils": "^1.0.8", 303 | "squizlabs/php_codesniffer": "^3.7.2" 304 | }, 305 | "require-dev": { 306 | "php-parallel-lint/php-console-highlighter": "^1.0.0", 307 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 308 | "phpcompatibility/php-compatibility": "^9.0", 309 | "phpcsstandards/phpcsdevtools": "^1.2.0", 310 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 311 | }, 312 | "suggest": { 313 | "ext-iconv": "For improved results", 314 | "ext-mbstring": "For improved results" 315 | }, 316 | "type": "phpcodesniffer-standard", 317 | "notification-url": "https://packagist.org/downloads/", 318 | "license": [ 319 | "MIT" 320 | ], 321 | "authors": [ 322 | { 323 | "name": "Contributors", 324 | "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 325 | } 326 | ], 327 | "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 328 | "keywords": [ 329 | "phpcs", 330 | "standards", 331 | "static analysis", 332 | "wordpress" 333 | ], 334 | "support": { 335 | "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", 336 | "source": "https://github.com/WordPress/WordPress-Coding-Standards", 337 | "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 338 | }, 339 | "funding": [ 340 | { 341 | "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", 342 | "type": "custom" 343 | } 344 | ], 345 | "time": "2023-09-14T07:06:09+00:00" 346 | } 347 | ], 348 | "aliases": [], 349 | "minimum-stability": "stable", 350 | "stability-flags": [], 351 | "prefer-stable": false, 352 | "prefer-lowest": false, 353 | "platform": [], 354 | "platform-dev": [], 355 | "plugin-api-version": "2.3.0" 356 | } 357 | --------------------------------------------------------------------------------