=== LexNova Content Types ===
Contributors: titandevagency
Tags: custom post types, law firm, demo import, page builder, gutenberg blocks
Requires at least: 6.5
Tested up to: 7.1
Stable tag: 1.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds Practice Areas, Case Studies and Attorneys CPTs and Gutenberg blocks for the LexNova theme.

== Description ==

LexNova Content Types is a companion plugin for the **LexNova** WordPress theme. It registers the custom post types, taxonomies and Gutenberg blocks the theme's templates rely on, and adds a Demo Import screen so a fresh install can be populated with sample content in one click.

**Custom Post Types**

* Practice Areas (`lexnova-services`) — a law firm's service/practice area listings
* Case Studies (`lexnova-case-studies`) — case results and outcomes
* Attorneys (`lexnova-attorneys`) — attorney/team profiles

**Demo Import / Export**

Found under **Appearance → Demo Import**.

* *Import Demo Content* — imports demo pages, practice areas, case studies, attorneys, navigation menus, and theme settings using the official WordPress Importer under the hood.
* *Export Demo Content* — generates a scoped demo package in the WordPress uploads directory containing selected LexNova content, referenced media, and presentation settings.
* *Delete Demo Content* — removes only objects recorded in the LexNova import ownership manifest and safely restores unchanged settings.

**Requirements**

* [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) is used by the demo contact forms.
* The [WordPress Importer](https://wordpress.org/plugins/wordpress-importer/) is bundled internally and used automatically for demo import — no separate install needed.

This plugin is intended to be used together with the LexNova theme; the custom post types and blocks it registers remain available after switching themes.

== External services ==

The plugin itself does not transmit analytics, telemetry, account details, or site data to the plugin author. Demo import runs only after an administrator explicitly starts it.

The optional demo content contains a Google Maps embed. If an administrator imports the demo and leaves that map enabled, a visitor's browser connects directly to Google when viewing the map and may send the visitor's IP address, browser details, and page URL. Google's terms and privacy policy apply. The map can be removed or its URL cleared in the block editor without affecting other plugin features.

Social sharing links open Facebook, Instagram, LinkedIn, or X only when a visitor chooses a link. No request is sent to those services merely by displaying the links.

== Privacy ==

LexNova Content Types does not collect or transmit telemetry or personal data. Custom post content and settings remain on the WordPress site. Scoped demo exports are written below the site's uploads directory and are controlled by administrators; administrators should review and remove exports when no longer needed.

== Third-party resources ==

* WordPress Importer - WordPress contributors - GPLv2 or later - https://wordpress.org/plugins/wordpress-importer/
* Tailwind CSS output used by plugin-owned blocks - Tailwind Labs, Inc. - MIT License - https://tailwindcss.com/
* Lucide icons - Lucide contributors - ISC License - https://lucide.dev/
* Regenerator Runtime - Facebook, Inc. and contributors - MIT License - https://github.com/facebook/regenerator
* Laravel Mix (build tool) - Jeffrey Way - MIT License - https://github.com/laravel-mix/laravel-mix

The WordPress.org release package intentionally excludes local exported uploads, stock/demo photographs, AI-generated images, and nested theme archives whose redistribution provenance is not documented. Administrators can supply their own media or create a scoped export from content they are authorized to redistribute.

== Source code & build ==

The human-readable source code for the Gutenberg block scripts shipped in `blocks-runtime/js/` is included in this plugin under `blocks-runtime/src/`. Each block directory contains the original `index.js`, `edit.js`, and `save.js` ES-module files before bundling and minification.

**Build tool:** Laravel Mix (webpack wrapper) — the build configuration lives in the companion LexNova theme (`webpack.mix.js`).

**Build dependency:** `blocks-runtime/src/lucide-icons.json` — icon data imported at build time by the hero, practice-areas, and why-choose-us block editors.

**To regenerate the compiled block scripts:**

1. Install the LexNova theme (which contains `webpack.mix.js` and `package.json`).
2. Run `npm ci` inside the theme directory.
3. Run `npm run production` — Laravel Mix compiles each `resources/blocks/*/index.js` entry point and copies the output to the plugin's `blocks-runtime/js/` directory.

The `@wordpress/*` packages (`@wordpress/blocks`, `@wordpress/block-editor`, `@wordpress/components`, `@wordpress/i18n`, `@wordpress/element`, `@wordpress/data`) are treated as externals and resolve to the global `wp.*` objects at runtime — they are not bundled into the output.

== Installation ==

**Manual installation (upload)**

1. Download the plugin ZIP file.
2. In your WordPress admin, go to **Plugins → Add New → Upload Plugin**.
3. Choose the ZIP file and click **Install Now**.
4. Click **Activate**.
5. (Optional) Go to **Appearance → Demo Import** to import sample content.

**From the WordPress Plugin Directory** *(once published)*

1. Go to **Plugins → Add New**.
2. Search for "LexNova Content Types".
3. Click **Install Now**, then **Activate**.

== Frequently Asked Questions ==

= Does this plugin work without the LexNova theme? =

The custom post types and demo importer work standalone, but the Gutenberg blocks and templates are designed specifically for the LexNova theme and are built to be used together with it.

= Where did my demo content go after I clicked "Delete Demo Content"? =

Deleting demo content permanently removes the imported pages, practice areas, case studies, attorneys and menus. This action cannot be undone, so use it only on a test site or before you've added your own content.

= Why does Import ask me to wait for Contact Form 7? =

The demo content includes ready-made contact forms. If Contact Form 7 isn't active yet when you import, WordPress still creates the form entries, but Contact Form 7 won't recognize them later even after you activate it. The importer waits for Contact Form 7 to finish installing/activating first so the forms come in fully configured.

== Changelog ==

= 1.0.2 =
* Sanitized all nonce inputs with sanitize_text_field( wp_unslash( ... ) ) before wp_verify_nonce.
* Added JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT flags to JSON-LD output.
* Added direct-access (ABSPATH) guards to all PHP files including bundled vendor importer.
* Removed BOM bytes from vendor PHP files to prevent activation output warnings.
* Corrected Contributors username in readme.txt.
* Bumped version to 1.0.2.

= 1.0.1 =
* Moved LexNova blocks, content metadata, and structured data into the plugin.
* Hardened demo import, export, and reset behavior.
* Removed the unsafe global SVG upload override.
* Improved WordPress.org metadata, licensing, internationalization, and packaging.
* Sanitized inline SVG icon output and delayed $_POST sanitization across attorney, service, and case study meta boxes.
* Removed undocumented stock demo photography from the release package.
* Added block script source code under blocks-runtime/src/ and documented the build process.
* Prefixed all custom post type and taxonomy keys with lexnova- to avoid collisions with other plugins.
* Moved all inline admin styles and scripts to enqueued css/admin.css, js/admin.js, and js/demo-import.js files.
* Moved all inline frontend block styles to wp_add_inline_style and tab script to case-result-detail-tabs.js.

= 1.0.0 =
* Initial release: custom post types, Gutenberg blocks, and demo import/export.

== Upgrade Notice ==

= 1.0.2 =
Security and compliance fixes: sanitized nonces, escaped JSON-LD, direct-access guards, and corrected Contributors.

= 1.0.1 =
Moves persistent LexNova functionality into the plugin, hardens sanitization, and improves demo-data safety.

= 1.0.0 =
Initial release.
