PHPackages                             eighteen73/spark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. eighteen73/spark

ActiveWordpress-plugin[API Development](/categories/api)

eighteen73/spark
================

Fetch and manage block patterns from a remote API, providing a centralised pattern library for consistent design across multiple websites.

v1.0.0(8mo ago)044PHPPHP &gt;=8.3

Since Nov 3Pushed 8mo agoCompare

[ Source](https://github.com/eighteen73/spark)[ Packagist](https://packagist.org/packages/eighteen73/spark)[ RSS](/packages/eighteen73-spark/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Spark
=====

[](#spark)

A WordPress plugin that fetches and manages block patterns from a remote API, providing a centralised pattern library for consistent design across multiple websites.

Overview
--------

[](#overview)

Spark solves the problem of manually updating block patterns across multiple client websites. Instead of updating patterns individually on each site, you can manage them centrally and have them automatically distributed to all connected websites.

Features
--------

[](#features)

- **Remote Pattern Fetching**: Securely fetches block patterns from a remote API endpoint
- **Persistent Storage**: Stores patterns in the WordPress options table (never expires)
- **Automatic Sync**: Weekly automatic synchronisation to keep patterns up-to-date
- **Admin Interface**: Clean, WordPress-native admin interface for pattern management
- **Pattern Management**: View all cached patterns with detailed information including:
    - Pattern name, title, and description
    - Categories and keywords
    - Block types, post types, and template types
    - Viewport width and inserter settings
    - Last updated timestamp
- **Screen Options**: Customisable table display with column visibility and pagination
- **Secure API Integration**: Uses basic authentication with username and password defined in wp-config.php

Requirements
------------

[](#requirements)

- WordPress 6.8 or higher
- PHP 8.3 or higher
- Valid username and password for your pattern service

Installation
------------

[](#installation)

### Manual Installation

[](#manual-installation)

1. Download the plugin files
2. Upload the `spark` folder to your `/wp-content/plugins/` directory
3. Activate the plugin through the 'Plugins' menu in WordPress
4. Configure your credentials (see Configuration section)

### Via WP-CLI

[](#via-wp-cli)

```
wp plugin install /path/to/spark.zip --activate
```

Configuration
-------------

[](#configuration)

### Credentials Setup

[](#credentials-setup)

Add your username and password to your `wp-config.php` file:

```
define( 'SPARK_API_USERNAME', 'your-username' );
define( 'SPARK_API_PASSWORD', 'your-password' );
define( 'SPARK_API_URI', 'https://your-api-endpoint.com/patterns' );
```

**Important**: Never store credentials in the database or plugin files. Always use wp-config.php for security.

### API Endpoint

[](#api-endpoint)

The plugin connects to any compatible pattern service API. The endpoint URL is configurable via the `SPARK_API_URI` constant. Contact your administrator for the correct endpoint URL and credentials.

Usage
-----

[](#usage)

### Initial Setup

[](#initial-setup)

1. **Configure API Settings**: Add your username, password, and API URI to wp-config.php
2. **Fetch Patterns**: Go to Settings → Spark and click "Update Patterns"
3. **Verify Patterns**: Check that patterns appear in the table and are available in the block editor

### Admin Interface

[](#admin-interface)

Navigate to **Settings → Spark** to access the plugin's admin interface:

- **Update Patterns**: Manually fetch the latest patterns from the API
- **Storage Status**: View current storage status and last sync time
- **Pattern List**: Browse all cached patterns with detailed information
- **Screen Options**: Customize which columns to display and items per page

### Block Editor Integration

[](#block-editor-integration)

Once patterns are fetched, they automatically appear in the WordPress block editor:

1. Open any post or page in the block editor
2. Click the "+" button to add a block
3. Navigate to the "Patterns" tab
4. Find your patterns organised by category

Automatic Synchronisation
-------------------------

[](#automatic-synchronisation)

The plugin automatically syncs patterns weekly using WordPress cron:

- **Frequency**: Every 7 days
- **Automatic**: No manual intervention required
- **Background**: Runs via WordPress cron system
- **Fallback**: Manual sync available if needed

Pattern Information
-------------------

[](#pattern-information)

Each pattern includes comprehensive metadata:

FieldDescription**Name**Unique pattern identifier**Title**Display name in the editor**Categories**Pattern categories for organisation**Description**Pattern description and usage notes**Last Updated**When the pattern was last modified**Block Types**Compatible block types**Post Types**Compatible post types**Template Types**Compatible template types**Viewport Width**Recommended viewport width**Inserter**Whether pattern appears in inserterSecurity
--------

[](#security)

- Credentials are stored securely in wp-config.php
- All API communications use HTTPS
- Pattern content is sanitised before storage
- No sensitive data is stored in the database

Development
-----------

[](#development)

### File Structure

[](#file-structure)

```
spark/
├── spark.php                    # Main plugin file
├── autoload.php                 # Class autoloader
├── composer.json                # Composer dependencies
├── includes/
│   └── classes/
│       ├── Admin.php            # Admin interface logic
│       ├── AdminPage.php        # Admin page rendering
│       ├── ApiClient.php        # API communication
│       ├── Cache.php            # Pattern storage management
│       ├── PatternListTable.php # Admin table display
│       ├── Registration.php     # Pattern registration
│       └── Singleton.php        # Singleton trait
└── README.md                    # This file

```

### Hooks and Filters

[](#hooks-and-filters)

The plugin provides several WordPress hooks for customization:

- `spark_weekly_sync`: Fired during weekly pattern sync
- Admin action hooks for pattern management

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance62

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

243d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73229?v=4)[Brett Mason ](/maintainers/brettsmason)[@brettsmason](https://github.com/brettsmason)

---

Top Contributors

[![brettsmason](https://avatars.githubusercontent.com/u/73229?v=4)](https://github.com/brettsmason "brettsmason (18 commits)")

### Embed Badge

![Health badge](/badges/eighteen73-spark/health.svg)

```
[![Health](https://phpackages.com/badges/eighteen73-spark/health.svg)](https://phpackages.com/packages/eighteen73-spark)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
