using same mysql user with many databases

Well it’s really not good practise, but this depends on how you’re accessing the other databases. For example, I have a server that hosts 10+ different WordPress sites. I have two options for connecting to the databases: Use the root login in all my wp-config.php files as it’s easier Create a user and logins associated … Read more

Write mysql credentials in plugin

As long as you aren’t passing out the plugin and other people don’t have access to it, you should be fine. You might add something like the following to the top of the file just in case though: defined(‘ABSPATH’) or die(‘Access denied’); That will simply make sure that the file is loaded via wordpress (e.g. … Read more

How can I work on a database along side a client?

You’ll need to make some modifications to wp-config.php. Add the following so WordPress picks up the domain automatically based on the environment: define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’] ); define( ‘WP_HOME’, ‘http://’ . $_SERVER[‘SERVER_NAME’] ); Now we need to make WordPress a little more portable by having it determine which host to use based on which … Read more

not saving post in wp_post wordpress database table

As Milo noted, you need to call the importposts functions to have it do anything. Additionally, if your post is not inserted, post_id should hold a wp_error object, so you could see what is wrong by doing the following right before add_post_meta if ( is_wp_error( $post_id ) ) { echo “<p>Bad Post Attempt:</p><pre>” . print_r($post_id, … Read more