diff --git a/pingback-updater.php b/pingback-updater.php
index 35042fb..6190c5d 100644
--- a/pingback-updater.php
+++ b/pingback-updater.php
@@ -1,4 +1,4 @@
-<?
+<?php
 /* See http://trilema.com/2015/how-to-fix-your-local-trackbacks/ (but note that .php files in your WP directory can be executed by anyone).
 
 // Db connect data.
@@ -9,8 +9,8 @@ $db_pass = '';
 
 $table_prefix  = '';
 
-$nconnection = mysql_connect("localhost", $db_user, $db_pass );
-mysql_select_db($db_name, $nconnection);
+$nconnection = mysqli_connect("localhost", $db_user, $db_pass );
+mysqli_select_db($db_name, $nconnection);
 
 // Index of post at which script last ran. Script won't look through earlier posts. You have to update the value manually. 
 $last_run = 61145; 
@@ -19,9 +19,9 @@ $last_run = 61145;
 $local = "http://trilema.com/";
 
 $query = 'SELECT YEAR(post_date), post_name, post_content FROM '.$table_prefix.'posts WHERE post_type ="post" AND post_content LIKE "%<a href=%" AND ID > '.$last_run;
-$record = mysql_query($query);
+$record = mysqli_query($nconnection, $query);
 
-while (	$row = mysql_fetch_array($record, MYSQL_NUM)) {
+while (	$row = mysqli_fetch_array($record, MYSQL_NUM)) {
   $post_url = "http://trilema.com/".$row[0]."/".$row[1];
  // echo "<h1>",$post_url,"</h1>";
 
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index e00b4a2..d40bc10 100644
--- a/wp-admin/includes/dashboard.php
+++ b/wp-admin/includes/dashboard.php
@@ -217,7 +217,7 @@ function wp_dashboard_right_now() {
 	echo "\n\t".'<div class="versions">';
 	$ct = current_theme_info();
 	$sidebars_widgets = wp_get_sidebars_widgets();
-	$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
+	$num_widgets = array_reduce( $sidebars_widgets, function($prev, $curr) { return $prev+count($curr); }, 0 );
 	$num = number_format_i18n( $num_widgets );
 
 	echo "\n\t<p>";
diff --git a/wp-admin/includes/import.php b/wp-admin/includes/import.php
index c9cd71c..e9bb34d 100644
--- a/wp-admin/includes/import.php
+++ b/wp-admin/includes/import.php
@@ -16,7 +16,7 @@
 function get_importers() {
 	global $wp_importers;
 	if ( is_array($wp_importers) )
-		uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
+		uasort($wp_importers, function($a, $b) { return strcmp($a[0], $b[0]); });
 	return $wp_importers;
 }
 
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index cae31ff..46f0023 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -309,7 +309,7 @@ function get_media_item( $attachment_id, $args = null ) {
 	$hidden_fields = array();
 
 	foreach ( $form_fields as $id => $field ) {
-		if ( $id{0} == '_' )
+		if ( $id[0] == '_' )
 			continue;
 
 		if ( !empty($field['tr']) ) {
diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php
index 2672b07..1623659 100644
--- a/wp-admin/includes/plugin.php
+++ b/wp-admin/includes/plugin.php
@@ -213,7 +213,7 @@ function get_plugins($plugin_folder = '') {
 		$wp_plugins[plugin_basename( $plugin_file )] = $plugin_data;
 	}
 
-	uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
+	uasort( $wp_plugins, function($a, $b) { return strnatcasecmp( $a["Name"], $b["Name"] ); });
 
 	$cache_plugins[ $plugin_folder ] = $wp_plugins;
 	wp_cache_set('plugins', $cache_plugins, 'plugins');
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 74b6eeb..2581434 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1909,7 +1909,7 @@ function _list_meta_row( $entry, &$count ) {
 		$style = 'alternate';
 	else
 		$style = '';
-	if ('_' == $entry['meta_key'] { 0 } )
+	if ('_' == $entry['meta_key'][0] )
 		$style .= ' hidden';
 
 	if ( is_serialized( $entry['meta_value'] ) ) {
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index e691d08..32f6207 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -562,7 +562,7 @@ class WP_User_Search {
 	 * @param string $role Role name.
 	 * @return WP_User_Search
 	 */
-	function WP_User_Search ($search_term = '', $page = '', $role = '') {
+	function __construct ($search_term = '', $page = '', $role = '') {
 		$this->search_term = $search_term;
 		$this->raw_page = ( '' == $page ) ? false : (int) $page;
 		$this->page = (int) ( '' == $page ) ? 1 : $page;
diff --git a/wp-admin/page.php b/wp-admin/page.php
index b5f4ebe..b7ed6d5 100644
--- a/wp-admin/page.php
+++ b/wp-admin/page.php
@@ -111,7 +111,7 @@ case 'edit':
 			$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
 			$message = sprintf( __( 'Warning: %s is currently editing this page' ), wp_specialchars( $last_user_name ) );
 			$message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" );
-			add_action('admin_notices', create_function( '', "echo '$message';" ) );
+			add_action('admin_notices', function() { echo '$message'; } );
 		} else {
 			wp_set_post_lock( $post->ID );
 		}
diff --git a/wp-admin/post.php b/wp-admin/post.php
index 0aa40df..2f49a3f 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -144,7 +144,7 @@ case 'edit':
 			$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
 			$message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) );
 			$message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" );
-			add_action('admin_notices', create_function( '', "echo '$message';" ) );
+			add_action('admin_notices', function() { echo '$message'; } );
 		} else {
 			wp_set_post_lock( $post->ID );
 		}
diff --git a/wp-content/themes/bmg_minimal/comments.php b/wp-content/themes/bmg_minimal/comments.php
index 0ea9b18..ae24b88 100644
--- a/wp-content/themes/bmg_minimal/comments.php
+++ b/wp-content/themes/bmg_minimal/comments.php
@@ -87,7 +87,7 @@
       size="22"
       tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>
     />
-    <?php if ($req) ?><span class="input-required">*</span><? endif; ?>
+    <?php if ($req) ?><span class="input-required">*</span><?php endif; ?>
   </div>
 
   <div class="comment-input-group">
@@ -104,7 +104,7 @@
       size="22"
       tabindex="2" <?php if ($req) echo "aria-required='true'"; ?>
     />
-    <?php if ($req) ?><span class="input-required">*</span><? endif; ?>
+    <?php if ($req) ?><span class="input-required">*</span><?php endif; ?>
   </div>
 
   <div class="comment-input-group">
diff --git a/wp-includes/atomlib.php b/wp-includes/atomlib.php
index e75ca39..16bbb9b 100644
--- a/wp-includes/atomlib.php
+++ b/wp-includes/atomlib.php
@@ -91,8 +91,8 @@ class AtomParser {
 
         $this->feed = new AtomFeed();
         $this->current = null;
-        $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
-        $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
+        $this->map_attrs_func = function($k, $v) { return "$k=\"$v\""; };
+        $this->map_xmlns_func = function($p, $n) { $xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\""; };
     }
 
     function _p($msg) {
@@ -148,7 +148,7 @@ class AtomParser {
 
     function start_element($parser, $name, $attrs) {
 
-        $tag = array_pop(split(":", $name));
+        $tag = array_pop(explode(":", $name));
 
         switch($name) {
             case $this->NS . ':feed':
@@ -227,7 +227,7 @@ class AtomParser {
 
     function end_element($parser, $name) {
 
-        $tag = array_pop(split(":", $name));
+        $tag = array_pop(explode(":", $name));
 
         $ccount = count($this->in_content);
 
@@ -302,7 +302,7 @@ class AtomParser {
 
     function ns_to_prefix($qname, $attr=false) {
         # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div')
-        $components = split(":", $qname);
+        $components = explode(":", $qname);
 
         # grab the last one (e.g 'div')
         $name = array_pop($components);
diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php
index 5ea849f..c415588 100644
--- a/wp-includes/capabilities.php
+++ b/wp-includes/capabilities.php
@@ -80,7 +80,7 @@ class WP_Roles {
 	 *
 	 * @return WP_Roles
 	 */
-	function WP_Roles() {
+	function __construct() {
 		$this->_init();
 	}
 
@@ -279,7 +279,7 @@ class WP_Role {
 	 * @param array $capabilities List of capabilities.
 	 * @return WP_Role
 	 */
-	function WP_Role( $role, $capabilities ) {
+	function __construct( $role, $capabilities ) {
 		$this->name = $role;
 		$this->capabilities = $capabilities;
 	}
@@ -462,7 +462,7 @@ class WP_User {
 	 * @param int $name Optional. User's username
 	 * @return WP_User
 	 */
-	function WP_User( $id, $name = '' ) {
+	function __construct( $id, $name = '' ) {
 
 		if ( empty( $id ) && empty( $name ) )
 			return;
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index be0c11b..5276637 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -647,9 +647,9 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
 
 	// SQL cannot save you; this is a second (potentially different) sort on a subset of data.
 	if ( 'name' == $orderby )
-		uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
+		uasort( $tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); } );
 	else
-		uasort( $tags, create_function('$a, $b', 'return ($a->count < $b->count);') );
+		uasort( $tags, function($a, $b) { return ($a->count < $b->count); } );
 
 	if ( 'DESC' == $order )
 		$tags = array_reverse( $tags, true );
diff --git a/wp-includes/class-phpass.php b/wp-includes/class-phpass.php
index 93f4536..40428fb 100644
--- a/wp-includes/class-phpass.php
+++ b/wp-includes/class-phpass.php
@@ -39,7 +39,7 @@ class PasswordHash {
 	var $portable_hashes;
 	var $random_state;
 
-	function PasswordHash($iteration_count_log2, $portable_hashes)
+	function __construct($iteration_count_log2, $portable_hashes)
 	{
 		$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
 
diff --git a/wp-includes/class-phpmailer.php b/wp-includes/class-phpmailer.php
index a7ad292..4556aa5 100644
--- a/wp-includes/class-phpmailer.php
+++ b/wp-includes/class-phpmailer.php
@@ -466,7 +466,7 @@ class PHPMailer {
       $to .= $this->AddrFormat($this->to[$i]);
     }
 
-    $toArr = split(',', $to);
+    $toArr = explode(',', $to);
 
     $params = sprintf("-oi -f %s", $this->Sender);
     if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
@@ -1706,7 +1706,7 @@ class PHPMailer {
           $directory = dirname($url);
           ($directory == '.')?$directory='':'';
           $cid = 'cid:' . md5($filename);
-          $fileParts = split("\.", $filename);
+          $fileParts = explode("\.", $filename);
           $ext = $fileParts[1];
           $mimeType = $this->_mime_types($ext);
           if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php
index e4c9c45..df41f7b 100644
--- a/wp-includes/class.wp-dependencies.php
+++ b/wp-includes/class.wp-dependencies.php
@@ -192,7 +192,7 @@ class _WP_Dependency {
 
 	var $extra = array();
 
-	function _WP_Dependency() {
+	function __construct() {
 		@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
 		if ( !is_array($this->deps) )
 			$this->deps = array();
diff --git a/wp-includes/classes.php b/wp-includes/classes.php
index 1751785..a197c8f 100644
--- a/wp-includes/classes.php
+++ b/wp-includes/classes.php
@@ -491,7 +491,7 @@ class WP {
 	 *
 	 * @return WP
 	 */
-	function WP() {
+	function __construct() {
 		// Empty.
 	}
 }
@@ -543,7 +543,7 @@ class WP_Error {
 	 * @param mixed $data Optional. Error data.
 	 * @return WP_Error
 	 */
-	function WP_Error($code = '', $message = '', $data = '') {
+	function __construct($code = '', $message = '', $data = '') {
 		if ( empty($code) )
 			return;
 
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 207c813..609f3f8 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -500,7 +500,7 @@ function get_comments_link() {
  * @param string $deprecated Not Used
  * @param bool $deprecated Not Used
  */
-function comments_link( $deprecated = '', $deprecated = '' ) {
+function comments_link() {
 	echo get_comments_link();
 }
 
diff --git a/wp-includes/feed.php b/wp-includes/feed.php
index 916d84f..a3f8d38 100644
--- a/wp-includes/feed.php
+++ b/wp-includes/feed.php
@@ -400,10 +400,10 @@ function rss_enclosure() {
 	foreach ( (array) get_post_custom() as $key => $val) {
 		if ($key == 'enclosure') {
 			foreach ( (array) $val as $enc ) {
-				$enclosure = split("\n", $enc);
+				$enclosure = explode("\n", $enc);
 
 				//only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'
-				$t = split('[ \t]', trim($enclosure[2]) );
+				$t = explode('[ \t]', trim($enclosure[2]) );
 				$type = $t[0];
 
 				echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n");
@@ -436,7 +436,7 @@ function atom_enclosure() {
 	foreach ( (array) get_post_custom() as $key => $val ) {
 		if ($key == 'enclosure') {
 			foreach ( (array) $val as $enc ) {
-				$enclosure = split("\n", $enc);
+				$enclosure = explode("\n", $enc);
 				echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
 			}
 		}
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 599bb96..37d2b7d 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -73,7 +73,7 @@ function wpautop($pee, $br = 1) {
 	$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
 	$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
 	if ($br) {
-		$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "<WPPreserveNewline />", $matches[0]);'), $pee);
+		$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', function($matches) { return str_replace("\n", "<WPPreserveNewline />", $matches[0]); }, $pee);
 		$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
 		$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
 	}
@@ -813,9 +813,9 @@ function untrailingslashit($string) {
 function addslashes_gpc($gpc) {
 	global $wpdb;
 
-	if (get_magic_quotes_gpc()) {
-		$gpc = stripslashes($gpc);
-	}
+	// if (get_magic_quotes_gpc()) {
+	// 	$gpc = stripslashes($gpc);
+	// }
 
 	return $wpdb->escape($gpc);
 }
@@ -1026,7 +1026,7 @@ function convert_smilies($text) {
 		$stop = count($textarr);// loop stuff
 		for ($i = 0; $i < $stop; $i++) {
 			$content = $textarr[$i];
-			if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
+			if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag
 				$content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
 			}
 			$output .= $content;
@@ -1815,8 +1815,8 @@ function sanitize_option($option, $value) {
  */
 function wp_parse_str( $string, &$array ) {
 	parse_str( $string, $array );
-	if ( get_magic_quotes_gpc() )
-		$array = stripslashes_deep( $array );
+	// if ( get_magic_quotes_gpc() )
+	// 	$array = stripslashes_deep( $array );
 	$array = apply_filters( 'wp_parse_str', $array );
 }
 
@@ -1887,7 +1887,7 @@ function wp_sprintf( $pattern ) {
 		$fragment = substr($pattern, $start, $end - $start);
 
 		// Fragment has a specifier
-		if ( $pattern{$start} == '%' ) {
+		if ( $pattern[$start] == '%' ) {
 			// Find numbered arguments or take the next one in order
 			if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) {
 				$arg = isset($args[$matches[1]]) ? $args[$matches[1]] : '';
@@ -1995,7 +1995,7 @@ function wp_html_excerpt( $str, $count ) {
 function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
 	$attrs = implode('|', (array)$attrs);
 	return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i",
-			create_function('$m', 'return _links_add_base($m, "' . $base . '");'),
+			function($m) { return _links_add_base($m, "' . $base . '"); },
 			$content);
 }
 
@@ -2036,7 +2036,7 @@ function _links_add_base($m, $base) {
 function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
 	$tags = implode('|', (array)$tags);
 	return preg_replace_callback("!<($tags)(.+?)>!i",
-			create_function('$m', 'return _links_add_target($m, "' . $target . '");'),
+			function($m) { return _links_add_target($m, "' . $target . '"); },
 			$content);
 }
 /**
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index b863e31..34b6507 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1767,7 +1767,7 @@ function path_is_absolute( $path ) {
 	if ( realpath($path) == $path )
 		return true;
 
-	if ( strlen($path) == 0 || $path{0} == '.' )
+	if ( strlen($path) == 0 || $path[0] == '.' )
 		return false;
 
 	// windows allows absolute paths like this
diff --git a/wp-includes/gettext.php b/wp-includes/gettext.php
index 48e98b3..5955e6d 100644
--- a/wp-includes/gettext.php
+++ b/wp-includes/gettext.php
@@ -101,7 +101,7 @@ class gettext_reader {
 	 * @param object Reader the StreamReader object
 	 * @param boolean enable_cache Enable or disable caching of strings (default on)
 	 */
-	function gettext_reader($Reader, $enable_cache = true) {
+	function __construct($Reader, $enable_cache = true) {
 		// If there isn't a StreamReader, turn on short circuit mode.
 		if (! $Reader || isset($Reader->error) ) {
 			$this->short_circuit = true;
@@ -397,4 +397,4 @@ class gettext_reader {
 
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-includes/locale.php b/wp-includes/locale.php
index 14ac190..c8295de 100644
--- a/wp-includes/locale.php
+++ b/wp-includes/locale.php
@@ -323,7 +323,7 @@ class WP_Locale {
 	 *
 	 * @return WP_Locale
 	 */
-	function WP_Locale() {
+	function __construct() {
 		$this->init();
 		$this->register_globals();
 	}
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index d4f4bb2..08eb1dd 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -1703,8 +1703,8 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
 	$left_string  = normalize_whitespace($left_string);
 	$right_string = normalize_whitespace($right_string);
 
-	$left_lines  = split("\n", $left_string);
-	$right_lines = split("\n", $right_string);
+	$left_lines  = explode("\n", $left_string);
+	$right_lines = explode("\n", $right_string);
 
 	$text_diff = new Text_Diff($left_lines, $right_lines);
 	$renderer  = new WP_Text_Diff_Renderer_Table();
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index 990e78b..9d849df 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -528,7 +528,7 @@ function the_meta() {
 		echo "<ul class='post-meta'>\n";
 		foreach ( (array) $keys as $key ) {
 			$keyt = trim($key);
-			if ( '_' == $keyt{0} )
+			if ( '_' == $keyt[0] )
 				continue;
 			$values = array_map('trim', get_post_custom_values($key));
 			$value = implode($values,', ');
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 2096a35..10bc124 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1793,7 +1793,7 @@ function get_enclosed($post_id) {
 		if ( 'enclosure' != $key || !is_array( $val ) )
 			continue;
 		foreach( $val as $enc ) {
-			$enclosure = split( "\n", $enc );
+			$enclosure = explode( "\n", $enc );
 			$pung[] = trim( $enclosure[ 0 ] );
 		}
 	}
diff --git a/wp-includes/query.php b/wp-includes/query.php
index d0009e8..6b70bea 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -2595,7 +2595,7 @@ class WP_Query {
 	 * @param string $query URL query string.
 	 * @return WP_Query
 	 */
-	function WP_Query ($query = '') {
+	function __construct ($query = '') {
 		if (! empty($query)) {
 			$this->query($query);
 		}
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php
index 116c7f9..a93d2a4 100644
--- a/wp-includes/rewrite.php
+++ b/wp-includes/rewrite.php
@@ -34,7 +34,7 @@ function add_rewrite_rule($regex, $redirect, $after = 'bottom') {
  */
 function add_rewrite_tag($tagname, $regex) {
 	//validation
-	if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') {
+	if (strlen($tagname) < 3 || $tagname[0] != '%' || $tagname[strlen($tagname)-1] != '%') {
 		return;
 	}
 
@@ -1896,7 +1896,7 @@ class WP_Rewrite {
 	 *
 	 * @return WP_Rewrite
 	 */
-	function WP_Rewrite() {
+	function __construct() {
 		$this->init();
 	}
 }
diff --git a/wp-includes/rss.php b/wp-includes/rss.php
index 9962773..f8aee0a 100644
--- a/wp-includes/rss.php
+++ b/wp-includes/rss.php
@@ -96,7 +96,7 @@ class MagpieRSS {
 		// check for a namespace, and split if found
 		$ns	= false;
 		if ( strpos( $element, ':' ) ) {
-			list($ns, $el) = split( ':', $element, 2);
+			list($ns, $el) = explode( ':', $element, 2);
 		}
 		if ( $ns and $ns != 'rdf' ) {
 			$this->current_namespace = $ns;
diff --git a/wp-includes/streams.php b/wp-includes/streams.php
index 60b617d..54f921a 100644
--- a/wp-includes/streams.php
+++ b/wp-includes/streams.php
@@ -55,7 +55,7 @@ class StringReader {
   var $_pos;
   var $_str;
 
-  function StringReader($str='') {
+  function __construct($str='') {
     $this->_str = $str;
     $this->_pos = 0;
     // If string functions are overloaded, we need to use the mb versions
@@ -109,7 +109,7 @@ class FileReader {
   var $_fd;
   var $_length;
 
-  function FileReader($filename) {
+  function __construct($filename) {
     if (file_exists($filename)) {
 
       $this->_length=filesize($filename);
@@ -165,7 +165,7 @@ class FileReader {
 // Preloads entire file in memory first, then creates a StringReader
 // over it (it assumes knowledge of StringReader internals)
 class CachedFileReader extends StringReader {
-  function CachedFileReader($filename) {
+  function __construct($filename) {
     parent::StringReader();
 
     if (file_exists($filename)) {
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index 9d1488a..c0db49b 100644
--- a/wp-includes/theme.php
+++ b/wp-includes/theme.php
@@ -259,7 +259,7 @@ function get_themes() {
 
 	while ( ($theme_dir = readdir($themes_dir)) !== false ) {
 		if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) {
-			if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
+			if ( $theme_dir[0] == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
 				continue;
 			$stylish_dir = @ opendir($theme_root . '/' . $theme_dir);
 			$found_stylesheet = false;
@@ -277,7 +277,7 @@ function get_themes() {
 				$theme_subdir = @ opendir( $subdir );
 				while ( ($theme_dir = readdir($theme_subdir)) !== false ) {
 					if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) {
-						if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
+						if ( $theme_dir[0] == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
 							continue;
 						$stylish_dir = @ opendir($subdir . '/' . $theme_dir);
 						$found_stylesheet = false;
@@ -833,13 +833,13 @@ function preview_theme() {
 	if ( validate_file($_GET['template']) )
 		return;
 
-	add_filter('template', create_function('', "return '{$_GET['template']}';") );
+	add_filter('template', function() { return '{$_GET[\'template\']}'; } );
 
 	if ( isset($_GET['stylesheet']) ) {
 		$_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-]|i', '', $_GET['stylesheet']);
 		if ( validate_file($_GET['stylesheet']) )
 			return;
-		add_filter('stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );
+		add_filter('stylesheet', function() { return '{$_GET[\'stylesheet\']}'; } );
 	}
 
 	ob_start( 'preview_theme_ob_filter' );
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index 3ec6ee6..380bd5c 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -19,22 +19,22 @@ define('EZSQL_VERSION', 'WP1.25');
 /**
  * @since 0.71
  */
-define('OBJECT', 'OBJECT', true);
+define('OBJECT', 'OBJECT');
 
 /**
  * @since {@internal Version Unknown}}
  */
-define('OBJECT_K', 'OBJECT_K', false);
+define('OBJECT_K', 'OBJECT_K');
 
 /**
  * @since 0.71
  */
-define('ARRAY_A', 'ARRAY_A', false);
+define('ARRAY_A', 'ARRAY_A');
 
 /**
  * @since 0.71
  */
-define('ARRAY_N', 'ARRAY_N', false);
+define('ARRAY_N', 'ARRAY_N');
 
 /**
  * WordPress Database Access Abstraction Object
@@ -317,7 +317,7 @@ class wpdb {
 		if ( defined('DB_COLLATE') )
 			$this->collate = DB_COLLATE;
 
-		$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
+		$this->dbh = @mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname);
 		if (!$this->dbh) {
 			$this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/"
 <h1>Error establishing a database connection</h1>
@@ -404,7 +404,7 @@ class wpdb {
 	 * @return null Always null.
 	 */
 	function select($db) {
-		if (!@mysql_select_db($db, $this->dbh)) {
+		if (!@mysqli_select_db($this->dbh, $db)) {
 			$this->ready = false;
 			$this->bail(sprintf(/*WP_I18N_DB_SELECT_DB*/'
 <h1>Can&#8217;t select database</h1>
@@ -432,9 +432,9 @@ class wpdb {
 		// Disable rest for now, causing problems
 		/*
 		if( !$this->dbh || version_compare( phpversion(), '4.3.0' ) == '-1' )
-			return mysql_escape_string( $string );
+			return mysqli_escape_string( $string );
 		else
-			return mysql_real_escape_string( $string, $this->dbh );
+			return mysqli_real_escape_string( $string, $this->dbh );
 		*/
 	}
 
@@ -483,7 +483,7 @@ class wpdb {
 	function print_error($str = '') {
 		global $EZSQL_ERROR;
 
-		if (!$str) $str = mysql_error($this->dbh);
+		if (!$str) $str = mysqli_error($this->dbh);
 		$EZSQL_ERROR[] = array ('query' => $this->last_query, 'error_str' => $str);
 
 		if ( $this->suppress_errors )
@@ -603,43 +603,43 @@ class wpdb {
 		// Keep track of the last query for debug..
 		$this->last_query = $query;
 
-		// Perform the query via std mysql_query function..
+		// Perform the query via std mysqli_query function..
 		if ( defined('SAVEQUERIES') && SAVEQUERIES )
 			$this->timer_start();
 
-		$this->result = @mysql_query($query, $this->dbh);
+		$this->result = @mysqli_query($this->dbh, $query);
 		++$this->num_queries;
 
 		if ( defined('SAVEQUERIES') && SAVEQUERIES )
 			$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
 
 		// If there is an error then take note of it..
-		if ( $this->last_error = mysql_error($this->dbh) ) {
+		if ( $this->last_error = mysqli_error($this->dbh) ) {
 			$this->print_error();
 			return false;
 		}
 
 		if ( preg_match("/^\\s*(insert|delete|update|replace|alter) /i",$query) ) {
-			$this->rows_affected = mysql_affected_rows($this->dbh);
+			$this->rows_affected = mysqli_affected_rows($this->dbh);
 			// Take note of the insert_id
 			if ( preg_match("/^\\s*(insert|replace) /i",$query) ) {
-				$this->insert_id = mysql_insert_id($this->dbh);
+				$this->insert_id = mysqli_insert_id($this->dbh);
 			}
 			// Return number of rows affected
 			$return_val = $this->rows_affected;
 		} else {
 			$i = 0;
-			while ($i < @mysql_num_fields($this->result)) {
-				$this->col_info[$i] = @mysql_fetch_field($this->result);
+			while ($i < @mysqli_num_fields($this->result)) {
+				$this->col_info[$i] = @mysqli_fetch_field($this->result);
 				$i++;
 			}
 			$num_rows = 0;
-			while ( $row = @mysql_fetch_object($this->result) ) {
+			while ( $row = @mysqli_fetch_object($this->result) ) {
 				$this->last_result[$num_rows] = $row;
 				$num_rows++;
 			}
 
-			@mysql_free_result($this->result);
+			@mysqli_free_result($this->result);
 
 			// Log number of rows the query returned
 			$this->num_rows = $num_rows;
@@ -981,7 +981,7 @@ class wpdb {
 	 * @return false|string false on failure, version number on success
 	 */
 	function db_version() {
-		return preg_replace('/[^0-9.].*/', '', mysql_get_server_info( $this->dbh ));
+		return preg_replace('/[^0-9.].*/', '', mysqli_get_server_info( $this->dbh ));
 	}
 }
 
diff --git a/wp-login.php b/wp-login.php
index c85eb9f..afad578 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -422,7 +422,7 @@ default:
 	if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
 		$secure_cookie = false;
 
-	$user = wp_signon('', $secure_cookie);
+	$user = wp_signon(array(), $secure_cookie);
 
 	$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
 
diff --git a/wp-pass.php b/wp-pass.php
index 1be8095..28bfd93 100644
--- a/wp-pass.php
+++ b/wp-pass.php
@@ -9,11 +9,11 @@
 /** Make sure that the WordPress bootstrap has ran before continuing. */
 require( dirname(__FILE__) . '/wp-load.php');
 
-if ( get_magic_quotes_gpc() )
-	$_POST['post_password'] = stripslashes($_POST['post_password']);
+// if ( get_magic_quotes_gpc() )
+// 	$_POST['post_password'] = stripslashes($_POST['post_password']);
 
 // 10 days
 setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
 
 wp_safe_redirect(wp_get_referer());
-?>
\ No newline at end of file
+?>
diff --git a/wp-settings.php b/wp-settings.php
index 7e54fa0..dc19527 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -138,7 +138,7 @@ if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
 	}
 }
 
-if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
+if ( !extension_loaded('mysqli') && !file_exists(WP_CONTENT_DIR . '/db.php') )
 	die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );
 
 /**
@@ -487,11 +487,11 @@ foreach ( $default_constants as $c => $v )
 unset($default_constants, $c, $v);
 
 // If already slashed, strip.
-if ( get_magic_quotes_gpc() ) {
-	$_GET    = stripslashes_deep($_GET   );
-	$_POST   = stripslashes_deep($_POST  );
-	$_COOKIE = stripslashes_deep($_COOKIE);
-}
+// if ( get_magic_quotes_gpc() ) {
+// 	$_GET    = stripslashes_deep($_GET   );
+// 	$_POST   = stripslashes_deep($_POST  );
+// 	$_COOKIE = stripslashes_deep($_COOKIE);
+// }
 
 // Escape with wpdb.
 $_GET    = add_magic_quotes($_GET   );
diff --git a/wp_db_sitemap.php b/wp_db_sitemap.php
index 1469825..754991e 100644
--- a/wp_db_sitemap.php
+++ b/wp_db_sitemap.php
@@ -1,17 +1,17 @@
-<?
+<?php
 
 $db_name = 'fill your own';
 $db_user = 'fill your own';
 $db_pass = 'fill your own';
 $table_prefix  = 'fill your own';
 
-$nconnection = mysql_connect("localhost:3306", $db_user, $db_pass );
-mysql_select_db($db_name, $nconnection);
+$nconnection = mysqli_connect("localhost:3306", $db_user, $db_pass );
+mysqli_select_db($db_name, $nconnection);
 
 $query = 'SELECT post_name, post_date FROM '.$table_prefix.'posts WHERE post_type ="post" AND post_status = "publish" ORDER BY ID DESC';
-$record=mysql_query($query);
+$record=mysqli_query($nconnection, $query);
 
-while (	$row = mysql_fetch_array($record, MYSQL_NUM)) {
+while (	$row = mysqli_fetch_array($record, MYSQL_NUM)) {
 
 	$year = substr($row[1],0,4);
 	$name = 'http://fill your own/'.$year.'/'.$row[0].'/';
diff --git a/xmlrpc.php b/xmlrpc.php
index 5375b30..712f921 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -2588,7 +2588,7 @@ class wp_xmlrpc_server extends IXR_Server {
 			foreach ( (array) get_post_custom($post_ID) as $key => $val) {
 				if ($key == 'enclosure') {
 					foreach ( (array) $val as $enc ) {
-						$encdata = split("\n", $enc);
+						$encdata = explode("\n", $enc);
 						$enclosure['url'] = trim(htmlspecialchars($encdata[0]));
 						$enclosure['length'] = trim($encdata[1]);
 						$enclosure['type'] = trim($encdata[2]);
