Whenever you want to send a small amount of data to the server from client-side JS you almost always use AJAX, right? (Or, if you’re old enough, maybe a JS generated <img />.) For example, maybe you want to benchmark user actions or maybe you have your own special analytics….
Check your server’s composer files for known PHP vulnerabilities
The Sensio people have made so cool stuff including the SensioLabs Security Checker. You can use it via composer but you can also download a PHAR file and scan your entire server. wget http://get.sensiolabs.org/security-checker.phar -O ~/security-checker.phar find /var/www -type f -name “composer.lock” -exec php ~/security-checker.phar security:check {} ; Symfony Security…
Hide Jetpack nag for Clef migration
Add this to a plugin or maybe your functions.php file to remove the nag at the top of most admin pages. add_action( ‘plugins_loaded’, function(){ remove_action( ‘init’, array( ‘ClefWindDown’, ‘init’ ), 1 ); } );
If we piss off enough countries we might be able to get back to ASCII
I just lost an hour and a half and my sanity to a BOM.
Installing drush via composer on Drupal 8.3 throws errors
We recently had a problem installing drush on a new site. After we ran the following (we have a local composer) ./composer.phar require drush/drush:^8 We received this giant error message: ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved…
Better Nginx rules for BWP Minify
The plugin Better WordPress Minify is a great plugin for handling CSS and JS merging and minification. I’ve been using it for years now but just noticed today that there’s a weird header being emitted on some of my sites. Pragma: no-cache; What!?! No, please cache! Turns out it (probably) wasn’t…
The anatomy of a spoon
I thought spoons were simple but this diagram shows seven named parts (true, the “tip” is used twice) of the spoon! Learn more at The anatomy of a spoon
XDebug code coverage in PHP 7 doesn’t reach all code
I was noticing a lot of white (untouched) code in my XDebug code coverage reports however the method signatures at the top were all green and 100% covered. After some searching I found this thread (don’t bother reading) which led to this thread (scroll fast and occasionally read) which showed…