PHPackages                             enhance-dev/enhance-wordpress-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. enhance-dev/enhance-wordpress-plugin

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

enhance-dev/enhance-wordpress-plugin
====================================

A WordPress plugin that uses the Enhance SSR PHP library to render web components on the server

v0.0.3(2y ago)195[3 issues](https://github.com/enhance-dev/enhance-wordpress-plugin/issues)[1 PRs](https://github.com/enhance-dev/enhance-wordpress-plugin/pulls)Apache-2.0JavaScript

Since Mar 13Pushed 2y ago2 watchersCompare

[ Source](https://github.com/enhance-dev/enhance-wordpress-plugin)[ Packagist](https://packagist.org/packages/enhance-dev/enhance-wordpress-plugin)[ RSS](/packages/enhance-dev-enhance-wordpress-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Enhance Wordpress Plugin
========================

[](#enhance-wordpress-plugin)

This plugin server side renders enhance components for wordpress sites. It is experimental and should probably not be used in production yet.

Two plugins are included:

1. `enhance-ssr-wp-plugin.php` server side render any enhance custom elements in the wordpress site. These can be added in PHP templates, raw HTML blocks in the editor, or as predefined blocks.
2. `enhance-wp-blocks-plugin.php` demonstrates wrapping an Enhance component for use in the block editor. This works with the SSR plugin. These blocks are stored in the WP database as HTML (i.e. Hi) and then the SSR plugin will them wherever they are used.

Install Plugin Directly
-----------------------

[](#install-plugin-directly)

To add the plugin to a Wordpress project you can clone this repository into a folder in the plugins directory for the project. All required dependencies are included in the vendor directory with the repository so running `composer install` should not be required.

Install Plugin with Composer
----------------------------

[](#install-plugin-with-composer)

Composer can also be used to install the plugin to a Wordpress project.

```
composer require enhance-dev/enhance-wordpress-plugin
```

Development Copy of WordPress Instructions
------------------------------------------

[](#development-copy-of-wordpress-instructions)

- [Local](./docs/wp-local.md)

Examples
--------

[](#examples)

### Write Elements

[](#write-elements)

Enhance Elements are pure functions that accept `state` and return HTML. Here is an example of `/elements/my-header.js`:

```
