ok then, since SharDB works with latest WP, my real case is (should i make new thread?, or continuing this one are ok?) the WP multisite is compromised a lot before the automatic update to WP 4.0 (shell backdoor, phising script, deface, etc), i have clean them all for now but i am not sure whether if there is still bad script injected somewhere else that i can’t see
now i wonder if i can do this approach for security reason? : changing whole file WP 4.0 (upgrade) with new WP 4.0 files (download), adjust all plugin files like old one (but using the latest version including ShardDB 2.7.7) and preserve all configuration files either the databases with the old one?
now i wonder if i can do this approach for security reason? : changing whole file WP 4.0 (upgrade) with new WP 4.0 files (download), adjust all plugin files like old one (but using the latest version including ShardDB 2.7.7) and preserve all configuration files either the databases with the old one?
Yes, you can do that. Make a backup of the files first though.
Thank you Ron, still on progress but when i set WP_DEBUG to true, i found this error
SharDB was called incorrectly. SharDB must set a database connection for use with escaping. Please see Debugging in WordPress for more information. (This message was added in version 1024.) in /home/wwwadmin/public_html/blog/wp-includes/functions.php on line 3374
That warning is probably being triggered by one of your plugins. It would help if you could identify which one.
I got this message, but no plugin activated
For who can read Vietnamese. I have a post to fix this proplem : http://wordpresskite.com/quicktip/sua-loi-escaping-trong-plugin-shardb/
For instance, Add method _real_escape to class SharDB on file db.php. See this method here : https://gist.github.com/nguyenvanduocit/8ba2cd9ca4ba8bfca233
I am facing the same problem. I have added that function in db.php file but still showing that error.
Notice: SharDB was called incorrectly. SharDB must set a database connection for use with escaping.
db-settigs.php settings
$shardb_hash_length = 1;
$shardb_prefix = ‘old_wordpress_’;
$shardb_dataset = ‘wordpress’;
$enable_home_db = true;
$shardb_local_db = true;
Hi nrbtushar.
I will load full db.php tomorow. But now, you can fix by my gist
Hi Nguyen,
How do I call function _real_escape( $string ) after adding that in db.php
This method was used by WordPress. You do not need to call this method. Just update it.
I have added that function inside shardDB class and its working. That’s error message gone but still I have another error message.
The mysql extension is deprecated and will be removed in the future: use mysqli or PDO
Do you know how I can remove that?
I just update the method : Replace it with
function _real_escape( $string ) {
if ( is_resource( $this->dbhs['global_r'] ) ) {
if ( $this->use_mysqli ) {
return mysqli_real_escape_string( $this->dbhs['global_r'] , $string );
} else {
return mysql_real_escape_string( $string, $this->dbhs['global_r'] );
}
} else {
return addslashes( $string );
}
}
still I have got that error.
The mysql extension is deprecated and will be removed in the future: use mysqli or PDO