function import_start($file)
{
if (!is_file($file)) {
echo '<p><strong>' . __('Sorry, there has been an error.', 'wordpress-importer') . '</strong><br />';
echo __('The file does not exist, please try again.', 'wordpress-importer') . '</p>';
$this->footer();
die;
}
$import_data = $this->parse($file);
if (is_wp_error($import_data)) {
echo '<p><strong>' . __('Sorry, there has been an error.', 'wordpress-importer') . '</strong><br />';
echo esc_html($import_data->get_error_message()) . '</p>';
$this->footer();
die;
}
$this->version = $import_data['version'];
$this->get_authors_from_import($import_data);
$this->posts = $import_data['posts'];
$this->terms = $import_data['terms'];
$this->categories = $import_data['categories'];
$this->tags = $import_data['tags'];
$this->base_url = esc_url($import_data['base_url']);
wp_defer_term_counting(true);
wp_defer_comment_counting(true);
do_action('import_start');
}