# easydb-wordpress-plugin

Plugin to easily transport media files to Wordpress CMS. It is available for [**easydb5**](#install-plugin-in-easydb5) and [**fylr**](#install-plugin-in-fylr).

Currently this supports creating of new media as well as updating media metadata. When media are updated in easydb5 or fylr, a new media is created (or updated if it exists) in Wordpress. There is no support for deleting media.

## Setup Wordpress 

* This plugin was built and tested for Wordpress version `4.7.` and higher
* This plugin supports [**JSON Basic Authentication**](#http-authentication)

## Install Plugin in easydb5

* Add the following lines to your `easydb-server.yml`:
  ```yaml
  base:
    plugins+:
      - name: wordpress
        file: path/to/plugins/easydb-wordpress-plugin/manifest.master.yml

  plugins:
    enabled+:
      - base.wordpress
  ```

## Install Plugin in fylr

* You can add the plugin in the plugin manager in the frontend as a **zip** or **url** plugin
  * Setup as **url** plugin is recommended!
* To use the plugin as a **disk** plugin, add the following lines to your `fylr.yml`:
  ```yaml
  fylr+
    plugins+:
      paths+:
        - path/to/plugins/easydb-wordpress-plugin
  ```

## Setup in the Base Configuration

* Go to the Base Configuration and find the "Wordpress" config block
* Use **`+`** to add a new configuration
* Enter name (used to identify this setup later) and the url of the Wordpress server

### HTTP-Authentication

* Use an admins login & password to connect
* For the password, generate and use a new **Application Password** for the user in Wordpress

## Authenticate users

* Use system rights "Wordpress" & "Wordpress transport" and authorize anybody who should be able to use Wordpress Transport

## Use in easydb5 and fylr

* In any export, use "Transport Wordpress" to transport all exported files to Wordpress
* Pick the prepared and configured Wordpress instance for the transport
* Optionally choose a schedule and incremental updates for regular updates
