# rubengameztorrijos/digital-legacy architecture

> Architecture diagram of the GitHub repository rubengameztorrijos/digital-legacy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rubengameztorrijos/digital-legacy
- Repository: https://github.com/rubengameztorrijos/digital-legacy

## Overview

##### Project Type and Purpose
- The plugin is designed to integrate with a WordPress environment.
- Its main goal is to allow users to configure what happens to their online accounts and digital data after a set period of inactivity.
- It handles user preferences (including inactivity time thresholds and notification setups) and triggers the eventual deletion of accounts based on those settings.

##### Analyzing the File Structure
- The provided file tree is minimal (LICENSE and README.md), which is common for plugins distributed as ZIP files. This implies that the core functionality is likely encapsulated within one or several PHP files that integrate tightly with WordPress.

##### Key Components
a. Plugin Core/Initialization:
- This is where the plugin hooks into WordPress. It registers actions and filters needed to integrate into both the WordPress admin dashboard and the public-facing side.

b. Admin Panel Integration:
- A component representing the settings screen where administrators or users can define their legacy preferences.
- This would interface with the WordPress dashboard, invoking hooks and APIs.

c. User Profile Interface:
- The functionality that exposes new fields/options on the user profile page so that each user can specify their chosen inactivity period and notification reminders.

d. Inactivity and Deletion Workflow:
- A scheduled (cron) job or background task mechanism that monitors user activity. This component checks user inactivity periods and triggers deletion or sends notification emails as configured by the user.
- It as a “Scheduled Task/Watcher” module that communicates with both the database and notification components.

e. Email/Notification System:
- A notification module that handles sending emails to users at designated intervals before deletion occurs.
- This module interacts with the user settings and triggers alerts, possibly using WordPress’s built-in mail functions.

f. Data Store and Settings Persistence:
- Although WordPress handles most of the data persistence, the plugin might create custom database tables or leverage the wp_options and user_meta tables to store configuration data and state information.
- A “Database/WordPress Data Store” component that the plugin interacts with.

##### Relationships and Interactions
- The Inactivity and Deletion Workflow should be shown as accessing user data from the Data Store, scheduling tasks via WordPress cron, and invoking the Notification System.

##### Architectural Patterns and Design Principles
- Separation of concerns by showing distinct modules (initialization, user settings, scheduled tasks, notifications) each fulfilling a specific role.
- Since this is a plugin, the design can follow WordPress plugin best practices by leveraging hooks and filters.
- Minimal but clear boundary between plugin functionality and WordPress core functionalities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    DLP["Digital Legacy Plugin Core"]:::plugin
    Admin["Admin Settings Interface"]:::admin
    Profile["User Profile Extension"]:::plugin
    Cron["Cron/Background Task"]:::cron
    Notify["Notification/Email System"]:::notify
    DB["WordPress Data Store"]:::db

    DLP -->|"hooks_into"| Admin
    DLP -->|"hooks_into"| Profile
    DLP -->|"schedules"| Cron
    Admin -->|"stores_settings_in"| DB
    Profile -->|"updates_userdata_in"| DB
    Cron -->|"checks_inactivity_in"| DB
    Cron -->|"triggers_notifications"| Notify

    classDef plugin fill:#B3CDE0,stroke:#333,stroke-width:2px;
    classDef admin fill:#FBB4AE,stroke:#333,stroke-width:2px;
    classDef cron fill:#CDEBAA,stroke:#333,stroke-width:2px;
    classDef notify fill:#DECBE4,stroke:#333,stroke-width:2px;
    classDef db fill:#FED9A6,stroke:#333,stroke-width:2px;
```
