Skip to content

TheAggressive/CampaignBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CampaignBridge

A comprehensive WordPress plugin for creating and managing professional email campaigns with dynamic content integration. Features Mailchimp API integration, custom email templates with block-based design, automated campaign generation, and seamless WordPress post type management.

✨ Features

🎨 Email Template System

  • Block-Based Email Design: Create beautiful email templates using WordPress block editor
  • Custom Post Type: Dedicated cb_email_template post type for template management
  • Template Categories: Organize templates by purpose (newsletter, promotional, welcome, etc.)
  • Responsive Design: Email-safe HTML generation with CSS inlining

πŸ“§ Email Service Provider Integration

  • Mailchimp API Integration: Full integration with Mailchimp's powerful email platform
  • Campaign Management: Create and update campaigns directly from WordPress
  • Audience Management: Sync and manage Mailchimp audiences
  • Template Mapping: Map WordPress content to Mailchimp email templates

πŸ”§ Content Management

  • Dynamic Content: Automatically generate campaigns from WordPress posts and pages
  • Post Type Configuration: Choose which post types are available for campaigns
  • Content Filtering: Include/exclude specific posts based on criteria
  • Rich Content Support: Handles images, excerpts, titles, and custom fields

πŸ› οΈ Professional Architecture

  • Service Container: Dependency injection for clean code organization
  • Provider Interface: Extensible architecture for multiple email providers
  • REST API: Complete REST API for all plugin operations
  • Admin Interface: Professional WordPress admin integration

πŸ“Š Advanced Features

  • Rate Limiting: Built-in rate limiting for API calls
  • Error Handling: Comprehensive error handling and user feedback
  • Debug Logging: Debug-mode logging for development
  • Security: Proper data sanitization and validation throughout
  • Performance Optimization: Critical resource preloading and intelligent asset management

πŸ“‹ Requirements

System Requirements

  • WordPress: 6.5.0 or higher
  • PHP: 8.2 or higher
  • MySQL: 5.6 or higher
  • Memory: 128MB RAM minimum (256MB recommended)
  • HTTPS: Required for secure API communications

Browser Support

  • Chrome 80+
  • Firefox 75+
  • Safari 13+
  • Edge 80+

πŸš€ Installation

Automatic Installation

  1. Go to Plugins > Add New in your WordPress admin
  2. Search for "CampaignBridge"
  3. Click Install Now
  4. Click Activate

Manual Installation

  1. Download the plugin from the WordPress plugin repository
  2. Upload to /wp-content/plugins/ directory
  3. Activate through Plugins > Installed Plugins
  4. Navigate to CampaignBridge > Settings

βš™οΈ Configuration

Initial Setup

  1. Go to CampaignBridge > Settings in your admin menu
  2. Configure your email service provider (Mailchimp)
  3. Enter your API credentials
  4. Select your audience/list
  5. Save your configuration

Post Type Configuration

  1. Navigate to CampaignBridge > Post Types
  2. Select which post types should be available for campaigns
  3. Configure content inclusion rules
  4. Save your configuration

Template Setup

  1. Go to CampaignBridge > Email Templates
  2. Create new templates using the block editor
  3. Configure template settings (width, category, status)
  4. Preview and publish templates

πŸ“– Usage

Creating Email Campaigns

  1. Select Content: Choose posts from configured post types
  2. Choose Template: Select from available email templates
  3. Configure Campaign: Set campaign parameters and audience
  4. Send Campaign: Send immediately or schedule for later

Managing Templates

  1. Template Editor: Use WordPress block editor for design
  2. Template Categories: Organize templates by purpose
  3. Template Preview: Live preview of email appearance
  4. Template Settings: Configure width, category, and status

API Usage

All plugin functionality is available via REST API:

  • GET /wp-json/campaignbridge/v1/mailchimp/audiences
  • GET /wp-json/campaignbridge/v1/mailchimp/templates
  • POST /wp-json/campaignbridge/v1/mailchimp/verify
  • Plus many more endpoints for full functionality

πŸ—οΈ Technical Architecture

Plugin Structure

campaignbridge/
β”œβ”€β”€ includes/                    # Core PHP classes
β”‚   β”œβ”€β”€ Admin/                   # Admin interface classes
β”‚   β”‚   β”œβ”€β”€ Pages/               # Admin page classes
β”‚   β”‚   └── Asset_Manager.php     # Asset management
β”‚   β”œβ”€β”€ Core/                    # Core functionality
β”‚   β”‚   β”œβ”€β”€ Service_Container.php # Dependency injection
β”‚   β”œβ”€β”€ Post_Types/               # Custom post type classes
β”‚   β”‚   └── Post_Type_Email_Template.php    # Email template management
β”‚   β”œβ”€β”€ Providers/               # Email service providers
β”‚   β”‚   β”œβ”€β”€ Provider_Interface.php # Provider contract
β”‚   β”‚   β”œβ”€β”€ Mailchimp_Provider.php # Mailchimp integration
β”‚   β”‚   └── Html_Provider.php     # HTML export provider
β”‚   β”œβ”€β”€ REST/                    # REST API endpoints
β”‚   β”‚   β”œβ”€β”€ Routes.php           # General REST routes
β”‚   β”‚   β”œβ”€β”€ MailchimpRoutes.php  # Mailchimp-specific routes
β”‚   β”‚   └── Editor_Settings_Routes.php # Editor settings
β”‚   └── Services/                # Business logic services
β”‚       └── Email_Generator.php   # Email HTML generation
β”œβ”€β”€ src/blocks/                  # WordPress block definitions
β”‚   β”œβ”€β”€ post/                    # Post content blocks
β”‚   β”œβ”€β”€ post-cta/               # Call-to-action blocks
β”‚   β”œβ”€β”€ post-excerpt/           # Post excerpt blocks
β”‚   β”œβ”€β”€ post-image/             # Featured image blocks
β”‚   └── post-title/             # Post title blocks
β”œβ”€β”€ languages/                   # Translation files
β”œβ”€β”€ assets/                      # Static assets
└── uninstall.php               # Comprehensive uninstall script

πŸ”§ WordPress Integration

The plugin leverages official WordPress packages for consistent behavior:

  • @wordpress/data - State management and data persistence
  • @wordpress/components - UI components with accessibility support
  • @wordpress/block-editor - Block-based email template editor
  • @wordpress/i18n - Internationalization support

Key Classes and Components

Service Container Pattern

The plugin uses a service container for dependency injection:

$container = new Service_Container();
$container->initialize();
$mailchimp = $container->get('mailchimp_provider');

Provider Interface

All email service providers implement a common interface:

interface ProviderInterface {
    public function slug(): string;
    public function label(): string;
    public function send_campaign(array $blocks, array $settings);
    // ... other methods
}

REST API Architecture

Complete REST API for all operations:

  • Rate limiting protection
  • Permission-based access control
  • Comprehensive error handling
  • JSON response formatting

File-Based Admin System

CampaignBridge uses a modern file-based admin system that auto-discovers screens and provides a clean, maintainable architecture for WordPress admin pages.

Key Features:

  • Zero Configuration: Just create files, everything works automatically
  • Auto-Discovery: Controllers, tabs, and assets auto-detected
  • Convention Over Configuration: Naming determines behavior
  • Progressive Enhancement: Start simple, add complexity when needed

Directory Structure:

includes/Admin/
β”œβ”€β”€ Core/                    # System core files
β”œβ”€β”€ Screens/                 # Auto-discovered admin pages
β”‚   β”œβ”€β”€ dashboard.php       # Simple screen
β”‚   └── settings/           # Tabbed screen
β”‚       β”œβ”€β”€ general.php     # Tab 1
β”‚       └── mailchimp.php   # Tab 2
β”œβ”€β”€ Controllers/             # Optional business logic
└── Models/                  # Optional data layer

For complete developer documentation including:

  • Screen types and creation
  • Controller auto-discovery
  • Configuration overrides
  • Screen context helper methods
  • Best practices and migration guide

See DEV_README.md for comprehensive technical documentation.

πŸ”’ Security Features

  • Input Sanitization: All user input is properly sanitized
  • CSRF Protection: Nonce verification for form submissions
  • Capability Checks: Proper user capability validation
  • API Rate Limiting: Built-in protection against API abuse
  • SQL Injection Prevention: Prepared statements and escaping
  • XSS Protection: Output escaping and content filtering
  • Secure Uninstall: Complete data cleanup on uninstall

πŸ› Troubleshooting

Common Issues

Plugin Not Loading

  1. Check PHP version (requires 8.2+)
  2. Verify WordPress version (requires 6.5.0+)
  3. Check for plugin conflicts
  4. Enable debug logging for detailed errors

API Connection Issues

  1. Verify API credentials in settings
  2. Check network connectivity
  3. Review rate limiting settings
  4. Enable debug mode for API errors

Template Editor Issues

  1. Clear browser cache
  2. Check WordPress block editor compatibility
  3. Verify PHP memory limits
  4. Check for JavaScript conflicts

Debug Mode

Enable WordPress debug mode to see detailed error information:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Support

For technical support and bug reports, please:

  1. Check the WordPress error logs
  2. Verify plugin compatibility
  3. Test with default WordPress theme
  4. Contact the development team with detailed error information

πŸ“ Changelog

Version 0.2.0

  • βœ… Major Refactoring: Complete code organization improvements
  • βœ… Enhanced Security: Comprehensive security enhancements
  • βœ… Professional Architecture: Service container and interface patterns
  • βœ… Better Performance: Optimized database queries and caching
  • βœ… Improved Documentation: Comprehensive code documentation
  • βœ… Standards Compliance: WordPress coding standards throughout

Version 0.1.0

  • Initial release with basic functionality

πŸ› οΈ Development

Environment Setup

# WordPress development environment
# Requires: WordPress 6.5.0+, PHP 8.2+, MySQL 5.6+

# Plugin uses standard WordPress development practices
# No external build tools required for core functionality

Code Organization

  • Service Container: Dependency injection for clean architecture
  • Provider Pattern: Extensible email service provider system
  • Interface Contracts: Clear contracts for all major components
  • REST API: Modern API design with proper error handling

Testing

  • Compatible with WordPress testing framework
  • Unit tests for core functionality
  • Integration tests for API endpoints
  • Security testing for user input handling

πŸ“„ License

This plugin is licensed under the GPL v2 or later.

Copyright (C) 2024 Aggressive Network, LLC

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Follow WordPress coding standards
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“ž Support

For issues and feature requests:

  • Check the WordPress plugin repository
  • Review the troubleshooting section above
  • Contact the development team with detailed information

CampaignBridge - Professional Email Campaign Management for WordPress

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published