query_posts() replaces the main query after WordPress has already run it, which throws away the first result set, breaks pagination and leaves conditional tags lying about what page…
$wpdb->prepare() looks like sprintf() and behaves differently in the one way that matters: %s adds the surrounding quotes itself. Writing them by hand produces a doubly-quoted value and…
MySQL’s utf8 encodes at most three bytes per character. Real UTF-8 needs four for anything above the basic plane, which is where emoji and a good deal of…
INSERT IGNORE is reached for to skip rows that already exist. What it actually does is downgrade every error in the statement to a warning, which is a…
Running a REPLACE() over the database to change a domain looks like it works, until a widget disappears or a theme setting resets. PHP serialised strings encode their…