WP Manifestindependent plugin directory
manifest / integrations / imaginary-webhooks

Imaginary Webhooks

WordPress Plugin To Send Webhooks When Events Happen

★ 1stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/imaginarymachines/imaginary-webhooks/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Installation For Development

  • Git clone:
    • git clone git@github.com:imaginary-machines/imaginary-webhooks.git
  • Install php dependencies
    • composer install

Build

  • Build, without zip
    • plugin-machine plugin build --buildDir=build
    • Other plugin expects this.
  • Build and zip
    • plugin-machine plugin zip

Working With PHP

Autoloader

PHP classes should be located in the "php" directory and follow the PSR-4 standard.

The root namespace is ImaginaryMachines\Webhooks.

Tests

  • Run unit tests
    • composer test:unit
  • Run WordPress tests
    • composer test:wordpress
    • See local development instructions for how to run with Docker.
  • Run unit tests and WordPress tests
    • composer test

Linter

PHPCS is installed for linting and automatic code fixing.

  • Run linter and autofix
    • composer fixes
  • Run linter to identify issues.
    • compose sniffs

Local Development Environment

A docker-compose-based local development environment is provided.

  • Start server
    • docker-compose up -d
  • Acess Site
  • WP CLI
    • Run any WP CLI command in container:
      • docker-compose run wpcli wp ...
    • Setup site with WP CLI
      • docker-compose run wpcli wp core install --url=http://localhost:6080 --title="Imaginary Webhooks" --admin_user=admin0 --admin_email=something@example.com
      • docker-compose run wpcli wp user create admin admin@example.com --role=administrator --user_pass=pass

There is a special phpunit container for running WordPress tests, with WordPress and MySQL configured.

  • Enter container
    • docker-compose run phpunit
  • Composer install
    • composer install
  • Test
    • composer test:wordpress