We are sorry, the demo failed to finish importing

I have purchased X theme newly, and I have installed it on my computer in LOCALHOST, i cant import the demos, I keep receiving this error “we are sorry, the demo failed to finish importing”.

I am living in Afghanistan and My internet connection is not stable I think this is the main problem, but I can download files with my weak connection (40 kb/sec) out side of the X theme using download managers, Can I have any access to these demos to download them out side of my X them dashboard and add theme to my theme?

Hello There,

Thanks for writing in! You should be able to download the demos even if you have a slow connection. Please make sure to increase the curl time out and increase also the PHP memory limit. Please do this things:
1.) To increase the PHP memory limit, ​please edit your wp-config.php file and insert these lines:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

You can add it before the line
/*That's all, stop editing! Happy Blogging. */

2.) And for the curl time out, please insert this custom code in your theme’s functions.php file

//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) {
	$r['timeout'] = 15;
	return $r;
}
 
add_action('http_api_curl', 'bal_http_api_curl', 100, 1);
function bal_http_api_curl($handle) {
	curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 15 );
	curl_setopt( $handle, CURLOPT_TIMEOUT, 15 );
}

We would loved to know if this has work for you. Thank you.

Thank you for your information and tips, it really helped me.

You’re welcome!
Thanks for letting us know that it has worked for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.