• Resolved seo90

    (@seo90)


    Hello,

    When trying to download the w3 total cache configuration my server responds with this error and does not download:

    Internal Server Error
    Oops! Something went wrong.
    
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Error Code: 500

    I was looking at the plugin code and got here:

    	function w3tc_config_export() {
    		$filename = substr( get_home_url(), strpos( get_home_url(), '//' )+2 );
    		@header( sprintf( __( 'Content-Disposition: attachment; filename=%s.json', 'w3-total-cache' ), $filename ) );
    		echo $this->_config->export(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    		die();
    	}

    If I remove the line

    @header( sprintf( __( 'Content-Disposition: attachment; filename=%s.json', 'w3-total-cache' ), $filename ) );

    and replacement by

    header("Content-disposition: attachment; filename=".$filename.".json");

    it works perfectly, I have only removed the sprintf function, without removing that part of the code it does not work on my server.

    Why could it be?

    Only w3 total cache fails when downloading the configuration, wordpress and other plugins work correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter seo90

    (@seo90)

    I have already discovered the bug… If wordpress is in English, it works perfectly, if it is in Spanish, it fails.

    Content-Disposition: attachment; is being translated to Spanish as “Disposición de contenido: adjunto;” and then it makes the server error…

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @seo90

    Thank you for reaching out and thank you for taking the time to find out where the problem is.
    We’ll make sure to check the problem related to translations.
    You can always make a backup of the /wp-content/w3tc-config/master.php file, which is a configuration file.
    Once again, thank you for taking the time to investigate this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error 500 when downloading configuration’ is closed to new replies.