March 10, 2011 by Ivan Kristianto
DB Cache Reloaded Fix For WordPress 3.1

Since WordPress upgrade to version 3.1, there are some plugin compatibility issue for example DB Cache Reloaded. You may read my previous article DB Cache Reloaded not compatible with WordPress 3.1 as during plugin activation trigger an error: “DB Cache Reloaded Error: wpdb class is redefined, plugin cannot work!
Previous definition is at /home/xxxx/public_html/wp-includes/wp-db.php:52.”.
As the plugin developer not responded to any complain in forums. I took a step to take a look at the code. And i finally found what cause it and patch the code. I have installed in some of my testing blog. So far so good. This patch is tested only in WordPress 3.1 environment. I’m haven’t tested for prior WordPress 3.1.
As this modified is quick and dirty fixed, please test it in your test environment prior to use it in your production website.
Usage instructions:
1. If you have DB Cache Reloaded activated in wrapper mode, please deactivate the plugin.
2. Download the module from the link at the end of this article.
3. Upload the module to your server, overwrite the current file.
4. Activate the plugin, and enable it from the Setting.
Download DB Cache Reloaded Patch For WordPress 3.1
Note: this is not an official release from the original developer. This patched is developed by me because i’m using DB Cache Reloaded in this blog and i want to upgrade to WordPress 3.1. Later i will make my own plugin which is rewrite from DB Cache Reloaded, and keep maintaining it for the community.
If you found any bugs or problem or issue or even want to say thanks, please use the comment box below.
This plugin has cost me hours of work, if you use it, please donate a token of your appreciation!
Update: Now DB Cache Reloaded Fix is availabe in WordPress Plugin Repository.
Update 25 October 2011: Release DB Cache Reloaded Fix v2.2.4.
[HowTo] Install Alternative PHP Cache (APC)



Hi ivan, your plugin seems to work on my site, but despite the number of minutes I set it to expire, i see my cache folder clearing too quickly. It starts to fill but then after i refresh the homepage once or twice the cache folder clears! and it is set to expire at 1440 minutes!
- spam
- offensive
- disagree
- off topic
LikeIts a nice informative post and its great resource for lots of peoples, so to promote your business by using some internet marketing strategy and it can easily to reach the correct market place.
- spam
- offensive
- disagree
- off topic
LikeYour convert is opportune. This diary is conferred consultative entropy. Impart you for this usable information. I will share it with my friends. I bang through bookmarked it.
- spam
- offensive
- disagree
- off topic
LikeHI Ivan,
thanks for the recent update for WP 3.4!
However am having following issue:
am using WP DB-Manager which does e.g. a daily back-up. The query caching prohibits the plugin the update the status, so it keeps running until the DB cache is refreshed (got once 800 emails with 2mb attachements....)
any solution available? I assume the same might happen with any pluing using scheduled task
- spam
- offensive
- disagree
- off topic
LikeCordMailBeez
I am myself using WP DB manager to do weekly backup. and i found not errors so far. I would like to know what plugins you are using that has cron schedule task?
- spam
- offensive
- disagree
- off topic
Likeivankrisdotcom
am using the default WP set-up.
also WP-Supercache is running - might that be the reason?
- spam
- offensive
- disagree
- off topic
LikeI get the following error whenever I try to enable the plugin "Caching can't be activated. Please chmod 755 wp-content/db-cache-reloaded-fix/cache folder". Yet, there is no directory close to that to set the permissions for. Is this plugin flawed or is there a fix for this issue?
- spam
- offensive
- disagree
- off topic
Likehi ivan, i am trying the plugin on www.biriyilik.com, i will write later for giving the information, thanks and take care
- spam
- offensive
- disagree
- off topic
LikeHello,
I'm using this plugin and it does just what I need.
Thanks alot and keep up the great work!
Regards
- spam
- offensive
- disagree
- off topic
LikeHi Ivan. I am using your plugin on my site and it has reduced CPU usage greatly, however with one side effect. It is replicating links in my sidebar that php code is embedded into a widget over and over (so far averaging about 300-400 times depending on visitors I believe, to the front page of my blog. And, on the single posts of my blog it is not showing up at all. Here's an image http://www.diigo.com/item/image/1d8vg/1rub .. Any suggestions? I'm on v3.3.1 WP
HART
- spam
- offensive
- disagree
- off topic
LikePS in the settings, my Cache Filter is blank.
- spam
- offensive
- disagree
- off topic
LikeHartleyBSinger Can you send me your url? i will take a look. Thanks
- spam
- offensive
- disagree
- off topic
LikeivankrisdotcomHartleyBSinger Thanks.
The URL is http://PetLvr.com .... it's on a wpMU installation, forcing the /blog/ folder in network configuration ... I should have come back here since posting this. A new release and installation of the TLA plugin fixed the replication problem down the sidebar ... If there are any tips to help reduce CPU usage in that Cache Filter, it would still be appreciated :D
Thanks / HART
- spam
- offensive
- disagree
- off topic
LikeHartleyBSingerivankrisdotcom as i browse to your site, i saw that the db cache working good.
- spam
- offensive
- disagree
- off topic
LikeThanks for fixing this plugin up for us Ivan, works fantastic here!
- spam
- offensive
- disagree
- off topic
LikeHi,
is there a possibility to exclude some queries from caching? I use a own login system and caching is really bad with changed data.
Thanks!
- spam
- offensive
- disagree
- off topic
LikeAdrianB Yes you can add it to filter in the plugin settings.
- spam
- offensive
- disagree
- off topic
Likei get also the fatal error did u got managed to fix it?
- spam
- offensive
- disagree
- off topic
LikeHi Ivan!
My content dir is not /wp-content/
How can I get a plugin works? I've got errors with chmod 755 wp-content/db-cache-reloaded-fix/cache and can't save options because of chmod 755 file config.ini
Regards
- spam
- offensive
- disagree
- off topic
LikeThanks for Great Plugin, but do you have any function to clear the cache which I can use in the theme development?
- spam
- offensive
- disagree
- off topic
LikePlease tell me, how do I FULLY remove this plugin from my website. I want to return my database exactly as it was before I installed this plugin.
After I installed this, it works fine. Now I am duplicating my website to the same domain but with /temp for re-development whilst my website still runs.
After migration, the /temp website keeps going back to the live site for ALL pages. I can also see that I have hundreds of instances referring to the root website and not /temp in the temporary website database. This is because of your plugin.
Please tell me how to remove this so I can have my database EXACTLY as it was before I installed.
Thanks
Luke
- spam
- offensive
- disagree
- off topic
LikeMrMintMarketing Disable the plugin, delete it and then go to wp-content folder and delete the db.php.
- spam
- offensive
- disagree
- off topic
LikeExcuse, the problem with activation (chmod 755) isn't solved yet?
- spam
- offensive
- disagree
- off topic
Likeyoumagaz72 I beleive it is solve. but i have some reports that it have problem with server which is not using suPHP. what is you db cache reloead fix version? did you update to the latest one?
- spam
- offensive
- disagree
- off topic
LikeivankrisdotcomI use VDS. And in setting I didn't see usage suPHP.
db cache reloead fix: Version 2.2.4
WordPress: Version 3.2.1
- spam
- offensive
- disagree
- off topic
Likeyoumagaz72 Do you use WHM/CPanel for your server? do you use Apache? and please try to use suPHP instead of fastcgi.
- spam
- offensive
- disagree
- off topic
LikeHi, I have an ongoing error with your plugin. I always get error that I wp-content folder needs to be chmod 755. That folder is already set to that setting. I tried the suggestion of adding tmp folder and that didn't work either, including deactivating and uninstalling. All the permissions are properly set. What other option should I look at? Thanks, Carl
- spam
- offensive
- disagree
- off topic
Likemichael.small i'm fixing that issue. i think i know what causing that issue. please stay tune for next update.
- spam
- offensive
- disagree
- off topic
LikeExcellent. Thank You.
- spam
- offensive
- disagree
- off topic
LikeHi,
i am using WP 3.0.5 multisite with MySQL 16 db installed. The installation of 16 db required me to put file including db.php in the wpcontent folder. I notice that either disable or enable your DB Cache Reloaded Fix to the system will either delete or add your db.php file to the wpcontent. It will then destroy my subdomain system and show my wordpress site as no information on it. How can I resolve this problem? Can you set your file db.php to other name?
Thanks,
Charles
- spam
- offensive
- disagree
- off topic
LikeIt is not possible to remove db.php since it is the core function that WordPress need to overwrite the global $wpdb so i can inject the cache mechanism system. I haven't test this plugin for multi database setup. So for now it is only available for single database setup. thanks.
- spam
- offensive
- disagree
- off topic
LikeHi I'm facing a problem. One day my website bijusubhash.com is suspended because of high resource usage. I request to re enable my website after that I'm using this db-cache-reloaded-fix plugin. Its now showing on footer "<!-- Generated in 0.704 seconds. Made 215 queries to database and 106 cached queries. Memory used - 22.54MB -->" Kindly please let me know is this value fine or not. If not what I have to do more on to reduce my server load.
Kindly please replay.
Thank you,
Biju Subhash
- spam
- offensive
- disagree
- off topic
Likebijusubhash please follow this link to reduce your server load and optimize them http://goo.gl/id3Ai
- spam
- offensive
- disagree
- off topic
Likethank you ivan...
- spam
- offensive
- disagree
- off topic
LikeYou my friend are a gentleman and a scholar for doing this! Work great, and now I finally have one of my favorite plug-ins back!
- spam
- offensive
- disagree
- off topic
Likedysfunctionalparrot Thanks for you kind words.
- spam
- offensive
- disagree
- off topic
LikeHello Ivan,
My website is completely broken as soon as I uninstall your plugin. It says:
Warning: require_once(/var/www/vhosts/votre-site-internet.com/httpdocs/wp-content/plugins/db-cache-reloaded-fix/db-module.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/votre-site-internet.com/httpdocs/wp-content/db.php on line 94 Fatal error: require_once() [function.require]: Failed opening required '/var/www/vhosts/votre-site-internet.com/httpdocs/wp-content/plugins/db-cache-reloaded-fix/db-module.php' (include_path='.:') in /var/www/vhosts/votre-site-internet.com/httpdocs/wp-content/db.php on line 94
How can I fix this problem ?
My website's URL: www.votre-site-internet.com
- spam
- offensive
- disagree
- off topic
LikeHaute Savoie delete db.php under wp-content folder. I will patch this plugin in the future.
- spam
- offensive
- disagree
- off topic
LikeAny chance to be able to format the stats template so that the font size and centering on the page can be done? It's just hanging on the left and looks funky. Apparently standard html gets boogered up when putting in the window on the admin panel.
Will be sending something on the development. Good work...
- spam
- offensive
- disagree
- off topic
LikeOm Ivan waktu pake Suphp ga ada masalah dgn db cache reloaded fix, tapi setelah saya ganti handler ke DSO muncul eror [function.fopen]: failed to open stream: Permission denied in sama header already sent, pdhl permission dah 755, knapa ya?
apa harus chown jadi nobody?
makasih
- spam
- offensive
- disagree
- off topic
LikesuPHP akan execute php code nya berdasarkan user permission. sedangkan dso akan menjalankan php dengan user apache (biasanya nobody). coba ubah permission wp-content/tmp menjadi 777.
- spam
- offensive
- disagree
- off topic
LikeJust a note that on my host with the htaccess file just being as it is the tmp folders and files can be accessed. If it's changed to -<Files *>Order allow,denyDeny from All</Files>it works
- spam
- offensive
- disagree
- off topic
Likeit seems there are no language files packed in 2.2.2
- spam
- offensive
- disagree
- off topic
LikeYes i have a very frustration internet connection this couple days.
I thought that the lang files go through, but it didn't.
I'm fixing it.
Thanks for notify me.
- spam
- offensive
- disagree
- off topic
LikeI have translated this plugin to simplified chinese and traditional chinese. It's my first time to do this and i dont know how to send .mo & .po files to you. My mail address is in the comment meta.
- spam
- offensive
- disagree
- off topic
LikeYep Melissa I'm also having the same problem - unable to activate the plugin due to permission issues but everything is fine regarding premissions
- spam
- offensive
- disagree
- off topic
LikeThanks for the plugin fix for 3.1. I've never used this plugin before, but in trying to install it to my 3.1.1 blog, I get the error that wp-content folder should be chmod 755. This folder has always had these permissions. I even tried changing the folder to 777, but that didn't work either. Can you please help with how to enable the caching? Thanks!
- spam
- offensive
- disagree
- off topic
LikePlease check that you have "tmp" folder under wp-content and set it to 755 permission. Sometimes the problem is folder permission that doesn't allow the plugin to create a folder.
- spam
- offensive
- disagree
- off topic
LikeMy blog has more than 20k hits everyday. I want to set the time of expired cache to the best. Which one is better? faster or lower? 20 minutes?
Thanks ...
- spam
- offensive
- disagree
- off topic
Likeif i were you i set it up at 1440 minutes (1 day)
- spam
- offensive
- disagree
- off topic
Like