# wordpress/hello-dolly architecture

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

- Interactive diagram: https://gitdiagram.com/wordpress/hello-dolly
- Repository: https://github.com/wordpress/hello-dolly

## Overview

Hello Dolly is a small WordPress admin plugin: on each admin page, WordPress invokes its notice callback, which selects and formats a random lyric and renders it; a separate admin-head callback supplies positioning CSS. The sampled source shows no persistent storage or external service. Both callbacks rely on WordPress hooks and APIs.

Main entry points: [`hello.php`](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php) (Render lyric notice)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Hello Dolly plugin"]
  node_notice_render["Render lyric notice<br/>[hello.php]"]
  node_lyric_select["Select random lyric<br/>[hello.php]"]
  node_lyric_text["Embedded lyrics<br/>[hello.php]"]
  node_locale_check["Check user locale<br/>[hello.php]"]
  node_notice_markup["Notice markup<br/>[hello.php]"]
  node_css_callback["Emit positioning CSS<br/>[hello.php]"]
end

node_admin_user(("Admin user"))
node_wordpress_admin["WordPress admin"]
node_notice_hook["Admin notices hook"]
node_head_hook["Admin head hook"]
node_wordpress_format["Texturize lyric"]
node_wordpress_translate["Translate screen text"]
node_admin_page["Rendered admin page"]

node_admin_user -->|"opens page"| node_wordpress_admin
node_wordpress_admin -->|"fires"| node_notice_hook
node_wordpress_admin -->|"fires"| node_head_hook
node_notice_hook -->|"dispatches"| node_notice_render
node_notice_render -->|"calls"| node_lyric_select
node_lyric_select -->|"reads"| node_lyric_text
node_lyric_select -->|"formats with"| node_wordpress_format
node_wordpress_format -->|"returns text"| node_lyric_select
node_notice_render -->|"checks locale"| node_locale_check
node_locale_check -->|"reads locale"| node_wordpress_admin
node_notice_render -->|"translates label"| node_wordpress_translate
node_notice_render -->|"renders"| node_notice_markup
node_notice_render -->|"outputs notice"| node_admin_page
node_head_hook -->|"dispatches"| node_css_callback
node_css_callback -->|"outputs styles"| node_admin_page

click node_notice_render "https://github.com/wordpress/hello-dolly/blob/trunk/hello.php"
click node_lyric_select "https://github.com/wordpress/hello-dolly/blob/trunk/hello.php"
click node_lyric_text "https://github.com/wordpress/hello-dolly/blob/trunk/hello.php"
click node_locale_check "https://github.com/wordpress/hello-dolly/blob/trunk/hello.php"
click node_notice_markup "https://github.com/wordpress/hello-dolly/blob/trunk/hello.php"
click node_css_callback "https://github.com/wordpress/hello-dolly/blob/trunk/hello.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_notice_render,node_lyric_select,node_lyric_text,node_locale_check,node_notice_markup,node_css_callback,node_admin_user,node_wordpress_translate toneBlue
class node_wordpress_admin,node_notice_hook,node_head_hook,node_wordpress_format,node_admin_page toneIndigo
```

## Components

### Hello Dolly plugin

- [Render lyric notice](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`
- [Select random lyric](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`
- [Embedded lyrics](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`
- [Check user locale](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`
- [Notice markup](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`
- [Emit positioning CSS](https://github.com/wordpress/hello-dolly/blob/trunk/hello.php): `hello.php`

### Other components

- **Admin user**
- **WordPress admin**
- **Admin notices hook**
- **Admin head hook**
- **Texturize lyric**
- **Translate screen text**
- **Rendered admin page**

## Connections

- Admin user → WordPress admin: opens page
- WordPress admin → Admin notices hook: fires
- WordPress admin → Admin head hook: fires
- Admin notices hook → Render lyric notice: dispatches
- Render lyric notice → Select random lyric: calls
- Select random lyric → Embedded lyrics: reads
- Select random lyric → Texturize lyric: formats with
- Texturize lyric → Select random lyric: returns text
- Render lyric notice → Check user locale: checks locale
- Check user locale → WordPress admin: reads locale
- Render lyric notice → Translate screen text: translates label
- Render lyric notice → Notice markup: renders
- Render lyric notice → Rendered admin page: outputs notice
- Admin head hook → Emit positioning CSS: dispatches
- Emit positioning CSS → Rendered admin page: outputs styles
