kokopelli
Member
Posted 1 year ago #
When I activate DB Cache Reloaded Fix on a site running the User Spam Remover plugin, I get an error in the latter:
Catchable fatal error: Argument 1 passed to UserSpamRemover::__construct() must be an instance of wpdb, instance of dbrc_wpdb given, called in /home/mysite/public_html/wp-content/plugins/user-spam-remover/user-spam-remover.php on line 113 and defined in /home/mysite/public_html/wp-content/plugins/user-spam-remover/user-spam-remover.php on line 92
If I deactivate DB Cache Reloaded Fix, the error goes away. I also posted about the problem here.
Any ideas? Thanks.
http://wordpress.org/extend/plugins/db-cache-reloaded-fix/
Ivan Kristianto
Member
Posted 1 year ago #
User Spam Remover use wpdb class in the it's constructor on line 92.
Here is the quick fix, change the constructor (line 91) into this:
// Constructor runs once only, since private and called only by getInstance()
private function __construct() {
global $wpdb;
self::$defaults['logDir'] = dirname(__FILE__).'/log';
$this->wpdb = $wpdb;
// initialize config vars from WordPress options table
$this->timezone = get_option('timezone_string');
foreach (self::$defaults as $key => $default) {
$this->config[$key] = get_option(self::$wpOptGroup.$key, $default);
}
}
Thanks
Ivan