WP Manifestindependent plugin directory
manifest / analytics / executive-erp-dashboard

Executive ERP Dashboard

WordPress plugin providing real-time executive dashboards from Odoo ERP with inventory forecasting, sales analytics, and shipment tracking

by Trygve "Trig" Bundgaard (aka Ubuntu Buddha) · github.com/ubuntu-buddha/executive-erp-dashboard

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/ubuntu-buddha/executive-erp-dashboard/archive/refs/heads/main.zip

Author: Trygve "Trig" Bundgaard (aka Ubuntu Buddha)

A production-style WordPress plugin providing secure, private executive dashboards with real-time reports from Odoo ERP. Features inventory forecasting, sales analytics, and shipment tracking with interactive visualizations.

Design Philosophy

This plugin demonstrates enterprise WordPress development with complex integrations:

  • ERP Integration: Odoo 17 XML-RPC client with read-only safeguards and robust error handling
  • Multi-Report System: Modular architecture supporting forecast, sales, and shipping reports
  • Caching Architecture: Database-backed caching with TTL management and wildcard clearing
  • Data Visualization: Chart.js integration with interactive filtering and Leaflet maps
  • Security: Role-based access control, nonce verification, and read-only API enforcement

Why This Exists

Executives need real-time business intelligence, but ERP systems like Odoo can be complex for non-technical users. This plugin bridges that gap by:

  • Providing a familiar WordPress interface for executives who already know the CMS
  • Aggregating data from multiple Odoo modules (inventory, sales, shipping)
  • Presenting data through interactive charts and visualizations
  • Caching responses to reduce API load and improve performance
  • Enforcing read-only access to prevent accidental data modification

Architecture

graph TB
    A[WordPress Admin] -->|Role Check| B[Executive Dashboard]
    B -->|Shortcode| C[Report Views]
    C -->|AJAX| D[Data Processors]
    D -->|Cache Check| E[Cache Manager]
    E -->|Cache Miss| F[Odoo API Client]
    F -->|XML-RPC| G[Odoo ERP]
    G -->|Data| F
    F -->|Store| E
    E -->|Return| D
    D -->|Process| C
    C -->|Render| H[Chart.js/Leaflet]

    I[Shipping Dashboard] -->|API Call| J[Shipping API Client]
    J -->|OAuth| K[DSV/Shipping API]
    K -->|Tracking Data| J
    J -->|Map Data| L[Leaflet Map]

    style F fill:#e1f5ff
    style G fill:#fff4e1
    style E fill:#ffe1e1
    style H fill:#e1ffe1
    style J fill:#f0e1ff

Core Components

  1. Odoo API Client (includes/class-odoo-api-client.php)

    • XML-RPC authentication and communication
    • Read-only operation enforcement
    • Connection testing and error handling
    • Support for multiple Odoo models
  2. Cache Manager (includes/class-cache-manager.php)

    • Database-backed caching with configurable TTL
    • Wildcard cache clearing for related data
    • Automatic cache expiration
    • Cache health checking
  3. Report System (includes/reports/)

    • Forecast Report: Inventory forecasting with stock move analysis
    • Sales Report: Quotations, orders, and payment tracking
    • Shipping Dashboard: Real-time shipment tracking with map visualization
    • Base classes for extensibility
  4. Data Processors (includes/reports/*/processors/)

    • Domain-specific data transformation
    • Date range calculations
    • Sales rep filtering
    • Payment aggregation
  5. View Layer (includes/reports/*/views/)

    • Template rendering
    • Chart data preparation
    • CSV export functionality
    • Debug views for development

Key Features

Inventory Forecasting

  • Product-level inventory projections
  • Stock move analysis (incoming/outgoing)
  • Category-based filtering
  • Interactive Chart.js visualizations
  • CSV export

Sales Analytics

  • Quotation tracking and conversion rates
  • Sales order analysis by period
  • Customer payment tracking
  • Sales rep performance filtering
  • Period comparison (current vs previous)

Shipping Dashboard

  • Real-time shipment tracking
  • Interactive Leaflet map visualization
  • Bi-directional table/map interaction
  • Multiple shipping API support (DSV, Gmail fallback)
  • Status filtering and date ranges

Security & Performance

  • Role-based access control (executive role)
  • Read-only API enforcement
  • Database-backed caching (configurable TTL)
  • Nonce verification for AJAX requests
  • Input sanitization throughout

Installation

Prerequisites

  • WordPress 5.0+
  • PHP 7.4+
  • Odoo 17 with XML-RPC API access
  • MySQL/MariaDB for cache storage

Setup

  1. Install the plugin:

    # Copy the plugin directory to wp-content/plugins/
    cp -r executive-erp-dashboard /path/to/wordpress/wp-content/plugins/
  2. Activate the plugin in WordPress admin

  3. Configure Odoo API (Settings > Executive ERP Dashboard):

    • Odoo API URL (e.g., https://your-odoo-instance.com)
    • API Key (from Odoo user settings)
    • Database name
    • Username
  4. Configure Shipping API (optional, for shipping dashboard):

    • Shipping API URL
    • Username and password (or OAuth credentials)
    • Subscription key (if required)
  5. Set cache duration (default: 24 hours)

Usage

Shortcodes

Forecast Report:

[forecast_report category="Machine Chassis" days="90" limit="20"]

Sales Report:

[sales_report period="month" period_value="current"]

Shipping Dashboard:

[shipping_dashboard]

Admin Dashboard

Access the executive dashboard via:

  • WordPress Admin > Executive ERP Dashboard
  • Requires view_executive_reports capability (executive role)

Cache Management

  • Clear Cache: Available in admin dashboard
  • Automatic Expiration: Based on configured duration
  • Wildcard Clearing: Related caches cleared when data changes

Configuration

WordPress Options

The plugin stores configuration in WordPress options:

  • exec_erp_odoo_api_url: Odoo instance URL
  • exec_erp_odoo_api_key: API authentication key
  • exec_erp_odoo_database: Database name
  • exec_erp_odoo_username: Odoo username
  • exec_erp_cache_duration: Cache TTL in seconds (default: 86400)
  • exec_erp_shipping_api_url: Shipping API endpoint
  • exec_erp_shipping_username: Shipping API username
  • exec_erp_shipping_password: Shipping API password

Database Tables

  • {prefix}_exec_erp_odoo_cache: Stores cached report data
    • report_type: Cache key identifier
    • report_data: JSON-encoded cached data
    • last_updated: Timestamp for expiration checking

Technical Details

API Integration

Odoo XML-RPC:

  • Uses custom Simple_XMLRPC client for WordPress compatibility
  • Authenticates via authenticate method
  • Executes queries via execute_kw
  • Enforces read-only operations (blocks write methods)

Shipping API:

  • OAuth 2.0 authentication support
  • RESTful API integration
  • Fallback to Gmail API for email-based tracking
  • Rate limiting and error handling

Caching Strategy

  • Cache Keys: Structured by report type and parameters
  • TTL: Configurable per-installation (default: 24 hours)
  • Invalidation: Manual clear or automatic expiration
  • Storage: WordPress database (no external dependencies)

Security

  • Read-Only API: Write operations explicitly blocked
  • Role-Based Access: Executive role with custom capability
  • Nonce Verification: All AJAX requests verified
  • Input Sanitization: WordPress sanitization functions throughout
  • SQL Injection Prevention: Prepared statements via $wpdb

Performance Considerations

  • Caching: Reduces API calls by 90%+ for repeated requests
  • Lazy Loading: Charts and maps load on-demand
  • Batch Processing: Multiple products processed in single API calls
  • Database Indexing: Cache table indexed on report_type and last_updated

When NOT to Use This

This plugin is not suitable for:

  • High-traffic public sites without additional caching layers
  • Multi-tenant WordPress without namespace isolation
  • Write operations (plugin is read-only by design)
  • Real-time data requirements (uses caching with TTL)

This is a portfolio project demonstrating ERP integration patterns. For production use, additional security hardening, load testing, and compliance review are recommended.

Portfolio Highlights

Skill Demonstrated Evidence
ERP Integration Odoo XML-RPC client with authentication, error handling
API Client Design Read-only enforcement, connection testing, retry logic
Caching Architecture Database-backed cache with TTL, wildcard clearing
Data Visualization Chart.js integration, Leaflet maps, interactive filtering
WordPress Development Shortcodes, AJAX handlers, role-based access, hooks
Modular Architecture Base classes, processors, views, extensible design
Full-Stack PHP backend + JavaScript frontend + database layer

Dependencies

  • WordPress: Core functionality
  • Chart.js: Data visualization (loaded via CDN)
  • Leaflet: Map visualization (loaded via CDN)
  • Odoo 17: ERP backend (external)
  • Shipping API: External service (DSV or similar)

License

MIT License - See LICENSE file for details.

Disclaimer

This software is for demonstration purposes only. ERP integrations require careful security review and compliance considerations. The developers are not responsible for any business decisions made using this software.


Built to demonstrate enterprise WordPress development with ERP integration.