foreach ($arrFieldQueries as $fieldQuery) { $fields = $dom_xpath->query($fieldQuery); if ($fields->length == 0 && isset($_POST['chkShowDebug'])) { echo "No entries found for the query " . $fieldQuery . "<br>"; } } echo "Starting Import\n"; $import->import_xhtml_entries($dom, $dom_xpath); $import->index_searchstrings(); $import->convert_fields_to_links(); $message = "The import of the vernacular (configured) xhtml export is completed.\n"; $message .= "Go here to configure more settings: " . get_site_url() . "/wp-admin/admin.php?page=webonary"; wp_mail($current_user->user_email, 'Import complete', $message); echo "Import finished\n"; } elseif ($filetype == 'reversal') { $import->reversal_table_name = $wpdb->prefix . 'sil_reversal'; $import->import_xhtml_reversal_indexes($dom, $dom_xpath); $import->index_reversals(); $message = "The reversal import is completed.\n"; $message .= "Go here to configure more settings: " . get_site_url() . "/wp-admin/admin.php?page=webonary"; wp_mail($current_user->user_email, 'Reversal Import complete', $message); } elseif ($filetype == 'stem') { $import->import_xhtml_stem_indexes($dom, $dom_xpath); } $file = $import->get_latest_xhtmlfile(); if (substr($file->url, strlen($file->url) - 5, 5) == "xhtml") { wp_delete_attachment($file->ID); } else { //file is inside extracted zip directory unlink($xhtmlFileURL); }