WordPress Developer Ukraine, Kyiv
Write Unit Tests for WordPress Plugins with PHPUnit and WP-CLI Scaffold

Write Unit Tests for WordPress Plugins with PHPUnit and WP-CLI Scaffold

Write unit tests for WordPress plugins with PHPUnit and WP-CLI scaffolding WordPress unit tests run against a real WordPress loaded with a separate test database. Every test runs inside a database transaction that is rolled back afterwards, so each test starts from a clean state. WP-CLI generates the whole setup, and the base class WP_UnitTestCase…
PHP Composer in WordPress Development

PHP Composer in WordPress Development

Composer in WordPress plugins and themes Composer is the dependency manager of PHP. WordPress core does not use it, but in your own plugins and themes it saves copying libraries by hand: composer require downloads a library with its dependencies, and one autoloader loads all classes, the libraries’ and your own.
Debugging WordPress PHP Code with Xdebug and VS Code

Debugging WordPress PHP Code with Xdebug and VS Code

Debug WordPress with Xdebug and VS Code var_dump() and error_log() show one value at one moment. A step debugger stops the code on a line you choose and shows all variables, the call stack and the current hook, and lets you go on line by line. For WordPress, with its chains of hooks and filters,…
PHP 7 Features Every WordPress Developer Should Know

PHP 7 Features Every WordPress Developer Should Know

PHP 7 features worth using in WordPress code PHP 7.0 came out in December 2015 and was roughly twice as fast as PHP 5.6 on WordPress, but it also brought language features that make code shorter and clearer. WordPress itself still runs on PHP 5.2.4 and newer, so core cannot use them, but in your…