• If you are seeing errors such as:

    Try the following:

    Open up w3-total-cache-api.php, look for function w3tc_class_autoload( $class ).
    Erase the entire function (from line 120 to line 163) and replace it with the following:

    function w3tc_class_autoload( $class ) {
    	$base = null;
    
    	// some php pass classes with slash
    	if ( substr( $class, 0, 1 ) == "\\" )
    		$class = substr( $class, 1 );
    
    	if ( substr( $class, 0, 5 ) == 'HTTP_' || substr( $class, 0, 7 ) == 'Minify_' ) {
    		$base = W3TC_LIB_DIR . DIRECTORY_SEPARATOR . 'Minify' . DIRECTORY_SEPARATOR;
    	} elseif ( substr( $class, 0, 8 ) == 'Minify0_' ) {
    		$base = W3TC_LIB_DIR . DIRECTORY_SEPARATOR . 'Minify' . DIRECTORY_SEPARATOR;
    		$class = substr( $class, 8 );
    	} elseif ( substr( $class, 0, 7 ) == 'Google_' &&
    		( !defined( 'W3TC_GOOGLE_LIBRARY' ) || W3TC_GOOGLE_LIBRARY ) ) {
    		// Google library
    		$classPath = explode( '_', $class );
    		if ( count( $classPath ) > 3 ) {
    			// Maximum class file path depth in this project is 3.
    			$classPath = array_slice( $classPath, 0, 3 );
    		}
    
    		$filePath = W3TC_LIB_DIR . DIRECTORY_SEPARATOR .
    			implode( '/', $classPath ) . '.php';
    		if ( is_readable( $filePath ) ) {
                        require $filePath;
                    }
    		return;
    	}
    
    	if ( !is_null( $base ) ) {
    		$file = $base . strtr( $class, "\\_",
    			DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR ) . '.php';
    		if ( is_readable( $file ) ) {
    			require_once $file;
                    }
    	} else if ( substr( $class, 0, 5 ) == 'W3TC\\' ) {
    			$filename = W3TC_DIR . DIRECTORY_SEPARATOR . substr( $class, 5 ) . '.php';
    
                            if ( is_readable( $filename ) ) {
                                require $filename;
                            }
                            else {
                                if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
                                        debug_print_backtrace();
                                }
    			}
    			
                            return;
    		}
    }
    
Viewing 7 replies - 16 through 22 (of 22 total)
  • Yes! Fixed in W3TC 0.9.5.1

    Thank you very much.
    Your plug-in is great!

    Hei guys I have another fatal error concerning google analytics plugin but it appears only when clicking on the menu in the mobile version. It says
    Fatal error: Can’t use function return value in write context in /home4/larayannik/public_html/wp-content/plugins/googleanalytics/class/Ga_Admin.php on line 106

    And my blog is vanillacrunnch.com

    Thanks for any help!

    I got a notification in my elementor pagebuilder pluginto upgrade it, i clicked on the upgrade option, however the upgrade was not completed it showed some error after that when i type my website url, the following error shows up in the screen.

    Fatal error: require(): Failed opening required ‘/home/u250257086/public_html/wp-content/plugins/elementor/includes/plugin.php’ (include_path=’.:/opt/php-5.6/pear’) in /home/u250257086/public_html/wp-content/plugins/elementor/elementor.php on line 41

    I am clueless now what to do even /wp-admin is not working.

    thanx in advance

    @laravanillacrunnch and @krunal123:

    What hints have told you that your errors are related to W3 Total Cache. In both reports I see issues with your plugins, Google Analytics and Elementor, respectively, but not with any cache related thing.

    Good evening. I need a help- after instalation of Visual composer and making some upgrade I saw such message at all pages of the web site: Fatal error: Call to undefined function get_row_css_class() in /home/fiji/ftp/www/wp-content/themes/jupiter/shortcodes/vc_row.php on line 40

    Please help me to manage this problem, regards. Olga

    @fijidance Your error is related to your installation of the Visual Composer, not the W3 Total Cache however, if you log into your hosting package and use your file manager, or connect via FTP to your server, simply remove the Visual Composer folder (within the wp-content/plugins folder). By removing the plugin, WordPress will disable the plugin and your site should come back up. (I’m assuming Visual Composer is a plugin).

    If that’s not the case, go to the Visual Composer page and raise a support question there. It might be a known issue between that code and other plugins/themes.

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Fix for “Fatal error: require():”’ is closed to new replies.