# Smart Content Sync

Create once. Sync everywhere.

Smart Content Sync lets you create reusable content blocks and insert them consistently across posts, pages, and WooCommerce products — manually or automatically — without copy‑pasting.

---

## ✨ Key Features (v1.0.0)

### Smart Content Blocks

- Dedicated **Smart Content** custom post type
- Centralized content editing with live preview
- Internal notes for editors (not shown on frontend)

### Editor Integrations

- **Classic Editor**: TinyMCE button to insert Smart Content
- **Gutenberg**: Dynamic block for Smart Content
- **Shortcode** support:
  - `[smart_content id="123"]`
  - `[smart_content slug="shipping-policy"]`

### Auto Insert (v1.0 Free)

- Automatically inject Smart Content at predefined locations
- Supported locations:
  - WordPress content (prepend / append)
  - WooCommerce single product pages
- Runs only on:
  - WordPress: `is_singular()` (no archives)
  - WooCommerce: single product pages only
- Stable ordering:
  - Blocks render in **Smart Content order**
  - Ordering remains stable across saves and rebuilds
- High performance:
  - Uses an internal option‑based index (no slow meta queries)

### Smart Variables

- Unified rendering pipeline via `RenderingGateway`
- Context‑aware variables:
  - Site
  - Post / Product
  - Shortcode attributes
- Consistent output across editors, previews, auto‑insert, and frontend

### SEO Analysis Compatibility (v1.0)

- Smart Content **manual inserts** are visible to SEO analyzers
- Server-side rendering ensures analyzers see **expanded HTML**, not placeholders
- Draft-aware analysis:
  - Unsaved editor changes are included during SEO analysis
- Supported SEO plugin:
  - Yoast SEO

**Not included in v1.0:**

- Auto Inserted Smart Content is **not yet included** in SEO analysis
- Additional SEO plugins (Rank Math, AIOSEO) are planned for future releases

### Permissions & Safety

- Dedicated capabilities for Smart Content
- Preview and rendering guarded against:
  - Admin screens
  - Feeds
  - REST requests
  - SEO analysis contexts

### Settings

- Central Settings page under **Smart Content**
- Uninstall behavior option:
  - Optional deletion of Smart Content posts on uninstall

---

## 🗑️ Uninstall Behavior

By default, uninstalling Smart Content Sync will:

- Remove internal caches and runtime options
- **Preserve all Smart Content posts and metadata**

You may optionally enable deletion of Smart Content posts from:
**Smart Content → Settings → Uninstall**

---

## 📦 Version History

### v1.0.0

- Initial stable release
- Smart Content custom post type
- Classic Editor + Gutenberg integrations
- Shortcode rendering
- Auto Insert (WordPress + WooCommerce)
- Smart Variables with unified rendering pipeline
- Performance‑safe auto‑insert indexing
- Settings framework with uninstall control
- SEO analysis compatibility for manually inserted Smart Content (Yoast SEO)

---

## 🧪 Tested Scenarios

- Posts, pages, and WooCommerce products
- Multiple auto‑insert blocks per location
- Mixed WordPress + WooCommerce locations
- Ordering stability after edits
- Works alongside caching plugins

---

## 🔌 Extensibility

Smart Content Sync exposes filters and hooks for:

- Auto‑insert locations
- Rendering behavior
- Smart Variable contexts
- Permissions and guards

Designed to scale cleanly into features without breaking v1.0 behavior.

---

## 📄 License

GPL v2 or later
