wp-phpstan

Configure WordPress-specific PHPStan setups with stubs and baselines.

12|9|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/jnealey88/designsetgo --skill wp-phpstan-jnealey88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-phpstan
Source: https://github.com/jnealey88/designsetgo/tree/main/.claude/skills/wp-phpstan
Command: npx skills add https://github.com/jnealey88/designsetgo --skill wp-phpstan-jnealey88

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

WordPress PHPStan setup and maintenance is error-prone without WordPress-aware typing, stubs, baselines, and safe handling of third-party classes. This skill provides a structured approach to configuring phpstan.neon, generating or updating baselines, and applying WordPress-specific PHPDoc annotations to reduce false positives.

Core Features & Use Cases

  • Ensure WordPress core stubs are loaded and PHPStan config references them
  • Create, adjust, or baseline phpstan.neon for plugins/themes/sites
  • Improve type accuracy for REST callbacks, hooks, and WPDB results using WordPress-annotations guidelines

Quick Start

Run the wp-phpstan inspection workflow to inspect a WordPress project and generate a report to guide tuning.

Frequently Asked Questions about wp-phpstan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure PHPStan for a WordPress project to reduce type errors?

To configure PHPStan for WordPress, you need to load WordPress core stubs and reference them in your phpstan.neon file. This ensures the static analysis understands WordPress-specific functions and reduces false positives.

What is the best way to manage PHPStan baselines for WordPress plugins?

Managing PHPStan baselines involves generating or updating baseline files to handle third-party classes and existing errors. This approach keeps your phpstan.neon configuration in sync with project policies without breaking the build.

Why does PHPStan report false positives for WordPress hooks and REST callbacks?

PHPStan reports false positives for hooks and REST callbacks due to missing WordPress-specific type definitions. Applying WordPress-specific PHPDoc annotations and loading stubs improves type accuracy and resolves these errors.

Can I use PHPStan static analysis on WordPress core, themes, and plugins simultaneously?

Yes, you can apply PHPStan static analysis to WordPress core, themes, and plugins simultaneously. The setup requires ensuring WordPress stubs are loaded and phpstan.neon is configured to scan all target directories safely.

Do I need WordPress stubs to run static analysis on my site?

Yes, you need WordPress stubs to run static analysis effectively. Without stubs loaded in your phpstan.neon configuration, the analyzer cannot recognize WordPress core functions, leading to inaccurate results.

What's the best way to document PHPStan decisions in a WordPress project?

The best way to document PHPStan decisions is to keep your phpstan.neon and baseline workflows in sync with project policies. Recording these configurations ensures baseline management and stub loading decisions are transparent.