I need help... I have looked all over and maybe it's just a rookie mistake somewhere, however I feel I have looked and re-looked at every aspect of install on configuration.
Error in Visual Studio Code (1.74.0) phpcs: The "WordPress" coding standard is not installed. Please review your configuration an try again.
What am I doing wrong that when I load my site folder into VS and open a .PHP I get this error.
System Build:
OS Name Microsoft Windows 10 Pro
Version 10.0.19044 Build 19044
System Type x64-based PC
Processor 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 2803 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date Dell Inc. 1.9.0, 12/8/2021
Windows Directory C:\Windows
Memory:
Installed Physical Memory (RAM) 16.0 GB
Total Physical Memory 15.7 GB
Available Physical Memory 6.27 GB
Total Virtual Memory 27.4 GB
Available Virtual Memory 13.2 GB
Page File Space 11.7 GB
User Environment Variables:
C:\Users\towle\AppData\Local\Microsoft\WindowsApps
C:\Users\towle\AppData\Local\GitHubDesktop\bin
C:\Users\towle\AppData\Local\atom\bin
C:\Program Files (x86)\Nmap
C:\Users\towle\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\towle\AppData\Roaming\Composer\vendor\bin
System Environment Variables:
C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files\Eclipse Adoptium\jdk-17.0.2.8-hotspot\bin
C:\Program Files\Eclipse Adoptium\jdk-11.0.13.8-hotspot\bin
%INTEL_DEV_REDIST%redist\intel64_win\compiler
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\dotnet\
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
C:\Program Files\Common Files\Autodesk Shared\
C:\Program Files\Git\cmd
C:\Program Files\MySQL\MySQL Utilities 1.6\
C:\xampp\php
C:\composer
C:\PHP7
Composer Install Path:
- C:\composer
- \vendor\bin
- \vendor\composer
- \vendor\dealerdirect
- \vendor\phpcompatibility
- \vendor\squizlabs
- \vendor\squizlabs\php_codesniffer
WordPress Coding Standards Path:
- C:\composer\Tools\wpcs
Local Wordpress Dev Site Path:
- C:\xampp\htdocs\vhdev
PS C:\composer> phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra
PS C:\composer> php --version
PHP 8.1.4 (cli) (built: Mar 16 2022 09:33:31) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
PS C:\composer> phpcs --version
PHP_CodeSniffer version 3.7.1 (stable) by Squiz (http://www.squiz.net)
PS C:\composer> phpcbf --version
PHP_CodeSniffer version 3.7.1 (stable) by Squiz (http://www.squiz.net)
MY Visual Studio JSON
{
"workbench.settings.editor": "json",
"workbench.colorTheme": "Cobalt2",
"phpcs.executablePath": "C:\\composer\\Tools\\wpcs\\vendor\\bin\\phpcs.bat",
"phpcs.enable": true,
"phpcs.standard": "WordPress",
"editor.fontSize": 16,
"editor.lineHeight": 20,
"editor.fontVariations": false,
"editor.fontLigatures": false,
"editor.fontWeight": "normal",
"editor.fontFamily": "Times New Roman",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"phpcbf.enable": true,
"phpcbf.executablePath": "C:\\composer\\Tools\\wpcs\\vendor\\bin\\phpcbf.bat",
"phpcbf.documentFormattingProvider": true,
"phpcbf.onsave": true,
"phpcbf.standard": "WordPress",
"php.version": "8.1.4",
"php.suggest.basic": true,
"php.validate.enable": true,
}
PS C:\xampp\htdocs\vhdev> composer global require squizlabs/php_codesniffer wp-coding-standards
/wpcs
Changed current directory to C:/Users/towle/AppData/Roaming/Composer
Using version ^3.7 for squizlabs/php_codesniffer
Using version ^2.3 for wp-coding-standards/wpcs
squizlabs/php_codesniffer is currently present in the require-dev key and you ran the command w
ithout the --dev flag, which will move it to the require key.
Do you want to move this requirement? [no]? no
Do you want to re-run the command with --dev? [yes]? yes
./composer.json has been updated
Running composer update squizlabs/php_codesniffer wp-coding-standards/wpcs
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading wp-coding-standards/wpcs (2.3.0)
- Installing wp-coding-standards/wpcs (2.3.0): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
No security vulnerability advisories found
PS C:\xampp\htdocs\vhdev> phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz and Zend
PS C:\xampp\htdocs\vhdev> composer global require squizlabs/php_codesniffer wp-coding-standards
/wpcs
Changed current directory to C:/Users/towle/AppData/Roaming/Composer
Using version ^3.7 for squizlabs/php_codesniffer
Using version ^2.3 for wp-coding-standards/wpcs
squizlabs/php_codesniffer is currently present in the require-dev key and you ran the command w
ithout the --dev flag, which will move it to the require key.
wp-coding-standards/wpcs is currently present in the require-dev key and you ran the command wi
Do you want to move these requirements? [no]? yes
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Nothing to install, update or remove
Generating autoload files
PS C:\xampp\htdocs\vhdev> phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz and Zend
PS C:\xampp\htdocs\vhdev> phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-stand
ards/wpcs
Using config file: C:\Users\towle\AppData\Roaming\Composer\vendor\squizlabs\php_codesniffer\Cod
eSniffer.conf
Config value "installed_paths" added successfully
Eventually I got phpcs to see the WordPress Standards, but when I load PHP file, I get the "WordPress coing standard not installed message"
PS C:\xampp\htdocs\vhdev> phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra