Download the PHP package jascha030/wp-plugin-lib without Composer

On this page you can find all versions of the php package jascha030/wp-plugin-lib. 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-lib

WP Plugin Library for OOP

A backbone for utilizing the Wordpress Plugin API , using [email protected] and OOP.

Getting started

Prerequisites

Installation

Usage

The easiest way to explain usage is with an example of the main plugin file.

The name of the package might be deceiving, Plugin refers to the WP Plugin API, which means that it can be used for either a plugin or a theme. In this example we pretend to be building a plugin, but for a theme we would just write our code in the theme's functions.php file instead of the main plugin file.

main-plugin-file.php

Hookables

The plugin revolves around classes implementing HookableInterface or one of it's extended interfaces. Hookables should only contain public methods that are hooked to WordPress' filters or actions.

I recommend using the LazyHookableInterface, classes implementing this will only be constructed upon the first call to a hook containing one of its methods.

Here's an example of a class Implementing LazyHookableInterface:

TestingHookable.php

Providers

The standard container used is the Psr11 wrapper from the pimple/pimple package. Providers follow pimple's ServiceProviderInterface.

Testing

Included with the package are a set of Unit tests using phpunit/phpunit. For ease of use a composer script command is defined to run the tests.

A code coverage report is generated in the project's root as cov.xml. The cov.xml file is not ignored in the .gitignore by default. You are encouraged to commit the latest code coverage report, when deploying new features.

Code style & Formatting

A code style configuration for friendsofphp/php-cs-fixer is included, defined in .php-cs-fixer.dist.php.

To use php-cs-fixer without having it necessarily installed globally, a composer script command is also included to format php code using the provided config file and the vendor binary of php-cs-fixer.

License

This composer package is an open-sourced software licensed under the MIT License


All versions of wp-plugin-lib with dependencies

PHP Build Version
Package Version
Requires pimple/pimple Version ^3.3
psr/container Version ^1.1
symfony/uid Version ^5.2
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 jascha030/wp-plugin-lib contains the following files

Loading the files please wait ....