How to connect my wordpress plugin to a remote database securely?
First of all I do not have a lot of experience with wordpress plugins, but I am developing a plugin which has to connect and send data to a remote database ( which it is already doing ). But at this point of time my connection is not secure at all because all the database info is shown for the admin of the site.
This is my code at the moment, it works and all but how can I make sure that noone will see the database data that is in this file?
?php
function webARX_connect_to_db(){
$servername = "remote_host";
$username = "username";
$password = "password";
$dbname = "database_name";
// Create connection
$webARX_connection = new wpdb($username, $password, $dbname, $servername);
if (empty($webARX_connection-show_errors())){
return $webARX_connection;
} else {
return $webARX_connection-show_errors();
}
}
?
Topic plugin-development security Wordpress
Category Web