/** * Builds the HTML for the import form * * @since 1.3.5 */ function output_import_html() { $upload_dir = wp_upload_dir(); $wpseo_upload_dir = $upload_dir["basedir"] . '/wpseo/import/'; echo '<p>' . sprintf(__('View the %sdocumentation%s to check what format of the CSV file should be.', 'yoast-local-seo'), '<a href="https://yoast.com/question/csv-import-file-local-seo-look-like/" target="_blank">', '</a>') . '</p>'; echo '<form action="" method="post" enctype="multipart/form-data">'; WPSEO_Local_Admin_Wrappers::file_upload('csvuploadlocations', __('Upload CSV', 'yoast-local-seo')); echo '<label for="csv_separator" class="checkbox">' . __('Column separator', 'yoast-local-seo') . ':</label>'; echo '<select class="textinput" id="csv_separator" name="csv_separator">'; echo '<option value="comma">' . __('Comma', 'yoast-local-seo') . '</option>'; echo '<option value="semicolon">' . __('Semicolon', 'yoast-local-seo') . '</option>'; echo '</select>'; echo '<br class="clear">'; echo '<p>'; echo '<input class="checkbox double" id="is-simplemap-import" type="checkbox" name="is-simplemap-import" value="1"> '; echo '<label for="is-simplemap-import">' . __('This CSV is exported by the SimpleMap plugin', 'yoast-local-seo') . '</label>'; echo '</p>'; echo '<br class="clear">'; echo '<br/>'; echo '<p><em>' . __('Note', 'yoast-local-seo') . ': ' . __('The Geocoding API is limited to 2,500 queries a day, so when you have large CSV files, with no coordinates, cut them in pieces of 2,500 rows and import them one a day. Indeed, it\'s not funny. It\'s reality.', 'yoast-local-seo') . '</em></p>'; if (!is_writable($wpseo_upload_dir)) { echo '<p>' . sprintf(__('Make sure the %s directory is writeable.', 'yoast-local-seo'), '<code>"' . $wpseo_upload_dir . '"</code>') . '</p>'; } # Add a NONCE field echo wp_nonce_field('wpseo_local_import_nonce', 'wpseo_local_import_nonce_field'); echo '<input type="submit" class="button-primary" name="csv-import" value="Import" ' . (!is_writable($wpseo_upload_dir) ? ' disabled="disabled"' : '') . ' />'; echo '</form>'; }