- ApiPractical example – How to add a new Block and Module
- ApiAPI – Smart Lists – Introduction
- ApiAPI – Category top section style – Introduction
- ApiAPI – Category top section template – Introduction
- Apitd_api_module::update
- Apitd_api_module::add
- ApiAPI – Modules – Introduction
- ApiUsing the Theme API in plugins
Hey guys,
Just wanted to let you know that I got 96 on desktop and 91 on mobile now 🙂 I am so happy! Thank you Christopher, Shashank and Steven for the tips on the forum 😉
Some of the things I noticed on his site was not using the gravatar, which is a major slowdown, and also he’s limiting the number of thumbs on page, such as not having four big “related stories” images at bottom of post, and as I suggested he’s using only the share buttons vs the number shares buttons.
I just checked one of my pages, which does not have js/css minified, and has gravatar, and has an ajax slider top right AND four images for related posts. This page has a “90” on PageSpeed Insights with both AdSense, and Disqus running. And one of those things is loading Google Analytics even though I am not. I’m not using a caching plugin either. So, in my case I need to consider changing the related posts, figure out how to cache or save the author image locally vs from gravatar, and possibly remove the big image slider top right of each page … which would reduce payload of page by a lot. And I need to minify my main js and style.css files, and retest. I haven’t looked at this since before I got sick, and have been working on something else which pays the bills vs the fun stuff, but need to get back to that obviously 🙂 And even worse, I don’t think I’ve updated the theme to 4.x on the test page (still 3.9.2). Doh. I suppose I should catch up on following my own advice! My non WP site has 97/100 for desktop, and 93/100 mobile.
What blows my mind, as it were, is the 99/100 user experience rating for mobile that Shashank has. May I say “wow” 🙂
Well, several things you can do
1) use only text ads from adsense, so images are not loaded (one big issue right there)
2) very aggressive caching and/or proper CDN
3) fast server (less than 300msec response time)
4) avoid stuff like photon or other stuff loading off wordpress
5) optimize your social media stuff; use share buttons not the numerical crap that needs to go “fetch” numbers for EACH button
6) load fonts from your own CSS not from Google CSS; or use web safe fonts ONLY
7) limit use of plugins which slow down your php
8) optimize your config.php file to include paths to your resources
9) do not use child theme which uses css redirect which google does *not* like
etc.
I’m sure Shashank could likely provide a single “round up” of all the stuff he’s done in the particular case of his own site. I just tested one of his pages, which as a desktop score of 93, mobile 86; which is pretty damn impressive with adsense and disqus running!
https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.styzic.com%2Fgadgets%2Fiphone%2Fbigger-iphone-6l%2F491%2F&tab=desktop
-
This reply was modified 11 years by
simchris.
Hi guys,
I currently have 90 for my desktop site and 75 for mobile (http://bit.ly/1tKOeYu). I have minified all of the theme files and did everything to speed up the site. But, as I use AdSense and Google Analytic, the speed is a bit slow. For example, as you can see on the screenshot bellow, Google is asking me to Leverage Browser Caching for this URL: http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js and other URLs.

But as I don’t have access to the files, I can’t do anything to them. 🙁 So, how am I meant to modify them to make the site faster? The same thing is happening on the Eliminate render-blocking JavaScript and CSS in above-the-fold content section where Google asks me to Optimize CSS Delivery for one of their Google Fonts. And Minify JS for their Google AdSense script.
Please help.
Thanks!
Salut,
Pentru acel buton adauga:
<div style="display: inline-block"><?php echo do_shortcode( '[vc_button title="New topic" target="_self" color="default2" size="default2" href="#new-post"]' ) ?></div>
<div style="display: inline-block"><?php echo do_shortcode( '[vc_button title="Post reply" target="_self" color="default2" size="default2" href="#new-post"]' ) ?></div>
.. in fisierul content-single-topic.php asa: http://screencast.com/t/uNXeWgZJ
O sa obtii acest rezultat: http://screencast.com/t/fWP0N78gIbP
O sa ai doua butoane pastreaza unul sau cum doresti.
Adauga acelasi cod in fisierul form-search.php asa: http://screencast.com/t/QOwMJI9RoDl pentru acest rezultat: http://screencast.com/t/3NQ31iLoS
Poti sa editezi fisierele cu un text editor precum notepad++
1. Asta se intampla pentru ca banner-ul face parte din continutul postului iar pentru acel layout continutul este setat sa se modeleze dupa imagine, de accea bannerul cade sub iamgine cand redimensionezi fereastra, oricum acel banner o sa se incarce la dimensiunea screen-ului pentru device-ul de pe care este accesat site-ul tau, pentru desktop este ok pentru ca incape langa imagine iar pentru tablete si mobile o sa se incarce la alte dimensiuni, deci nu ai o problema, doar reincarca pagina de fiecare data can redimensionezi fereastra si o sa te convingi.
2. Am verificat la mine si se pare ca functioneaza corect: http://screencast.com/t/JIcXIL0x poate fii un conflict cu un plugin inceraca si verfica cu toate pluginurile dezactivate.
3. Daca introduci un link video in campul “featured video” video respectiv va fii afisat in locul imaginii la inceputul articolului, asigura-te ca ai setat post-ul ca si video pentru asta si sa nu ai selectat stilul 5 pentru postul respectiv, acela este fara imagine.
Multumesc!
Hi,
I’m not sure I understand, please offer more details about this. Note that you can also change the ad size from theme panel on each device http://screencast.com/t/H3o0NlFpDb0D
Thanks
Hi,
I’m trying to improve the performance of my site (http://admitto.nl), which is now at 49% for mobile and 65% for desktop with Pagespeed). This is however the max I’ve been able to reach. Do you have any more tips or tricks?
Im using the Newspaper theme with the following plugins:
ClickDesk Live Chat
Contact Form 7
Google Analytics Dashboard
Hide Title
MailPoet Newsletters
Custom Anti-Spam
Recent Tweets Widget
Share buttons by AddtoAny
tagDiv Social Counter
tagDiv speed booster
W3 Total Cache
Wordpress SEO
WP-Optimize
WPBakery Visual Composer
WP Smush.it
I know these are a lot of plugins, but I don’t think they influence the performance that bad. Pagespeed is mainly complaining about compressing CSS/JS. Any ideas here?
Thanks in advance!
Hey
I was just wondering why you render a small square ad underneath a video and not a mobile leaderboard as in the header ad. I think the mrec/square takes away a lot of space and doesn’t integrate well!
Is it possible to change the above content ad to a mobile leader board like the header ad is rendered?
thx, Manuel
Hello Lucian,
Thanks for the reply. I Had to de-activate the WP Super cache plugin and got it working now.
Although there are two more issues which i am not able to sort out.
1. On the home page even though i have infinite scroll activated, it is not working properly. As soon as i hit the footer, it does not load more posts. So i have to scroll up and then scroll down again to make the infinite loader working. I have tried deactivating all the plugins, but still it does not seem to work.
2. I would like to change the home page design for mobile view. How do i do this ?
I am sending you the login details through email for you to further investigate on these issues.
Thanks for your help.
Manu
I disabled Photon an my scores went from:
Mobile: from 60 to 88
PC: 97 to 97
Hi,
Please make sure that you are using other header style than 3 or 6 with those styles the logo dose not changes.
Thanks
Hi,
Please make sure you have set the header ad like this from theme panel: http://screencast.com/t/Ruod2gmNl
Also, please make sure you add the ads into this div tags like explained in the demo:
* http://screencast.com/t/Ruod2gmNl
* https://forum.tagdiv.com/ads/
Of you don’t want that the ad to be shown on mobile make sure you add it for tablets and desktop and enable it to show on tables and desktop only from theme panel and leave it not top be displayed on mobile.
Hope this helps!
Thanks
Hi again, So I get the following scores on http://www.styzic.com
Desktop = 97
Mobile = 60
https://developers.google.com/speed/pagespeed/insights/?url=www.styzic.com
On desktop adsense ads are enabled and it’s still fair and better than theme demo page ( score = 90). But two things that are annoying for on mobile are:
1) Optimize Images: I have optimized all images and this warning does not show on desktop but only on Mobile. When I turn jetpack photon off the warning is gone. Jetpack uses quer strings to resize images and that’s the reason.
2) Eliminate render-blocking CSS: This warning doesn’t occurs for js as they are defered. My css are at the bottom of the page but still this warning appears. I’ve minified the css files.
So, any bdy out here who might be so generous to help with Photon and async css?
I’ve tried all plugins in the sticky threads here but none of them could async the 3 css files.
Thanks, Shashank 🙂
I tried many times to clear render blocking css and JS but not successful. I hope someone here will help me out.
Here is my speedbooster.php file
<?php
/*
Plugin Name: tagDiv speed booster
Plugin URI: http://tagdiv.com
Description: Speed booster for Newspaper theme - It moves the styles and all the scripts of the theme to the bottom. It also activates internal theme optimizations for better speed.
Author: tagDiv
Version: 2.5
Author URI: http://tagdiv.com
*/
/*
* 2.6 - fixed rendering bug on the loading of the page
* 2.5 - code improvements, newspaper 4 compatibility
* - makes most of the javascript files use defer parsing
* - better compatibility with revolution slider
* 2.4 - updated jquery version
* - support for https
* 2.3 - fixed warnings when trying to move javascript files that are not registered
*/
class td_speed_booster {
var $load_contact_form_7 = '';
var $load_google_fonts = '';
var $styles_for_footer = array();
var $async_js_scripts = array(
'contact-form-7',
'bbpress',
'woocommerce',
'site',
'devicepx',
'js_composer_front'
);
function __construct() {
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_hook'), 100);
add_action('wp_footer', array($this, 'wp_footer_hook'), 15);
add_action('wp_head', array($this, 'wp_head_hook'), 15);
define('TD_SPEED_BOOSTER' , 'v2.5');
}
function enqueue_scripts_hook() {
global $wp_scripts;
//$this->move_js_to_footer('bp-legacy-js');
//detect revmin - revolution slider and do not move jquery
if( !is_admin() and !isset($wp_scripts->registered['revmin'])){
if (is_ssl()) {
$td_protocol = 'https';
} else {
$td_protocol = 'http';
}
wp_deregister_script('jquery');
wp_register_script('jquery', ($td_protocol . '://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'), true, '1.11.0', true);
wp_enqueue_script('jquery');
}
//move styles
$this->move_style_to_footer('bbp-default-bbpress'); //bpress old
$this->move_style_to_footer('bbp-default'); //bpress
$this->move_style_to_footer('contact-form-7');
$this->move_style_to_footer('td-bootstrap');
$this->move_style_to_footer('td-theme');
$this->move_style_to_footer('google-font-rest');
$this->move_style_to_footer('woocommerce_frontend_styles');
//jetpack lost styles
$this->move_style_to_footer('jetpack-subscriptions');
$this->move_style_to_footer('jetpack-widgets');
$this->move_js_to_footer('themepunchtools');
$this->move_js_to_footer('revmin');
//bbpress
//remove_action( 'bbp_head', array($BBP_Default, 'head_scripts') );
}
function wp_footer_hook() {
$current_theme_version = '';
if (defined('TD_THEME_VERSION')) {
//get the theme version for style
$current_theme_version = TD_THEME_VERSION;
//on demo mode, autogenerate version hourly + day
if (TD_DEPLOY_MODE == 'demo') {
$current_theme_version = date('jG');
}
}
foreach ($this->styles_for_footer as $style_id => $style_src) {
echo "<link rel='stylesheet' id='" . $style_id . "-css' href='" . $style_src . "?ver=" . $current_theme_version . "' type='text/css' media='all' />\n";
}
}
function wp_head_hook() {
if (defined('TD_THEME_VERSION')) {
echo '<style>body {visibility:hidden;}</style>';
}
}
function move_style_to_footer($style_id) {
global $wp_styles;
if (!empty($wp_styles->registered[$style_id]) and !empty($wp_styles->registered[$style_id]->src)) {
$this->styles_for_footer[$style_id] = $wp_styles->registered[$style_id]->src;
wp_deregister_style($style_id);
}
}
function move_js_to_footer($js_id) {
global $wp_scripts;
if (isset($wp_scripts->registered[$js_id])) {
wp_enqueue_script($js_id, ($wp_scripts->registered[$js_id]->src), '', $wp_scripts->registered[$js_id]->ver, true);
}
}
function async_js_hook($url) {
//check to see if we have js
if (strpos( $url, '.js' ) === false) {
return $url;
}
if ($this->strpos_array($url, $this->async_js_scripts) === false) {
return $url;
} else {
return "$url' defer='defer";
}
}
private function strpos_array($haystack_string, $needle_array, $offset=0) {
foreach($needle_array as $query) {
if(strpos($haystack_string, $query, $offset) !== false) {
return true; // stop on first true result
}
}
return false;
}
}
new td_speed_booster();
And here is my function generated file
registered scripts
common | /wp-admin/js/common.min.js
admin-bar | /wp-includes/js/admin-bar.min.js
utils | /wp-includes/js/utils.min.js
svg-painter | /wp-admin/js/svg-painter.js
wp-auth-check | /wp-includes/js/wp-auth-check.min.js
itsec_file_change_warning_js | http://mydomain.com/wp-content/plugins/better-wp-security/modules/free/file-change/js/admin-file-change-warning.js
itsec_strong_passwords | http://mydomain.com/wp-content/plugins/better-wp-security/modules/free/strong-passwords/js/strong-passwords.js
devicepx | http://s0.wp.com/wp-content/js/devicepx-jetpack.js
wpuf-subscriptions | http://mydomain.com/wp-content/plugins/wp-user-frontend-pro/assets/js/subscriptions.js
wp-color-picker | /wp-admin/js/color-picker.min.js
jquery |
media-upload | /wp-admin/js/media-upload.min.js
thickbox | /wp-includes/js/thickbox/thickbox.js
wpuf-chosen | http://mydomain.com/wp-content/plugins/wp-user-frontend-pro/admin/../assets/js/chosen.jquery.js
wpseo-admin-global-script | http://mydomain.com/wp-content/plugins/wordpress-seo/js/wp-seo-admin-global.min.js
td-wp-admin-general | http://mydomain.com/wp-content/themes/Newspaper/wp-admin/js/general.js
td-wp-admin-panel-js | http://mydomain.com/wp-content/themes/Newspaper/wp-admin/js/wp-admin-panel.js
suggest | /wp-includes/js/jquery/suggest.min.js
registered styles
admin-bar | /wp-includes/css/admin-bar.min.css
colors | 1
ie | /wp-admin/css/ie.min.css
wp-auth-check | /wp-includes/css/wp-auth-check.min.css
itsec_notice_css | http://mydomain.com/wp-content/plugins/better-wp-security/core/css/itsec_notice.css
wp-color-picker | /wp-admin/css/color-picker.min.css
wpuf-chosen-style | http://mydomain.com/wp-content/plugins/wp-user-frontend-pro/admin/../assets/css/chosen/chosen.css
google-font-ubuntu | http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic&subset=latin,cyrillic-ext,greek-ext,greek,latin-ext,cyrillic
td-wp-admin-td-panel-2 | http://mydomain.com/wp-content/themes/Newspaper/wp-admin/css/wp-admin.css
thickbox | /wp-includes/js/thickbox/thickbox.css
wpalchemy-metabox | http://mydomain.com/wp-content/themes/Newspaper/wp-admin/content-metaboxes/meta.css
ithemes-icon-font | http://mydomain.com/wp-content/plugins/better-wp-security/lib/icon-fonts/icon-fonts.css
bbp-admin-css | http://mydomain.com/wp-content/plugins/bbpress/includes/admin/css/admin.css
jetpack-icons | http://mydomain.com/wp-content/plugins/jetpack/_inc/jetpack-icons.min.css
Here what my pagespeed test suggest
Remove Render Blocking Javascript
http://mydomain.com/wp-includes/js/jquery/jquery.js.pagespeed.jm.ocognCjcS2.js
http://mydomain.com/wp-includes/js/jquery/jquery-migrate.min.js.pagespeed.jm.mhpNjdU8Wl.js
http://maps.google.com/maps/api/js?sensor=true
http://maps.gstatic.com/maps-api-v3/api/js/17/15/main.js
http://mydomain.com/wp-content/plugins/wp-user-frontend-pro/assets/js/frontend-form.js.pagespeed.jm.DduuMTRcHs.js
Optimize CSS Deliver of the following
http://mydomain.com/wp-content/plugins/revslider/rs-plugin/css/W.settings.css,qrev=4.3.8.pagespeed.cf.DyIPD1r_80.css
http://mydomain.com/wp-content/plugins/revslider/rs-plugin/css/W.captions.php,qrev=4.3.8.pagespeed.cf.VUw1T7K7S2.css
http://mydomain.com/wp-content/plugins/wp-user-frontend-pro/assets/css/W.frontend-forms.css.pagespeed.cf.vemqQTxrMU.css
http://fonts.googleapis.com/css?family=Roboto%3A400%2C700
I am also using Dreampress which is on varnish cache. I enabled Page Speed Mod as well. No other caching plugin.
My Page Speed Score is 64 for desktop and 41 for mobile.
Further, Here is what i added in my httaccess
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedModifyCachingHeaders off
</IfModule>
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
#ExpiresByType text/html "access plus 600 seconds"
#ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
Now please suggest me what to do for increasing my page speed. My site is damn slow. Please help me to correct the speedbooster.php file as per instructions. Special request ot Christopher for helping me out. Thanks
Now that it’s fixed and infront of the header in mobile, its squished. My header logo is 1114px in width. It’s not using the mobile one that I uploaded. It currently looks like this: http://screencast.com/t/wNIXiq50ysb
Hi,
I have tested your site to try to recreate this on different mobiles using android and didn’t found anything wrong, are still experiencing this? Please let me know on which device this happens so I can check.
Thanks
I’ve installed the speed booster plugin and noticed a huge speed improvement. Like you advised, i add the 4 .js files in the exceptions.
To not break any slide are the menu on mobile please add these files in the
Exceptions (files to ignore and load in render-blocking way) box to the bottomjquery.min.js
external.min.js
site.min.js
js_composer_front.js
The problem is that there are some problems:
1. The header menu is not sticky and the pull down columns are to small
2. There are no header image visible at theme 4 (other templates are ok)
Did i miss a file to exclude?
Thanks in advance!
JB
I have enabled Arabics for wordpress in this website:
http://viralegypt.com
But on phones and even tough I have disabled responsive design, it shows up in a buggy way:
https://www.dropbox.com/s/rkx1lx2ovsmq3cf/Screenshot_2014-08-21-19-39-07.png
How can I fix this?
Note: that screenshot is from a Chrome Browser running on Android.
Thank you
Hi
I got 90 on desktop and 64 on mobile for my page speed of my site. I know there is lots of tips on the Pagespeed topic but I couldn’t figure out how to minify JS the right way so that it doesn’t break the slider and other JS of the theme.
@christopher , I know you might know how to fix it. So, please help.
This mod works, thanks.
Hi,
You can change the menu icons color to white from theme panel like this: http://screencast.com/t/1NZufAorUmcP you will get this result: http://screencast.com/t/uUrJNxtxw
Hope this helps!
Thanks
Hi, the theme layout would have to change for most of those social media options. You could certainly hack this theme, but in one example, you’d have to redesign the layout to have a wide layout for post top, for image and headline, then a skinny column on left for that, and then that would end up going above the story box for mobile devices.
For breaking news, you can obviously add a text box on your home page and use CSS to style a breaking news box – you have that ability right now. It would not be on ALL pages site wide, but you could easily add that to the single post template by calling a “breaking” file, and leave that empty if no breaking news, or populate when you have something earth shattering if your site actually breaks news in realtime. Simple to do. I think this might be on the list of 150+ “requests” for the theme, but not a hot topic for most, and so doubtful you’d see this anytime soon, unfortunately. But easy to add yourself within a few minutes of work.
For the social media stuff, you could create a php file with the social media elements you want, then add that in a float left div with right margin in the single post template at start of the post text, for example, or put a widget on top right of your post custom sidebar – you could hardcode by making a custom sidebar to load for the posts where the social media stuff is hard coded to query current post meta, and then still have the widget areas below that.
But don’t assume I’m being contrarian or negative in any way. Many “custom” things are pretty easy to do with existing plugins, or a couple of quick hacks to the single post template.
-
This reply was modified 11 years by
simchris.
Hi,
How can I change the color of mobile menu icon: http://oi61.tinypic.com/3509ztk.jpg
I’ll customize it to color white because I’ll use a black background.
Thank you.
Hi,
I’ve tested and for me the disable ad on phones works fine. About the cut off ad can you provide a link to see the issue?
Thanks!
Hey guys, I’ve noticed the ‘disable on mobile’ is not working. When I go to disable the ad on desktop it works fine but mobile I still am seeing it. Is anybody else experiencing this?
Also, the 728×90 is cut off on the right: http://screencast.com/t/gafiRXl9o6oh, is this just my ad?