Fix for “Fatal error: Class ‘W3_Config'”
-
I saw a lot of reports here about the following error:
Fatal error: Class ‘W3_Config’ not found in /wp-content/plugins/wptouch/core/class-cache-smash.php on line 96
This error is not directly related to W3TC itself, but rather to the WPTouch plugin that is attempting to access the W3_Config class, which was removed in v0.9.5
I think plugin developers should refrain from directly accessing the W3TC classes, and instead use the function w3_instance() since those classes might magically disappear in new releases, as what happened today.
Anyway, here’s a workaround that you can use to fix this bug until something more permanent is added in the official plugin.
Edit the file called
w3-total-cache-api.php, and add the following at the end of it:if(!class_exists('W3_Config')) : class W3_Config extends \W3TC\Config { public function __construct($master = false, $blog_id = null) { return parent::__construct($blog_id); } public function get_cache_option( $key, $default = null) { return parent::get( $key, $default ); } } endif;This should hopefully solve the problems with those of you who are using WPTouch.
The topic ‘Fix for “Fatal error: Class ‘W3_Config'”’ is closed to new replies.