Adding PHP 8.2 in travis tests

Phew, getting php 8.2 working in my #wordpress plugin’s travis tests required quite a bit of trial & error in travis.yaml, but 8 commits later I won 😉 The solution was in these extra lines to ensure libonig5 was installed; matrix: include: – dist: focal php: 8.2 env: LIBONIG_INSTALL=1 install: # for PHP 8.2 install … Read more

Warning WordPress plugin users about their old PHP

After my initial disbelief about the amount of WordPress installations still on the slow and vulnerable PHP 5.2.17 (or older), I decided to warn users of my plugin with an non-dismissable warning on the plugin’s settings-page (and only there, so it’s not a default WordPress admin notice) cluttering the entire backend): This is going in … Read more

Why would you still be on PHP 5.2?

For Autoptimize 2.0.1 I declared a pretty complex regex to extract font-face’s from CSS using the nowdoc-syntax which is supported from PHP 5.3 onwards. Taking into account that the first PHP 5.2 release was over 9 years ago and support ended with the release of 5.2.17, over 5 years ago I assumed using a nowdoc … Read more

Autoptimize: why are .php,jquery excluded from JS optimization?

If you see .php,jquery added to the JS optimization exclusion list and wonder why that is the case; these are added by WP Spamshield to ensure optimal functioning of the that plugin and when you remove them they will be re-added automatically by WP Spamshield. I am currently exchanging information with Scott (WP Spamshield’s developer) … Read more

PHP HTML parsing performance shootout; regex vs DOM

As I wrote earlier an Autoptimize user proposed to switch from regular expression based script & style extraction to using native PHP DOM functions (optionally with xpath). I created a small test-script to compare performance and the DOM methods are on average 500% slower than the preg_match based solution. Here are some details; There are … Read more

Some HTML DOM parsing gotchas in PHP’s DOMDocument

Although I had used Simple HTML DOM parser for WP DoNotTrack, I’ve been looking into native PHP HTML DOM parsing as a possible replacement for regular expressions for Autoptimize as proposed by Arturo. I won’t go into the performance comparison results just yet, but here’s some of the things I learned while experimenting with DOMDocument … Read more

Quercus PHP on GAE: pining for file handles

Quercus really is great stuff; it allows nitwits like me to develop crappy PHP-applications and to deploy them on Google’s App Engine. But when you combine the limitations of Quercus’ PHP implementation with those of GAE, you’re going to have to code around some problems you wouldn’t be facing when developing a “normal” PHP webapp. … Read more

PHP OAuth extension: trial, error and success

I’ve been experimenting with the PHP OAuth PECL extension over the last few days and initially ran into some small problems getting it to function correctly. So for the sake of making this world wide web an even better place, here are some error-messages you might encounter and what you could do to resolve them: … Read more