PHPackages                             echodash/echodash - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. echodash/echodash

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

echodash/echodash
=================

Track user events and interactions from popular WordPress plugins in EchoDash analytics

2.0.0(9mo ago)23[4 issues](https://github.com/EchoDash/echodash/issues)GPL-3.0-or-laterPHPPHP &gt;=7.4

Since Dec 4Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/EchoDash/echodash)[ Packagist](https://packagist.org/packages/echodash/echodash)[ RSS](/packages/echodash-echodash/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (7)Versions (13)Used By (0)

[![EchoDash Banner](assets/banner-1544x500.jpg)](https://echodash.com)

EchoDash for WordPress
======================

[](#echodash-for-wordpress)

Track user events and interactions across your WordPress site with EchoDash analytics. Built for developers and site owners who need detailed insights into user behavior across multiple WordPress plugins.

Features
--------

[](#features)

- 🔌 **Plugin Integrations**: Ready-made tracking for popular WordPress plugins
- 🚀 **Performance Focused**: Non-blocking API calls and minimal overhead
- 🛠 **Developer Friendly**: Extensible architecture for custom integrations
- 🎯 **Flexible Events**: Track any data point with customizable event properties
- 🔄 **Real-time Updates**: Events appear instantly in your EchoDash dashboard
- 🔒 **Secure**: All data is transmitted over HTTPS

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

[](#requirements)

- WordPress 6.0+
- PHP 7.4+

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

[](#installation)

1. Download the latest release from [GitHub Releases](../../releases/latest)
2. Upload to wp-content/plugins/
3. Activate through WordPress admin
4. Connect to EchoDash in Settings → EchoDash

Development Setup
-----------------

[](#development-setup)

### Prerequisites

[](#prerequisites)

- Node.js 18+ and npm 8+
- PHP 7.4+ (tested up to PHP 8.2)
- Composer
- WordPress development environment

### Quick Start

[](#quick-start)

1. **Clone and Install Dependencies**

    ```
    git clone https://github.com/yourusername/echodash.git
    cd echodash

    # Install PHP dependencies
    composer install

    # Install Node.js dependencies
    npm install
    ```
2. **Start Development**

    ```
    # Start React development server with hot reloading
    npm run dev
    # or
    npm run start
    ```
3. **Build for Production**

    ```
    npm run build
    ```

### Development Commands

[](#development-commands)

#### React Development (Primary Interface)

[](#react-development-primary-interface)

```
npm run dev           # Start development server with hot reloading
npm run build         # Production build with optimization
npm run build:analyze # Build with bundle size analysis
```

#### Testing (Comprehensive Test Suite)

[](#testing-comprehensive-test-suite)

```
# Run all tests
npm run test:all      # Complete test suite (unit + integration + e2e)

# Individual test types
npm run test          # Basic Jest unit tests
npm run test:unit     # Unit tests only
npm run test:integration # API integration tests
npm run test:performance # Performance benchmarks
npm run test:e2e      # End-to-end Playwright tests
npm run test:visual   # Visual regression tests

# Test utilities
npm run test:watch    # Watch mode for development
npm run test:coverage # Generate coverage reports
npm run test:ci       # CI-optimized test run (used in GitHub Actions)
```

#### Code Quality

[](#code-quality)

```
# Linting and formatting
npm run lint          # ESLint + Stylelint
npm run lint:js       # JavaScript/TypeScript linting
npm run lint:css      # CSS/SCSS linting
npm run format        # Prettier code formatting

# PHP quality checks
composer phpcs        # WordPress coding standards
composer phpcbf       # Auto-fix coding standards
composer phpstan      # Static analysis (PHPStan level 5)
```

#### Automated Quality Checks

[](#automated-quality-checks)

```
# Run the same checks as CI
./bin/run-checks.sh   # Complete local quality check suite
```

### Understanding Test Results

[](#understanding-test-results)

#### JavaScript Tests (Jest)

[](#javascript-tests-jest)

- **Coverage Reports**: Generated in `/coverage/` folder
- **Test Reports**: HTML reports in `/test-reports/jest-report.html`
- **Coverage Thresholds**: 80% minimum (branches, functions, lines, statements)
- **Test Files**: `*.test.{js,jsx,ts,tsx}` in `assets/src/` and `assets/tests/`

**Interpreting Results:**

```
# Example successful output
✅ Test Suites: 15 passed, 15 total
✅ Tests: 89 passed, 89 total
✅ Coverage: 85.2% lines, 81.4% branches
```

#### PHP Tests (Static Analysis; optional PHPUnit)

[](#php-tests-static-analysis-optional-phpunit)

- **PHPStan**: Level 5 static analysis with WordPress stubs
- **PHPCS**: WordPress coding standards compliance
- **PHPUnit**: Traditional PHP unit testing (optional; not configured by default in v2)

**Common Issues:**

- **PHPStan warnings** about third-party plugins are normal
- **PHPCS errors** must be fixed (warnings are acceptable)
- **Coverage** reports help identify untested code paths

#### Visual Regression Tests (Playwright)

[](#visual-regression-tests-playwright)

```
npm run test:visual        # Run visual tests
npm run test:visual:update # Update visual baselines
npm run test:visual:ui     # Interactive test runner
```

### Performance Monitoring

[](#performance-monitoring)

#### Bundle Analysis

[](#bundle-analysis)

```
npm run build:analyze
# Opens bundle-report.html showing:
# - Bundle sizes and dependencies
# - Performance recommendations
# - Code splitting effectiveness
```

#### Performance Budgets

[](#performance-budgets)

- **500KB maximum** per chunk (enforced at build time)
- **Core Web Vitals** monitoring in production
- **Bundle splitting** for WordPress components and vendors

### Continuous Integration

[](#continuous-integration)

Our GitHub Actions workflow runs:

1. **PHP Quality Checks** (multiple PHP versions 7.4-8.2)

    - WordPress coding standards (PHPCS)
    - Static analysis (PHPStan)
    - Compatibility checks
2. **JavaScript Quality Checks**

    - ESLint + Stylelint
    - Code formatting (Prettier)
    - License compliance
    - Engine compatibility
3. **Comprehensive Testing**

    - Jest unit/integration tests
    - Playwright E2E tests
    - Visual regression tests
    - Multiple WordPress versions (6.0-6.4)
4. **Security &amp; Compatibility**

    - Composer security audit
    - npm security audit
    - PHP compatibility checks
    - WordPress compatibility verification
5. **Build Verification**

    - Production build test
    - Bundle size analysis
    - Plugin ZIP creation

### Troubleshooting

[](#troubleshooting)

#### Common Development Issues

[](#common-development-issues)

**Build Errors:**

```
# Clear caches and reinstall
rm -rf node_modules vendor coverage test-reports
npm install && composer install
npm run build
```

**Test Failures:**

```
# Update test snapshots if UI changed
npm run test:visual:update

# Check for missing WordPress mocks
# See assets/tests/__mocks__/wordpress/ for available mocks
```

**PHP Issues:**

```
# Fix coding standards automatically
composer phpcbf

# Check PHPStan with more detail
composer phpstan -- --verbose
```

#### Performance Issues

[](#performance-issues)

- **Large bundles**: Check `bundle-report.html` after `npm run build:analyze`
- **Slow tests**: Run specific test suites instead of all tests
- **Memory issues**: PHPStan has 2GB memory limit configured

### File Structure

[](#file-structure)

```
echodash/
├── assets/
│   ├── src/                 # React TypeScript source code
│   ├── tests/               # Jest test files and mocks
│   └── dist/                # Built assets (auto-generated)
├── includes/
│   ├── integrations/        # PHP integration classes
│   ├── admin/               # WordPress admin functionality
│   └── public/              # Public-facing functionality
├── tests/                   # PHP tests (if implemented)
├── bin/                     # Development scripts
│   └── run-checks.sh        # Local CI simulation
├── .github/workflows/       # GitHub Actions CI/CD
├── webpack.config.js        # Build configuration
├── jest.config.js           # Test configuration
├── phpcs.xml                # PHP coding standards
└── composer.json            # PHP dependencies

```

Creating Custom Integrations
----------------------------

[](#creating-custom-integrations)

### 1. Basic Integration Structure

[](#1-basic-integration-structure)

Create a new file in `includes/integrations/your-integration/class-echodash-your-integration.php`:

```
class EchoDash_Your_Integration extends EchoDash_Integration {

    public $slug = 'your-integration';
    public $name = 'Your Integration Name';

    public function init() {
        // Add your action/filter hooks here
        add_action( 'your_plugin_event', array( $this, 'handle_event' ) );
    }

    protected function setup_triggers() {
        return array(
            'event_happened' => array(
                'name'               => __( 'Event Happened', 'echodash' ),
                'description'        => __( 'Triggered when your event occurs.', 'echodash' ),
                'has_global'         => true, // Show in global settings
                'has_single'         => true, // Show on individual posts/items
                'post_types'         => array( 'post', 'your-cpt' ),
                'option_types'       => array( 'user', 'your_data' ),
                'enabled_by_default' => true,
                'default_event'      => array(
                    'name'     => 'Your Event',
                    'mappings' => array(
                        'user_email' => '{user:user_email}',
                        'item_name'  => '{your_data:name}',
                    ),
                ),
            ),
        );
    }

    public function handle_event( $event_data ) {
        $this->track_event(
            'event_happened',
            array(
                'user'      => get_current_user_id(),
                'your_data' => $event_data->id,
            )
        );
    }
}

new EchoDash_Your_Integration();
```

### 2. Adding Custom Data Sources

[](#2-adding-custom-data-sources)

Define what data is available for event tracking:

```
public function get_your_data_options() {
    return array(
        'name'    => __( 'Your Data', 'echodash' ),
        'type'    => 'your_data',
        'options' => array(
            array(
                'meta'        => 'name',
                'preview'     => 'Example Name',
                'placeholder' => __( 'The item name', 'echodash' ),
            ),
            array(
                'meta'        => 'value',
                'preview'     => '100',
                'placeholder' => __( 'The item value', 'echodash' ),
            ),
        ),
    );
}

public function get_your_data_vars( $item_id ) {
    $item = get_your_item( $item_id );

    return array(
        'your_data' => array(
            'name'  => $item->name,
            'value' => $item->value,
        ),
    );
}
```

### 3. Tracking Events

[](#3-tracking-events)

```
// Simple event tracking
echodash_track_event( 'event_name', array(
    'key' => 'value',
) );

// Full event tracking with source and trigger
echodash_track_event(
    'purchase_completed',
    array(
        'total' => $order_total,
        'items' => $items,
    ),
    'your-integration',
    'order_completed'
);
```

### 4. Available Hooks

[](#4-available-hooks)

#### Actions

[](#actions)

```
/**
 * Fires when an event is being tracked.
 *
 * @param string $event_name    The name of the event being tracked
 * @param array  $event_data    The data being sent with the event
 * @param string $source        The integration/source name (e.g., 'WooCommerce')
 * @param string $trigger       The trigger name (e.g., 'order_completed')
 */
do_action( 'echodash_track_event', $event_name, $event_data, $source, $trigger );

// Example usage:
add_action( 'echodash_track_event', function( $event_name, $event_data, $source, $trigger ) {
    // Log events to a file
    if ( 'purchase_completed' === $event_name ) {
        error_log( sprintf(
            'EchoDash Event: %s from %s (%s) with data: %s',
            $event_name,
            $source,
            $trigger,
            wp_json_encode( $event_data )
        ) );
    }
}, 10, 4 );
```

#### Filters

[](#filters)

```
// Modify event data before sending
add_filter( 'echodash_event_data', function( $data, $objects ) {
    return $data;
}, 10, 2 );

// Add custom objects to events
add_filter( 'echodash_event_objects', function( $objects, $trigger ) {
    return $objects;
}, 10, 2 );

// Modify available triggers
add_filter( 'echodash_your-integration_triggers', function( $triggers ) {
    return $triggers;
} );
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

Support
-------

[](#support)

- Documentation:
- Support:
- Issues: [Create a GitHub issue](../../issues/new)

License
-------

[](#license)

GPL v3 or later

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~35 days

Recently: every ~48 days

Total

8

Last Release

281d ago

Major Versions

1.2.0 → 2.0.02025-08-10

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/b89d481167e32f1612aaf0e8995e8d2a4c9c700a473b78a70adbb40eac9a982c?d=identicon)[echodash](/maintainers/echodash)

---

Top Contributors

[![jack-arturo](https://avatars.githubusercontent.com/u/13076544?v=4)](https://github.com/jack-arturo "jack-arturo (109 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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