=== ERA Markdown Importer ===
Contributors: eraai
Tags: markdown, importer, markdown importer, gutenberg, obsidian
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Import Markdown (.md, .txt) files as standard WordPress posts or pages, automatically converted into native Gutenberg blocks.

== Description ==

ERA Markdown Importer is a lightweight, secure, and developer-friendly tool designed to streamline your content creation workflow. If you write your articles in Markdown-based applications like Obsidian, Notion, VS Code, or Typora, this plugin completely eliminates the need for manual copy-pasting, manual formatting, and layout adjustments.

The plugin converts standard Markdown elements (headings, paragraphs, lists, blockquotes, tables, and code blocks) into native, editable Gutenberg Blocks instantly.

== Core Features ==

* **Drag-and-Drop Uploader:** Beautiful, minimalist administration interface inspired by modern design principles (shadcn/ui style).
* **Gutenberg Blocks Conversion:** Automatically generates native Gutenberg block comments (such as `wp:paragraph`, etc.) instead of inserting raw HTML, ensuring clean and native editing inside the block editor.
* **YAML Front-Matter Support:** Automatically parses settings like title, status (draft/publish), post type, categories, and tags directly from your file header.
* **Table Spacing Auto-Fix:** Automatically pre-processes Markdown tables to ensure they parse and align correctly in the WordPress table block.
* **Enhanced Security Hardening:** 
    * Enabled Parsedown **Safe Mode** to automatically escape and strip raw HTML tags, inline scripts, and unsafe protocols (e.g. `javascript:` links).
    * Explicit sanitization of custom and extracted post titles via `sanitize_text_field()`.
    * Enforced 500KB maximum file size limits to prevent server memory exhaustion (DoS).
    * Enforced strict nonces, capability checks, and file validation.

== Installation ==

1. Upload the `era-markdown-importer` folder to the `/wp-content/plugins/` directory, or upload the ZIP file through the WordPress admin panel.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Access the tool under **Tools > Markdown Importer** in your WordPress sidebar.

== Frequently Asked Questions ==

= Does this plugin support custom post types? =
Yes, you can choose to import files as standard Posts, Pages, or any public Custom Post Type registered on your site.

= Does it support YAML Front Matter? =
Yes, it automatically parses YAML headers at the beginning of the file to map the post title, status, categories, and tags.

= Is it Gutenberg compatible? =
Yes, it converts Markdown elements into native, editable block editor blocks.

== Changelog ==

= 1.0.2 =
* **Compliance & Security:** Removed debug logging logic and resolved a potential mock backdoor in developer mode.
* **Uninstall Routine:** Integrated database cleanup for custom plugin options.

= 1.0.1 =
* **Security Hardening:** Activated Parsedown Safe Mode to prevent Stored XSS and HTML injection.
* **Input Sanitization:** Added explicit title sanitization using `sanitize_text_field()`.
* **Resource Optimization:** Reduced maximum file size limit from 2MB to 500KB to prevent memory exhaustion.
* **UI/UX Updates:** Reflected the 500KB limit in the admin UI drag-and-drop zone.

= 1.0.0 =
* Initial release. Core drag-and-drop uploader, Parsedown parser, and HTML-to-Gutenberg block converter.
