Istiaq Nirab full stack + ai
← Writing
vsCode Dec 17, 2022

vsCode Configuration for WordPress Plugin

Configure vscode to experience better on develop WordPress Plugin.

First of all you need to install wpcs dependencies on your plugin via composer :

composer require --dev wp-coding-standards/wpcs:dev-develop

After install this package, you’ll get access these two types of commands :

# check php coding standard releted issues

./vendor/bin/phpcs
# fix coding standard automatically

./vendor/bin/phpcbf

I recommend to register these commands with composer scripts.

"scripts": {
	"phpcs": "\"vendor/bin/phpcs\"",
	"phpcbf": "\"vendor/bin/phpcbf\"",
	"sniffs": "\"vendor/bin/phpcs\" -e",
}

then you can easily access phpcs commands via composer:

composer phpcs
composer phpcbf
composer sniffs

Extensions

Some vsCode extensions, I always use :

PHP-Intelephense I recommend PHP Intelephense for PHP built-in functions completion, code completion (IntelliSense), go to definition support and many more.

Phpcs

phpcs extension allow us to display phpcs related issues without running phpcs commands every time & also fix coding styles after save file.

To enable WordPress coding standards:

"phpsab.standard": "WordPress",

It’s automatically configure setup from your root project composer.json.

But what happen if you want to develop something like WooCommerce Extension OR any other plugin based plugin !!

You need to open wordpress plugins directory instead of opening single plugin directory. vsCode explorer

Then you can get better code completion (IntelliSense) support.

But the phpcs extension doesn’t work, you need to configure locally in the plugins directory. So, create new folder called .vscode under the project root and create settings.json file here.

Inside settings.json :

{
  "phpsab.executablePathCS": "./subscription-pro/vendor/bin/phpcs",
  "phpsab.executablePathCBF": "./subscription-pro/vendor/bin/phpcbf",
  "phpsab.standard": "WordPress",
  "[php]": {
    "editor.defaultFormatter": "valeryanm.vscode-phpsab"
  }
}

Now, you can see phpcs working fine.

vscode phpcs

The last extension is WordPress Hooks IntelliSense, which will provide better autocompletion for hooks.

wordpress intellisense

Thanks.

Discussion

Comments run on giscus, backed by GitHub Discussions — sign in with GitHub to reply.

More posts
LLM

Five steps from a business problem to an LLM that actually ships

Understand, prepare, select, customize, productionize. A working order of operations for picking a language model and getting it into production without burning a quarter.

2026-09-12
NLP

N-grams: the language model before language models

How N-grams turn text into countable sequences, how they predict the next word, and why counting eventually stopped being enough.

2026-09-11
Laravel

Setup vsCode for Laravel Development

The extensions and keyboard shortcuts that turn Visual Studio Code into a proper Laravel editor.

2023-09-22
ContactGMT+6

Have something that needs building, fixing, or finishing? Write one paragraph — that's usually enough.

open to new work
Local time--:--:--
Based inDhaka, BD
Experience6+ years