Errors when trying to use a plugin to write to the database
You should never have to read wp-config to get database credentials. WordPress has built-in functions which are generally more secure for this sort of operation. In your plugin, simply call global $wpdb; and you will be connected to the WP database. You can then perform whatever queries you need – select, update, add, etc. For … Read more