From 06ddd768aaa3c68acbca2b96323ce0a12ab4dda5 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 28 Nov 2025 18:39:48 +0200 Subject: [PATCH] Adds plugin asset page --- app/pages/plugin-asset.php | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 app/pages/plugin-asset.php diff --git a/app/pages/plugin-asset.php b/app/pages/plugin-asset.php new file mode 100644 index 0000000..8ee1091 --- /dev/null +++ b/app/pages/plugin-asset.php @@ -0,0 +1,74 @@ + 'text/css', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'png' => 'image/png', + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'svg' => 'image/svg+xml', + 'webp' => 'image/webp', + 'woff' => 'font/woff', + 'woff2'=> 'font/woff2', + 'ttf' => 'font/ttf', + 'eot' => 'application/vnd.ms-fontobject' +]; + +header('Content-Type: ' . ($contentTypes[$extension] ?? 'application/octet-stream')); +header('Content-Length: ' . filesize($fullPath)); +header('Cache-Control: public, max-age=86400'); +header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); + +readfile($fullPath);