WordPress Plugin

Your application needs a backend for directory listing management. The administrator is enabled to create/update/delete directory listing data. Then Listar FluxPro mobile application needs to connect your backend and show data on the mobile app. So that we need to install these WordPress plugin for make it work

1. Listar – Directory Listing & Classifieds WordPress Plugin

This plugin is Free and was developed by the PassionUI Team. It allows you to manage your directory listing via WordPress backend. Please keep in mind this plugin just is providing solution for backend and support REST APIs for mobile app and don’t require any extends purchase

Manual Installation

You can download Listar – Directory Listing & Classifieds WordPress Plugin directly from WordPress Plugin official page, then do steps below

  1. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation
  2. Activate ‘Listar – Directory Listing & Classifieds WordPress Plugin’ through the ‘Plugins’ menu in WordPress.
xxx
Listar – Directory Listing & Classifieds manual installation

Direct Download & Installation

  1. From your WordPress Admin Panel
    > Plugins menu
    > Add New button
    > Search for ‘Listar – Directory Listing & Classifieds WordPress Plugin’.
  2. Click Install.
Listar – Directory Listing & Classifieds direct download

Check Your Result

After your install Listar – Directory Listing & Classifieds WordPress Plugin and for make sure it’s working fine. Please access the url following format {domain}/index.php/wp-json/listar/v1

Example: https://demo.listarapp.com/index.php/wp-json/listar/v1

If your result like image below, it’s mean you installed successfully and your mobile can work fine with REST APIs

Listar API check result

1.2 JWT Authentication for WP-API

This plugin supports for Authentication. You can download JWT Authentication for WP-API directly from WordPress Plugin official page, then do steps below

Manual Installation

  1. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation
  2. Activate ‘JWT Authentication for WP-API’ through the ‘Plugins’ menu in WordPress.
JWT Authentication for WP-API manual installation

Direct Download & Installation

  1. From your WordPress Admin Panel
    > Plugins menu
    > Add New button
    > Search for ‘JWT Authentication for WP-API’.
  2. Click Install.
JWT Authentication for WP-API direct download

Configure HTTP Authorization Header

Most server has disabled the HTTP Authorization Header by default. For enable HTTP Authorization Header

You can find your .htaccess by directory {your-wordpress-source-code-path}/.htaccess, then edit your file .htaccess with format below

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

To enable this option you’ll need to edit your .htaccess file adding the follow

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

After you modified your .htaccess will be liked

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
RewriteRule . /index.php [L]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Configure WordPress wp-config.php

The JWT needs a secret key to sign the token this secret key must be unique and never revealed.

To add the secret key edit your wp-config.php file and add a new constant called JWT_AUTH_SECRET_KEY

define('JWT_AUTH_SECRET_KEY', 'you-secret-key');

Check Your Result

After you installed JWT Authentication for WP-API plugin and for make sure it’s working fine. Please use your web browser access the url following format {domain}/index.php/wp-json

Example: https://demo.listarapp.com/index.php/wp-json

If your result like image below, it’s mean you installed successfully and your mobile can work fine with REST APIs

JWT Authentication for WP-API check result

Login your backend and check again

Listar – Backend menu