Core Web Vitals problem with FCP and LCP


crnogorac081

Next week I will be able to look again.
Web developer

svsanchez

Hello, dbs and crnogorac081

Unfortunatelly I wasn't lucky with the programmers from Fiverr, not sure if they are too busy or couldn't do it. I was wondering if you had a chance to try this?


hgs

At
    WebsiteBaker Community Forum "
    Profile of xxx "
    Design & Layout
Can you set that new posts are always displayed on top, then you will never miss a new post again?
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

svsanchez

Hello dbs, I'm so sorry to answer until now, I hadn't noticed that the thread now has 2 pages and your message is on the second page :-o

Yes, that is how my main site's CMS works, it creates a menu and breadcrumb file for each category / subcategory.

These sites are an extension of my main site, so I would like to keep them as close as possible in appearance, so the breadcrumbs is an important element for me. Of course, only showing the categories / subcategories and not the actual page.

Taking into account all the main categories plus the subcategories / sub-subcategories, there would be about 300 breadcrumb / menu files on the Directory site and about 350 on the Geography site.

Regarding the deletion / moving of pages, a "Regenerate menus" and "Regenerate breadcrumbs" URL would suffice.

dbs

That's what i wanted to do.
Creating a file with the output from sm2.
For mainmenu it could be menu.html|php|whatever
For breadcrumb we use the page_id in the filename bread123.html
For submenu maybe sub123.html

In your index you include
menu.html
bread<?php echo page_id; ?>.html
sub<?php echo page_id; ?>.html
If you add or delete a page you need a button for new generating a menu.

Are you sure you need the breadcrumb and submenu also as static file?
Maybe only the main menu is the lame duck.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

svsanchez

Hello, maybe this could be a solution: my main site has more than 150,000 pages, each one of them has a breadcrumbs and a menu just like my WB sites.

This site is built with a very old CMS, which generates a static page for each article, as well as a static breadcrumb and a static menu and sub menu for each category.

So I was wondering if there was a way to generate the breadcrumbs and menus / sub menus as static pages that could be included via PHP INCLUDE on each page, it would eliminate the need of querying the DB to create the menus each time a page is accessed. Instead, the menus and breadcrumbs could be generated by calling the "GENERATE MENUS AND BREADCRUMBS" function.

Does that make sense on WB? I will look for a programmer on Fiverr to do this, but would like to know if you think it's feasible, and what you think that I should tell the programmer for this to work?

svsanchez

Hello crnogorac081 and dbs,

1) MENU ARRAY: could you help me with that coding? I understand what you are asking but I simply don't know how to do it.  :roll:

2) The sites have NO registered users (the only user is admin) so no problem with that new security function. Plus, I am still using WB 2.8.3 but if this works I would be glad to finally be able to upgrade 2.13!  8-)

3) 3000 SUBMENUS: My first site has 42 Categories, but many of those categories have Subcategories and sub-subcategories, so I think there could be about 200-300 different menus. The second site though is a geography site for Guatemala and is divided in Departments (States) then Municipalities (Counties), then each municipality has it's own sub menu to display it's history, geography, population, etc... In this case there would be about 400 menus! :-o

Then, there's the Breadcrumbs which of course there is one for each page so more than 3,000+ for each site  :|.


crnogorac081

Quote from: dbs on April 22, 2021, 11:49:33 PM
From the developer: the menu function has security changes since 2.10.
Unfortunately i can't say more.
Yes I totally forgot about this! My code may work only if you dont have registered users and pages for their eyes only but all pages are for visible for all (non logged in visitors)
Web developer

dbs

From the developer: the menu function has security changes since 2.10.
Unfortunately i can't say more.

Is it right you need for all 3000 pages a different submenu?
My try for a solution is a static main menu for visitors in a menu.html. This html will be generated new if a new page is found in the database.
Maybe the same can be done for the submenu.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

crnogorac081

#21
Yes ,placing raw output from one page is just for testing, so we have now starting point. There is a problem because on every page there is set specific page as active menu item and active breadcrumb.

This is my idea how to solve this example
At the beginning of the template file make database query to populate array. After doing this put this array to variable, for use, and do not do database query except when Pages change.

[1] => Array
    (
        [title] => Page id 1
        [url] => www...
        [children] => Array
            (
                [2] => Array...

Then every time on page load use this array variable ( and not db query) to feed two functions
Menu( $array, $current_page_id)
Breadcrumb ( $array, $current_page_id)
To generate menu and breadcrumbs but to highlight current menu item (page where you are)

Now is needed to make array and these two functions.
Web developer

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.

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

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:

$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;


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?

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
Web developer

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.

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



$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;

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
Web developer

crnogorac081

I was testing some of my websites with very good ranking position based on seo ,and they have score around 50 in this page speed test.

What could be done regarding menu is to make one db query that would extract page tree into array at the top of template's index.php file, and then later to use it to generate menu /breadcrumbs/ sitemap
Web developer

dbs

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.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

svsanchez

Hello Crnogorac081

QuoteBy making these pages faster will not rank your website better.

You are not correct Crnogorac081, Google takes into account the speed of the sites as a ranking factor, and starting in May, this will be a very important factor determining the position of your pages. They will be using something they call CORE WEB VITALS (CWV), and in fact Google's John Mueller just said that now was the time to learn to fix the Core Web Vitals as doing so would mean you can make a lot of money as an SEO specialist, due to all the site owners scrambling to make their sites faster to regain their lost SERPs when the CWV update starts in May.

You can read more about Core Web Vitals here: https://www.internetx.com/en/news-detailview/core-web-vitals-as-ranking-factor/#:~:text=Core%20Web%20Vitals%20will%20become,for%20the%20respective%20search%20queries.

QuoteWhat is possible here is that developers  make one database query for page tree and to put it in global variable.

I am not a programmer but I also believe that WB somehow checks the whole DB every time it has to display a page, which is causing the apparent slow server response time. Removing the menus (either Show_Menu2 or the SiteMapChildRL Droplet) instantly solves the problem, but leaves us with an impossible to navigate site.

This may not be a problem for small sites, but bigger sites will definitely get smashed by Google's new CWV update. My two main WB sites have more than 3000 pages each (which is not that much), and they are suffering a great deal from this.

It would be great if there was a way to insert the menus in a way that doesn't have to check the whole DB, or whatever is happening under the hood!

crnogorac081

Hello,

dont bother with this, of course if website has more database queries or included scripts it will take more time to load. By making these pages faster will not rank your website better. What is possible here is that developers  make one database query for page tree and to put it in global variable. Then you could make menu ad breadcrumbs and sitemap
Web developer

svsanchez

Hello dbs, I was able to create the droplet, thank you. Unfortunately, the droplet causes the same effect, degrading the SERVER RESPONSE TIME according to PageSpeed Insights.

I removed the show_menu from the BLANK template that I had created yesterday, and added the following three example pages:

EXAMPLE 1) Page using BLANK template, with NO show_menu and NO SiteMapChildRL droplet. This page achieves PERFECT score, with NO server response time issues. You can see it on the following link:

Page: https://www.deguate.com.gt/guatemala/pruebas/blank.php
PageSpeedInsights: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.deguate.com.gt%2Fguatemala%2Flimpieza%2Fpapel-higienico.php&tab=mobile


EXAMPLE 2) Page using BLANK template, with NO show_menu but using ONE SiteMapChildRL droplet. This page's score is lower, because the SERVER RESPONSE TIME goes up to almost 4 SECONDS! From there, any other added things to the page will degrade the scores much more. You can see it on the following link:

Page: https://www.deguate.com.gt/guatemala/pruebas/blank-droplet.php
PageSpeedInsights: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.deguate.com.gt%2Fguatemala%2Fpruebas%2Fblank-droplet.php&tab=mobile

EXAMPLE 3) Page using BLANK template, with NO show_menu but using THREE SiteMapChildRL droplets. You can see that the page's score is the same with 1 or 3 (or more) droplets, with the same degraded SEVER RESPONSE TIME of about 4 seconds. You can see it on the following link:

Page: https://www.deguate.com.gt/guatemala/pruebas/blank-multiple-droplets.php
PageSpeedInsights: https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.deguate.com.gt%2Fguatemala%2Fpruebas%2Fblank-multiple-droplets.php&tab=mobile

What I am desperately looking for is a way to show the Breadcrumbs / Menus / Child pages without causing the server response time issue.

Thank you!

dbs

The droplet is only a call for subpages of a page_id.

Desc: List of pages below current page or page_id. Modified for servicelinks.

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">');
}
return $content.'';


Comments:
[[SiteMapChildRL?start=11]]
(optional parameter) start=page_id


@Manu: not helpfully. The problem is show_menu, not JS.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

svsanchez

Hello dbs,

QuoteHi, "my" PageSpeed Insights says "A problem has occurred with the request. Please try again later.".
Later the same message.

Strange, it also happened to me once, but it's working now.

QuoteI see on your page https://www.deguate.com.gt/guatemala/agricultura.php three lists of pages (left, right, bottom).
Have you tried with only one list?

I guess that when you mean "three lists of pages" you mean three menus? Yes, there's the Breadcrumbs, the list of pages inside the category (what you called SiteMapChildRL) and the Categories menu. It DOESN'T make a difference if I add one or 3 menus, the problem happens as soon as there is ONE menu.

QuoteMaybe you can try to use droplets like [[SiteMapChildRL]] or similar?

I just added the [[SiteMapChildRL]] to the page but it doesn't do anything, it only shows the text [[SiteMapChildRL]] instead of showing the list of pages. I guess I have to create the droplet but I don't know what code I should use?

dbs

Hi, "my" PageSpeed Insights says "A problem has occurred with the request. Please try again later.".
Later the same message.

I see on your page https://www.deguate.com.gt/guatemala/agricultura.php three lists of pages (left, right, bottom).
Have you tried with only one list? Maybe you can try to use droplets like [[SiteMapChildRL]] or similar?
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]