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
Databases

ACID in practice: what SQLite, Postgres, MySQL and MariaDB actually promise

Atomicity, consistency, isolation and durability, one letter at a time, and how differently SQLite, Postgres, MySQL, MariaDB and a few others implement each one. Same words, different guarantees.

2026-10-01
Networking

TCP: how a connection actually works

What TCP does on top of IP: ports, the three-way handshake, sequence numbers, ACKs, retransmission, closing a connection, and the costs that pushed HTTP/3 onto QUIC.

2026-09-26
NLP

Vectorizing text: from word counts to meaning

How text becomes numbers a model can work with: one-hot vectors, bag of words, TF-IDF, the hashing trick, word embeddings and sentence embeddings, and when to use each.

2026-09-25
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