<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>DB Cache Reloaded 2.3 Fix Readme</title> </head> <body> <h1>DB Cache Reloaded 2.3 Fix Readme</h1> <p>The fastest cache engine for WordPress, that produces cache of database queries with easy configuration - now with bugs fixed. And WordPress 3.1 Compatible</p> <p><b>Plugin Homepage:</b> <a href="http://www.ivankristianto.com/web-development/programming/db-cache-reloaded-fix-for-wordpress-3-1/1784/">DB Cache Reloaded Fix</a></p> <p><b>Plugin Homepage on WordPress.org:</b> <a href="http://wordpress.org/extend/plugins/db-cache-reloaded-fix/">DB Cache Reloaded</a></p> <p><b>Author Homepage:</b> <a href="http://www.ivankristianto.com/">Poradnik Webmastera</a></p> <p><b>Author:</b> Ivan Kristianto</p> <p> </p> <p><b>Original Plugin Homepage:</b> <a href="http://www.poradnik-webmastera.com/projekty/db_cache_reloaded/">DB Cache Reloaded</a></p> <p><b>Original Plugin Homepage on WordPress.org:</b> <a href="http://wordpress.org/extend/plugins/db-cache-reloaded/">DB Cache Reloaded</a></p> <p><b>Original Author Homepage:</b> <a href="http://www.poradnik-webmastera.com/">Poradnik Webmastera</a></p> <p><b>Original Author:</b> Daniel Frużyński</p> <h2>Description</h2> <p>This plugin caches every database query with given lifetime. It is much faster than other html caching plugins and uses less disk space for caching.</p> <p>I think you've heard of WP-Cache or WP Super Cache, they are both top plugins for WordPress, which make your site faster and responsive. Forget about them - with DB Cache Reloaded your site will work much faster and will use less disk space for cached files. Your visitors will always get actual information in sidebars and server CPU loads will be as low as possible.</p> <p>This plugin is a fork of a DB Cache plugin. Because his author did not updated its plugin to WordPress 2.8, I finally (after almost three months since release of WP 2.8) took his plugin and updated it so now it works with newest WordPress version. Additionally I fixed few bugs, cleaned up the code and make it more secure.</p> <p>This plugin was tested with WordPress 2.8. It may work with earlier versions too - I have not tested. If you perform such tests, let me know of the results.</p> <p>If you are using WordPress 2.9, please use DB Cache Reloaded version 2.0 or never - versions 1.x are not compatible with WordPress 2.9.</p> <p>If you are using WordPress 3.0, please use DB Cache Reloaded version 2.1 or never - earlier versions are not compatible with WordPress 3.0.</p> <p>Available translations:</p> <ul> <li>English</li> <li>French (fr_FR) - thanks InMotion Hosting</li> <li>Polish (pl_PL)</li> <li>Italian (it_IT) - thanks Iacopo</li> <li>Portuguese Brazilian (pt_BR) - thanks Calebe Aires</li> <li>Belorussian (be_BY) - thanks FatCow</li> <li>Spanish (es_ES) - thanks Dasumo</li> <li>Dutch (nl_NL) - thanks Rene</li> <li>Turkish (tr_TR) - thanks wolkanca</li> <li>Japanese (jp) - thanks wokamoto</li> <li>German (de_DE) - thanks Carsten Tauber</li> </ul> <h2>Installation</h2> <ol> <li>Upload <code>db-cache-reloaded</code> directory to the <code>/wp-content/plugins/</code> directory</li> <li>Activate the plugin through the 'Plugins' menu in WordPress</li> <li>Configure and enjoy :)</li> </ol> <h2>Frequently Asked Questions</h2> <h3>How do I know my blog is being cached?</h3> <p>Check your cache directory wp-content/tmp/ for cache files. Check the load statistics in footer. Also you can set <code>DBCR_DEBUG</code> to true in wp-config.php file to display as hidden comments on your html page, what queries were loaded from cache and what from mysql.</p> <p>You can also define <code>DBCR_SAVEQUERIES</code> in wp-config.php file - it works similarly as defining <code>SAVEQUERIES</code>, but DB Cache Reloaded adds one extra field to the <code>$wpdb->queries</code> array - boolean value indicating if query was executed directly (<code>false</code>) or loaded from cache (<code>true</code>). Of course you can also use some extra code (e.g. some plugin) do display this data.</p> <h3>What does this plugin do?</h3> <p>This plugin decreases count of queries to DB, which means that CPU load of your web-server decreases and your blog can serve much more visitors in one moment.</p> <h3>What is page generation time?</h3> <p>It is time from request to server (start of generation) and the generated page sent (end of generation). This time depends on server parameters: CPU speed, RAM size and the server load (how much requests it operates at the moment, popularity of sites hosted on the server) and of course it depends on how much program code it needs to operate for page generation.</p> <p>Let set the fourth parameter as constant (we can't change the program code). So we have only 3: CPU, RAM and popularity.</p> <p>If you have a powerful server (costs more) it means that will be as low as possible and it can serve for example 100 visitors in one moment without slowing down. And another server (low cost) with less CPU speed and RAM size, which can operate for example 10 visitors in one moment. So if the popularity of your site grows it is needed more time to generate the page. That's why you need to use any caching plugins to decrease the generation time.</p> <h3>How can I ensure of reducing server usage?</h3> <p>You can show usage statistics with your custom template in your footer.</p> <p>Checking count of queries, ensure that other cache plugins are disabled, because you can see cached number.</p> <p>View the source of your site page, there maybe some code like this at the foot:</p> <p><code><!-- 00 queries. 00 seconds. --></code></p> <p>If not, please put these codes in your footer template:</p> <p><code><!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. --></code></p> <p>After using the DB Cache Reloaded, I think you'll find the number of queries reducing a lot.</p> <h3>Why is DB Cache Reloaded better than WP Super Cache?</h3> <p>This plugin is based on a fundamentally different principle of caching queries to database instead of full pages, which optimises WordPress from the very beginning and uses less disk space for cache files because it saves only useful information. It saves information separately and also caches hidden requests to database.</p> <p>Dmitry Svarytsevych analysed server load graphs of his sites and he can say that the peaks of server load are caused of search engines bots indexing your site (they load much pages practically in one moment). He has tried WP Super Cache to decrease the server loads but it was no help from it. Simply saying WP Super Cache saves any loaded page and much of these pages that are opened only once by bots. His original plugin (DB Cache) roughly saves parts of web-page (configuration, widgets, comments, content) separately, which means that once configuration is cached it will be loaded on every page.</p> <p>Here is the Google translation of <a href="http://translate.google.com/translate?prev=&hl=uk&u=http%3A%2F%2Fwordpress.net.ua%2Fmaster%2Foptimizaciya-wordpress.html&sl=uk&tl=en">Dmitry Svarytsevych's article</a> on it.</p> <h3>Troubleshooting</h3> <p>Make sure wp-content is writeable by the web server. If not you'll need to chmod wp-content folder for writing.</p> <h3>How do I uninstall DB Cache Reloaded?</h3> <ul> <li>Disable it at Settings->DB Cache Reloaded page. The plugin will automatically delete all cache files. If something went wrong - delete /wp-content/db.php, /wp-content/db-config.ini and /wp-content/tmp folder. While db.php file exists WordPress will use our optimised DB class instead of own.</li> <li> Deactivate it at plugins page.</li> </ul> <h3>Why plugin shows -1 as number of cached queries?</h3> <p>By default DB Cache Reloaded shows number of cached queries in hidden HTML comment in page footer. When you see -1 as a cached queries count, this means that caching is not active. Please make sure that you have enabled caching on settings page (DB Cache Reloaded also shows message in admin backend when caching is not enabled). If caching is enabled and you still see -1, this is a result of conflict with other plugin, which wants to replace default <code>wpdb</code> class with its own too. You have to disable plugins one by one until you find one which causes this conflict. If you have added custom code to your wp-config.php (or other file) in order to install plugin, please remove (or comment out) it too. When you find conflicting plugin, please notify its author about this problem.</p> <p>You can also try to enable Wrapper Mode - it may help.</p> <h3>Why plugin shows 0 as number of cached queries?</h3> <p>Please check if you have enabled caching. If yes, this may indicate some problems with your plugins - check previous question (Why plugin shows -1 as number of cached queries?) for more details.</p> <h3>What is the Wrapper Mode?</h3> <p>When DB Cache Reloaded works in Wrapper Mode, it uses different method to load DB Module. By default plugin assumes that WordPress will be able to load wp-content/db.php. However sometimes other plugin may load wp-includes/wp-db.php file directly, or replace value of <code>$wpdb</code> variable. This usually does not allow DB Cache Reloaded to work. When you enable Wrapper Mode, DB Cache Reloaded will load a bit different DB Module, which adds caching and works as a proxy for DB Module loaded by other plugin. Depending on your plugin, everything may work smoothly, or there may be some issues.</p> <p>Wrapper is also a bit slower then normal method, and does not cache all queries (usually one, but some plugins may increase this number). It also requires at least PHP 5 to work.</p> <h3>I am a plugin developer. How can I make my plugin compatible with DB Cache Reloaded?</h3> <p>DB Cache Reloaded uses default WordPress mechanism to load custom version of <code>wpdb</code> class - it creates custom wp-content/db.php file. WordPress checks if this file exists, and loads it instead of wp-includes/wp-db.php.</p> <p>When your plugin includes this class using custom code added to wp-config.php (or any other file), please use <code>require_wp_db()</code> to do this, or use similar code to this function body.</p> <p>When you need to modify <code>wpdb</code> class (e.g. by adding or replacing methods), consider deriving your class from the default one (using the <code>extends</code> keyword). Another option is to use aggregation - save value of <code>$wpdb</code> variable, create object of your class and assign to <code>$wpdb</code>. Your class should call methods and access member variables of this saved object, in order to keeps its functionality. Your class should also implement magic methods <code>__get</code>, <code>__set</code>, <code>__isset</code>, <code>__unset</code> and <code>__call</code> in order to forward calls for non-standard methods and properties to the aggregated class.</p> <p>Note: when you use derivation, make sure you create object of your class very early, before queries are done. Otherwise number of queries shown in stats will be incorrect.</p> <h3>How to move default cache directory elsewhere?</h3> <p>By default DB Cache Reloaded saves cached queries in <code>wp-content/db-cache-reloaded-fix/cache</code> dir (or another, if you changed value of <code>WP_CONTENT_DIR</code> constant). If you want to change this location, please define <code>DBCR_CACHE_DIR</code> constant in your <code>wp-config.php</code> file - it should point to existing directory. DB Cache Reloaded will use it instead of default location.</p> <h2>Changelog</h2> <p>2.3</p> <ul> <li>Compatible to WordPress 3.4</li> </ul> <p>2.2.4</p> <ul> <li>Add French (fr_FR) translation</li> <li>Move cache folder from wp-contents/tmp to db-cache-reloaded-fix/cache to fix permission issue</li> </ul> <p>2.2.3</p> <ul> <li>Fix missing lang folder</li> </ul> <p>2.2.2</p> <ul> <li>Add zh_CN and zh_TW lang</li> </ul> <p>2.2.1</p> <ul> <li>Fix an error in db.php wrong path in DBCR_PATH thanks to Christian for remind me.</li> </ul> <p>2.2</p> <ul> <li>Now compatible with WordPress 3.1</li> </ul> <p>2.1</p> <ul> <li>Make plugin compatible with WordPress 3.0 (single site mode; multisite mode requires additional work);</li> <li>Added Dutch translation (thanks Rene);</li> <li>Added Turkish translation (thanks wolkanca);</li> <li>Added Japanese translation (thanks wokamoto);</li> <li>Added German translation (thanks Carsten Tauber);</li> <li>Do not cache queries which use `RAND()`;</li> <li>Fixed table filter not working all times (thanks poer for pointing this);</li> <li>Code cleanup</li> </ul> <p>2.0.2</p> <ul> <li>Merged last WP 2.9 changes: bump required MySQL version to 4.1.2 for WP 2.9;</li> <li>Added Spanish translation (thanks Dasumo)</li> </ul> <p>2.0.1</p> <ul> <li>Fix: WordPress plugin repository does not add hidden (.name) files to release archives - added workaround</li> </ul> <p>2.0</p> <ul> <li>Merged changes introduced in WordPress 2.9 (make sure you upgrade DB Cache Reloaded to version 2.0 before upgrading WordPress to version 2.9 - earlier plugin versions are not compatible with WP 2.9!);</li> <li>Marked plugin as compatible with WP 2.9;</li> <li>Added Wrapper Mode - with it DB Cache Reloaded can work with some incompatible plugins, like WP Tuner;</li> <li>Added Belorussian translation (thanks FatCow);</li> <li>Fix: added missing .htaccess file;</li> <li>Fix: remove created files if plugin cannot be activated successfully</li> </ul> <p>1.4.2</p> <ul> <li>Marked as compatible with WP 2.8.5</li> </ul> <p>1.4.1</p> <ul> <li>Added Portuguese Brazilian translation (thanks Calebe Aires)</li> </ul> <p>1.4</p> <ul> <li>Show -1 as cached queries count when plugin's DB Module is not in use (e.g. because of conflict with other plugin);</li> <li>Added check if DB Module version is in sync with plugin version (may not be if someone will upgrade plugin manually without deactivating it or disabling cache);</li> <li>Allow to use <code>DBCR_CACHE_DIR</code> define to change default cache directory;</li> <li>Fix: uninstall function was not executed</li> </ul> <p>1.3</p> <ul> <li>Further performance improvement;</li> <li>Fix: changes done in admin section were not visible in frontend;</li> <li>Added icon to use by Ozh' Admin Drop Down Menu plugin</li> </ul> <p>1.2</p> <ul> <li>Fix: queries were not cached starting from first not cached query;</li> <li>Fix: all queries were cached in the same directory instead of dedicated subdirectories;</li> <li>Fix: total row count calculation did not work for complex queries (usually observed as no pagination problem);</li> <li>Added support for <code>DBCR_SAVEQUERIES</code> define to enable extended query logging (as compared to default <code>SAVEQUERIES</code> support)</li> </ul> <p>1.1</p> <ul> <li>Added Polish translation;</li> <li>Added Italian translation (thanks Iacopo);</li> <li>Show error in admin section when wpdb class already exists (this should not happen, but I got few reports about this);</li> <li>Fix: do not cause fatal error when plugin is deleted manually without deactivating it first (in this case wp-content/db.php is left). Instead display error in admin section;</li> <li>Added support for custom plugin directory;</li> <li>Some performance improvements;</li> <li>Show message in admin section when plugin is activated but caching is not enabled</li> </ul> <p>1.0.1</p> <ul> <li>Fix: statistics are not working</li> </ul> <p>1.0</p> <ul> <li>Took DB Cache 0.6 as a baseline;</li> <li>Merged changes done in WordPress 2.9 for the wpdb class (this fixes annoying tags bug);</li> <li>Cleaned up code, moved almost everything from global scope to class;</li> <li>Secured settings page with nonces;</li> <li>Switched to po/mo files for internationalisation</li> </ul> </body> </html>
wenzizone/DB-Cache-Reloaded-Fix
A WordPress Plugins To Cache The Database Query, for Faster Performance
PHP