WordPress Developer Ukraine, Kyiv
PHP Named Arguments and First-Class Callable Syntax in WordPress Plugins

PHP Named Arguments and First-Class Callable Syntax in WordPress Plugins

PHP 8.0 named arguments and PHP 8.1 first-class callable syntax (strlen(...)) are two underused features that improve readability and safety in WordPress plugin code. Named arguments eliminate the need to look up parameter order in function signatures and make optional parameters self-documenting. First-class callables create a Closure from any callable without wrapping it in an…
TypeScript in WordPress Block Development with @wordpress/scripts

TypeScript in WordPress Block Development with @wordpress/scripts

@wordpress/scripts (the official Webpack/Babel build tool for WordPress blocks) supports TypeScript out of the box — adding a tsconfig.json is all that is needed to enable type checking for block attributes, store selectors, and editor component props. TypeScript in block development catches attribute shape mismatches, incorrect useSelect return types, and missing block API fields before…
PHP Asymmetric Visibility: set-private Properties in PHP 8.4

PHP Asymmetric Visibility: set-private Properties in PHP 8.4

PHP 8.4 introduces asymmetric visibility — the ability to declare different access levels for reading and writing a property using the public private(set) / protected private(set) syntax. This replaces the common pattern of a public getter method plus a private property, making class definitions more concise while maintaining encapsulation. It is especially useful in WordPress…
PHP Pest Testing Framework for WordPress Plugins

PHP Pest Testing Framework for WordPress Plugins

Pest is a modern PHP testing framework built on top of PHPUnit that provides a more expressive, fluent API — expect($value)->toBe(42) — and reduces test boilerplate significantly. Pest’s higher-order tests, built-in parallel test execution, and architectural testing rules (arch()) make it a compelling alternative to raw PHPUnit for WordPress plugin test suites.
PHP Property Hooks: Computed and Validated Properties in PHP 8.4

PHP Property Hooks: Computed and Validated Properties in PHP 8.4

PHP 8.4 introduces property hooks — get and set hooks that run when a property is read or written, without requiring explicit getter/setter methods. They bring computed properties (a property whose value is derived from other state) and validated properties (a property that enforces a constraint on write) into the language as first-class syntax, making…
PHP readonly Properties and Classes: Immutable Value Objects in WordPress

PHP readonly Properties and Classes: Immutable Value Objects in WordPres ...

PHP 8.1 introduced readonly properties (written once at construction, immutable thereafter) and PHP 8.2 extended this to entire readonly classes where all properties are implicitly readonly. These features enable clean immutable value-object patterns in WordPress plugins — DTOs for REST API responses, money values, post metadata snapshots — without the boilerplate of private setters and…
PHP Enums in WordPress: Replacing Class Constants with Type-Safe Enums

PHP Enums in WordPress: Replacing Class Constants with Type-Safe Enums

PHP 8.1 enums provide a first-class alternative to the class-constant pattern that WordPress plugins have used for decades. Enums are type-safe, support methods and interfaces, and integrate cleanly with WordPress’s hooks API, sanitize_*() family, and database layers — while making intent far more explicit in code reviews and static analysis.
PHP Fibers: Cooperative Concurrency for WordPress Background Tasks

PHP Fibers: Cooperative Concurrency for WordPress Background Tasks

PHP 8.1 introduced Fibers — a low-level cooperative concurrency primitive that lets you pause execution of a function, yield control back to the caller, and resume later. While PHP remains single-threaded, Fibers unlock patterns like async I/O coordination, coroutine-style generators, and lightweight task queues that were previously impossible without forking or external queues.
PHP 8.4 Features for WordPress Plugin Development

PHP 8.4 Features for WordPress Plugin Development

PHP 8.4 (released November 2024) introduced property hooks — getter/setter logic directly on class properties — asymmetric visibility for readonly-like properties, array_find() and related array functions, and the #[\Deprecated] attribute. These changes significantly affect how modern WordPress plugin architecture is written.