v2.6.5 (Lyra): Dynamische pad-resolutie, WordPress-stijl docblocks, security-fix wachtwoord, git-historie schoon
- Bug: dashboard toonde 0 content (AdminPluginAPI::getContentDir() gaf relatief pad terug zonder normalisatie) - Dynamische pad-resolutie: PluginAPIInterface uitgebreid met getProjectRoot/getContentDir/getPluginsDir/getVersionInfo; CMSAPI en AdminPluginAPI implementeren deze universeel - public/index.php media-serving gebruikt $config['content_dir'] i.p.v. hardcoded /content - Navigation en Logs plugins halen paden via de API i.p.v. hardcoded dirname(__DIR__) - WordPress-stijl docblocks toegevoegd voor alle classes, methods, properties en functies (~450 docblocks, @since 2.6.5) - Security: hardcoded plaintext-wachtwoord 'admin' verwijderd uit AdminAuth.php; bij eerste installatie wordt een cryptografisch veilig wachtwoord gegenereerd (random_bytes, 16 tekens) en eenmalig op het inlogscherm getoond - Security: git-geschiedenis schoongemaakt (admin.json, admin.json.example, admin-console/config/admin.json verwijderd uit alle commits; filter-branch over alle branches + tags, gc --prune --aggressive) - README.md, README.en.md, AGENTS.md bijgewerkt - Test-scripts bijgewerkt naar clean-URL structuur + actuele ARIA-waarden - Versie verhoogd naar 2.6.5 - Tests: pentest 29/29, WCAG 25/25, functioneel 16/16, enhanced 25/25
This commit is contained in:
+32
-32
@@ -6,14 +6,14 @@
|
||||
* Biedt toegang tot de CodePressCMS-instance, pagina-informatie, menu, zoekresultaten,
|
||||
* vertalingen en bestandsoperaties binnen de front-end context.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*/
|
||||
class CMSAPI implements PluginAPIInterface
|
||||
{
|
||||
/**
|
||||
* De CodePressCMS-hoofdinstantie.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
* @var CodePressCMS
|
||||
*/
|
||||
private CodePressCMS $cms;
|
||||
@@ -21,7 +21,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* De front-end PluginManager-instantie, optioneel via setPluginManager geïnjecteerd.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
* @var PluginManager|null
|
||||
*/
|
||||
private ?PluginManager $pluginManager = null;
|
||||
@@ -29,7 +29,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Construeer een CMSAPI-instantie met de opgegeven CodePressCMS.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param CodePressCMS $cms De CodePressCMS-hoofdinstantie.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
* Injecteer de front-end PluginManager zodat content-plugins hun eigen
|
||||
* vertalingen via dezelfde fallback-keten kunnen resolven.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param PluginManager $pm De front-end PluginManager-instantie.
|
||||
* @return void
|
||||
@@ -55,7 +55,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de informatie van de huidige pagina op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<string,mixed> Pagina-informatie van de huidige pagina.
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de titel van de huidige pagina op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string De titel van de huidige pagina, of lege string.
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de inhoud van de huidige pagina op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string De HTML-inhoud van de huidige pagina, of lege string.
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de URL van de huidige pagina op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string De URL van de huidige pagina inclusief query-parameters.
|
||||
*/
|
||||
@@ -107,7 +107,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de menustructuur op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<int,array<string,mixed>> De menustructuur.
|
||||
*/
|
||||
@@ -119,7 +119,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal een configuratiewaarde op via dot-notatie.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $key Configuratie-sleutel in dot-notatie (bijv. 'language.default').
|
||||
* @param mixed $default Standaardwaarde indien de sleutel niet bestaat.
|
||||
@@ -143,7 +143,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de project-rootdirectory op (absoluut, genormaliseerd).
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string Absoluut pad naar de project-root.
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
* De CMS-config lost relatieve content_dir-waarden al op
|
||||
* (zie cms/core/config.php), dus deze wordt as-is teruggegeven.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string Absoluut pad naar de contentdirectory.
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal het pad naar de pluginsdirectory op (absoluut, genormaliseerd).
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string Absoluut pad naar de pluginsdirectory.
|
||||
*/
|
||||
@@ -182,7 +182,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de versie-informatie uit version.php op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<string,mixed> Versie-informatie met minimaal de sleutel 'version'.
|
||||
*/
|
||||
@@ -201,7 +201,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal een vertaling op voor de opgegeven sleutel.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $key Vertaalsleutel.
|
||||
* @return string De vertaalde string, of $key indien niet gevonden.
|
||||
@@ -214,7 +214,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de huidige content-taal op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string De huidige taalcode (bijv. 'nl', 'en').
|
||||
*/
|
||||
@@ -226,7 +226,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Controleer of de gebruiker zich op de homepage bevindt.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien de huidige pagina de default_page is.
|
||||
*/
|
||||
@@ -240,7 +240,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de bestandsinformatie van de huidige pagina op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<string,mixed>|null Bestandsinformatie of null indien niet aanwezig.
|
||||
*/
|
||||
@@ -253,7 +253,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de breadcrumb-HTML op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return string De gegenereerde breadcrumb-HTML.
|
||||
*/
|
||||
@@ -265,7 +265,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Controleer of de contentdirectory inhoud bevat.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien de contentdirectory niet leeg is.
|
||||
*/
|
||||
@@ -277,7 +277,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de zoekresultaten op indien een zoekopdracht actief is.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<int,array<string,mixed>> De zoekresultaten, of een lege array.
|
||||
*/
|
||||
@@ -292,7 +292,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Controleer of momenteel een zoekopdracht wordt uitgevoerd.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien de search-query-parameter aanwezig is.
|
||||
*/
|
||||
@@ -304,7 +304,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de beschikbare talen op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<int,string> Lijst met beschikbare taalcodes.
|
||||
*/
|
||||
@@ -316,7 +316,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Maak een URL voor een pagina.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $page Pagina-identifier.
|
||||
* @param string|null $lang Taalcode; standaard de huidige content-taal.
|
||||
@@ -334,7 +334,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
* Het bestand moet binnen de CMS-directory liggen om willekeurige
|
||||
* file-inclusion te voorkomen.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $filePath Absoluut pad naar het PHP-bestand.
|
||||
* @return string De opgevangen output, of lege string indien ongeldig.
|
||||
@@ -360,7 +360,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal de inhoud op uit een PHP-, HTML- of Markdown-bestand.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $filePath Pad naar het bestand.
|
||||
* @return string De bestandsinhoud (gerenderd indien PHP/Markdown), of lege string.
|
||||
@@ -390,7 +390,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Controleer of een bestand in de contentdirectory bestaat.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $filename Bestandsnaam relatief ten opzichte van de contentdirectory.
|
||||
* @return bool True indien het bestand bestaat.
|
||||
@@ -404,7 +404,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Haal alle content-items (mappen + bestanden) op als lijst met entry-arrays.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<int,array<string,mixed>> Lijst met entries ['path' => ..., 'title' => ..., 'type' => ...].
|
||||
*/
|
||||
@@ -418,7 +418,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
*
|
||||
* Geeft author_name, author_email en created terug uit de pagina-frontmatter.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array<string,string> Auteursmetadata met sleutels: author_name, author_email, created.
|
||||
*/
|
||||
@@ -440,7 +440,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
* (afgehandeld door PluginManager): aangevraagde taal ->
|
||||
* default_language van de plugin -> lege array.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $pluginName Plugin-directorynaam.
|
||||
* @param string|null $lang Override-taal; standaard de huidige content-taal.
|
||||
@@ -458,7 +458,7 @@ class CMSAPI implements PluginAPIInterface
|
||||
/**
|
||||
* Vertaal een enkele sleutel voor een plugin in de front-end context.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $key Vertaalsleutel.
|
||||
* @param string $pluginName Plugin-directorynaam.
|
||||
|
||||
Reference in New Issue
Block a user