Core Architecture

What is the Core Architecture?

ComplyFlow is built on a modular, enterprise-grade architecture that ensures performance, extensibility, and security. Understanding the core structure helps users and site administrators make the most of the plugin and troubleshoot or extend it as needed.

Key Components

1. Main Plugin Class (Plugin.php)

    1. Singleton Pattern: Only one instance of the plugin runs, preventing conflicts.
    2. Hook Management: Centralizes all WordPress actions and filters for easy management.
    3. Module Initialization: Loads and manages all feature modules (Consent, Accessibility, DSR, etc.).
    4. Internationalization: Loads translation files for multi-language support.
    5. REST API & WP-CLI: Registers custom REST API endpoints and WP-CLI commands for automation and integration.
    6. 2. Module Manager (ModuleManager.php)

    7. Dynamic Module Registration: Enables or disables modules as needed.
    8. Dependency Management: Ensures modules load in the correct order and with required dependencies.
    9. Capability Checks: Only users with the right permissions can access or configure modules.
    10. Versioning: Each module can be versioned and updated independently.
    11. 3. Loader (Loader.php)

    12. Action/Filter Registration: Handles all WordPress hooks in a single place.
    13. Priority Management: Controls the order in which hooks are executed.
    14. 4. Caching (Cache.php)

    15. WordPress Transients: Stores temporary data for performance.
    16. Object Caching: Supports Redis/Memcached for high-traffic sites.
    17. Cache Groups: Organizes cache by type (settings, scans, consent, etc.).
    18. TTL Management: Controls how long data is cached (15 min to 24 hours).
    19. Cache Statistics: Tracks cache hits/misses for optimization.
    20. 5. Settings Repository (SettingsRepository.php)

    21. Centralized Settings: All plugin settings are stored and retrieved from one place.
    22. Validation/Sanitization: Ensures all settings are safe and valid.
    23. Import/Export: Easily move settings between sites or environments.
    24. Option Caching: Settings are cached for fast access.
    25. 6. Activator/Deactivator

    26. Database Table Creation: Sets up all required tables on activation.
    27. Default Settings: Initializes plugin with safe defaults.
    28. Cleanup: Removes or resets data on deactivation.
    29. Version Checks: Ensures compatibility with WordPress and PHP versions.
    30. How It Benefits You

    31. Performance: Optimized for speed and low resource usage.
    32. Security: Follows WordPress best practices for data handling and permissions.
    33. Extensibility: Easily add or remove features as your needs change.
    34. Reliability: Modular design means one feature can be updated or fixed without affecting others.
    35. Practical Tips

    36. Use the settings import/export feature to quickly configure multiple sites.
    37. If you experience issues, check the plugin’s cache and try flushing it from the Advanced settings tab.
    38. Advanced users can use WP-CLI and REST API endpoints for automation and integration with other tools.
    39. Related Documentation

    40. See the Admin Settings and Advanced/Developer documentation for more on customizing and extending the plugin.

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket