Download the PHP package enhance-dev/enhance-wordpress-plugin without Composer

On this page you can find all versions of the php package enhance-dev/enhance-wordpress-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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</my-header>) and then the SSR plugin will them wherever they are used.

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

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

Development Copy of WordPress Instructions

Examples

Write Elements

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

This can also be written as an html file since it does not depend on $state like:

Use Elements

This element is authored as an HTML web component or custom element (i.e. <my-header>Cool</my-header>). With the SSR plugin these can be used anywhere in the wordpress site and the plugin will expand them just before they are sent to the browser. They can be used:

  1. Directly in PHP templates

  2. In raw HTML blocks anywhere

  3. As Gutenburg blocks

Enhance Elements as Gutenburg blocks

The new Wordpress block editor uses React for the editor and for rendering individual blocks before storing them as plain html in the database. Enhance elements are pure functions that run on the server to render plain HTML. That does not mean that they can't have clientside JavaScript, but the baseline experience is HTML. One way to wrap Enhance Elements so that they work in the block editor is shown below:


All versions of enhance-wordpress-plugin with dependencies

PHP Build Version
Package Version
Requires enhance-dev/ssr Version ~v0.0.4
composer/installers Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enhance-dev/enhance-wordpress-plugin contains the following files

Loading the files please wait ....