WordPress MySQL & PHP Performance

Hi Matthew Paulson, I see your using W3 Total Cache but your database and object cache is set to disk. Caching objects and your database to disk can actually have a negative performance effect especially if your getting that much traffic. You can read more about the effects on caching database and objects to disk … Read more

Connect forms in WP to external database

You can easily connect to another DB using the wpdb class: $external_users_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); (substituting in your applicable values, of course). From there you can use the get_results, insert, update, and query methods (among others) to do what you need to do, e.g. $external_users_db->get_results( “SELECT ID, username FROM users” );. The … Read more

Sharing database for collaborative development

Yes. Use WP_HOME and WP_SITEURL in your wp-config.php, so the URLs in the database won’t mess (a lot) with local site development. define (‘WP_HOME’, ‘http://local/site/url’); define (‘WP_SITEURL’, ‘http://local/site/url’); Also, some other good practices: Put in your .gitignore things like: wp-config.php wp-content/uploads wp-content/cache wp-content … # Everything that is created by users .htaccess Make a copy … Read more

Optimize Multiple Taxonomy Term MySQL Query?

While this is really a MySQL question it does help to understand the WordPress SQL schema and also I love trying to optimize SQL queries so rather than send you off to StackOverflow I’ll try to answer you here. You may still want to post it over there to get some other opinions. And while … Read more

How to move existing WordPress wp-content folder along with database to new server and new domain name?

There’s a pretty good step by step on moving WordPress in the Codex. It is what I follow when changing domains. Moving the files is pretty straight-forward. It is the hard-coded references in the database that are tricky. However, serialized search and replace will take care of all database changes. I’ve used the Velvet Blues … Read more

Slow wp_term_relationships query

Prepare yourself for an unsatisfying answer… After several days of testing, the conclusion that I’ve come to is that, put simply, this isn’t WordPress’ “fault”. I believe another related issue on the server was putting undue strain on the system. This was simply one of the slower queries, which, since the server was under strain, … Read more

Forcing nickname as display_name in custom edit profile template

I’m not 100% sure if I follow the logic of your question. But this is probably what you need: if ( !empty( $_POST[‘nickname’] ) ) { wp_update_user( array (‘ID’ => $current_user->id, ‘display_name’ => esc_attr( $_POST[‘nickname’] ) ) ) ; update_user_meta($current_user->id, ‘nickname’, esc_attr( $_POST[‘nickname’] ) ); update_user_meta($current_user->id, ‘display_name’, esc_attr( $_POST[‘nickname’] ) ); } Attention: update_usermeta has … Read more