wp-phpstan

Configure, execute, and debug PHPStan static analysis for WordPress projects.

3|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/ihatesea69/HieuNghi-AI-Skills --skill wp-phpstan-ihatesea69
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-phpstan
Source: https://github.com/ihatesea69/HieuNghi-AI-Skills/tree/main/wordpress_skills/wp-phpstan
Command: npx skills add https://github.com/ihatesea69/HieuNghi-AI-Skills --skill wp-phpstan-ihatesea69

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of configuring, running, and resolving errors from PHPStan static analysis within WordPress projects, ensuring code quality and catching potential bugs before runtime.

Core Features & Use Cases

  • Configuration: Assists in setting up phpstan.neon files, including paths, exclusions, and WordPress-specific settings.
  • Error Resolution: Guides users on fixing PHPStan errors by leveraging WordPress-specific PHPDoc annotations and handling third-party plugin compatibility.
  • Baseline Management: Facilitates the generation and updating of phpstan-baseline.neon files.
  • Use Case: You've just installed PHPStan in your WordPress plugin and are facing hundreds of errors. This Skill will help you configure PHPStan correctly, understand the errors related to WordPress functions, and apply the right annotations or ignore patterns to resolve them efficiently.

Quick Start

Use the wp-phpstan skill to inspect the current PHPStan setup in the project.

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 static analysis for a WordPress plugin?

Configuring PHPStan static analysis for WordPress involves setting up a `phpstan.neon` file with specific paths, exclusions, and WordPress-specific settings to ensure proper code quality checks. The process includes managing baselines and applying type annotations to handle third-party plugin compatibility.

Why does PHPStan report errors for native WordPress functions in my plugin?

PHPStan reports errors for native WordPress functions because it lacks default type definitions for the WordPress environment. Resolving these static analysis errors requires applying WordPress-specific PHPDoc annotations and configuring the analysis to recognize third-party plugin code.

Can I use PHPStan with WordPress 6.9+ and Composer dependencies?

Yes, you can use PHPStan with WordPress 6.9+ and Composer dependencies. This static analysis setup specifically targets WordPress 6.9+ environments and requires a Composer-based PHPStan installation to inspect your project's code quality and catch potential bugs before runtime.

What is the best way to manage a PHPStan baseline for an existing WordPress project?

The best way to manage a PHPStan baseline for an existing WordPress project is to generate and update a `phpstan-baseline.neon` file. This baseline captures current static analysis errors, allowing you to enforce code quality on new code while systematically addressing existing technical debt.

How do I fix PHPStan errors related to third-party WordPress plugins?

Fixing PHPStan errors related to third-party WordPress plugins requires adjusting your `phpstan.neon` configuration to recognize external code. You can resolve these static analysis errors by applying WordPress-specific PHPDoc annotations or defining ignore patterns for incompatible third-party structures.