Tag: php
-
PHPCS Anywhere!
in Dev StuffSomething that I do often is run PHPCS on code I’m working on, almost always inside a git repository. Even more likely is that PHPCS was installed via composer, which means it will live in $GIT_ROOT/vendor/bin. So I always end up doing something like ../../../vendor/bin/phpcs file.php which is hugely annoying. Which is why I made…
-
Silly Ideas: Cache WordPress Excerpts
in WordPressLet’s explore dumb ideas around caching parts of WordPress we shouldn’t.
-
Stopping WordPress User Registration Spam
in WordPressCombatting the surge of user registration spam on WordPress, this guide introduces a code snippet to block registrations from specific email hostnames, offering an extra layer of protection against unwanted sign-ups.
-
Gathering database performance with WP-CLI
in WordPressDiscover how we employed WP-CLI to streamline the assessment of database server performance in WordPress, facilitating a more efficient profiling of SQL queries before and after crucial server upgrades.
-
Converting CSV to SQL
in Dev StuffLearn how to convert CSV files into SQL statements using PHP. Avoid directly inserting data into a live database; follow a safer approach. See a PHP script example for converting CSV files into SQL inserts, with an output demonstration for an “airtravel.csv” sample. Use this script cautiously or as a starting point for similar tasks.