@Amit I tried the Plugin Async it helps to get the LCP down but the main menu stops working correctly in Chrome. Do you have any idea?
Greetings Kathrin
Kathrin,
I have checked your blog. The LCP issue is coming from the title of your blog post.
This generally happens when your server response time is poor.
Solution:
1. Reduce title font size for the mobile version.
2. Protect your blog from DDoS attacks and bad bots. This will definitely improve server response time. (With DDoS attacks https://prnt.sc/w6xktg Score 90-89 Without DDoS attacks https://prnt.sc/w6xlam Score 96-93) [I attacked your site during this test, sorry!]
3. Upgrade to a better hosting plan.
I hope you will find this helpful.
Greetings
Amit
@rafaellorenzoni
Yea, the latest version of WP Rocket improves overall site speed and server response time.
I have also shared WP Rocket settings for the Newspaper theme in my previous reply to this thread.
Not just cache, it is essential to keep your site protected from attackers and bad bots to keep it running fast and smooth.
Hope this tip will help.
Greetings
Amit
I will not use Async if that is negatively affecting the user’s experience. You can solve menu loading issue by excluding the theme’s main JS and jQuery from Async.
I hope you will find this helpful.
Greetings
Amit
@Amit What is the name of the themes main Javascript? The plugin wants concrete name for the exclusion. JQuery I already have excluded from Async.
Here’s a picture of my current settings: https://www.topfgartenwelt.com/svg-logo
The problem with the menu only appears in chrome…
Normally I’m using stop bad bots and my hoster has a protection for the website too, but if the plugin is on all testing tools are blocked, so I have deactivated it for trying to get the LCP down.
I have already tried to reduce the font size on mobile but that leads to a much more higher LCP because the featured image comes into the viewpoint. Than the LCP is really worse.
I have a premium managed wordpress hosting. 🙁 I have already asked them why the server has problems but they only told me that I have worse optimized site…
Greetings Kathrin
-
This reply was modified 5 years by
Topfgartenwelt.
@amit /wp-content/themes/newspaper(.*).js doesn’t work, if I want to exclude the main javascript…
@Topfgartenwelt
I follow this thread as there is always something to learn about optimizing the theme for speed, just to let you know, when I open your website on my mobile phone (android) neither the menu or search option function.
I know 🙁 This is caused by Async Javascript and I don’t find the wright path to exclude 🙁
The correct path for the theme javascript is /wp-content/plugins/td-composer/legacy/Newspaper/js/tagdiv_theme.min.js
For images, consider using any lazy load plugin which uses placeholder. Currently, Newspaper theme is missing browser-level image lazy-loading. [i.e. loading=”lazy” tag]
After you make any changes to the blog, clear all cache and give it some time before you make a speed test.
Greetings
Amit
@Amit Thanks for your help, but the problem is that the theme is using an old JQuery:
ofenkartoffel-raeucherlachs-dillsauce:4387 Uncaught ReferenceError: tdbMenu is not defined
at HTMLDocument.<anonymous> (ofenkartoffel-raeucherlachs-dillsauce:4387)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
I have now added this code to the function.php (desktop/mobile):
//Modern Jquery
add_action('wp_enqueue_scripts', 'nwd_modern_jquery');
function nwd_modern_jquery() {
global $wp_scripts;
if(is_admin()) return;
$wp_scripts->registered['jquery-core']->src = 'https://code.jquery.com/jquery-3.5.1.min.js';
$wp_scripts->registered['jquery']->deps = ['jquery-core'];
}
and now it works. Unfortunately sometimes there is a little delay. But I’m afraid to download the new jquery directly into the theme like written here:
https://nimblewebdeveloper.com/blog/use-modern-jquery-in-wordpress
Or would that be better?
The jQuery file is always being loaded by core WordPress and not by the theme you use.
So, if you are using WordPress 5.6 (older version were using outdated jQuery), then it should load the latest version of jQuery file, which is fully compatible with Newspaper Version 10.3.9 and Version 10.3.9.1
So there is no need to add jQuery to your theme. And the guide you provided is from the year 2019.
If you want to load jQuery directly from Google servers and not from your server (from core WordPress), you can consider adding the following code to theme’s functions.php file.
// jQuery Google API
function infophilic_jquery() {
if (!is_admin()) {
// This will remove core jQuery and load it from Google
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', false, '3.5.1');
wp_enqueue_script('jquery');
}
}
add_action('init', 'infophilic_jquery');
Tip: You can not cache; add expiry headers to the resources loading from third-party servers. In many cases loading jQuery from Google’s end reduces waiting time and 1 HTTP request to your server.
I hope you will find this helpful.
Greetings
Amit
@Amit Thank you so much!!! Now everything is working and I have a good score too 🙂
Greetings Kathrin
@amit I’ve tried your code but it doesn’t work. The code from site I shared works but the menu function is very often delayed. So, what should I do?
I am using the same code on some of my websites and it’s working as expected.
Tip: You must remove the old code you have added to theme’s functions.php before adding the code I have mentioned in the previous reply.
Instead of using Async plugin I will recommend using WP Rocket plugin it comes with all the features and options you need to speed up WordPress website.
They also have defer JavaScript option for both internal and external scripts.
They are also working on removing unused CSS code functionality and will be available in coming updates.
Note: This reply contains an affiliate link.
I hope you will find this helpful.
Greetings
Amit
Hello Amit,
I’ve copy-paste the code in .htaccess in cpanel. But when I check my website speed on gmetrix then it was showing 91 speed at first attempt. Later when I check my website speed again then speed downgrade to 67.
.
Could you please check if I copy-paste the code correctly or not? should I send your screenshot?
Hi, Amit
Please help me fix the “Cumulative Layout Shift“. I use the WP Rocket cache plugin.
Check the Homepage and the following URL for CLS:
https://www.softfully.com/android/mx-player
Site: Softfully[.com]
Thank you
Hello,
Please also, this article https://www.infophilic.com/get-almost-100-pagespeed-newspaper-theme/ and topic https://forum.tagdiv.com/topic/slow-my-webiste/
Thank you!
Hi Amit, Thank you for your reply
How to fix: https://kinsta.com/knowledgebase/wordpress-missed-schedule/
Here are my settings as follows:
Manage Cron Jobs Directly Through my Server and disabled by WordPress
php -f /home/a12345/domains/mysite.com/public_html/wp-cron.php (FOR EVERY 1 MINUTE)
/** Increase PHP Memory. */
define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
define( ‘WP_MAX_MEMORY_LIMIT’, ‘768M’ ); // Administration tasks
My timezone is correct in WordPress.
But still, I am receiving Missed Schedule Error…
I don’t want to use any kind of plugins, so keep this in mind.
Thank you
