Passing Data from PHP to JavaScript
When passing data between PHP and JavaScript in WordPress, two methods can help. Use wp_add_inline_script to easily pass any data and perform dynamic code logic. Then, access the data from a single file to limit global variable access and allow easy inline documentation.
PHIVE: The Phar Installation and Verification Environment
In this post, I would like to give a quick summary of the PHIVE tool, what it allows to do, and invite you all to trial and discuss this. Maybe it will be useful for you to adopt. Manage Local PHP Tooling The idea behind PHIVE is to provide an optimized and streamlined way for […]
Proper File Checking in PHP
TL;DR: if you want to read a file, use is_readable, not file_exists. Over the last year or so, I think I reviewed about a dozen PRs—both Human Made and external—with something like this PHP code snippet: While this code works like 99% of the time, it’s not really doing what people thought it did. What […]
How to Set up Modern PHP Coding Standards for WordPress
This post explains how to write WordPress code following modern PHP best practices, adhering to the official (or other established) coding standards.
Three Things You Should Know About WordPress Filters
Oftentimes, people are using WordPress filters in a wrong way. This post tries to educate people on how to correctly filter data.
WordCamp Europe 2018: Unit Testing Workshop
I’m super excited to be hosting a workshop on unit testing at WordCamp Europe 2018. If you want to know why that is, you might want to read this post.
Becoming Human
New year, new job. With the end of 2017, I left Inpsyde, and as of January 15, 2018, I am one of the lucky devils working at Human Made. This post provides a little background to that move.
On PHP Language Constructs and Parentheses
What are PHP language constructs, why do they exist, and what are they good for? And what’s the issue with parentheses? Well, here are some answers to that.
Upgrade XAMPP the Clean Way
So you want to upgrade XAMPP. Instead of installing the new version on top of the current one, though, here’s what to do to get a fresh and clean install.
An Introduction to Unit Testing (for WordPress)
Talking about “testable code” is usually done in the context of unit testing. Writing testable code thus requires understanding unit testing. Learn it now.