# Changelog

All notable changes to AppsFruit Elementor Embed will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.4] - 2026-04-23
### Security
- Set `publicly_queryable => false` on the `aefe_template` post type. Templates are intended for embedding only; direct URL access was publicly available and could expose raw template content.

### Fixed
- `template_include()` only applied the custom single template when Elementor was active. It now always uses the plugin template for `aefe_template` posts, ensuring consistent rendering regardless of Elementor state.

## [1.0.3] - 2026-04-23
### Fixed
- Elementor frontend JavaScript not enqueued on pages not built with Elementor, causing all JS-dependent widgets (sliders, tabs, accordions, animations) to not function when embedded via shortcode or Gutenberg block. Assets are now proactively registered on the `wp` hook when `[aefe_embed]` shortcode or `aefe/embed-template` block is detected on the current page.

## [1.0.2] - 2026-04-23

### Fixed
- Version constant `AEFE_VERSION` was out of sync with the plugin header after the 1.0.1 release.

## [1.0.1] - 2026-04-23

### Fixed
- Shortcode displaying as raw text when plugin loads before Elementor alphabetically. Plugin now initialises on the `elementor/loaded` action instead of `plugins_loaded` so `add_shortcode()` is always called after Elementor is ready.
- Fatal PHP error (`Call to a member function on null`) when rendering a template whose Elementor document had never been saved. `documents->get()` return value is now null-checked before calling `is_built_with_elementor()`.
- Embedded template content rendering without its Elementor stylesheet. `get_builder_content_for_display()` is now called with `$with_css = true` so styles are injected inline alongside the content.
- Empty template output when shortcode is processed in admin-AJAX or REST API contexts where the Elementor frontend had not been initialised. The frontend is now explicitly initialised if `elementor/frontend/init` has not fired.
- Admin list shortcode column showing unquoted attribute (`id=123` instead of `id="123"`).

## [1.0.0] - 2025-09-30

### Added
- Initial release of AppsFruit Elementor Embed
- Custom post type `aefe_template` for managing Elementor templates
- Shortcode `[aefe_embed]` for embedding templates anywhere
- Conditional display attributes:
  - `device` - Show on mobile or desktop only
  - `role` - Show to specific user roles
  - `post_type` - Show on specific post types
- Category taxonomy for organizing templates
- Tag taxonomy for labeling templates
- Admin UI enhancements:
  - Shortcode column in template list view
  - Quick copy shortcode button
  - Shortcode meta box in edit screen
  - "Edit with Elementor" quick action link
- Gutenberg block "Insert Elementor Template" for visual embedding
- Developer hooks and filters:
  - `aefe_init` action
  - `aefe_activated` action
  - `aefe_deactivated` action
  - `aefe_before_render_template` action
  - `aefe_after_render_template` action
  - `aefe_post_type_args` filter
  - `aefe_category_taxonomy_args` filter
  - `aefe_tag_taxonomy_args` filter
  - `aefe_shortcode_atts` filter
  - `aefe_should_display` filter
  - `aefe_should_render_template` filter
  - `aefe_template_content` filter
  - `aefe_wrapper_classes` filter
  - `aefe_error_message` filter
- Help & Documentation admin page
- Comprehensive README.md with usage examples
- Detailed SETUP.md with step-by-step instructions
- Admin JavaScript for clipboard functionality
- Block editor JavaScript for Gutenberg integration
- Admin CSS styling
- Block editor CSS styling
- Template file for single template display
- Error handling with user-friendly messages
- Security checks and WordPress coding standards compliance
- Translation-ready with text domain
- Elementor dependency check with admin notice

### Security
- Proper sanitization and escaping of all user inputs
- Capability checks for admin functions
- Nonce verification where applicable
- Direct file access prevention

### Performance
- Efficient database queries
- Minimal asset loading (only on relevant admin pages)
- Server-side rendering for Gutenberg blocks
- Lazy loading of Elementor frontend

### Developer Experience
- Well-documented code with inline comments
- Modular architecture with separate class files
- Extensive hook system for customization
- Example code snippets in documentation
- PSR-4 style autoloading structure

## [Unreleased]

### Planned Features
- Template import/export functionality
- Template usage statistics
- Advanced caching options
- Template preview in admin
- Bulk operations for templates
- Template duplication feature
- Custom CSS per template
- JavaScript event triggers
- REST API endpoints
- Template scheduling (show between dates)
- Geographic targeting
- A/B testing support
- Template library/marketplace integration

---

## Version History

- **1.0.0** - Initial release (2025-09-30)
