Minn\Admin
The minn-admin/v1 namespace and serving the Minn Admin app. 41 classes, 150 public methods and 70 internals. This page is the public surface; each class name opens the whole class.
ActivityChart final readonly class
public/minn/src/Minn/Admin/ActivityChart.php · 65 lines · Open the class →
The overview's activity chart: published posts and pages plus every comment, counted per bar. A window over 45 days is drawn in weeks, anything shorter in days; each bar carries the (from, to] GMT bounds the drill-down asks for.
| new | __construct(Minn\Db $db, Minn\Content\Site $site) | |
| method | bars(int $days, int $now): array | The bars for a window of days, counted from the database. @return list<array{label: string, value: int, from: string, to: string}> |
| static | bucket(array $dates, int $days, int $now, int $offset): array | GMT stamps into bars, oldest first. Labels are site-local: the day for daily bars, "Week of" the bar's first day for weekly ones. @param list<string> $dates "Y-m-d H:i:s" in GMT@return list<array{label: string, value: int, from: string, to: string}> |
ActivityFeed final readonly class
public/minn/src/Minn/Admin/ActivityFeed.php · 213 lines · Open the class →
What happened lately, as the overview and the bell tell it: the caller's own recent posts and the latest comments, and the events behind one chart bar. Also the visibility rule every comment row is put through.
| new | __construct(Minn\Db $db, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities) | |
| method | recent(int $userId, int $now, int $offset): array | The overview's four most recent items, times already worded ("2 hours ago"). Oracle-caught quirk: the reference's recent-activity query runs with a multi-type post_type plus perm=editable, and on that combination it restricts EVERY status to post_author = caller, admins included, published posts included. Authorless posts appear for nobody. The engine reproduces the observed behavior, not the intent. @return list<array> |
| method | between(int $userId, string $from, string $to, int $now): array | The events behind one chart bar, (from, to] GMT, newest first. Post rows decode the RAW stored title; comment rows decode the texturized one (the reference's asymmetry, kept). @return list<array> |
| method | commentVisible(int $userId, int $postId): bool | May this caller see a comment row that names its post? |
| method | postTitle(int $postId): string | A post's stored title, empty when the post is gone. |
| method | displayName(int $userId): string | A user's display name, empty when the user is gone. |
| inside | ownPosts(), latestComments(), publishedBetween(), commentsBetween() |
AdminArgs final class
public/minn/src/Minn/Admin/AdminArgs.php · 29 lines · Open the class →
The arguments Minn Admin's own routes register, as the reference lists them with the plugin running there: declared, the router judges them before the caller, as the reference does, so a bad value is a 400 even for someone signed out. Each set names the handler that reads it.
| const | OVERVIEW = array ( 'days' => array ( 'type' => 'integer', 'default' => 30, 'minimum' => 7, 'maximum' => 90, 'required' => false, ), ) | Read by OverviewController::overview(): the window the charts cover, in days. |
| const | ACTIVITY = array ( 'from' => array ( 'type' => 'string', 'pattern' => '^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$', 'required' => true, ), 'to' => array ( 'type' => 'string', 'pattern' => '^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$', 'required' => true, ), ) | Read by OverviewController::overviewActivity(): the bounds of one chart bar. |
| const | THEME_SEARCH = array ( 'q' => array ( 'type' => 'string', 'required' => true, ), ) | Read by PackagesController::searchThemes(): the words searched for. |
| const | PLUGIN_SEARCH = array ( 'q' => array ( 'type' => 'string', 'required' => true, ), 'page' => array ( 'type' => 'integer', 'default' => 1, 'minimum' => 1, 'required' => false, ), ) | Read by PackagesController::searchPlugins(): the words searched for and the page of results. |
| const | PLUGIN_INFO = array ( 'slug' => array ( 'type' => 'string', 'required' => true, ), ) | Read by PackagesController::pluginInfo(): the directory slug. |
AdminNotice final class
public/minn/src/Minn/Admin/AdminNotice.php · 25 lines · Open the class →
An admin notice's markup, as wp_get_admin_notice builds it on the reference (probe functions-formatting-doubts): a type is a string, trimmed, and one holding a space is a mistake; extra classes come only from a list; an attribute that is true is a bare name, a value under a number is a bare name too, an empty one is left out.
| static | markup(string $message, array $args, Closure $attr): array | The notice's div and its inner part (the message, in a paragraph unless paragraph_wrap is off), escaped by $attr. @param array<string, mixed> $args the parsed and filtered arguments@param Closure(string): string $attr the attribute escaper@return array{0: string, 1: string} |
AdminPlugin final class
public/minn/src/Minn/Admin/AdminPlugin.php · 135 lines · Open the class →
Minn Admin's home on a site is wp-content/plugins/minn-admin: the same plugin WordPress runs, so an eject leaves the site its admin, and Minn Admin's own updates keep it current between engine releases. The engine carries the Minn Admin release of its build at minn/admin and lays it into the plugins folder the first time a new engine version serves a request: into an empty place, where it is also activated, or over an older copy, whose active state is kept; never over a newer copy, a link, or a folder under git, and never from a development checkout.
The copy served is the plugin when it is at least the engine's own and asks for no newer engine (a "Requires Minn" header); otherwise the engine's copy, which also stands in while the plugin folder is missing.
| const | FOLDER = 'minn-admin' | |
| const | MAIN = 'minn-admin/minn-admin.php' | |
| const | OPTION = 'minn_admin_laid' | The engine version that last settled the plugin: one autoloaded option, so a request with nothing to do reads nothing more. |
| const | KEPT = 'Minn Admin is this site\'s admin, so it cannot be deleted while Minn runs the site. Deactivate it to switch the admin off.' | Why deleting Minn Admin is refused, wherever it is asked for. |
| static | app(string $engineDir, string $contentDir): Minn\Admin\App | The app a request serves, with the address its files load from. |
| static | settle(string $engineDir, string $contentDir, Minn\Runtime\Options $options): void | Once per engine version: lays the engine's copy into the plugins folder when that is due, activating it when it was not there. A copy that cannot be laid (an unwritable folder) is not retried until the next version; the engine's copy is served meanwhile. Called once the runtime has booted, so the check is a read of the autoloaded list. |
| static | activated(?string $stored): ?array | The stored active_plugins list with Minn Admin added, sorted as activation sorts it; null when it is already there. @return list<string>|null |
| static | lay(string $bundle, string $target): string | Puts the engine's copy at $target: "laid" into an empty place, "upgraded" over an older copy, "kept" when the copy there is as new or newer, "skipped" when nothing may be written (no whole plugin to lay, a link or a git checkout in the way, another lay in progress). The new copy is built beside the target and swapped in by renames, so a request never finds half a plugin. |
| static | servable(string $plugin, string $bundle, string $engineVersion): bool | Whether the plugin copy is whole, at least the engine's own, and asks for no newer engine. |
| inside | engineVersion() |
AdminTypes final class
public/minn/src/Minn/Admin/AdminTypes.php · 85 lines · Open the class →
Admin-facing type facts (viewable, labels, supports, the edit gate) live beside, not inside, the wp/v2 registry, so the types route's payload stays byte-faithful.
| new | __construct(Minn\Rest\Types $types, Minn\Auth\Capabilities $capabilities) | |
| method | extra(): array | The types beyond post and page the app may show, with their labels. |
| method | section(int $userId): array | The boot-status types section: edit-visible types for this user, slimmed. |
| method | restBaseOf(string $slug): string | The rest_base of a type slug. |
| method | singularOf(string $slug): string | A type's singular label. |
| method | editable(): array | The viewable types a person edits in the app: slug => rest base. @return array<string, string> @return array<string, string> |
| method | commentsEnabled(): bool | Whether a UI post type still supports comments. |
App final readonly class
public/minn/src/Minn/Admin/App.php · 106 lines · Open the class →
The Minn Admin app on disk the engine serves the shell and assets from: the plugin in wp-content/plugins, or the engine's own copy at minn/admin (AdminPlugin::app picks), with the site path its files load from. Minn Admin is MIT, so reading its files is fine.
| new | __construct(string $dir, string $path = '/minn/admin') | |
| static | switchedOff(string $contentDir, Minn\Content\Site $site): bool | Whether the site has switched Minn Admin off: its plugin folder is in wp-content/plugins (the record the reference keeps) and active_plugins does not name it. A site that carries only the engine's bundle has no such record and keeps its admin. |
| method | dir(): string | Where the bundle sits on disk. |
| method | path(): string | The site path its files load from (no trailing slash). |
| method | installed(): bool | Whether the bundle is on disk. |
| method | version(): string | The bundle's version from its plugin header. |
| method | file(string $relative): ?string | The absolute path of a readable file inside the app, or null. |
| method | assetVersion(string $relative): string | A self-busting asset version: app version plus file mtime. |
| method | asset(string $relative): ?array | The absolute path and content type of an asset inside the app, or null for anything missing or outside it. @return array{0: string, 1: string}|null |
AppController final readonly class
public/minn/src/Minn/Admin/AppController.php · 150 lines · Open the class →
Serves Minn Admin from the engine: the path-routed shell (every sub-path renders the same page) and the app's assets. The nonce refresh app.js asks admin-ajax.php for is the reference's own rest-nonce action (Runtime\AjaxController).
| new | __construct(Minn\Admin\App $app, Minn\Admin\BootPayload $payload, Minn\Auth\Authenticator $authenticator, Minn\Auth\Capabilities $capabilities, Minn\Front\Permalinks $permalinks, string $engineVersion, Minn\Content\SiteIcon $icon, bool $off = false) | |
| method | shell(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin (public)GET /minn-admin/{rest*} (public) | Requires a signed-in user who can edit content; otherwise the login form. |
| method | asset(Minn\Http\Request $request, string $path): Minn\Http\ResponseGET /minn/admin/assets/{path*} (public) | One file of the app bundle, with its content type and caching headers. |
| inside | offPage(), favicon(), render() |
Appearance final readonly class
public/minn/src/Minn/Admin/Appearance.php · 82 lines · Open the class →
A person's Minn Admin appearance: the colour scheme and its custom token maps, stored where the app stores them (user meta minn_admin_appearance, a serialized array) so the choice survives an eject. The two WordPress-era switches, "Minn is the default admin" and "Minn admin bar on the site", are always on here: there is no other admin and no other bar, so the engine reports them true and ignores writes to them.
| const | META = 'minn_admin_appearance' | |
| const | SCHEMES = array ( 0 => 'minn', 1 => 'ocean', 2 => 'forest', 3 => 'amber', 4 => 'rose', 5 => 'coral', 6 => 'teal', 7 => 'slate', 8 => 'dusk', ) | |
| const | SLOTS = array ( 0 => 'bg', 1 => 'bg2', 2 => 'panel', 3 => 'panel2', 4 => 'hover', 5 => 'border', 6 => 'border2', 7 => 'text', 8 => 'text2', 9 => 'text3', 10 => 'accent', 11 => 'accent2', 12 => 'accentFg', ) | Scheme slots in the order the app lists them. |
| const | BASE = array ( 'dark' => array ( 'bg' => '#0b0b0d', 'bg2' => '#101013', 'panel' => '#151518', 'panel2' => '#1b1b1f', 'hover' => '#202027', 'border' => '#242429', 'border2' => '#31313a', 'text' => '#ececed', 'text2' => '#9d9da7', 'text3' => '#63636d', 'accent' => '#6e62f5', 'accent2' => '#8a80f8', 'accentFg' => '#ffffff', ), 'light' => array ( 'bg' => '#f6f6f7', 'bg2' => '#ffffff', 'panel' => '#ffffff', 'panel2' => '#f4f4f6', 'hover' => '#eeeef1', 'border' => '#e7e7ea', 'border2' => '#dadade', 'text' => '#1a1a1f', 'text2' => '#5e5e69', 'text3' => '#9696a0', 'accent' => '#6a5ef2', 'accent2' => '#5a4ef0', 'accentFg' => '#ffffff', ), ) | The app's own Minn tokens, the fill for incomplete custom maps. |
| new | __construct(Minn\Content\Users $users) | |
| method | read(int $userId): array | A user's saved appearance, normalised. @return array{scheme: string, custom: array, defaultAdmin: bool, frontBar: bool, font: string} |
| method | save(int $userId, array $raw): array | Merges the given keys over the stored map and writes it back; returns the normalised result. |
| static | normalise(array $raw): array | The appearance with every field valid and every missing one defaulted. |
| static | hex(string $value): string | #rgb or #rrggbb to lowercase #rrggbb, or '' for anything else. |
BootPayload final readonly class
public/minn/src/Minn/Admin/BootPayload.php · 257 lines · Open the class →
The window.MINN boot payload, assembled from the engine: the keys app.js needs to boot and drive the wp/v2 surface, with capabilities from the engine's own model.
| new | __construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Auth\Capabilities $capabilities, Minn\Admin\App $app, string $engineVersion, Minn\Admin\Appearance $appearance, Minn\Admin\HiddenIntegrations $hidden, Minn\Content\SiteIcon $icon, bool $blockTheme = false, ?Minn\Admin\Translations $translations = NULL) | |
| method | siteName(): string | The site's name, or Site when it has none. |
| method | build(Minn\Auth\Authenticated $session): array | The window.MINN payload the app boots from, for one signed-in session. |
| static | fromPlugin(): ?array | What Minn Admin's own boot_payload() computes when the plugin runs as code on the runtime, so the app boots with the same keys on both stacks (connectors, discussion defaults, roles, post formats, the adapter flags). Engine-owned keys win; the withheld ones would send the app to a wp-admin page the engine does not have. Null while the plugin is not running as code. @return array<string, mixed>|null |
| inside | userSlice(), siteSlice(), commerce(), caps(), standHomeQuery(), adapterSlices() |
BundleController final readonly class
public/minn/src/Minn/Admin/BundleController.php · 46 lines · Open the class →
What the app bundle answers for: the user guide it carries, the translation offers (none: the engine polls no translation channel), and the two changelogs, Minn Admin's and the engine's, read from GitHub because a release carries neither.
| new | __construct(Minn\Admin\App $app, Minn\Rest\Caller $caller, Minn\Ops\Changelog $adminChangelog, Minn\Ops\Changelog $engineChangelog) | |
| method | translations(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/translations (floor edit_posts) | The translation offers; none on the engine. |
| method | changelog(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/changelog (floor edit_posts) | Minn Admin's changelog, released sections only, beside the bundle's version. |
| method | engineChangelog(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/engine-changelog (floor edit_posts) | The engine's own changelog, kept in its repository and not in a release, shown beside the app's on Minn. |
| method | guide(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/guide (floor edit_posts) | The app's bundled user guide. |
| inside | bundled() |
CodeEditor final class
public/minn/src/Minn/Admin/CodeEditor.php · 96 lines · Open the class →
The code editor's settings as wp_get_code_editor_settings gives them (probe admin-doubts): CodeMirror's defaults and the three linters', the mode and its helpers from the content type (named, or worked out from the file's extension), then the caller's own settings merged over each part.
| static | settings(array $args, string $espreeUrl, Closure $mimeOf): array | The settings for one editor: $args' type, else its file's (the extension, else $mimeOf the file, else text/plain); the caller's codemirror, csslint, jshint and htmlhint settings merged over the defaults. @param array<string, mixed> $args@param Closure(string): string $mimeOf a file's content type, '' when unknown@return array<string, array<string, mixed>> |
| inside | mode(), defaults() |
Dashboard final readonly class
public/minn/src/Minn/Admin/Dashboard.php · 273 lines · Open the class →
The overview payload: stat cards, the activity chart, and the recent activity feed, plus the per-bar activity drill-down.
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities, Minn\Admin\ActivityChart $chart, Minn\Admin\ActivityFeed $feed, string $uploadsDir) | |
| method | overview(int $userId, int $days): array | The stat cards, the metric catalog and layout, the chart, and the feed. |
| method | metricLayout(int $userId, array $catalog, array $stats): array | Which cards show: the user's saved picks over the site default over the built-in layout, unknown keys dropped and slots refilled. @param list<array> $catalog@param list<array> $stats@return array{keys: list<string>, defaults: list<string>, custom: bool} |
| static | cleanMetricKeys(mixed $keys): array | At most six unique sanitize_key metric ids; anything else drops. |
| method | activity(int $userId, string $from, string $to): array | The events behind one chart bar, (from, to] GMT. |
| inside | postsCard(), pagesCard(), usersCard(), commentsCard(), mediaCard(), metricCatalog(), overlayMetricKeys(), statusCounts(), commentCounts() |
EditorController final readonly class
public/minn/src/Minn/Admin/EditorController.php · 31 lines · Open the class →
The editor's edit lock in minn-admin/v1. Its template and pattern lists are Minn Admin's own routes, answered by the plugin from the theme and the pattern registry.
| new | __construct(Minn\Content\PostWriter $writer, Minn\Rest\Caller $caller) | |
| method | lock(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/posts/{id:\d+}/lock (floor edit_posts) | Takes the edit lock on a post. |
| method | unlock(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/posts/{id:\d+}/unlock (floor edit_posts) | Releases the edit lock on a post. |
Format final class
public/minn/src/Minn/Admin/Format.php · 51 lines · Open the class →
The dashboard's number, size, age, and title formatting.
| static | number(int|float $value, int $decimals = 0): string | number_format_i18n for the default locale: comma thousands. |
| static | size(int $bytes): string | size_format with one decimal: 1024-step units, comma thousands. |
| static | humanTimeDiff(int $from, ?int $to = NULL): string | Humanized age, pinned by an oracle capture table: each unit rounds, floors at 1, and hands off at the next unit boundary. |
| static | plainTitle(string $raw): string | A post title as the feed shows it: texturized, entities decoded, tags gone. |
IframeMarkup final class
public/minn/src/Minn/Admin/IframeMarkup.php · 41 lines · Open the class →
The fixed markup of the two bare admin documents plugins print into, as iframe_header and wp_iframe print it on the reference (probe admin-doubts): the globals the admin scripts read (ajaxurl, pagenow and the rest), the body's opening with the no-js switch, and the onload call at the end. What hooks print goes between these pieces.
| static | headerScript(string $title, array $page): string | iframe_header's head after its title: the load-event helper, the thickbox closer and the admin globals. @param array{ajaxurl: string, pagenow: string, typenow: string, adminpage: string, thousands: string, decimal: string, rtl: int} $page |
| static | headerBody(string $idAttribute, string $classes): string | iframe_header's body opening, the no-js class switched to js. |
| static | iframeScript(string $title, string $ajaxurl, int $rtl): string | wp_iframe's head after the document opening: its title, the load-event helper and the media popup's globals. |
| static | iframeBody(string $idAttribute, string $classes): string | wp_iframe's body opening, the no-js class switched to js. |
| static | iframeEnd(): string | The onload call that closes wp_iframe's document. |
LanguageChoices final class
public/minn/src/Minn/Admin/LanguageChoices.php · 42 lines · Open the class →
The language picker's markup. English always leads the list and carries the empty value, because "no locale" and "American English" are the same choice. When the picker also offers what could be downloaded, the two halves split into named groups; otherwise every option sits in one flat list.
The attribute order is not tidy and is not ours to tidy: the English option carries `data-installed` before `selected`, an installed translation carries it after, and themes and plugins have been matching on that markup for years.
| static | dropdown(string $name, string $id, array $installed, array $available, string $selected, bool $offerAvailable): string | The language select's HTML, installed languages first. @param list<string> $installed locale codes the site already holds@param array<string, array{language: string, native_name: string, iso: array<int|string, string>}> $available every translation the directory offers, keyed by locale |
| inside | option() |
LanguageController final readonly class
public/minn/src/Minn/Admin/LanguageController.php · 109 lines · Open the class →
Languages: what is installed, what a person reads in, what the site defaults to.
| new | __construct(Minn\Admin\Translations $translations, Minn\Content\Users $users, Minn\Content\Site $site, Minn\Auth\Capabilities $capabilities, Minn\Rest\Caller $caller) | |
| method | languages(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/languages (floor edit_posts) | The languages a user may pick, installed and available. |
| method | bootLocale(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/boot-locale (floor edit_posts) | The slice of the boot payload a language switch repaints from. |
| method | mine(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/me/language (floor edit_posts) | Sets the caller's own locale. |
| method | user(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/users/{id:\d+}/language (floor edit_posts) | Sets another user's locale. |
| method | site(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/site/language (floor edit_posts + manage_options) | Sets the site's locale. |
| inside | setUserLocale(), ensure() |
LegacyPackController final readonly class
public/minn/src/Minn/Admin/LegacyPackController.php · 49 lines · Open the class →
The Minn Legacy Pack installed for an editor that needs it (Runtime\LegacyPack): the latest release the Minn update service follows for the pack's repository, its package checked against the sha256 the service recorded, unpacked as any plugin is, then activated. A site that has the pack only activates it. Minn asks Minn: the package comes from the update service, never from GitHub directly.
| new | __construct(Minn\Ops\Packages $packages, Minn\Http $http = \Minn\Http::__set_state(array( 'within' => array ( ), 'fake' => NULL, 'refusal' => NULL, ))) | |
| method | install(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/legacy-pack/install (floor edit_posts + install_plugins + activate_plugins) | Installs the pack when the site lacks it, and activates it; the pack's state after. |
| inside | release() |
MetaBoxMarkup final class
public/minn/src/Minn/Admin/MetaBoxMarkup.php · 23 lines · Open the class →
A meta box's frame as do_meta_boxes prints it on the reference (probe admin-doubts): a labelled region, its title as a heading the three handle buttons (move up, move down, show or hide) describe, each with its tooltip, then the box's inside, which the caller fills.
| static | open(string $id, string $title, string $classes): string | The box up to the start of its inside: the region, the header with its title, and the handle buttons. |
| inside | button() |
MetaBoxes final class
public/minn/src/Minn/Admin/MetaBoxes.php · 56 lines · Open the class →
One screen's meta boxes as add_meta_box files them on the reference (probe admin-doubts): context => priority => id => box, a removed box kept as false so it stays removed.
| static | add(array $boxes, string $context, string $priority, string $id, array $box): array | The screen's boxes with one filed. The context is made first. A box filed already is taken out of wherever it was, except at "core": a removed box stays removed, one filed at "default" moves to "core" as it was, and any other is left alone. At "sorted" the box keeps its own title, callback and arguments. @param array<string, mixed> $boxes@param array{id: string, title: mixed, callback: mixed, args: mixed} $box@return array<string, mixed> |
| static | remove(array $boxes, string $context, string $id): array | The screen's boxes with one removed from a context: false at every priority, so a later add at "core" leaves it out. @param array<string, mixed> $boxes@return array<string, mixed> |
Notifications final readonly class
public/minn/src/Minn/Admin/Notifications.php · 191 lines · Open the class →
The bell feed: pending and recent comments, translation offers and a newer Minn, and new registrations. Plugin and theme update rows need an extension inventory the engine does not have (a recorded gap); on the reference database those sections are empty, so parity holds by construction.
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities, Minn\Admin\ActivityFeed $feed, Minn\Ops\Updates $updates, Minn\Ops\Releases $releases) | |
| method | items(int $userId): array | The bell feed for a user, newest first, grouped and marked read or unread. |
| method | markRead(int $userId, string $id): void | An id marks one item read; an empty id marks everything read. |
| inside | commentItems(), updateItems(), updateItem(), coreItems(), registrationItems(), commentItem(), translationCount() |
OverviewController final readonly class
public/minn/src/Minn/Admin/OverviewController.php · 140 lines · Open the class →
The Overview of minn-admin/v1: the payload, the drill-down behind one chart bar, and the pick of cards, the person's own and the site's default.
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Admin\Dashboard $dashboard, Minn\Content\Users $users, Minn\Rest\Caller $caller) | |
| method | overview(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/overview (floor edit_posts) | The overview payload. |
| method | overviewActivity(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/overview/activity (floor edit_posts) | The events behind one chart bar. |
| method | setOverviewMetrics(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/overview/metrics (floor edit_posts) | Saves the caller's pick of overview cards. |
| method | setOverviewMetricDefaults(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/overview/metric-defaults (floor edit_posts + manage_options) | Saves the site's default overview cards. |
| inside | metricKeysFrom(), storedMetricLayout(), days(), window(), parameterError() |
PackagesController final readonly class
public/minn/src/Minn/Admin/PackagesController.php · 119 lines · Open the class →
Adding and removing themes and extensions from the Extensions view.
| new | __construct(Minn\Ops\Packages $packages, Minn\Content\Site $site, Minn\Rest\Caller $caller) | |
| method | searchThemes(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/themes/search (floor edit_posts + install_themes) | Searches the theme directory. |
| method | installTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/install (floor edit_posts + install_themes) | Installs a theme from the directory by slug. |
| method | uploadTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/upload (floor edit_posts + install_themes) | Installs a theme from an uploaded zip. |
| method | deleteTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/delete (floor edit_posts + delete_themes) | Deletes an inactive theme. |
| method | uploadPlugin(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/plugins/upload (floor edit_posts + install_plugins) | A plugin zip: a WordPress plugin or a Minn extension. |
| method | installFromUrl(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/plugins/install-url (floor edit_posts + install_plugins) | A zip URL, or a GitHub owner/repo whose latest release carries a zip asset. |
| method | searchPlugins(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/plugins/search (floor edit_posts + install_plugins) | Searches the plugin directory. |
| method | pluginInfo(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/plugins/info (floor edit_posts + install_plugins) | One directory plugin's details. |
| inside | required(), uploaded() |
PostListMarkup final class
public/minn/src/Minn/Admin/PostListMarkup.php · 39 lines · Open the class →
The markup a post list writes beside each post, as the reference writes it (probe placeholders-admin): the states after a title (an em dash, then each state in its span, a comma inside every span but the last), and the hidden fields quick edit reads, one div each, in its order.
| static | states(array $states): string | The states after a post's title, or nothing when it has none. @param array<string|int, string> $states |
| static | inline(int $id, array $post, string $more): string | The quick edit fields: the escaped title and slug, the author, the two discussion statuses, the status, the date in its six parts and the password, then what the caller adds (parent, template, order, terms, sticky, format) unbroken, and the closing tag. @param array{title: string, name: string, author: int, comments: string, pings: string, status: string, date: string, password: string} $post |
PreferencesController final readonly class
public/minn/src/Minn/Admin/PreferencesController.php · 133 lines · Open the class →
A person's own settings in minn-admin/v1: their appearance, the views they hid, and an administrator's reach into another person's, for the user edit page. While Minn Admin runs as code, hiding is the plugin's own routes': only its registry knows the surfaces, editor panels, design sources and slash namespaces its adapters add.
| new | __construct(Minn\Admin\Appearance $appearance, Minn\Admin\HiddenIntegrations $hiddenIntegrations, Minn\Rest\Caller $caller) | |
| method | myAppearance(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/me/appearance (floor edit_posts) | The caller's appearance. |
| method | saveMyAppearance(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/me/appearance (floor edit_posts) | Saves the caller's appearance. |
| method | userAppearance(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/users/{id:\d+}/appearance (cap edit_user on {id}) | A user's appearance, for one who may edit them. |
| method | saveUserAppearance(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/users/{id:\d+}/appearance (cap edit_user on {id}) | Saves a user's appearance. |
| method | hidden(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/users/{id:\d+}/hidden (cap edit_user on {id}) | The target user's restore list, for the user edit page. |
| method | unhideForUser(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/users/{id:\d+}/integrations/unhide (cap edit_user on {id}) | An administrator restores something another person hid; hiding stays that person's own choice. |
| method | hide(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/integrations/hide (floor edit_posts) | Hides a view for the caller. |
| method | unhide(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/integrations/unhide (floor edit_posts) | Shows a view again for the caller. |
| inside | leaveToPlugin(), integrationId(), integrationState(), appearanceBody(), editableUser() |
RenderController final readonly class
public/minn/src/Minn/Admin/RenderController.php · 52 lines · Open the class →
The editor's island previews: block markup rendered by the same renderer the public site uses, with the stylesheets that site loads (the engine's block stylesheet, the theme's, and the theme.json rules) so a preview looks like the page will.
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Posts $posts, Minn\Front\Permalinks $permalinks, Minn\Rest\Caller $caller, string $themesDir) | |
| method | render(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/render-blocks (floor edit_posts) | Renders blocks for the editor's preview. |
| method | editorStyles(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/editor-styles (floor edit_posts) | The stylesheets previews are scoped under: the engine's own, the theme's, and theme.json inline. |
| inside | styles() |
ScreenOptions final class
public/minn/src/Minn/Admin/ScreenOptions.php · 27 lines · Open the class →
Which screen option a save keeps for itself, as set_screen_options tells them apart on the reference (probe admin-doubts): a core list's page size is saved as a number from 1 to 999 without asking any filter; any other option is the plugin's to accept through its filters.
| static | isCore(string $option, Closure $registered): bool | Whether an option is a core list's page size: one of those above, or a name that is a post type or taxonomy once "edit_" and "_per_page" are taken out of it. @param Closure(string): bool $registered whether a post type or taxonomy has that name |
| static | pageSized(string $option): bool | Whether a plugin's option is a page size or the column count, which the general set-screen-option filter is asked about first. |
SessionsController final readonly class
public/minn/src/Minn/Admin/SessionsController.php · 72 lines · Open the class →
A person's sign-in sessions, read from the same session_tokens store the login endpoint writes. Verifiers are the store's keys (the sha256 of each cookie token), so the app can name one without ever seeing the token. Expired rows are skipped, not garbage-collected here.
| new | __construct(Minn\Content\Users $users, Minn\Auth\Sessions $sessions, Minn\Rest\Caller $caller) | |
| method | list(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/users/{id:\d+}/sessions (cap edit_user on {id}) | A user's sessions, the caller's own marked. |
| method | destroyAll(Minn\Http\Request $request, string $id): Minn\Http\ResponseDELETE /minn-admin/v1/users/{id:\d+}/sessions (cap edit_user on {id}) | Signs the person out everywhere; a caller acting on themselves keeps the session they are using. |
| method | destroy(Minn\Http\Request $request, string $id, string $verifier): Minn\Http\ResponseDELETE /minn-admin/v1/users/{id:\d+}/sessions/{verifier:[a-f0-9]{40,64}} (cap edit_user on {id}) | Signs one session out. |
| inside | target() |
SiteController final readonly class
public/minn/src/Minn/Admin/SiteController.php · 90 lines · Open the class →
The small Settings-view routes of minn-admin/v1: the site logo, the permalink structure, the spam queue, and the months the library spans.
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Posts $posts, Minn\Front\Permalinks $permalinks, Minn\Rest\Caller $caller) | |
| method | siteLogo(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/site-logo (floor edit_posts) | The site logo attachment. |
| method | permalinks(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/permalinks (floor edit_posts) | The permalink structure. |
| method | spam(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/spam (floor edit_posts) | The spam settings. |
| method | mediaMonths(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/media/months (floor edit_posts) | The months the library has uploads in. |
| inside | logoUrl() |
SiteHealthTests final class
public/minn/src/Minn/Admin/SiteHealthTests.php · 69 lines · Open the class →
The Site Health screen's tests as the reference lists them (probe blocks-rest-widget-doubts): the direct ones each by its label and the name of the check that runs it, the asynchronous ones by their REST route, with the check to run in their place when the screen runs them directly; through site_status_tests. And the weekly scheduled check.
| static | all(object $health, Closure $route): mixed | Every test, direct and asynchronous, through site_status_tests. @param Closure(string): string $route a test's REST address from its route slug |
| static | scheduleWeeklyCheck(): void | The weekly scheduled check, scheduled a day from now unless it is already. |
StructureController final readonly class
public/minn/src/Minn/Admin/StructureController.php · 159 lines · Open the class →
The Structure view of minn-admin/v1: post types, taxonomies, and the terms switcher, each with its live counts, answered from the registries.
| new | __construct(Minn\Db $db, Minn\Rest\Types $types, Minn\Rest\Taxonomies $taxonomies, Minn\Rest\Caller $caller) | |
| method | termTaxonomies(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/term-taxonomies (floor edit_posts) | The taxonomies of each public type, for the Structure view. |
| method | postTypes(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/post-types (floor edit_posts) | The Structure view's post types: core and site-declared, with their live counts. |
| method | taxonomies(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/taxonomies (floor edit_posts) | Every taxonomy with its counts. |
| inside | stamp(), publicTypes(), termCount(), postCount() |
SubmitButton final class
public/minn/src/Minn/Admin/SubmitButton.php · 37 lines · Open the class →
A settings form's submit input as get_submit_button builds it: "button" and a class for each type (primary, small and large prefixed with "button-", secondary meaning none), the id given among the other attributes or the name, the other attributes escaped one by one (or a string of them as given).
| static | input(string $text, array $types, string $name, array|string $otherAttributes): string | The input element. @param list<string> $types@param array<string, mixed>|string $otherAttributes |
| inside | attr() |
SystemController final readonly class
public/minn/src/Minn/Admin/SystemController.php · 73 lines · Open the class →
The System view: diagnostics, the scheduled-post list, autoloaded options, and the logs.
| new | __construct(Minn\Ops\Diagnostics $diagnostics, Minn\Ops\Logs $logs, Minn\Rest\Caller $caller) | |
| method | system(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/system (cap manage_options) | The System view's payload. |
| method | cron(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/system/cron (cap manage_options) | The scheduled posts. |
| method | autoload(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/system/autoload (cap manage_options) | The autoloaded options. |
| method | config(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/system/config (cap manage_options) | The engine never rewrites wp-config.php; the file is the site's, edited by hand. |
| method | logs(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/system/logs (cap manage_options) | The logs list. |
| method | log(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/system/logs/{id:[a-zA-Z0-9:_.\-]+} (cap manage_options) | One log's tail. |
| method | clearLog(Minn\Http\Request $request, string $id): Minn\Http\ResponseDELETE /minn-admin/v1/system/logs/{id:[a-zA-Z0-9:_.\-]+} (cap manage_options) | Empties one log. |
| method | debugLog(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/system/debug-log (cap manage_options) | The debug log's tail. |
| method | clearDebugLog(Minn\Http\Request $request): Minn\Http\ResponseDELETE /minn-admin/v1/system/debug-log (cap manage_options) | Empties the debug log. |
ThemesController final readonly class
public/minn/src/Minn/Admin/ThemesController.php · 99 lines · Open the class →
The theme inventory of minn-admin/v1: every theme on disk with its headers, screenshot, and update offer, and the switch of the active one.
| new | __construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Ops\Updates $updates, Minn\Rest\Caller $caller, string $contentDir) | |
| method | themes(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/themes (floor edit_posts) | Every theme on disk with the active one marked. |
| method | activateTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/activate (floor edit_posts + switch_themes) | Switches the active theme. |
| inside | themeText(), themeFolders(), screenshot() |
Translations final readonly class
public/minn/src/Minn/Admin/Translations.php · 237 lines · Open the class →
Languages for the admin. A person's locale is their `locale` user meta, else the site's WPLANG, else en_US, exactly as the reference resolves it. The app translates itself from a map of its source strings, read from the JED catalogs Minn Admin's language packs install under wp-content/languages/plugins (the bundle's own languages folder is the fallback). Installing a pack fetches the release asset the bundle's manifest names for that locale, checks its hash, and unpacks only that locale's files, so an eject leaves the files WordPress would have written.
| new | __construct(Minn\Content\Users $users, Minn\Content\Site $site, Minn\Admin\App $app, string $contentDir, Minn\Http $http = \Minn\Http::__set_state(array( 'within' => array ( ), 'fake' => NULL, 'refusal' => NULL, ))) | |
| method | localeOf(int $userId): string | The locale a person reads the admin in. |
| method | siteLocale(): string | The site's locale from WPLANG, en_US by default. |
| static | isRtl(string $locale): bool | Whether a locale reads right to left. |
| method | catalog(string $locale): array | The app's translation map for a locale: source string => translation, or the plural forms as a list. Later folders win, so the installed pack lands over the bundle's fallback. @return array{0: array<string, string|list<string>>, 1: string} map and the Plural-Forms rule |
| method | isInstalled(string $locale): bool | Whether a locale has any files on this site: a core pack or Minn Admin's own. |
| method | installed(): array | The locales with a pack on disk, the two defaults first. @return list<array{0: string, 1: string}> the site-default row, en_US, then every installed locale |
| method | payload(int $forUser): array | The languages route's payload; `current` is the raw meta of the user asked about. |
| method | readOnlyPayload(int $forUser): array | The same payload for a caller who may switch languages but not install one: no available list. |
| method | install(string $locale): bool | Fetches and unpacks Minn Admin's language pack for a locale from the release the bundle's manifest names. True when files were written; false when the manifest offers no pack for the locale. |
| inside | languages(), catalogFiles(), installedCodes(), names(), download() |
UpdatesController final readonly class
public/minn/src/Minn/Admin/UpdatesController.php · 128 lines · Open the class →
The minn-admin/v1 update routes: offers, directory meta, the check, the installs, the auto-update lists.
| new | __construct(Minn\Ops\Updates $updates, Minn\Ops\CoreStatus $core, Minn\Rest\Caller $caller) | |
| method | pluginUpdates(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/plugin-updates (floor edit_posts + update_plugins) | The plugin update offers. |
| method | pluginMeta(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/plugin-meta (floor edit_posts + activate_plugins) | Icons and details for the installed plugins. |
| method | check(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/check-updates (signed in) | Asks the Minn update service again, now: for plugin and theme offers, and for Minn itself (its status answered as core). |
| method | updatePlugin(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/plugins/update (signed in) | Updates one plugin. |
| method | updateAll(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/plugins/update-all (signed in) | Updates every plugin with an offer. |
| method | updateTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/update (signed in) | Updates one theme. |
| method | autoUpdates(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/auto-updates | Turns auto-updates on or off for one asset. |
UploadsSize final readonly class
public/minn/src/Minn/Admin/UploadsSize.php · 93 lines · Open the class →
How much the uploads folder holds, as Minn Admin 0.43 works it out and shares it through the minn_admin_uploads_size transient: the cached figure in either shape it has had ({bytes, partial}, or a bare count from before the budget), else a walk only an administrator may start, one at a time behind a two-minute lock, stopped after four seconds and kept as partial for an hour instead of twelve.
| new | __construct(Minn\Content\Site $site, Minn\Auth\Capabilities $capabilities, string $dir) | |
| method | label(int $userId): string | The Media card's "N used" line, "over N used" for a walk cut short, or "" when the size is not known. |
| method | measure(int $userId): ?array | The uploads size, cached or walked now. @return array{bytes: int, partial: bool}|null null when nothing is known and this caller may not find out |
| inside | cached(), lock(), walk() |
V1Controller final readonly class
public/minn/src/Minn/Admin/V1Controller.php · 80 lines · Open the class →
The boot burst of minn-admin/v1: the bell feed and its read marker, the core status, and the one-round-trip boot-status the app starts from. Every route sits behind the same capability floor (edit_posts) the plugin declares.
| new | __construct(Minn\Db $db, Minn\Admin\Notifications $notifications, Minn\Ops\CoreStatus $core, Minn\Admin\AdminTypes $types, Minn\Rest\Caller $caller) | |
| method | notifications(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/notifications (floor edit_posts) | The bell feed. |
| method | notificationsRead(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/notifications/read (floor edit_posts) | Body {id} marks one read; {} marks all read. |
| method | core(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/core (floor edit_posts) | Minn's version and any newer release; a day-old check of the update service runs once the answer is sent. |
| method | coreUpdate(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/core/update (floor edit_posts + update_core) | Replaces the running engine with the release on offer. |
| method | bootStatus(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/boot-status (floor edit_posts) | The app's one-round-trip boot burst. Absent sections are the contract's own fallback: the client loads a missing section standalone. The engine serves what it can honestly answer and omits the plugin-inventory sections it has no installation for. |
| inside | checkingReleases() |
Nothing matches.