Download the PHP package rlorenzo/mago-wordpress without Composer
On this page you can find all versions of the php package rlorenzo/mago-wordpress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rlorenzo/mago-wordpress
More information about rlorenzo/mago-wordpress
Files in rlorenzo/mago-wordpress
Package mago-wordpress
Short Description Mago extension for WordPress: WPCS-equivalent linter rules.
License MIT
Informations about the package mago-wordpress
mago-wordpress
WordPress Coding Standards for Mago. This extension ports the WPCS lint sniffs to Mago's linter, so a plugin or theme is checked in seconds, not minutes.
2–12× faster than phpcs
8.1× faster overall on the top 10 WordPress.org plugins plus WordPress core. Method and numbers: Benchmarks.
Install
Run mago lint. You get this package's 52 default rules, Mago's own WordPress security rules
and a WordPress formatter preset.
The worker runs as PHP inside your project and loads its Composer autoloader, like PHPUnit or PHPStan, so only lint projects you trust.
Configure
Settings go in composer.json:
- Already using phpcs? Without this block, the same settings and exclusions are read from your
phpcs.xml. - Existing
phpcs:ignoreandphpcs:disablecomments still work. - Turn a rule off with
exclude-patterns, under its WPCS code.[linter.rules]doesn't acceptwordpress/*codes.
All settings: Configuration.
Migrate from phpcs
It also lists anything it couldn't carry over. See Migrating from phpcs.
Format
mago format can't add the spaces WordPress puts inside parentheses, so a lint fix adds them
afterwards. Always run the three steps together, because mago format removes the spaces again:
See Formatting.
Docs
- Rules: the 53 rules, their levels and their autofixes.
- Configuration: every setting, the
phpcs.xmlfallback and suppression comments. - Formatting: the preset and what still differs from WPCS.
- Migrating from phpcs: what
migrateconverts and what it can't. - WPCS coverage: Mago's own WordPress rules,
WordPress-Docs, the generic sniffs, and what isn't ported. - Benchmarks: method and full results.
Development
Rule tests run a real Mago worker against tests/corpus/rules/<rule>/. Each expected report is
marked with // @mago-expect lint:wordpress/<rule> on the line before it, and any report without
a matching expectation fails. CI runs just check on PHP 8.1, 8.4 and 8.5.
Credits
Generic syntax helpers are adapted from amateescu/mago-drupal
(MIT) and the rule data from WordPress Coding Standards
(MIT); see NOTICE.md. The rules were first written in Rust for the Mago fork at
rlorenzo/mago and ported here after Mago gained worker extensions.
All versions of mago-wordpress with dependencies
ext-dom Version *
ext-libxml Version *
ext-tokenizer Version *
carthage-software/mago Version ^1.47.1