Select Page
Securing a WordPress 3.0 site

Securing a WordPress 3.0 site

Ensure you have the most recent version
Upgrading to the version 3.0 (as of the date of this article) will address many security vulnerabilities, including the protection of your wp-content/plugins directory, and your wp-admin folder.  These directories in 2.x versions had security issues and as such were prime targets for attacks.  Also be sure to upgrade all of your plug-ins, where applicable.  Regardless of how many WordPress sites you may be running, or how hard it may be to upgrade 10’s or 100’s of them, it’s better than having all of their content deleted and thus having to do reinstallations anyway.


Quick mysql_connect php script

The below script is a quick PHP script that connects to a mysql database to test connectivity.

$host = "";
$username = "username";
$password = "password";

        /* Connecting, selecting database */
        $conn = mysql_connect($host, $username, $password)
        or die("Could not connect");
        /* select the database */
        mysql_select_db("user") or die("Could not select database <I>user</I> Database<br>");

PHP script to send email

Very simple php script that sends email.  I use this from time to time to test the functionality of sendmail and php.

    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "emailtest@YOURDOMAIN";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";