Install PHPCS in the project root ( /public ) folder
composer require --dev automattic/vipwpcs dealerdirect/phpcodesniffer-composer-installer
Show errors/warnings in CSV
1. Run with WordPress VIP GO standards
./vendor/bin/phpcs --standard=WordPress-VIP-Go wp-content/themes/theme-name/ --report=csv --report-file=vip-go.csv --ignore= "*/node_modules/*" -d memory_limit= 1320 M
2. Run with WordPress VIP Minimum standards
./vendor/bin/phpcs --standard=WordPressVIPMinimum wp-content/themes/theme-name/ --report=csv --report-file=vip-minimum.csv --ignore= "*/node_modules/*" -d memory_limit= 1320 M
Fix PHPCBF errors
./vendor/bin/phpcbf --standard=WordPress public/wp-content/themes/theme-name
Show errors/warnings in terminal
./vendor/bin/phpcs --standard=WordPress wp-content/themes/theme-name/assets/src/blocks/sample/index.php --ignore= "*/node_modules/*" -d memory_limit= 1320 M
Skip from git indexing
git update-index --skip-worktree wp-config.php
Revert from git indexing
git update-index --no-skip-worktree wp-config.php
Remove file from git indexing but keep in local
git rm --cached sample-file.php
Remove folder from git indexing but keep in local
git rm --cached -r sample-folder
Add the SQL ( local.sql ) file to the project root ( /public ) folder then Run the below commands:
mysql
Use local
source local.sql