Site icon Hip-Hop Website Design and Development

Find out how to join my wordpress plugin to a distant database securely?

Initially I wouldn’t have a variety of expertise with wordpress plugins, however I’m growing a plugin which has to attach and ship information to a distant database ( which it’s already doing ). However at this level of time my connection shouldn’t be safe in any respect as a result of all of the database information is proven for the admin of the positioning.

That is my code in the mean time, it really works and all however how can I guarantee that noone will see the database information that’s on this file?

<?php
operate 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();
  }
}
?>