\MatthiasWeb\UtilsService

Create a base REST Service needed for boilerplate development. Please do not remove it.

Summary

Methods
Properties
Constants
rest_api_init()
routePlugin()
getCore()
admin_notices()
getSecurityPlugins()
getUrl()
getNamespace()
getExternalContainerUrl()
instance()
No public properties found
NOTICE_CORRUPT_REST_API_ID
SECURITY_PLUGINS_BLOCKING_REST_API
No protected methods found
No protected properties found
N/A
__construct()
$core
N/A

Constants

NOTICE_CORRUPT_REST_API_ID

NOTICE_CORRUPT_REST_API_ID ='notice-corrupt-rest-api'

SECURITY_PLUGINS_BLOCKING_REST_API

SECURITY_PLUGINS_BLOCKING_REST_API =array('better-wp-security', 'all-in-one-wp-security-and-firewall', 'sucuri-scanner', 'anti-spam', 'wp-cerber', 'wp-simple-firewall', 'wp-hide-security-enhancer', 'bulletproof-security', 'disable-json-api', 'ninjafirewall', 'hide-my-wp', 'perfmatters', 'swift-performance', 'clearfy')

Properties

$core

$core :

Type

Methods

rest_api_init()

rest_api_init()

Register endpoints.

routePlugin()

routePlugin()

Response for /plugin route.

admin_notices()

admin_notices()

Show a notice for `corruptRestApi.tsx`.

getSecurityPlugins()

getSecurityPlugins(): array<mixed,string>

Get all active security plugins which can limit the WP REST API.

Returns

array<mixed,string>

getUrl()

getUrl(string  $instance,string  $namespace = null,string  $endpoint = ''): string

Get the wp-json URL for a defined REST service.

Parameters

string $instance

The plugin class instance, so we can determine the slug from

string $namespace

The prefix for REST service

string $endpoint

The path appended to the prefix

Returns

string —

Example: https://wordpress.org/wp-json

getNamespace()

getNamespace(mixed  $instance,string  $version = 'v1'): string

Get the default namespace of this plugin generated from the slug.

Parameters

mixed $instance

The plugin class instance, so we can determine the slug from

string $version

The version used for this namespace

Returns

string

getExternalContainerUrl()

getExternalContainerUrl(integer  $developmentPort,string  $reviewPrefix,string  $productionUrl)

Get the (backend) API URL for the current running environment for another container.

Parameters

integer $developmentPort

E.g. 10004

string $reviewPrefix

E.g. commerce-

string $productionUrl

E.g. https://commerce.devowl.io/