Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/ninja-fo.../services
File: README.md
# Ninja Forms Services
[0] Fix | Delete
[1] Fix | Delete
Requires PHP v5.6+.
[2] Fix | Delete
[3] Fix | Delete
## Definition of Terms
[4] Fix | Delete
[5] Fix | Delete
- Client: The WordPress installation where the Ninja Forms plugin is installed.
[6] Fix | Delete
- Server: The site providing service functionality, ie [My.NinjaForms.com](https://my.ninjaforms.com).
[7] Fix | Delete
[8] Fix | Delete
## Registering Service Integrations
[9] Fix | Delete
[10] Fix | Delete
- Filter: `ninja_forms_services`
[11] Fix | Delete
[12] Fix | Delete
Note: This filter is implemented during an AJAX request, which is used to "live update" the current state of a service from the Ninja Forms Dashboard. The below properties can be set dynamically to correspond to the current "state" of the service.
[13] Fix | Delete
[14] Fix | Delete
Example
[15] Fix | Delete
```php
[16] Fix | Delete
add_filter( 'ninja_forms_services', function( $services ){
[17] Fix | Delete
$services[ 'my-service' ] => [
[18] Fix | Delete
'name' => esc_html__( 'My Service', 'textdomain' ),
[19] Fix | Delete
'slug' => 'my-service', // Duplicate of the array key.
[20] Fix | Delete
'description' => esc_html__( 'This is my service.', 'textdomain' ),
[21] Fix | Delete
'enabled' => true,
[22] Fix | Delete
'installPath' => 'my-plugin/my-plugin.php',
[23] Fix | Delete
];
[24] Fix | Delete
return $services;
[25] Fix | Delete
});
[26] Fix | Delete
```
[27] Fix | Delete
[28] Fix | Delete
Properties:
[29] Fix | Delete
- `name` string (required) The translatable, human-readable name of the service.
[30] Fix | Delete
- `slug` string (required) The programatic reference for the registered service.
[31] Fix | Delete
- `description` string (required) The short description to display on the services tab.
[32] Fix | Delete
- `enabled` bool|null (required) Pass `null` to disable the toggle.
[33] Fix | Delete
- `installPath` string (required) The expected plugin install path (inside of `/wp-content/plugins`).
[34] Fix | Delete
- `learnMore` string (required) The content of the "Learn More" modal.
[35] Fix | Delete
[36] Fix | Delete
Additional properties for installed service plugins:
[37] Fix | Delete
- `serviceLink` array (required) Properties for the external link to manage the service.
[38] Fix | Delete
- `text` string The content of the service link.
[39] Fix | Delete
- `href` string The URL of the service link.
[40] Fix | Delete
- `classes` string Add additional classes to the link, ie 'nf-button primary'.
[41] Fix | Delete
- `target` string Specify the anchor target.
[42] Fix | Delete
- `connect_url` string Override the OAuth connection URL.
[43] Fix | Delete
- `successMessage` string The content of the modal after the service is setup.
[44] Fix | Delete
- The success message can be triggered by passing the `?success` query string in the OAuth redirect with the `slug` of the service.
[45] Fix | Delete
[46] Fix | Delete
## OAuth Connection to My.NinjaForms.com
[47] Fix | Delete
[48] Fix | Delete
Ninja Forms services are provided via a secure OAuth connection to My.NinjaForms.com.
[49] Fix | Delete
[50] Fix | Delete
The `client` generates a local secret key which is passed to the `server` when connecting a service.
[51] Fix | Delete
[52] Fix | Delete
The `server` accepts the passed secret key, registers an new OAuth Client, and returns the OAuth Client ID.
[53] Fix | Delete
[54] Fix | Delete
Communication between the `server` and the `client` requires a `hash` of the combined OAuth Client ID and OAuth Client Secret.
[55] Fix | Delete
[56] Fix | Delete
Registered services have access to OAuth connection data via the `\NinjaForms\OAuth` class.
[57] Fix | Delete
[58] Fix | Delete
- `::is_connected()`
[59] Fix | Delete
- `::get_client_id()`
[60] Fix | Delete
- `::get_client_secret()`
[61] Fix | Delete
- `::connect_url()`
[62] Fix | Delete
[63] Fix | Delete
### Customizing the OAuth Connect Flow
[64] Fix | Delete
[65] Fix | Delete
The OAuth flow can be customized the a specific service (for an optimization experience) by passing a `connect_url` (See above).
[66] Fix | Delete
[67] Fix | Delete
## Remote Plugin Installation
[68] Fix | Delete
[69] Fix | Delete
Service integrations are provided as additional plugins, which are installed remotely from the WordPress.org plugin directory.
[70] Fix | Delete
[71] Fix | Delete
This remote plugin installation uses a custom [Plugin_Installer_Skin](https://developer.wordpress.org/reference/classes/plugin_installer_skin/) in order to suppress any output feedback text - since this process happens asynchronously.
[72] Fix | Delete
[73] Fix | Delete
See [services/remote-installer-skin.php](/services/remote-installer-skin.php).
[74] Fix | Delete
[75] Fix | Delete
## Local Development
[76] Fix | Delete
[77] Fix | Delete
When developing with a local copy the Ninja Forms Server, specify the `NF_SERVER_URL`.
[78] Fix | Delete
[79] Fix | Delete
Example:
[80] Fix | Delete
```php
[81] Fix | Delete
define('NF_SERVER_URL', 'https://my.ninjaforms.test');
[82] Fix | Delete
```
[83] Fix | Delete
[84] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function