$wpdb->prepare() warning in WordPress 3.5

Remove the call to $wpdb->prepare(): $result = $wpdb->get_var( “SELECT DISTINCT meta_value FROM $metatable WHERE meta_key LIKE ‘%matchme%’ AND meta_value IS NOT NULL AND meta_value <> ”” ); In this case, the $wpdb->prepare() function is not doing anything. There are no variables holding unknown values, therefore there is no need to sanitize them. If you did … Read more

wp_posts – guid update

The GUID should not be used to generate any URLs for the site (caveat below), so it shouldn’t hurt to leave them as they are… unless some badly designed plugin decides that GUIDs are a great shortcut to getting an URL. What the GUID is, is a globally unique identifier– global as in “throughout all … Read more

register_post_status – show_in_admin_all_list & show_in_admin_status_list does not affect query

TL;DR: It’s not a bug (as we generally understand it), rather it’s a feature that was never fully implemented in WordPress. Status of register_post_status() register_post_status() function was never fully implemented in WordPress. If you check WordPress Codex entry for register_post_status() function, you’ll see it’s clearly mentioned in a notice: NOTICE: This function does NOT add … Read more

Is it possible to define two databases for one installation?

What you’re talking about is a database fallback. It’s possible to set something like this up, but not directly with WordPress. How it would work Instead of accessing the database directly, you’d access a proxy. This proxy would sit in front of both your primary and backup databases and pass traffic through. Essentially, it would … Read more

Can a post ID be 0?

No, post ID can not be 0 in the DB. But the value 0 has a special meaning in the code, indicating the currently handled post (if the context is set up correctly)

Scanning Database for malicious Data

I’ve read that dumping the database as text and searching in it is a good way to go. You can search with phpmyadmin, but it’s limited. Depends on the size of the database and a good text editor, but you can delete post/page revisions before dumping the database to bring it down in size. Or … Read more