automattic/vipwpcs
PHP_CodeSniffer sniffs and rulesets for validating WordPress VIP code. Includes WordPressVIPMinimum for the older WordPress.com VIP platform and WordPress-VIP-Go for VIP Go, flagging errors and warnings per VIP documentation.
Architecture fit. automattic/vipwpcs is not a Laravel package — it is a PHP_CodeSniffer (PHPCS) ruleset that encodes WordPress VIP platform constraints (WordPressVIPMinimum for legacy WordPress.com VIP, WordPress-VIP-Go for VIP Go). Its architecture is nonetheless directly relevant to a Laravel/PHP team: it is a thin, composable ruleset that layers org-specific sniffs on top of a general-purpose standard (WordPressCS) plus a supplementary standard (VariableAnalysis), wired together through PHPCS's external-standards registration mechanism and the dealerdirect/phpcodesniffer-composer-installer Composer plugin. That is the same "baseline standard + curated overrides" pattern a Laravel team would use to govern its own codebase on top of PSR-12 / Laravel conventions.
Where it fits architecturally: a CI quality gate, run as a dev-only dependency, producing a machine-readable report (full/checkstyle/JSON) that feeds a CI annotation layer. Where it does not fit: it targets WordPress API surfaces — WP_Query argument misuse, suppress_filters, batcache/object-cache behavior, hook return contracts, wp_ function restrictions, template escaping. None of these fire meaningfully on Laravel code, and the ruleset deliberately restricts functions that are perfectly valid in Laravel.
Integration feasibility. Straightforward mechanically: composer require --dev automattic/vipwpcs, grant the Composer plugin permission (allow-plugins.dealerdirect/phpcodesniffer-composer-installer true), and point a phpcs.xml.dist at a standard. In a Laravel repo, this coexists with Laravel Pint because Pint is a PHP-CS-Fixer wrapper, not PHPCS — the two do not conflict at the dependency level, but they will produce overlapping, differently-shaped style findings, so ownership of "style" must be assigned to exactly one tool. Feasibility of value, however, is conditional: this only pays off if the team ships code to WordPress VIP, or if the intent is to fork the ruleset as a template for a bespoke Laravel standard.
Technical risk. (1) License ambiguity — the repo metadata reports NOASSERTION while LICENSE.md states GPL-2.0-or-later. GPL is fine for a dev-only CI tool that is not redistributed as part of a product, but any plan to vendor, fork into a distributed artifact, or embed sniffs in a shipped package needs legal sign-off first. This is the single highest-severity unknown. (2) Dependency fan-out — the package pulls PHPCS ≥3.13.2, PHPCSUtils ≥1.1.0, PHPCSExtra ≥1.4.0, WPCS ≥3.1.0, and VariableAnalysis ≥2.12.0, all transitively. Minimum-version bumps have historically been forced by upstream PHP 8.2/8.3 support (see 3.0.1 raising PHPCS from 3.7.2 to 3.9.2), which means version pinning in a large monorepo can collide with other PHPCS consumers. (3) False-signal risk — in a non-WordPress codebase the ruleset mostly emits noise, and a noisy gate gets disabled, not fixed. (4) Release-date anomaly — the recorded last release (2026-07-27) is ahead of the review date; treat the release cadence claim as unverified and confirm from Packagist/tags before committing to a versioning policy.
Key questions. Do we actually run workloads on WordPress VIP (or plan to), or is this purely a reference implementation? If reference-only, is a fork acceptable under GPL, and who owns it? Which tool is the single source of truth for style — Pint or PHPCS? Can we absorb a five-package transitive dependency tree into the existing CI image without version conflicts? What is the error-vs-warning policy — does the pipeline fail the build or annotate only?
Stack fit. Three viable postures, in descending order of fit:
phpcs.xml.dist selecting WordPress-VIP-Go, run as a non-blocking first pass, then promote to blocking once the baseline is clean.acme/laravel-coding-standards ruleset on PHPCS, layering a small number of high-value custom sniffs (e.g., env() outside config, raw DB:: in controllers, missing $fillable, N+1-prone relation access) over PSR-12.Migration path. Phase 1: install in a single pilot repo, run report-only against app/, database/, routes/; capture the error/warning distribution to quantify how much of the output is WordPress-specific noise versus genuinely portable findings. Phase 2: decide posture (1 vs 2). Phase 3a (if adopting directly): pin the version, add phpcs.xml.dist, wire into CI as a warning-only job, drive the count to zero or to an explicit, commented ignore list. Phase 3b (if forking): extract the ruleset skeleton and the two or three portable sniffs, drop the WordPress-coupled ones, publish internally as a separate package. Phase 4: enforce.
Compatibility. Requires PHP 5.4+ at the package level but PHPCS 3.13.2+ effectively means a modern PHP toolchain — fine on PHP 8.1–8.4 Laravel targets. Confirm that the host repo's PHPCS version satisfies the ≥3.13.2 floor; if another dependency pins PHPCS lower, resolution will fail loudly rather than silently, which is acceptable. Composer 2.2+ requires the allow-plugins grant — this must be a documented onboarding step or the standards never register and PHPCS silently reports "standard not installed."
Sequencing. Land the Composer plugin permission and dependency first (a no-op change), then the ruleset file, then the CI job as non-blocking, then remediation, then enforcement. Never ship the dependency and the blocking gate in the same change — the first red build will be attributed to the tool, not the code.
Maintenance. Low incremental effort if posture 1 or 2-with-fork: the package is actively maintained with a real changelog discipline (deprecations signposted a full major ahead of removal, explicit minimum-version raising rationale). The maintenance cost that does land on us is the fork, if we choose posture 2 — an internal ruleset is a permanently-owned artifact with an owner, a version, and a PHPCS-upgrade cadence. Budget for that explicitly; do not treat a fork as a one-off spike.
Support. Upstream is a small-maintainer, high-signal project — responsive PR-driven changelog, issue templates, contribution guide. There is no commercial SLA, and Dependents: 0 in the metadata is almost certainly a measurement artifact (WPCS ecosystem packages are widely used in practice), but it means we cannot lean on an external user base for answers. Internal support burden falls on whichever team owns the CI pipeline. The WordPress VIP documentation site is the authoritative reference for error/warning semantics and should be linked from our own runbook.
Scaling. PHPCS is single-process and scales linearly with file count; beyond a few thousand files, parallelize (phpcs with --parallel) or shard by directory in CI. The five-package dependency tree is the real scaling constraint across a monorepo — every PHPCS consumer must agree on one resolvable version set. Recommend a single centrally-managed dev dependency rather than per-package declarations.
Failure modes. (a) Silent no-op — Composer plugin not allowed, standards not registered, PHPCS runs against a default standard and reports meaningless results; guard with an explicit phpcs -i assertion step in CI. (b) Cry-wolf — WordPress-specific findings on Laravel code erode trust until the gate is bypassed; mitigate with a tight, reviewed ignore list and a documented "why this standard" note. (c) Version deadlock — a transitive minimum-version bump blocks an unrelated upgrade; mitigate with a lockfile and a scheduled composer update --with-dependencies cadence. (d) Divergent tooling — Pint and PHPCS both auto-fixing produces churn and merge conflicts; enforce a strict division (Pint formats, PHPCS audits only, phpcs never run with --fix in this repo). (e) License surprise — a downstream redistribution decision made without the GPL question resolved.
Ramp-up. For a team that already runs Pint, PHPCS concepts (standards, sniffs, error codes, severity levels) take roughly half a day to internalize; the error/warning distinction and per-sniff ignore mechanics add another half-day of real use. Realistic ramp: one engineer-day to land posture 1 in a pilot; one to two engineer-weeks to stand up an internal Laravel ruleset under posture 2, dominated by writing and testing the first two or three custom sniffs, not by the framework. Recommend a single named owner for code-quality tooling before either path starts.
How can I help you explore Laravel packages today?