PHPackages                             digitoimistodude/dude-coding-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. digitoimistodude/dude-coding-standards

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

digitoimistodude/dude-coding-standards
======================================

Dude Coding Standards (DCS) for WordPress theme and plugin development

1.0.8(4mo ago)01.4k↑539.3%[1 PRs](https://github.com/digitoimistodude/dude-coding-standards/pulls)2MITJavaScriptPHP &gt;=8.3CI passing

Since Dec 5Pushed 1w agoCompare

[ Source](https://github.com/digitoimistodude/dude-coding-standards)[ Packagist](https://packagist.org/packages/digitoimistodude/dude-coding-standards)[ RSS](/packages/digitoimistodude-dude-coding-standards/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (9)Dependencies (8)Versions (11)Used By (2)

Dude Coding Standards (DCS)
===========================

[](#dude-coding-standards-dcs)

Note

**Please note:** The Dude Coding Standard is a work in progress. We're in the process of replacing WordPress-Core standard in [dudestack](https://github.com/digitoimistodude/dudestack) with our own DSC standard, the one you are currently looking at (internal reference: [DEV-624](https://linear.app/dude/issue/DEV-624)). This PHPCS standard is used by Dude staff and may not provide additional value for external developers.

[![Packagist Version](https://camo.githubusercontent.com/4ba18947104d06044e447dfd04039c3212a7de489f23ad16a783c7100dba77f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696769746f696d6973746f647564652f647564652d636f64696e672d7374616e64617264733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/digitoimistodude/dude-coding-standards)[![WordPress](https://camo.githubusercontent.com/148b2a986da0b4a829fbfd2f5743c9446fc8447a3ea54a2b3189f20df3ef1cbe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d2532333131374143392e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d576f72645072657373266c6f676f436f6c6f723d7768697465)](#)[![PHP](https://camo.githubusercontent.com/d282cc3193faee11ee32307d0c4c9d809e8fafa4b3a8c12c6afbf35d4f7ec617/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](#)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/41a148597ff9fd62fa435b6edf0f2b4aec907d1f8bab5ee9568fb406732f90fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64696769746f696d6973746f647564652f647564652d636f64696e672d7374616e64617264732f2e676974687562253246776f726b666c6f77732532466275696c642e796d6c3f7374796c653d666f722d7468652d6261646765)](https://github.com/digitoimistodude/dude-coding-standards/actions)

PHP\_CodeSniffer and Stylelint rules for WordPress theme and plugin development at [Digitoimisto Dude Oy](https://www.dude.fi).

This repository contains:

- **PHPCS standard** (DCS) - via Composer
- **Stylelint config** - via npm

---

PHPCS Installation
------------------

[](#phpcs-installation)

```
composer require --dev digitoimistodude/dude-coding-standards
```

The standard will be automatically registered with [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) via the [Composer](https://getcomposer.org/) installer plugin.

Usage
-----

[](#usage)

### In phpcs.xml

[](#in-phpcsxml)

Create a `phpcs.xml` in your project root:

```

```

### Command line

[](#command-line)

```
phpcs --standard=DCS path/to/your/code
```

### With custom configuration

[](#with-custom-configuration)

You can override rules in your project's `phpcs.xml`:

```

  */some-legacy-folder/*

```

What's included
---------------

[](#whats-included)

DCS is based on [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards) with Dude-specific customizations:

### Code style

[](#code-style)

- **2-space indentation** instead of tabs
- **Short array syntax** `[]` allowed (instead of `array()`)
- **Relaxed commenting** requirements
- **Flexible function formatting** with spaces
- **...and more** in the future

### Security

[](#security)

All WordPress security sniffs are enabled:

- `WordPress.Security.NonceVerification`
- `WordPress.Security.ValidatedSanitizedInput`
- `WordPress.Security.EscapeOutput`
- And more...

### PHP compatibility

[](#php-compatibility)

Checks code compatibility with &gt; PHP 8.3 using [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP).

### Development functions

[](#development-functions)

`error_log()` and `print_r()` are allowed but flagged as **warnings** to remind you to review before deployment.

Excluded rules
--------------

[](#excluded-rules)

The following WordPress rules are excluded for Dude's workflow:

- Yoda conditions (`WordPress.PHP.YodaConditions`)
- Strict file naming (`WordPress.Files.FileName`)
- Tab indentation (`Generic.WhiteSpace.DisallowSpaceIndent`)
- Long array syntax requirement (`Universal.Arrays.DisallowShortArraySyntax`)
- See [DCS/ruleset.xml](DCS/ruleset.xml) for the full list

Adding forbidden functions
--------------------------

[](#adding-forbidden-functions)

To add more forbidden functions to your project, create a custom sniff or override in your `phpcs.xml`:

```

```

Development and local testing
-----------------------------

[](#development-and-local-testing)

If you want to test DCS locally before the package is published, first install dependencies in dude-coding-standards:

```
cd /path/to/dude-coding-standards
composer install
```

Then add path repository to your project's composer.json:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "../dude-coding-standards"
    }
  ],
  "require-dev": {
    "digitoimistodude/dude-coding-standards": "@dev"
  }
}
```

Run composer update in your project:

```
composer update digitoimistodude/dude-coding-standards
```

**Note:** Path repositories create symlinks, so any changes you make to dude-coding-standards are instantly available in your test project without reinstalling.

Check that DCS is available:

```
./vendor/bin/phpcs -i
# Should show: ... DCS ...
```

Create phpcs.xml in your project, can be as simple as this:

```

```

Run phpcs:

```
# From the dev project
./vendor/bin/phpcs --standard=phpcs.xml path/to/your/code

# By using the global version
phpcs --standard=phpcs.xml path/to/your/code

# With ignore patterns
./vendor/bin/phpcs --ignore=node_modules,vendor path/to/your/code
```

You can also run phpcs directly from dude-coding-standards against your project:

```
cd /path/to/dude-coding-standards

# Test against a specific theme/plugin
./vendor/bin/phpcs --ignore=node_modules,vendor /path/to/project/content/themes/your-theme/

# Or test your entire project
./vendor/bin/phpcs --standard=DCS /path/to/your/project/
```

Check the standard itself for development:

```
phpcs --standard=phpcs.xml DCS/
```

---

Stylelint Config
----------------

[](#stylelint-config)

### Installation

[](#installation)

```
npm install --save-dev @digitoimistodude/stylelint-config stylelint
```

### Usage

[](#usage-1)

Create `.stylelintrc` in your project root:

```
{
  "extends": "@digitoimistodude/stylelint-config"
}
```

If you ever need to add project based exclusions, use rules in your project:

```
{
  "extends": "@digitoimistodude/stylelint-config",
  "rules": {
    "rem-over-px/rem-over-px": null
  }
}
```

### Overriding rules

[](#overriding-rules)

```
{
  "extends": "@digitoimistodude/stylelint-config",
  "rules": {
    "declaration-no-important": null
  }
}
```

See [stylelint.config.js](stylelint.config.js) for all rules.

---

Contributing (Dude staff)
-------------------------

[](#contributing-dude-staff)

### Adding excludes

[](#adding-excludes)

When you encounter a rule that should be excluded globally, add it to `DCS/ruleset.xml`:

```

  0

```

**Important:** Don't include full rulesets like `` or ``. WordPress already includes specific rules from these standards. Only disable individual rules that conflict with Dude's style.

Find the rule name from the phpcs error output (shown when using `-s` flag).

### Release cycle

[](#release-cycle)

1. Make changes to `DCS/ruleset.xml`
2. Update `CHANGELOG.md` with new version and changes
3. Commit and push: ```
    cd ~/Projects/dude-coding-standards
    git add -A && git commit -m "Your change description, Ref: DEV-624"
    git push
    ```
4. Tag a new release: ```
    git tag 1.0.x
    git push --tags
    ```

The GitHub Actions workflow will automatically create a release when a new tag is pushed.

Projects using the package can update with:

```
composer update digitoimistodude/dude-coding-standards
```

**Note:** Projects using path repository (symlink) get changes instantly without updating.

---

References
----------

[](#references)

- [Public Dude Coding Standards handbook: dev.docs.dude.fi](https://dev.docs.dude.fi)
- [DEV-624: Dude Coding Standards](https://linear.app/dude/issue/DEV-624)
- [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/)
- [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance87

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

9

Last Release

142d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac8f1091787825c059e30ad39ca1f58453f45c5ae0c585ba3be00904d045b8b2?d=identicon)[ronilaukkarinen](/maintainers/ronilaukkarinen)

---

Top Contributors

[![rollecode](https://avatars.githubusercontent.com/u/1534150?v=4)](https://github.com/rollecode "rollecode (23 commits)")

---

Tags

phpcswordpresscoding-standardsdude

### Embed Badge

![Health badge](/badges/digitoimistodude-dude-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/digitoimistodude-dude-coding-standards/health.svg)](https://phpackages.com/packages/digitoimistodude-dude-coding-standards)
```

###  Alternatives

[humanmade/coding-standards

Human Made Coding Standards

160443.1k59](/packages/humanmade-coding-standards)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k134.0M2.3k](/packages/slevomat-coding-standard)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.2M34](/packages/yoast-yoastcs)[syde/phpcs

Syde PHP coding standards for WordPress projects.

1027.6k9](/packages/syde-phpcs)[woocommerce/woocommerce-sniffs

WooCommerce sniffs

497.5M54](/packages/woocommerce-woocommerce-sniffs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
