# bliyscom/truewpsec architecture

> Architecture diagram of the GitHub repository bliyscom/truewpsec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bliyscom/truewpsec
- Repository: https://github.com/bliyscom/truewpsec

## Overview

TrueWPSec is a WordPress security plugin. WordPress loads the plugin, whose bootstrap initializes its runtime; administrators use the dashboard to configure protections and run scanning or cleanup actions. The product also covers request filtering, login and API hardening, file locking, malware repair, health checks, and audit logging. The sampled code confirms several admin-to-service and healer-to-service calls; wiring not shown in the excerpts is omitted rather than inferred.

Main entry points: [`inc/class-truewpsec-admin.php`](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-admin.php) (Admin dashboard), [`inc/class-truewpsec-scanner.php`](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-scanner.php) (Malware scanner), [`inc/class-truewpsec-audit-log.php`](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-audit-log.php) (Audit log), [`inc/class-truewpsec-auto-healer.php`](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-auto-healer.php) (Automatic repair)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin runtime"]
  node_bootstrap["Plugin bootstrap<br/>[truewpsec.php]"]
  node_core["Security core"]
end

subgraph group_protection["Request protection"]
  node_firewall["Web firewall"]
  node_attack["Attack prevention"]
  node_api["API blocker"]
  node_hardener["Login hardening"]
  node_login["Gatekeeper login"]
end

subgraph group_integrity["File integrity"]
  node_scanner["Malware scanner"]
  node_locker["System locker"]
  node_healer["Automatic repair"]
  node_health["Health checks"]
end

subgraph group_operations["Administration and records"]
  node_admin["Admin dashboard"]
  node_cleaner["System cleaner"]
  node_audit["Audit log"]
  node_auditdb[("Audit table")]
end

node_wordpress(("WordPress"))
node_geoip(("GeoIP service"))
node_wporg(("WordPress.org"))

node_wordpress -->|"loads plugin"| node_bootstrap
node_bootstrap -->|"initializes"| node_core
node_admin -->|"scans or repairs"| node_scanner
node_admin -->|"deletes junk"| node_cleaner
node_admin -->|"records deletion"| node_audit
node_admin -->|"updates settings"| node_attack
node_admin -->|"updates settings"| node_hardener
node_healer -->|"scans and repairs"| node_scanner
node_healer -->|"records repair"| node_audit
node_audit -->|"writes and queries"| node_auditdb
node_firewall -->|"checks IP country"| node_geoip
node_scanner -->|"fetches core file"| node_wporg

click node_bootstrap "https://github.com/bliyscom/truewpsec/blob/main/truewpsec.php"
click node_core "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-core.php"
click node_admin "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-admin.php"
click node_firewall "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-firewall.php"
click node_attack "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-attack-prevention.php"
click node_api "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-api-blocker.php"
click node_hardener "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-hardener.php"
click node_login "https://github.com/bliyscom/truewpsec/blob/main/templates/gatekeeper-login.php"
click node_scanner "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-scanner.php"
click node_locker "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-locker.php"
click node_healer "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-auto-healer.php"
click node_health "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-health-checker.php"
click node_cleaner "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-cleaner.php"
click node_audit "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-audit-log.php"
click node_auditdb "https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-audit-log.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_core toneBlue
class node_firewall,node_attack,node_api,node_hardener,node_login toneAmber
class node_scanner,node_locker,node_healer,node_health toneMint
class node_admin,node_cleaner,node_audit,node_auditdb toneRose
class node_wordpress,node_geoip,node_wporg toneIndigo
```

## Components

### Plugin runtime

- [Plugin bootstrap](https://github.com/bliyscom/truewpsec/blob/main/truewpsec.php): `truewpsec.php`
- [Security core](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-core.php): `inc/class-truewpsec-core.php`

### Request protection

- [Web firewall](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-firewall.php): `inc/class-truewpsec-firewall.php`
- [Attack prevention](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-attack-prevention.php): `inc/class-truewpsec-attack-prevention.php`
- [API blocker](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-api-blocker.php): `inc/class-truewpsec-api-blocker.php`
- [Login hardening](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-hardener.php): `inc/class-truewpsec-hardener.php`
- [Gatekeeper login](https://github.com/bliyscom/truewpsec/blob/main/templates/gatekeeper-login.php): `templates/gatekeeper-login.php`

### File integrity

- [Malware scanner](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-scanner.php): `inc/class-truewpsec-scanner.php`
- [System locker](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-locker.php): `inc/class-truewpsec-locker.php`
- [Automatic repair](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-auto-healer.php): `inc/class-truewpsec-auto-healer.php`
- [Health checks](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-health-checker.php): `inc/class-truewpsec-health-checker.php`

### Administration and records

- [Admin dashboard](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-admin.php): `inc/class-truewpsec-admin.php`
- [System cleaner](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-cleaner.php): `inc/class-truewpsec-cleaner.php`
- [Audit log](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-audit-log.php): `inc/class-truewpsec-audit-log.php`
- [Audit table](https://github.com/bliyscom/truewpsec/blob/main/inc/class-truewpsec-audit-log.php): `inc/class-truewpsec-audit-log.php`

### Other components

- **WordPress**
- **GeoIP service**
- **WordPress.org**

## Connections

- WordPress → Plugin bootstrap: loads plugin (evidence: `truewpsec.php`)
- Plugin bootstrap → Security core: initializes (evidence: `truewpsec.php`)
- Admin dashboard → Malware scanner: scans or repairs (evidence: `inc/class-truewpsec-admin.php`)
- Admin dashboard → System cleaner: deletes junk (evidence: `inc/class-truewpsec-admin.php`)
- Admin dashboard → Audit log: records deletion (evidence: `inc/class-truewpsec-admin.php`)
- Admin dashboard → Attack prevention: updates settings (evidence: `inc/class-truewpsec-admin.php`)
- Admin dashboard → Login hardening: updates settings (evidence: `inc/class-truewpsec-admin.php`)
- Automatic repair → Malware scanner: scans and repairs (evidence: `inc/class-truewpsec-auto-healer.php`)
- Automatic repair → Audit log: records repair (evidence: `inc/class-truewpsec-auto-healer.php`)
- Audit log → Audit table: writes and queries (evidence: `inc/class-truewpsec-audit-log.php`)
- Web firewall → GeoIP service: checks IP country (evidence: `inc/class-truewpsec-firewall.php`)
- Malware scanner → WordPress.org: fetches core file (evidence: `inc/class-truewpsec-scanner.php`)
