Download the PHP package alleyinteractive/wp-plugin-loader without Composer

On this page you can find all versions of the php package alleyinteractive/wp-plugin-loader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-plugin-loader

WP Plugin Loader

Code-enabled WordPress plugin loading package.

Installation

You can install the package via Composer:

Usage

Load the package via Composer and use it like so:

The plugin loader will load the specified plugins, be it files or folders under plugins/client-mu-plugins, and mark them as activated on the plugins screen. You can pass files or plugin folders that the package will attempt to determine the main plugin file from and load.

See APCu Caching for more information on caching.

Fluent Loading

The package supports a fluent API for loading plugins with the create() method:

You can also use the when() method to conditionally load plugins:

This pairs nicely with named arguments:

When using fluent loading you must call the load() method to load the plugins at the end of the chain.

Plugin Directories

Out of the box, the package will attempt to load your plugin from wp-content/plugins. When it is found, the package will attempt to load your plugin from wp-content/client-mu-plugins. For non-WordPress VIP sites, the plugin will also load plugins from wp-content/mu-plugins.

Preventing Activations

The package supports preventing activations of plugins via the plugins screen (useful to fully lock down the plugins enabled on site):

Plugin activations will be prevented on the plugin screen as well as with a capability check.

APCu Caching

When a plugin is loaded by a directory name the package will attempt to determine the main plugin file from the directory. This can be a semi-expensive operation that can be cached with APCu. To enable caching, pass $cache to the constructor with a boolean or string prefix:

Note: caching will only be enabled if APCu is available.

Testing

Run composer test to run tests against PHPUnit and the PHP code in the plugin.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

This project is actively maintained by Alley Interactive. Like what you see? Come work with us.

License

The GNU General Public License (GPL) license. Please see License File for more information.


All versions of wp-plugin-loader with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
alleyinteractive/composer-wordpress-autoloader Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alleyinteractive/wp-plugin-loader contains the following files

Loading the files please wait ....