Журнал изменений
Updates the documentation to match the implemented theme consolidation, hardened validation suite, and SEO semantics work.
Core changes:
- Templates guide (docs/TEMPLATES.md):
Independent theme packages: no cross-theme includes, assets, fallback, or shared files; matching filenames stay theme-local
div variant contract: is_searchbox, is_menu_grid, branch order, and the untouched generic content/rows modes
- Theme-local asset URLs via the explicitly passed theme variable
- Test guide (docs/TESTS.md):
Theme independence audits, non-zero reference counters, and the mixed-separator regression cases
- Theme-aware CSS usage audit and its informational unused report
- CSS token-stream verification and browser route matrices
- SEO HTTP audit workflow
Reference docs (docs/ARCHITECTURE.md, docs/PARSER.md, docs/EDITORS.md, docs/VERSIONS.md):
- Aligned with the SEO pipeline helpers and current template flow
Benefits:
- Documentation matches the shipped code and test suite
- Future theme work has explicit contracts to follow
Technical notes:
- Documentation only; no runtime changes
Adds a safe server-side SEO pipeline that builds titles, meta, Open Graph, JSON-LD structured data, and breadcrumb trails from explicit page facts across all frontend modules.
Core changes:
SEO core (core/system.php, core/helpers.php, core/security.php, core/user.php, core/classes/parser.php):
filterSeoText, getSeoTitle, getSeoJson/getSeoJsonItems, setSeoJsonVars, getSeoGraph, getSeoSchema, and getSeoBreadcrumbSchema build normalized, safely encoded head data
Structured data is re-encoded from decoded values, never rendered as raw template strings
Module coverage (modules/*, admin/modules/config.php, index.php, config/global.php):
Frontend modules pass explicit titles, descriptions, and schema facts through setHead
Legacy hardcoded JSON-LD template blocks removed from the default config; stale social profile link dropped
Templates (templates/lite fragments and partials, templates/admin/fragments/head-title.html, templates/lite/fragments/head-title.html):
Dedicated head-title fragment and semantic markup adjustments for cards, tables, titles, navigation, and category views
- Language constants (lang/.php, admin/lang/.php):
- SEO-related constants synchronized across all six languages
Verification (tests/SeoSemanticsValidationTest.php, tools/seo-audit.php, tests/Unit/ParserFixturesTest.php, tests/Unit/ViewBridgeSmokeTest.php, tests/Unit/PasswordHashTest.php, phpstan.neon, setup/index.php):
New semantics validation suite and a curl-based CLI audit for route-level schema types and indexability
- Minor code style cleanup applied by php-cs-fixer
Benefits:
Search engines receive consistent, escaped structured data built from one pipeline instead of per-template JSON strings
- Route matrix is auditable via tools/seo-audit.php
Technical notes:
JSON-LD encoding strips HTML-significant characters to keep script contexts safe
- Backward compatible: no routes, database, or module APIs changed
Applies the shared formatting conventions to the lite stylesheets and merges proven duplicate adjacent rules, keeping computed styles and cascade order intact.
Core changes:
- Formatting (templates/lite/assets/css/base.css, theme.css):
2-space indentation, one property per line, normalized section comments
Data URI lines kept atomic; no reordering of sections or responsive blocks
- Consolidation:
- Adjacent equivalent rules merged within one at-rule context
Six classes (sl-b-i-1..4, sl-b-icon, sl-big-sl-icons) removed together with their sl-advantage markup; zero source references remain
Benefits:
- Consistent stylesheet layout aligned with the admin theme process
- Dead advantage-section styles no longer ship to every page
Technical notes:
- Theme-aware usage audit reports 441 defined classes for lite
- Seasonal, parser, gallery, and JS state classes preserved
- No custom property values synchronized with the admin theme
Replaces the block-list-item fragment with a composition of the existing link and list-item fragments and removes the unused lite searchbox partial.
BREAKING: templates/lite/partials/searchbox.html is removed. External modules that rendered this partial by name must ship their own template. Removal confirmed by the project owner.
Core changes:
Block emitters (blocks/pages.php, news.php, faq.php, jokes.php, auto_links.php, files.php):
Build the anchor via getHtmlFrag('link') with escaped href, title, and label
- Wrap it as trusted content_html in getHtmlFrag('list-item')
auto_links uses the semantic is_blank flag instead of a raw target_attr string, which also adds rel="noopener noreferrer"
- Fragment removal (templates/lite/fragments/block-list-item.html):
- Deleted after zero-reference search across PHP and HTML
Benefits:
- One fragment contract for links instead of a parallel copy
- Stronger target security for external auto_links entries
Technical notes:
List markup of all six blocks verified; escaping boundaries unchanged
- No admin files touched by this change
Removes the hardcoded templates/lite image paths from the main slider so a replacement frontend theme resolves its own slide assets.
Core changes:
- Slider partial (templates/lite/partials/main-slider.html):
- Four slide image URLs now use templates/{{ theme }}/images/slide/
- Filenames, alt texts, and dimensions unchanged
- Emitter (modules/main/index.php):
Pass 'theme' => getTheme() and is_home explicitly to the partial
- getHtmlPart() only receives the passed data array and does not
inject page-level variables
Benefits:
- Theme replacement no longer breaks slider image URLs
- Runtime HTML no longer hardcodes its own theme directory
Technical notes:
- All four slide URLs verified HTTP 200 on the live page
- Guarded by the new hardcoded-theme-path test assertion
Reformats the admin theme stylesheets to the shared conventions and merges proven duplicate adjacent rules without changing any computed style.
Core changes:
- Formatting (templates/admin/assets/css/base.css, theme.css):
2-space indentation, one property per line, one blank line between blocks
- Section comments normalized to the / Name: scope / shape
- No rule reordering, no selector or value changes
- Consolidation:
Adjacent rules with identical declaration sets merged within the same at-rule context only
- No moves between base.css and theme.css, no cross-media merges
Benefits:
- Consistent, diff-friendly stylesheet layout
- Fewer duplicate declarations with cascade behavior preserved
Technical notes:
Theme-aware usage audit reports 361 defined classes, 8 static-only unknowns kept as informational
- No property values or selectors removed without emitter evidence
Replaces the single-purpose menu-grid and searchbox partials with semantic variants of the existing admin div partial while keeping the rendered DOM and CSS classes identical.
Core changes:
- Variant branches (templates/admin/partials/div.html):
Branch order: is_searchbox, is_menu_grid, generic content_html, generic rows
- is_searchbox renders sl-searchbox only for non-empty trusted
content_html; empty input renders nothing
- is_menu_grid always renders the sl-menu-grid wrapper, matching
the removed menu-grid partial
Existing generic content and rows/sl-div-grid contracts are untouched
- Call-site migration:
- 2 menu-grid calls in admin/index.php
17 searchbox calls across 11 admin PHP files migrated to div + is_searchbox with renderer-produced content_html
menu-grid.html and searchbox.html removed after zero-reference search; the dead rows_html slot of menu-grid was not carried over
- Bridge tests (tests/Unit/AdminSearchboxBridgeFlowTest.php):
Cover happy path, missing theme, raw trusted markup, empty content, empty and filled menu grid, and regression of both generic div modes
Benefits:
- Two fewer single-purpose partials without any DOM change
- PHP keeps passing semantic flags instead of CSS class strings
Technical notes:
- No visual or route changes; dashboard and module list DOM verified
- Backward compatible: same classes and wrappers are emitted
Fixes the Windows path defect that silently turned the template reference scan into a no-op and replaces cross-theme byte-equality checks with per-theme runtime contracts.
Core changes:
- Reference validator hardening (tests/TemplateValidationTest.php):
Normalize base path and file paths to forward slashes before computing repository-relative paths
- Mixed Windows/POSIX separators previously left absolute paths,
so anchored patterns matched nothing and zero references were
checked while the test stayed green
Require non-zero counters for found, classified, and include/extends/component references
Discover installed frontend themes dynamically instead of the hardcoded default/simple/lite list
Forbid cross-theme includes, cross-theme asset references, hardcoded own-theme directory paths, and symbolic links
Drop testSharedFrontendFragmentsStayInSyncAcrossThemes in favor of testThemeRuntimeContractsAreIndependent
- Theme-aware CSS usage audit (tests/Unit/AdminCssClassUsageTest.php):
- Report admin and lite independently
Scan theme HTML, theme hooks, PHP emitters, and shared JS state classes so chart, sort, and seasonal classes are no longer false positives
Keep the unused list informational; removal still requires a full emitter audit
Benefits:
The reference scan now actually validates template targets on Windows and POSIX alike
- Themes can evolve independently without byte-equality coupling
Technical notes:
Regression cases cover mixed-separator paths and emitter classification
- No runtime code changed in this commit
The reserved .sl-but-red button variant gets its first consumer: form submits that destroy data render red, while inline delete links keep their DelCheck-confirmed link styling as agreed.
Core changes:
- Button fragment (templates/admin/fragments/button.html):
New is_danger semantic flag maps to sl-but-red in both the button and input variants
- Search admin (modules/search/admin/index.php):
The search-index clear form (the only destructive form submit in the admin, verified by scanning hidden op values and form action URLs) passes is_danger
Benefits:
- Destructive submits are visually distinct from save/confirm actions
- The variant contract is a semantic flag; PHP passes no CSS classes
Technical notes:
- Intended visible change confined to the search index clear form
- Verified live: the submit renders the danger gradient; php -l clean
Four selectors opened two separate blocks each with complementary declarations, hiding half of a component's styling from the reader: the header login dropdown form (base block + arrow variable) and three mobile rules split across the max-width 900px section.
Core changes:
- Login dropdown (templates/lite/assets/css/theme.css):
- Arrow colour variable folded into the main dropdown-form block
- Mobile section (templates/lite/assets/css/theme.css):
- #hmenu overflow and padding blocks merged
- .sl-top-right flex and margin blocks merged
- #demo-line .sl-d-pane layout and margin blocks merged
Benefits:
- One block per selector; all declarations visible in one place
Technical notes:
Declaration relocation only, nothing dropped; verified by rendering the affected components under the pre-merge and merged CSS at 1280px and 800px viewports - computed styles identical