diff --git a/.changeset/short-ants-wave.md b/.changeset/short-ants-wave.md new file mode 100644 index 00000000..bef48ab0 --- /dev/null +++ b/.changeset/short-ants-wave.md @@ -0,0 +1,5 @@ +--- +"@wpengine/hwp-previews-wordpress-plugin": major +--- + +chore: Initial release of the HWP Previews Plugin diff --git a/plugins/hwp-previews/README.md b/plugins/hwp-previews/README.md index 2615921b..cfa7c64d 100644 --- a/plugins/hwp-previews/README.md +++ b/plugins/hwp-previews/README.md @@ -3,7 +3,7 @@ **Headless Previews** solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. * [Join the Headless WordPress community on Discord.](https://discord.gg/headless-wordpress-836253505944813629) -* [Documentation](#getting-started) +* [Documentation](../../docs/plugins/hwp-previews/) ----- @@ -16,27 +16,16 @@ [![Code Coverage](https://img.shields.io/badge/coverage-%3E95%25-brightgreen?label=Code%20Coverage)](https://github.com/wpengine/hwptoolkit/actions) [![Code Quality](https://github.com/wpengine/hwptoolkit/actions/workflows/code-quality.yml/badge.svg)](https://github.com/wpengine/hwptoolkit/actions/workflows/code-quality.yml) [![End-to-End Tests](https://github.com/wpengine/hwptoolkit/actions/workflows/e2e-test.yml/badge.svg)](https://github.com/wpengine/hwptoolkit/actions/workflows/e2e-test.yml) ------ +----- + > [!CAUTION] > This plugin is currently in a beta state. It's still under active development, so you may encounter bugs or incomplete features. Updates will be rolled out regularly. Use with caution and provide feedback if possible. You can create an issue at [https://github.com/wpengine/hwptoolkit/issues](https://github.com/wpengine/hwptoolkit/issues) ----- -## Table of Contents - -- [Overview](#overview) -- [Features](#features) -- [Getting Started](#getting-started) -- [Configuration](#configuration) -- [Front-End Integration](#front-end-integration) -- [Using With Faust.js](#using-with-faustjs) -- [Extending the Functionality](#extending-the-functionality) -- [Testing](#testing) -- [Uninstallation](#uninstallation) - ## Overview HWP Previews is a robust and extensible WordPress plugin that centralizes all preview configurations into a user-friendly settings interface. @@ -57,116 +46,34 @@ This fundamental architectural shift creates what we call the "preview problem" - **Faust Compatibility**: The plugin is compatible with [Faust.js](https://faustjs.org/) and the [FaustWP plugin](https://github.com/wpengine/faustjs/tree/canary/plugins/faustwp). ->[!IMPORTANT] +>[!NOTE] > For Faust users, HWP Previews integrates seamlessly, automatically configuring settings to match Faust's preview system. This allows you to maintain your existing preview workflow without additional setup. -## Getting Started - -This guide will help you set up your first headless preview link for the "Posts" post type. - -1. **Activate the Plugin:** Ensure "HWP Previews" is installed and activated. -2. **Navigate to Settings:** Go to **Settings > HWP Previews** in your WordPress admin dashboard. -3. **Enable for Posts:** On the "Posts" tab, check the "Enable HWP Previews" box. If you have Faust installed, this option will be enabled by default. Find more information about Faust integration below. -4. **Set the Preview URL:** In the "Preview URL Template" field for Posts, enter the URL for your front-end application's preview endpoint. Use parameters to add dynamic information that you want to access. -5. **Save and Test:** Save changes, go to any post, make a change, and click the "Preview" button. You should be redirected to the URL you just configured. - ---- - -## Project Structure - -```text -hwp-previews/ -├── src/ # Main plugin source code -│ ├── Admin/ # Admin settings, menu, and settings page logic -│ ├── Hooks/ # WordPress hooks and filters -│ ├── Integration/ # Integrations (e.g. Faust) -│ ├── Preview/ # Preview URL logic, template resolver, helpers -│ ├── Plugin.php # Main plugin class (entry point) -│ └── Autoload.php # PSR-4 autoloader -├── examples/ # Example front-end integrations for WP GraphQL and REST -├── tests/ # All test suites -│ ├── wpunit/ # WPBrowser/Codeception unit -├── hwp-previews.php -├── activation.php -├── composer.json -├── deactivation.php -├── ACTIONS_AND_FILTERS.md -├── TESTING.md -├── README.md -``` - -## Configuration - -HWP Previews configuration located at **Settings > HWP Previews** page in your WP Admin. The settings are organized by post type. - -### Settings - -For each public post type, you can configure: - -- **Enable HWP Previews:** This is the master switch for the post type. If disabled, WordPress will revert to its default preview behavior for these posts. -- **Allow All Statuses as Parent:** This option is only available for hierarchical post types like Pages. By default, WordPress only allows published posts to be parents. Enable this to build parent-child relationships using draft or pending posts. -- **Load Previews in Iframe:** When enabled, the preview will be displayed directly within the WordPress editor in a sandboxed `