=== KB HTML Site Importer & Visual Editor ===
Contributors: abhishekpadhi
Tags: html importer, static website, zip importer, visual editor, code editor
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Import AI-generated or static HTML sites from ZIP files into WordPress, then edit code, visually update content, preview, and manage media.

== Description ==

KB HTML Site Importer & Visual Editor helps WordPress administrators import AI-generated or static HTML websites from ZIP files and publish them as WordPress Pages or Posts.

Upload a ZIP containing `index.html` or `index.htm`, keep the original folder structure, preview the result at desktop, tablet and mobile sizes, edit source files, and make quick visual changes from WordPress.

= Key features =

* Import complete static HTML/CSS/JavaScript websites from ZIP files.
* Publish imported websites as WordPress Pages or Posts.
* Preserve the original folder and asset structure.
* Edit HTML, CSS, JavaScript, JSON, XML, text and SVG source files.
* Quick Visual Edit for text, link URLs, button destinations, colors, images and image alt text.
* Full-screen visual editing mode for distraction-free changes.
* Responsive desktop, tablet and mobile previews.
* Register imported raster images in the WordPress Media Library.
* Replace individual image assets while keeping existing file references.
* Replace a complete website ZIP while keeping the existing WordPress URL.
* Download the currently managed website as a ZIP.
* Create backups when individual managed files are edited or replaced.
* Blocks server-side executable files and server configuration files inside imported ZIP files.

= Security and permissions =

Importing and editing features are restricted to users with both `manage_options` and `unfiltered_html`, which limits raw script editing to appropriately trusted administrators. State-changing requests use WordPress nonces, uploaded ZIP paths are validated before extraction, and unsafe archive paths, server-side executable files, and server configuration files are rejected.

KB HTML Site Importer & Visual Editor does not make automatic requests to external services. The plugin dashboard contains optional links to Key2blogging support and YouTube resources; those sites are only opened when an administrator clicks the links.

== Installation ==

1. Upload the `html-site-importer-visual-editor` folder to `/wp-content/plugins/`, or install the plugin ZIP from **Plugins > Add New > Upload Plugin**.
2. Activate **KB HTML Site Importer & Visual Editor** from the WordPress Plugins screen.
3. Open **Pages > HTML Site Importer** in the WordPress admin menu.
4. Enter a website title, choose Page or Post, and upload a ZIP containing `index.html` or `index.htm`.
5. Use **Edit Code**, **Visual Edit**, or **Preview** to manage the imported website.

== Frequently Asked Questions ==

= What should the ZIP contain? =

The ZIP must contain an `index.html` or `index.htm` file. CSS, JavaScript, fonts, images and other static assets can be included in the same folder structure.

= Can I import PHP or other server-side code? =

No. KB HTML Site Importer & Visual Editor is designed for AI-generated or other static websites. Server-side executable file types and server configuration files such as .htaccess, web.config and php.ini are rejected during ZIP validation.

= Can I edit an imported website after publishing it? =

Yes. The plugin includes source-code editing, responsive previews, image replacement, and a Quick Visual Edit mode for common text, link, color and image changes.

= Are imported images added to the Media Library? =

Supported raster images are registered in the WordPress Media Library so they can be managed alongside other WordPress media.

= Does the plugin contact Key2blogging or YouTube automatically? =

No. The dashboard contains optional resource links, but the plugin does not automatically send site or visitor data to those websites.

= Where are imported website files stored? =

Imported website files and edit backups are stored under the WordPress uploads directory. The plugin keeps the website's relative folder structure intact.

== Changelog ==

= 1.0.0 =

* Initial WordPress.org-ready release under the KB HTML Site Importer & Visual Editor name.
* Added static website ZIP import with Page/Post creation.
* Added code editor, visual editor and full-screen visual editing workflows.
* Added responsive previews and Media Library image registration.
* Added secure ZIP validation, administrator capability checks and nonce verification.
* Added WordPress Filesystem-based file operations and safer attachment lookup logic.
* Added YouTube and Support resource links to the dashboard header.

== Upgrade Notice ==

= 1.0.0 =
Initial public release of KB HTML Site Importer & Visual Editor.
