2017 © Pedro Peláez
 

library plugin-endpoints

Allows you to create plugin endpoints, enabling only the minimum number of required plugins.

image

dannyvankooten/plugin-endpoints

Allows you to create plugin endpoints, enabling only the minimum number of required plugins.

  • Friday, June 9, 2017
  • by dannyvankooten
  • Repository
  • 9 Watchers
  • 67 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 5 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Plugin Endpoints

This tiny library allows you to register various URL endpoints. When any of these endpoints is requested, only the specified set of enabled plugins will be loaded., (*1)

Build Status Stable Version License Code Climate, (*2)

This drastically improves performance for requests to these URL's, only loading the minimum number of required plugins to return the final response., (*3)

Results depend on many factors but it is not unusual to experience a 50% gain in speed and a decrease in memory consumption of about 30%., (*4)

Installation

Using Composer

{
    "require": {
        "dannyvankooten/plugin-endpoints": "dev-master"
    }
}

Manually

require __DIR__ . '/plugin-endpoints/vendor/autoload.php';

Usage

Because the library needs control over which plugins are loaded, you need to instantiate the Router class and register your endpoints from your mu-plugins folder., (*5)

The following example registers an endpoint for Easy Digital Downloads & the Software Licensing add-on., (*6)


// file: `/wp-content/mu-plugins/endpoints.php` // load the autoloader manually (or use Composer!) require __DIR__ . '/plugin-endpoints/vendor/autoload.php'; // instantiate the routing class $router = new PluginEndpoints\Router; // register an endpoint $router->register_endpoint( '/edd-sl-api', // listen to requests starting with /edd-sl-api array( 'easy-digital-downloads/easy-digital-downloads.php', 'edd-software-licensing/edd-software-licenses.php' ) // only enable edd & edd sl plugins ); // done!

Now, point a request at https://your-site/edd-sl-api.... and notice that only the specified plugins are loaded for the request., (*7)

GET http://local.wp/edd-sl-api/?edd_action=activate_license...

The Versions

09/06 2017

dev-master

9999999-dev

Allows you to create plugin endpoints, enabling only the minimum number of required plugins.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.0

 

The Development Requires

04/05 2015

1.0.1

1.0.1.0

Allows you to create plugin endpoints, enabling only the minimum number of required plugins.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.0

 

The Development Requires

07/04 2015

1.0

1.0.0.0

Allows you to create plugin endpoints, enabling only the minimum number of required plugins.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3.0

 

The Development Requires