承接 dollieai/wp-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dollieai/wp-sdk

Composer 安装命令:

composer require dollieai/wp-sdk

包简介

Dollie Integrations SDK - Manifest-first integration framework for WordPress automations

README 文档

README

Manifest-first integration framework for WordPress automations

Overview

The Dollie SDK is a modern PHP 8.2+ framework for building WordPress integration automations. It provides base classes, attributes, and controllers that enable developers to create custom integrations with triggers and actions. The SDK uses a manifest-first architecture where metadata is generated at build time and consumed by external systems (like Laravel) without runtime code execution.

Features

  • PHP 8 Attributes: Modern, type-safe metadata definition for integrations, triggers, and actions
  • Base Classes: BaseIntegration and AutomateAction abstract classes for building integrations
  • Controllers: IntegrationsController and AutomationController for runtime management
  • Singleton Trait: Ready-to-use SingletonLoader trait for class instances
  • Manifest Generation: Automated JSON metadata export
  • Docker Development: Complete Docker-based development environment
  • CI/CD Ready: Automated builds and validation

Installation

composer require dollieai/wp-sdk

Requirements: PHP 8.2+

Quick Start

Creating a Custom Integration

<?php

namespace MyPlugin\Integrations\CustomService;

use Dollie\SDK\Attributes\Integration;
use Dollie\SDK\Base\BaseIntegration;
use Dollie\SDK\Traits\SingletonLoader;

#[Integration(
    id: 'custom_service',
    name: 'Custom Service',
    slug: 'custom-service',
    since: '1.0.0',
    homepage: 'https://example.com',
    tags: ['custom']
)]
class CustomService extends BaseIntegration
{
    use SingletonLoader;

    protected $id = 'custom_service';
    protected $name = 'Custom Service';

    public function is_plugin_installed(): bool
    {
        return class_exists('CustomServicePlugin');
    }
}

Creating a Trigger

<?php

namespace MyPlugin\Integrations\CustomService\Triggers;

use Dollie\SDK\Attributes\Trigger;

#[Trigger(
    id: 'custom_service.event_occurred',
    label: 'Event Occurred',
    description: 'Fires when a custom event occurs',
    payloadSchema: [
        'type' => 'object',
        'required' => ['event_id'],
        'properties' => [
            'event_id' => ['type' => 'integer'],
            'event_type' => ['type' => 'string']
        ]
    ],
    examples: [
        ['event_id' => 123, 'event_type' => 'custom']
    ],
    tags: ['events'],
    since: '1.0.0'
)]
class EventOccurred
{
    // Trigger implementation
}

Creating an Action

<?php

namespace MyPlugin\Integrations\CustomService\Actions;

use Dollie\SDK\Attributes\Action;
use Dollie\SDK\Base\AutomateAction;
use Dollie\SDK\Traits\SingletonLoader;

#[Action(
    id: 'custom_service.create_item',
    label: 'Create Item',
    description: 'Creates a new item in the service',
    inputSchema: [
        'type' => 'object',
        'required' => ['name'],
        'properties' => [
            'name' => ['type' => 'string'],
            'description' => ['type' => 'string']
        ]
    ],
    outputSchema: [
        'type' => 'object',
        'properties' => [
            'success' => ['type' => 'boolean'],
            'item_id' => ['type' => 'integer']
        ]
    ],
    examples: [
        ['name' => 'Test Item', 'description' => 'A test item']
    ],
    tags: ['items'],
    since: '1.0.0'
)]
class CreateItem extends AutomateAction
{
    use SingletonLoader;

    public $integration = 'custom_service';
    public $action = 'create_item';

    public function register($actions)
    {
        $actions[$this->integration][$this->action] = [
            'label' => 'Create Item',
            'action' => $this->action,
            'function' => [$this, '_action_listener'],
        ];
        return $actions;
    }

    public function _action_listener($user_id, $automation_id, $fields, $selected_options)
    {
        // Action implementation
        return ['success' => true, 'item_id' => 123];
    }
}

SDK Structure

The SDK provides the following components:

src/
├── Attributes/
│   ├── Integration.php    # #[Integration] attribute for marking integration classes
│   ├── Trigger.php        # #[Trigger] attribute for defining trigger metadata
│   └── Action.php         # #[Action] attribute for defining action metadata
├── Base/
│   ├── BaseIntegration.php    # Abstract base class for integrations
│   └── AutomateAction.php     # Abstract base class for actions
├── Controllers/
│   ├── IntegrationsController.php  # Manages integration registration
│   └── AutomationController.php    # Handles trigger execution
└── Traits/
    └── SingletonLoader.php    # Singleton pattern trait

Manifest Generation

Plugins that use this SDK can generate manifests by scanning classes with SDK attributes. The generated manifest structure:

{
  "plugin": "your-plugin/name",
  "name": "Your Plugin Name",
  "version": "1.0.0",
  "generated_at": "2025-11-12T10:30:00Z",
  "checksum": "sha256:...",
  "integrations": [
    {
      "id": "custom_service",
      "name": "Custom Service",
      "slug": "custom-service",
      "since": "1.0.0",
      "homepage": "https://example.com",
      "tags": ["custom"],
      "triggers": [...],
      "actions": [...]
    }
  ]
}

The SDK includes manifest generation scripts in scripts/ that can be adapted for your plugin.

Architecture

This SDK follows a manifest-first approach:

  1. Build Time: Attributes are scanned and converted to JSON manifest
  2. Distribution: Manifest files are published as artifacts
  3. Consumption: External systems (Laravel) import manifest metadata
  4. Runtime: Controllers manage integration registration and trigger execution

Development

Running Tests

# Using Docker
make test

# Using local PHP
composer test

Available Make Commands

make install    # Install dependencies
make test       # Run PHPUnit tests
make validate   # Validate composer.json
make shell      # Open a shell in the PHP container
make clean      # Remove generated files
make ci         # Run all CI checks

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

License

MIT License - see LICENSE file for details.

Links

dollieai/wp-sdk 适用场景与选型建议

dollieai/wp-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「wordpress」 「automation」 「triggers」 「actions」 「webhooks」 「integrations」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 dollieai/wp-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dollieai/wp-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 dollieai/wp-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-09