As titles states - loading main page as not logged in can be very slow - depending how fast GitHub answers 404 ;')
index.php includes header.php that includes functions.php that includes cache_handler.php and that one tries to load pokemonNames/itemNames. Only problem is both local and remote uses $locale as part of path and because $locale is empty it's testing non-existing files and then trying to download non-existed files (fe. fopen(https://raw.githubusercontent.com/WatWowMap/pogo-translations/master/static/englishRef/pokemon_.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found)
Possible solutions:
Set $_SESSION['locale'] for not logged in users as default (?) one?
Force $locale as "en" if empty in cache_handler.php?
Don't include cache_handler.php at all if user not logged in - is there anything need to render main login page?
Are there other parts of code depending on not set at all $_SESSION['locale']?
As titles states - loading main page as not logged in can be very slow - depending how fast GitHub answers 404 ;')
index.php
includesheader.php
that includesfunctions.php
that includescache_handler.php
and that one tries to load pokemonNames/itemNames. Only problem is both local and remote uses$locale
as part of path and because$locale
is empty it's testing non-existing files and then trying to download non-existed files (fe.fopen(https://raw.githubusercontent.com/WatWowMap/pogo-translations/master/static/englishRef/pokemon_.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
)$locale
is get via session$locale = @$_SESSION['locale'];
and set in set_locale() https://github.com/bbdoc/PoracleWeb/blob/ed58d43b3617de6864faa088c8cfba01a198ee7e/include/functions.php#L316-L331 but only if$_SESSION['id']
exists - so not logged in users will have no locales at all.Possible solutions: Set
$_SESSION['locale']
for not logged in users as default (?) one? Force$locale
as "en" if empty incache_handler.php
? Don't includecache_handler.php
at all if user not logged in - is there anything need to render main login page?Are there other parts of code depending on not set at all
$_SESSION['locale']
?