Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
25
.htaccess
@ -1,11 +1,18 @@
|
|||||||
# BEGIN WordPress
|
DirectoryIndex index.php index.html
|
||||||
<IfModule mod_rewrite.c>
|
Options -Indexes
|
||||||
|
Options -MultiViews
|
||||||
|
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
||||||
RewriteBase /
|
# 0) Serve existing files/directories as-is
|
||||||
RewriteRule ^index\.php$ - [L]
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
RewriteRule ^ - [L]
|
||||||
|
|
||||||
|
# 1) Internal map: /page or /page/ -> /page.php (if such PHP file exists)
|
||||||
|
RewriteCond %{REQUEST_FILENAME}.php -f
|
||||||
|
RewriteRule ^(.+?)/?$ $1.php [L]
|
||||||
|
|
||||||
|
# 2) Optional: strip trailing slash for non-directories (keeps .php links working)
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule . /index.php [L]
|
RewriteRule ^(.+)/$ $1 [R=301,L]
|
||||||
</IfModule>
|
|
||||||
# END WordPress
|
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
WordPress Admin Credentials:
|
|
||||||
URL: http://localhost/wp-admin
|
|
||||||
Username: admin
|
|
||||||
Password: Gmm5nFA2tmEtX6A5
|
|
||||||
|
Before Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 431 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 82 KiB |
@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
function pexels_key() {
|
|
||||||
$k = getenv('PEXELS_KEY');
|
|
||||||
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
|
|
||||||
}
|
|
||||||
function pexels_get($url) {
|
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt_array($ch, [
|
|
||||||
CURLOPT_URL => $url,
|
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
|
|
||||||
CURLOPT_TIMEOUT => 15,
|
|
||||||
]);
|
|
||||||
$resp = curl_exec($ch);
|
|
||||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
||||||
curl_close($ch);
|
|
||||||
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
function download_to($srcUrl, $destPath) {
|
|
||||||
$data = file_get_contents($srcUrl);
|
|
||||||
if ($data === false) return false;
|
|
||||||
if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true);
|
|
||||||
return file_put_contents($destPath, $data) !== false;
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Plugin Name: Flatlogic URL Preserver
|
|
||||||
* Description: Automatically attaches fl_project to all links on the page.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
||||||
|
|
||||||
// Function to fetch the ID once per request
|
|
||||||
function fl_get_env_project_id() {
|
|
||||||
static $cached_id = null;
|
|
||||||
if ($cached_id !== null) return $cached_id;
|
|
||||||
|
|
||||||
$cached_id = getenv('PROJECT_ID');
|
|
||||||
|
|
||||||
if (!$cached_id) {
|
|
||||||
$envPath = ABSPATH . '../.env';
|
|
||||||
if (file_exists($envPath)) {
|
|
||||||
$lines = file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
|
||||||
foreach ($lines as $line) {
|
|
||||||
if (strpos(trim($line), 'PROJECT_ID=') === 0) {
|
|
||||||
$cached_id = trim(str_replace('PROJECT_ID=', '', $line), "\"' ");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $cached_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The core function to modify the URL
|
|
||||||
function fl_append_project_param( $url ) {
|
|
||||||
$pid = fl_get_env_project_id();
|
|
||||||
if ( ! $pid || empty( $url ) || strpos( $url, '#' ) === 0 ) {
|
|
||||||
return $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only append if it's an internal link
|
|
||||||
if ( strpos( $url, home_url() ) === 0 || ( strpos( $url, '/' ) === 0 && strpos( $url, '//' ) !== 0 ) ) {
|
|
||||||
return add_query_arg( 'fl_project', $pid, $url );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply to all link filters
|
|
||||||
$filters = [
|
|
||||||
'post_link', 'page_link', 'post_type_link',
|
|
||||||
'term_link', 'attachment_link',
|
|
||||||
'author_link', 'category_link', 'tag_link'
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ( $filters as $f ) {
|
|
||||||
add_filter( $f, 'fl_append_project_param' );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Special case: Navigation Menus
|
|
||||||
add_filter( 'nav_menu_link_attributes', function( $atts ) {
|
|
||||||
if ( isset( $atts['href'] ) ) {
|
|
||||||
$atts['href'] = fl_append_project_param( $atts['href'] );
|
|
||||||
}
|
|
||||||
return $atts;
|
|
||||||
}, 10, 1 );
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Twenty Twenty-Five Child functions and definitions
|
|
||||||
*/
|
|
||||||
|
|
||||||
function twentytwentyfive_child_enqueue_styles() {
|
|
||||||
// Enqueue parent styles
|
|
||||||
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
|
|
||||||
|
|
||||||
// Enqueue child styles
|
|
||||||
wp_enqueue_style('child-style', get_stylesheet_uri(), ['parent-style'], wp_get_theme()->get('Version'));
|
|
||||||
|
|
||||||
// Enqueue dark mode JS
|
|
||||||
wp_enqueue_script('dark-mode-toggle', get_stylesheet_directory_uri() . '/js/dark-mode.js', [], '1.0.0', true);
|
|
||||||
}
|
|
||||||
add_action('wp_enqueue_scripts', 'twentytwentyfive_child_enqueue_styles');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a dark mode toggle to the site footer or header.
|
|
||||||
* We'll use a hook to inject the button.
|
|
||||||
*/
|
|
||||||
function twentytwentyfive_child_add_toggle() {
|
|
||||||
?>
|
|
||||||
<button id="dark-mode-toggle-btn" class="dark-mode-toggle" aria-label="Toggle Dark Mode">
|
|
||||||
<span class="sun">☀️</span>
|
|
||||||
<span class="moon">🌙</span>
|
|
||||||
</button>
|
|
||||||
<style>
|
|
||||||
.dark-mode-toggle {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 20px;
|
|
||||||
right: 20px;
|
|
||||||
background: var(--wp--preset--color--contrast);
|
|
||||||
color: var(--wp--preset--color--base);
|
|
||||||
border: none;
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
||||||
z-index: 9999;
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
}
|
|
||||||
.dark-mode-toggle:hover {
|
|
||||||
transform: scale(1.1);
|
|
||||||
}
|
|
||||||
.dark-mode-toggle .moon { display: none; }
|
|
||||||
body.is-dark-theme .dark-mode-toggle .sun { display: none; }
|
|
||||||
body.is-dark-theme .dark-mode-toggle .moon { display: block; }
|
|
||||||
</style>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
add_action('wp_footer', 'twentytwentyfive_child_add_toggle');
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
(function() {
|
|
||||||
const toggleBtn = document.getElementById('dark-mode-toggle-btn');
|
|
||||||
const body = document.body;
|
|
||||||
const storageKey = 'twentytwentyfive-dark-mode';
|
|
||||||
|
|
||||||
// Check for saved preference or default to enabled
|
|
||||||
if (localStorage.getItem(storageKey) === 'enabled' || localStorage.getItem(storageKey) === null) {
|
|
||||||
body.classList.add('is-dark-theme');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toggleBtn) {
|
|
||||||
toggleBtn.addEventListener('click', function() {
|
|
||||||
body.classList.toggle('is-dark-theme');
|
|
||||||
|
|
||||||
if (body.classList.contains('is-dark-theme')) {
|
|
||||||
localStorage.setItem(storageKey, 'enabled');
|
|
||||||
} else {
|
|
||||||
localStorage.setItem(storageKey, 'disabled');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
Theme Name: Twenty Twenty-Five Child
|
|
||||||
Theme URI: https://healthfitnesswealth.com
|
|
||||||
Description: A child theme for Twenty Twenty-Five with dark mode support.
|
|
||||||
Author: Flatlogic
|
|
||||||
Template: twentytwentyfive
|
|
||||||
Version: 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Dark Mode Overrides */
|
|
||||||
body.is-dark-theme {
|
|
||||||
--wp--preset--color--base: #0a0a0a !important;
|
|
||||||
--wp--preset--color--contrast: #ffffff !important;
|
|
||||||
--wp--preset--color--accent-1: #1a1a1a !important;
|
|
||||||
--wp--preset--color--accent-2: #222222 !important;
|
|
||||||
--wp--preset--color--accent-3: #2a2a2a !important;
|
|
||||||
--wp--preset--color--accent-4: #bbbbbb !important;
|
|
||||||
--wp--preset--color--accent-5: #eeeeee !important;
|
|
||||||
--wp--preset--color--accent-6: rgba(255, 255, 255, 0.2) !important;
|
|
||||||
|
|
||||||
background-color: var(--wp--preset--color--base);
|
|
||||||
color: var(--wp--preset--color--contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-dark-theme img {
|
|
||||||
filter: brightness(.8) contrast(1.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-dark-theme .wp-block-button__link {
|
|
||||||
background-color: var(--wp--preset--color--contrast) !important;
|
|
||||||
color: var(--wp--preset--color--base) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-dark-theme .wp-block-social-links {
|
|
||||||
--wp--preset--color--contrast: #ffffff;
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"settings": {
|
|
||||||
"color": {
|
|
||||||
"palette": [
|
|
||||||
{
|
|
||||||
"color": "#ffffff",
|
|
||||||
"name": "Base",
|
|
||||||
"slug": "base"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "#111111",
|
|
||||||
"name": "Contrast",
|
|
||||||
"slug": "contrast"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "#f5f5f5",
|
|
||||||
"name": "Accent 1",
|
|
||||||
"slug": "accent-1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "#eeeeee",
|
|
||||||
"name": "Accent 2",
|
|
||||||
"slug": "accent-2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "#0073aa",
|
|
||||||
"name": "Accent 3",
|
|
||||||
"slug": "accent-3"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"typography": {
|
|
||||||
"fontFamilies": [
|
|
||||||
{
|
|
||||||
"fontFamily": "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif",
|
|
||||||
"name": "System Sans-serif",
|
|
||||||
"slug": "system-sans-serif"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"styles": {
|
|
||||||
"color": {
|
|
||||||
"background": "var(--wp--preset--color--base)",
|
|
||||||
"text": "var(--wp--preset--color--contrast)"
|
|
||||||
},
|
|
||||||
"elements": {
|
|
||||||
"link": {
|
|
||||||
"color": {
|
|
||||||
"text": "var(--wp--preset--color--accent-3)"
|
|
||||||
},
|
|
||||||
":hover": {
|
|
||||||
"color": {
|
|
||||||
"text": "var(--wp--preset--color--contrast)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||