• Resolved wmsgeorge

    (@wmsgeorge)


    I just used this plugin perfectly the other day and I have to first say thank you. It’s easy to use and did the job for me perfectly.

    The problem I ran into is today I after generating the files it’s missing the main page index.html file now.

    I double checked this on the original site I used the plugin on and generated new static files and downloaded that zip file. Missing the index file in there as well.

    I am speaking of the home page index.html file. The first index.html file in the zip folder located under the wp-json folder.

    The only thing I can think of is that the update you pushed affected this. Because I just used this plugin on saturday and it worked perfectly. Please advise.

    https://www.ads-software.com/plugins/simply-static/

Viewing 4 replies - 1 through 4 (of 4 total)
  • It appears there is a bug that leaves a trailing “.” in the temporary directory name. If you disable “delete temporary files”, you will find index.html in <wpdir>/wp-content/plugins/simply-static/static-files/simply-static-1-timestamp-blogname. (with a period). You can just copy that file over.

    Here is my fix. Probably more lines than required, but I get lost in all of these short-circuit operators. I will send them to the plugin author for a real fix.

    ~/wp-content/plugins/simply-static/includes]% diff -u class-simply-static-archive-creator.php.broken class-simply-static-archive-creator.php
    --- class-simply-static-archive-creator.php.broken	2016-01-18 17:20:38.000000000 +0000
    +++ class-simply-static-archive-creator.php	2016-01-18 17:22:21.000000000 +0000
    @@ -314,10 +314,12 @@
     	 * @return boolean $success Did we successfully save the file?
     	 */
     	protected function save_url_to_file( $path, $content, $is_html ) {
    -		$path_info = pathinfo( $path && $path != '/' ? $path : 'index.html' );
    -
    +
    +	  $relpath = ($path && $path != '/') ? $path : 'index.html';
    +	  $abspath = $this->archive_dir . DIRECTORY_SEPARATOR . $relpath;
    +	  $path_info = pathinfo( $abspath );
     		// Create file directory if it doesn't exist
    -		$file_dir = untrailingslashit( $this->archive_dir ) . ( $path_info['dirname'] ? $path_info['dirname'] : '' );
    +		$file_dir = untrailingslashit( $path_info['dirname']  );
     		if ( empty( $path_info['extension'] ) && $path_info['basename'] == $path_info['filename'] ) {
     			$file_dir .= DIRECTORY_SEPARATOR . $path_info['basename'];
     			$path_info['filename'] = 'index';

    Thanks for reporting this issue! I’ve just released v1.2.1 that should fix it for you.

    Thread Starter wmsgeorge

    (@wmsgeorge)

    Awesome! Thanks guys. I Very much appreciate your quick response and quick fix.

    I upload my Backup but i can’t find my index.php plz help me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Missing index.html File’ is closed to new replies.