Context
flatMark currently handles multilingual behavior via two separate config files (config-basic.php and config-multilang.php).
This works, but it tightly couples core routing and language features, and makes extension harder than necessary.
We want to introduce a lightweight plugin architecture so features can be enabled optionally instead of being hardwired into core behavior.
Goal
Define and implement a minimal plugin system where:
- Core flatMark remains lean and single-language by default
- Multilanguage support is moved into an optional plugin
- Additional features can be added as plugins later
First Milestone
Extract current multilingual logic into a plugin, while preserving existing behavior for multilingual setups.
Open Question
Shortcodes are currently implemented in theme-level functions.php.
It needs to be evaluated## Context
flatMark currently handles multilingual behavior via two separate config files (config-basic.php and config-multilang.php).
This works, but it tightly couples core routing and language features, and makes extension harder than necessary.
We want to introduce a lightweight plugin architecture so features can be enabled optionally instead of being hardwired into core behavior.
Goal
Define and implement a minimal plugin system where:
- Core flatMark remains lean and single-language by default
- Multilanguage support is moved into an optional plugin
- Additional features can be added as plugins later
First Milestone
Extract current multilingual logic into a plugin, while preserving existing behavior for multilingual setups.
Open Question
Shortcodes are currently implemented in theme-level functions.php.
It needs to be evaluated whether shortcodes should:
- stay theme-specific, or
- become an optional plugin (or hybrid model)
This issue includes analysis criteria but does not require shortcode migration yet.
Proposed Architecture (Draft)
Plugin Folder Structure
Optional later:
Minimal Plugin Contract
Each plugin exposes a simple bootstrap entrypoint, for example:
return function (array $context): array {
// read/update request context
return $context;
};
The core decides plugin order and passes a shared context (request URI parts, config, resolved page, metadata hooks, etc.).
Core Integration
- Add plugin loading in
index.php
- Add config key for enabled plugins, e.g.:
$enabledPlugins = ['multilang'];
- If plugin is disabled, core remains single-language
Scope
In Scope
- Define plugin loading mechanism (small and explicit)
- Add
plugins/multilang and move multilingual routing there
- Keep current URLs and behavior compatible with existing multilingual sites
- Document plugin activation in README
- Provide migration notes from
config-multilang.php usage
Out of Scope
- Full shortcode migration to plugins
- Advanced plugin lifecycle/events system
- Dependency manager for plugins
- Backward-compatibility for custom forks that patch internals directly
Acceptance Criteria
Test Plan
Shortcode Evaluation Criteria (Follow-up)
When deciding whether to move shortcodes into plugin(s), evaluate:
- Theming concerns vs content/runtime concerns
- Reusability across themes
- Performance and complexity overhead
- Backward compatibility with existing theme-based shortcodes
Background / Motivation
A plugin-first approach keeps flatMark maintainable and modular:
-
Core stays minimal
-
Features become optional and composable
-
Future extensions (multilang, search, sitemap, shortcodes, etc.) become easier to implement and maintain
whether shortcodes should:
-
stay theme-specific, or
-
become an optional plugin (or hybrid model)
This issue includes analysis criteria but does not require shortcode migration yet.
Proposed Architecture (Draft)
Plugin Folder Structure
Optional later:
Minimal Plugin Contract
Each plugin exposes a simple bootstrap entrypoint, for example:
return function (array $context): array {
// read/update request context
return $context;
};
The core decides plugin order and passes a shared context (request URI parts, config, resolved page, metadata hooks, etc.).
Core Integration
- Add plugin loading in
index.php
- Add config key for enabled plugins, e.g.:
$enabledPlugins = ['multilang'];
- If plugin is disabled, core remains single-language
Scope
In Scope
- Define plugin loading mechanism (small and explicit)
- Add
plugins/multilang and move multilingual routing there
- Keep current URLs and behavior compatible with existing multilingual sites
- Document plugin activation in README
- Provide migration notes from
config-multilang.php usage
Out of Scope
- Full shortcode migration to plugins
- Advanced plugin lifecycle/events system
- Dependency manager for plugins
- Backward-compatibility for custom forks that patch internals directly
Acceptance Criteria
Test Plan
Shortcode Evaluation Criteria (Follow-up)
When deciding whether to move shortcodes into plugin(s), evaluate:
- Theming concerns vs content/runtime concerns
- Reusability across themes
- Performance and complexity overhead
- Backward compatibility with existing theme-based shortcodes
Background / Motivation
A plugin-first approach keeps flatMark maintainable and modular:
- Core stays minimal
- Features become optional and composable
- Future extensions (multilang, search, sitemap, shortcodes, etc.) become easier to implement and maintain
Context
flatMark currently handles multilingual behavior via two separate config files (
config-basic.phpandconfig-multilang.php).This works, but it tightly couples core routing and language features, and makes extension harder than necessary.
We want to introduce a lightweight plugin architecture so features can be enabled optionally instead of being hardwired into core behavior.
Goal
Define and implement a minimal plugin system where:
First Milestone
Extract current multilingual logic into a plugin, while preserving existing behavior for multilingual setups.
Open Question
Shortcodes are currently implemented in theme-level
functions.php.It needs to be evaluated## Context
flatMark currently handles multilingual behavior via two separate config files (
config-basic.phpandconfig-multilang.php).This works, but it tightly couples core routing and language features, and makes extension harder than necessary.
We want to introduce a lightweight plugin architecture so features can be enabled optionally instead of being hardwired into core behavior.
Goal
Define and implement a minimal plugin system where:
First Milestone
Extract current multilingual logic into a plugin, while preserving existing behavior for multilingual setups.
Open Question
Shortcodes are currently implemented in theme-level
functions.php.It needs to be evaluated whether shortcodes should:
This issue includes analysis criteria but does not require shortcode migration yet.
Proposed Architecture (Draft)
Plugin Folder Structure
plugins/multilang/plugin.phpREADME.mdOptional later:
plugins/shortcodes/Minimal Plugin Contract
Each plugin exposes a simple bootstrap entrypoint, for example:
The core decides plugin order and passes a shared context (request URI parts, config, resolved page, metadata hooks, etc.).
Core Integration
index.phpScope
In Scope
plugins/multilangand move multilingual routing thereconfig-multilang.phpusageOut of Scope
Acceptance Criteria
multilangworks as optional pluginTest Plan
multilangenabled:/en/...and/de/...routes resolve correctlyShortcode Evaluation Criteria (Follow-up)
When deciding whether to move shortcodes into plugin(s), evaluate:
Background / Motivation
A plugin-first approach keeps flatMark maintainable and modular:
Core stays minimal
Features become optional and composable
Future extensions (multilang, search, sitemap, shortcodes, etc.) become easier to implement and maintain
whether shortcodes should:
stay theme-specific, or
become an optional plugin (or hybrid model)
This issue includes analysis criteria but does not require shortcode migration yet.
Proposed Architecture (Draft)
Plugin Folder Structure
plugins/multilang/plugin.phpREADME.mdOptional later:
plugins/shortcodes/Minimal Plugin Contract
Each plugin exposes a simple bootstrap entrypoint, for example:
The core decides plugin order and passes a shared context (request URI parts, config, resolved page, metadata hooks, etc.).
Core Integration
index.phpScope
In Scope
plugins/multilangand move multilingual routing thereconfig-multilang.phpusageOut of Scope
Acceptance Criteria
multilangworks as optional pluginTest Plan
multilangenabled:/en/...and/de/...routes resolve correctlyShortcode Evaluation Criteria (Follow-up)
When deciding whether to move shortcodes into plugin(s), evaluate:
Background / Motivation
A plugin-first approach keeps flatMark maintainable and modular: