szepeviktor/phpstan-wordpress
PHPStan rules and stubs tailored for WordPress projects. Adds accurate type information for core functions, hooks, and globals to catch bugs earlier and improve static analysis in plugins and themes. Easy to integrate into existing PHPStan setups.
Enhancing Code Quality & Developer Experience (DX):
Build vs. Buy:
$wpdb queries, hooks, or theme template logic). This package provides out-of-the-box validation for:
get_post(), wp_insert_post()).add_action(), apply_filters()).the_content(), get_header()).Use Cases:
get_the_author() vs. get_user_data()) or unsafe type casts.$wpdb queries or unsafe esc_* function usage.Adopt if:
Look elsewhere if:
For Executives: *"This package lets us catch WordPress-specific bugs before they reach production—saving dev time, reducing support costs, and improving our plugins/themes’ reliability. For example, it can:
For Engineering Teams: *"We’re adding PHPStan + WordPress extensions to our toolchain to:
$wpdb queries, hook callbacks, or template logic before testing.phpstan analyse with the --extension=szepeviktor/phpstan-wordpress flag.How can I help you explore Laravel packages today?