Dev #12

Merged
LordSchmackes merged 2 commits from dev into main 2026-05-24 07:35:31 +00:00
LordSchmackes commented 2026-05-24 07:33:39 +00:00 (Migrated from github.com)
No description provided.
github-actions[bot] (Migrated from github.com) reviewed 2026-05-24 07:34:03 +00:00
github-actions[bot] (Migrated from github.com) left a comment

gemini-code-review-action comments

gemini-code-review-action comments
@@ -2,2 +2,4 @@
$pageTitle = $pageTitle ?? 'FlixCooks | Food Blog & Recipes';
$description = $description ?? 'Seasonal recipes, tested tips, and approachable cooking for busy weeknights.';
$assetVersion = static function (string $assetPath): string {
$absolutePath = dirname(__DIR__) . '/' . ltrim($assetPath, '/');
github-actions[bot] (Migrated from github.com) commented 2026-05-24 07:34:04 +00:00

Using dirname(__DIR__) assumes a fixed directory structure relative to the current file. If partials/head.php is moved or included from a different directory, this path calculation will break. Consider using a more robust method for determining the document root or asset base path, such as a global configuration variable or a framework helper if one is available.

Using `dirname(__DIR__)` assumes a fixed directory structure relative to the current file. If `partials/head.php` is moved or included from a different directory, this path calculation will break. Consider using a more robust method for determining the document root or asset base path, such as a global configuration variable or a framework helper if one is available.
@@ -3,1 +3,4 @@
$description = $description ?? 'Seasonal recipes, tested tips, and approachable cooking for busy weeknights.';
$assetVersion = static function (string $assetPath): string {
$absolutePath = dirname(__DIR__) . '/' . ltrim($assetPath, '/');
return is_file($absolutePath) ? (string) filemtime($absolutePath) : '1';
github-actions[bot] (Migrated from github.com) commented 2026-05-24 07:34:04 +00:00

Returning a hardcoded '1' when the file doesn't exist might lead to incorrect caching behavior. If the asset is expected but not found, it could be better to throw an exception or return a specific error indicator to make the issue more apparent during development and prevent potential security issues if the default '1' is misinterpreted as a valid version.

Returning a hardcoded `'1'` when the file doesn't exist might lead to incorrect caching behavior. If the asset is expected but not found, it could be better to throw an exception or return a specific error indicator to make the issue more apparent during development and prevent potential security issues if the default '1' is misinterpreted as a valid version.
github-actions[bot] (Migrated from github.com) commented 2026-05-24 07:34:04 +00:00

This line introduces cache busting for the CSS file using a version parameter. This is a good practice to ensure users get the latest version of the stylesheet after updates. The use of e() suggests proper escaping, which is also good.

This line introduces cache busting for the CSS file using a version parameter. This is a good practice to ensure users get the latest version of the stylesheet after updates. The use of `e()` suggests proper escaping, which is also good.
@@ -4,0 +4,4 @@
$assetVersion = static function (string $assetPath): string {
$absolutePath = dirname(__DIR__) . '/' . ltrim($assetPath, '/');
return is_file($absolutePath) ? (string) filemtime($absolutePath) : '1';
};
github-actions[bot] (Migrated from github.com) commented 2026-05-24 07:34:04 +00:00

Similar to the CSS, this line implements cache busting for the JavaScript file. This is beneficial for ensuring that users download the most recent version of the script, preventing potential issues with outdated cached files.

Similar to the CSS, this line implements cache busting for the JavaScript file. This is beneficial for ensuring that users download the most recent version of the script, preventing potential issues with outdated cached files.
Sign in to join this conversation.