wpdesk/wp-plugin-flow-common

WP Desk Plugin Flow Common

Maintainers

Package info

github.com/WP-Desk/wp-plugin-flow-common

Homepage

pkg:composer/wpdesk/wp-plugin-flow-common

Transparency log

Statistics

Installs: 23 802

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

1.5.2 2026-08-18 21:23 UTC

This package is auto-updated.

Last update: 2026-08-18 21:23:36 UTC


README

pipeline status Integration: coverage report Unit: coverage report

wp-plugin-flow-common

A small library for bootstrapping WordPress plugins built on WP Desk flow. It handles requirements checks, translations initialization, and startup strategy selection.

Requirements

  • PHP >= 7.4
  • WordPress

Installation

composer require wpdesk/wp-plugin-flow-common

Usage

Prepare the basic plugin variables and include one of the bootstrap files:

$plugin_version = '1.0.0';
$plugin_name = 'My Plugin';
$plugin_class_name = MyPlugin::class;
$plugin_text_domain = 'my-plugin';
$plugin_dir = __DIR__;
$plugin_file = __FILE__;
$requirements = [
	'php' => '7.4',
	'wp'  => '6.0',
];
$product_id = 'my-plugin';

require __DIR__ . '/vendor/wpdesk/wp-plugin-flow-common/src/plugin-init-php52.php';

For a free plugin use:

require __DIR__ . '/vendor/wpdesk/wp-plugin-flow-common/src/plugin-init-php52-free.php';

For a free plugin without tracker initialization use:

require __DIR__ . '/vendor/wpdesk/wp-plugin-flow-common/src/plugin-init-php52-free-no-tracker.php';

If you need a custom initialization strategy, define $plugin_init_factory before including the bootstrap file.

Usage trackers are shared between plugins with the same normalized Author header. The bucket is resolved only when the tracker sends data. It can be overridden for an individual plugin:

add_filter( 'wpdesk/tracker/bucket/my-plugin', function () {
	return 'my-company';
} );

Tests

composer phpunit-unit-fast
composer phpunit-integration-fast