wp-phpstan

Configure and run PHPStan in WordPress projects with stubs.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/zenbuapps/zenbu-powers --skill wp-phpstan-zenbuapps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-phpstan
Source: https://github.com/zenbuapps/zenbu-powers/tree/main/skills/wp-phpstan
Command: npx skills add https://github.com/zenbuapps/zenbu-powers --skill wp-phpstan-zenbuapps

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

WordPress projects often struggle with static analysis due to dynamic WordPress APIs and third-party plugins. This skill guides configuring PHPStan, loading WordPress stubs, and handling plugin classes to reduce false positives.

Core Features & Use Cases

  • Setup and maintain wp/phpstan configuration (phpstan.neon) for WordPress plugins, themes, and sites.
  • Generate and manage PHPStan baselines to address legacy code safely.
  • Improve WordPress typing by applying stubs and accurate PHPDoc recommendations for REST endpoints, hooks, and data models.

Quick Start

Configure wp-phpstan for your WordPress project and run the PHPStan analysis to identify and fix WordPress-specific typing issues.

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 plugin to reduce false positives?

Configuring PHPStan for WordPress requires loading WordPress stubs and handling third-party plugin classes in phpstan.neon to reduce false positives from dynamic APIs. This skill guides that setup including baseline generation for legacy code.

Why does PHPStan report unknown classes in my WordPress theme?

PHPStan reports unknown classes in WordPress themes because dynamic APIs and third-party classes lack native type definitions. Loading WordPress stubs resolves these errors by providing accurate PHPDoc and type-hinting for hooks and data models.

Do I need Composer to run PHPStan static analysis on WordPress sites?

Yes, running PHPStan static analysis on WordPress sites requires a Composer-based PHPStan setup. This environment is necessary to correctly load dependencies and WordPress stubs for accurate type-hinting and static analysis.

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

Managing PHPStan baselines for legacy WordPress code involves generating a baseline file to safely suppress existing errors while enforcing static analysis on new code. This skill provides steps to create and maintain these baselines.

Can I add type-hinting for WordPress REST endpoints and hooks in PHPStan?

Yes, you can add type-hinting for WordPress REST endpoints and hooks by applying WordPress stubs and accurate PHPDoc recommendations. This improves static analysis accuracy for data models and third-party plugin classes.