WebsiteBaker Support (2.12.x) > General Help & Support
Core Web Vitals problem with FCP and LCP
crnogorac081:
--- Quote from: dbs on April 21, 2021, 06:14:54 PM ---We can try another way. Loading a static menu.
Only for testing if this is faster as generating the menu for every page load.
In your index of the template (before DOCTYPE) we define a variable with your menu.
Then we ask if the visitor is logged in or not. If not:
- we give him a static menu
- we create this file in this moment in the WB root
- in your index in the body where the menu is normally called we ask again if the visitor is logged in or not
- if not we give him the static menu else the WB generated menu
I hope you are the admin and there are not many registered users.
If you give me your index i can implement this for testing.
--- End quote ---
This can work too. If you are admin and nobody have permission to change page tree ( add ,delete or reorder menu) you csn echo sm2 call to variable and store it as string. Example
--- Code: ---
$content = '';
if (isset($start) && !empty($start)) {
$iChild = (is_numeric($start) ? $start : PAGE_ID);
$content = show_menu2(SM2_ALLMENU,
$iChild,
SM2_ALL,
SM2_ALL|SM2_ALLINFO|SM2_BUFFER,
'[li]<span class="nav-link">[a][page_title]</a></span>',
false,
'<ul id="servicelinks">');
}
Echo $content;
--- End code ---
Then view source and what is output copy and put it as text ( $content = "...code from source";
And comment code from above with /* */
And whenever you add or change menu decoment code and get new output from source
crnogorac081:
Also performing test on https://forum.WebsiteBaker.org/ url gives score 88 which is pretty bad in my own opinion considering there are basically no images on website
svsanchez:
Hey guys, WOW that is amazing, I'm glad you got more than one excellent idea.
Yes I am the admin and there are ZERO registered users on my 2 big sites, so this should not be a problem.
The way to implement seems easy for a programmer. If I undestood correctly, what Crnogorac is saying is to add this code to my template:
--- Code: ---$content = '';
if (isset($start) && !empty($start)) {
$iChild = (is_numeric($start) ? $start : PAGE_ID);
$content = show_menu2(SM2_ALLMENU,
$iChild,
SM2_ALL,
SM2_ALL|SM2_ALLINFO|SM2_BUFFER,
'[li]<span class="nav-link">[a][page_title]</a></span>',
false,
'<ul id="servicelinks">');
}
Echo $content;
--- End code ---
Then access a page that uses that template and copy the output.
Then, finally, remove the SM2 menus from my template and replace them with the output, in a line that would look like:
$content = "...code from source";
If that's not the way to do it, I would greatly appreciate your help dbs in implementing this, sending you the login credentials via PM?
svsanchez:
Hello everyone, crnogorac081 was very kind to help me test by placing the menu and breadcrumbs directly in the template, without using the SM2 menu. It works, I had grades of 86 on mobile and 92 on desktop, and the server response time issue disappears this way:
https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.deguate.com.gt%2Fguatemala%2Fagricultura%2Ffrutas-y-verduras.php&tab=mobile
BUT, the problem is that I would have to create more than 3000 menus and bredcrumbs to place directly on each of the pages,
Is there a way to generate the Breadcrumbs and Subsection menus DINAMICALLY without causing the server response time issue?
svsanchez:
Upgrading to 2.10, 2.12 or 2.13 WORSENS the Initial Server Response problems on a big WB site.
New install is using WB 2.13.0 r31, with PHP 7.4
Here is the same page of Fruits and Vegetables on the new install, with no ads and NO SM2 menus, working fast:
https://www.deguate4.com/wb/guatemala/agricultura/frutas-y-verduras.php
And here is another page, with no ads but WITH SM2 menus, which is very slow, much slower than the 2.8.3 version.
https://www.deguate4.com/wb/guatemala/agricultura/despulpadoras-en-guatemala.php
With SM2 menus present, the Initial Server Response time goes from about 4 seconds on WB 2.8.3 to 7.5 seconds on WB 2.13.0
OTHER PROBLEMS WITH 2.13.0
As some of you know, I had already tried to upgrade a few times, but the front-end became slower and the back-end unusable (having to wait more than a minute when you click on PAGES and the SETTINGS showing an internal server error). I was able to work on the back-end with a /admin/pages/index.php file made by Ruud many years ago, which fortunately still works on WB 2.13.0, BUT the front-end is still to slow and the SETTINGS page still gives an internal server error.
I have several other sites on that same server using WB 2.10.x, WB 2.12.x, and WB 2.13.0 without issues. It is only when the site is big that all these problems occur.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version