Auto commit: 2026-01-27T15:58:05.956Z

This commit is contained in:
Flatlogic Bot 2026-01-27 15:58:05 +00:00
parent 4b40c1c287
commit bf2e9c972b
36 changed files with 101 additions and 16 deletions

View File

@ -1,18 +1,11 @@
DirectoryIndex index.php index.html # BEGIN WordPress
Options -Indexes <IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# 0) Serve existing files/directories as-is RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME} !-f
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 ^(.+)/$ $1 [R=301,L] RewriteRule . /index.php [L]
</IfModule>
# END WordPress

4
admin_credentials.txt Normal file
View File

@ -0,0 +1,4 @@
WordPress Admin Credentials:
URL: http://localhost/wp-admin
Username: admin
Password: Gmm5nFA2tmEtX6A5

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

25
includes/pexels.php Normal file
View File

@ -0,0 +1,25 @@
<?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;
}

View File

@ -0,0 +1,63 @@
<?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 );