Checkout my new post, which condenses a lot of my suggestions from the oooooold sticky topic started a year ago in the Newspaper forum. ๐
Might be some stuff there to help.
And, of course, be sure to CLEAR the mod_pagespeed cache once you change settings just to house clean. You don’t need to do that all the time, just good idea if you’re monkeying with bunches of other stuff.
I actually turn if OFF via htaccess
ModPagespeed off
when messing with ALL the other stuff, so it’s not trying to cache the other shenanigans.
Also remember that you need to hit the page a few times for PageSpeed to really optimize stuff.
Chris’ easier to read summary in one place, for 2015:
https://forum.tagdiv.com/topic/tutorial-chriss-custom-optimizations-for-functions-php-etc/
Manual minification of the theme style.css file
(e.g., /wp-content/themes/Newsmag/style.css)
Open style.css in a text editor, such as TextPad on Windows, BBEdit on Mac, or other pure “text editor” – notepad on windows works (NOT WordPad!!)
Go to http://cssminifier.com/
1) in your text editor, select all in the style.css file (CNTRL+A), and copy (right click copy, or CTRL+C)
2) paste into the left box on above website (right click paste or CTRL+V), click minify
3) copy all from right box
4) paste back into your style.css file on top (over/replace) — it should now look line one long string of code, not all the line breaks. This is what “minification” does; it removes spaces and line breaks (returns).
Optionally, make new text file called style.css and upload over the original (assuming you’ve made a backup). With a good text editor, you can also save with proper line breaks (for Unix servers, for example you should save stuff with “unix line breaks” and not “windows line breaks”) — hence something like TextPad 5 or BBEdit are good choices for this kind of stuff. Other freeware “programmer editor” software works, too.
This is how you manually minify the main style.css file. Must be done after every theme update; but literally takes less than 5 minutes.
You would need to replace the original style.css file either via FTP, or using a file manager in your hosting panel.
When running PageSpeed testing if you keep running into the issue with external Gravatars loading from gravatar.com, copy the images from your website when loaded, and then upload to your media folder, or other folder.
Use this plugin:
https://wordpress.org/plugins/simple-local-avatars/
this will allow you to load all the author photos locally and *not* from gravatar.com, and it works with both the author box on posts, author page, and the author widget in sidebar.
*PLEASE TO NOT POST QUESTIONS HERE, AS I WON’T ANSWER*
*ADMIN: make a sticky and lock from posts if you wish*
All of the above is from a forthcoming ebook I’m writing on how to optimize WordPress for speed, SEO, and raise visibility online.
DO NOT REPOST THE ABOVE, as I’ll be very unhappy with you.
The ‘left shark’ will hunt you down (kidding) ๐
Hope that all helps somebody.
My karmic debt is hereby paid for the month!
Customization/minification to wp-config.php file to optimize for fewer dbase calls.
a) remove all the excess comments
e.g., stuff like this does NOT need to be in file; which are “comments”
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information by
* visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "wp-config.php" and fill in the values.
*
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database password */
/** The Database Collate type. Dont change this if in doubt. */
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
/* Thats all, stop editing! Happy blogging. */
Add the following at bottom and put in your actual site URL
define('WP_HOME', 'http://site.com');
define('WP_SITEURL', 'http://site.com');
if your site runs as https, be sure to use https!
** ADVANCED USERS ONLY ON FINAL SITE DEPLOY **
For additional optimization, you can add the following:
(final line changes default folder from ‘uploads’ to something else; such as images; in my case ‘meta’)
define('TEMPLATEPATH', '/var/www/vhosts/site.com/httpdocs/guru/wp-content/themes/Newsmag');
define('STYLESHEETPATH', '/var/www/vhosts/site.com/httpdocs/guru/wp-content/themes/Newsmag');
define(UPLOADS, 'meta');
Additional .htaccess optimizations for Apache servers.
# END WordPress
AddType text/javascript .js
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2500000 seconds"
ExpiresByType image/jpeg "access plus 2500000 seconds"
ExpiresByType image/png "access plus 2500000 seconds"
ExpiresByType image/gif "access plus 2500000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2500000 seconds"
ExpiresByType text/css "access plus 700000 seconds"
ExpiresByType text/javascript "access plus 700000 seconds"
ExpiresByType application/javascript "access plus 700000 seconds"
ExpiresByType application/x-javascript "access plus 700000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
ExpiresByType font/truetype "access plus 2500000 seconds"
ExpiresByType font/opentype "access plus 2500000 seconds"
ExpiresByType application/x-font-woff "access plus 2500000 seconds"
ExpiresByType image/svg+xml "access plus 2500000 seconds"
ExpiresByType application/vnd.ms-fontobject "access plus 2500000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</IfModule>
# END Cache-Control Headers
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
<IfModule mod_alias.c>
RedirectMatch 403 /xmlrpc.php
</IfModule>
All of this “obviously” goes AFTER the WordPress elements generated when WP is setup.
-
This reply was modified 11 years by
simchris.
For those using mod_pagespeed on Apache or other server type, here are my custom “works best with WordPress” settings which I add to my sites in the .htaccess file, at top, above the WordPress rewrite module stuff.
You generally do NOT want to use the javacript modification stuff with WordPress.
This is compatible with both Newspaper and Newsmag, and with TagDiv Speedbooster plugin.
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters insert_dns_prefetch
</IfModule>
-
This reply was modified 11 years by
simchris.
It’s possible the “subscriptions” plugin may not be compatible with latest version of Visual Composer. If the plugin has not been updated since WP 4.1 came out, it may not be fully compatible with WordPress 4.1x also.
I don’t work here, but I’m not having issues with out beta install of WooCommerce with the theme and about 6 popular plugins. (Although the tabs plugin folk have updated their plugin 3x so far this month!)
I am finding I need to set my PHP memory to 128MB vs 64MB default with the new version of Visual Composer. Bigger site 256MB, heavy duty site, 1GB. Massive site 4GB.
(the last item there removes visual composer css from post pages, where MOST folks don’t use VC; I don’t — remove that if you do)
See my other post on “mod_pagespeed” today for explanation of what some of that does. ๐
I have some custom code I use in functions.php — some of which you may find useful for optimization:
——————
/*CHRISTOPHER's CUSTOM MODS - 1.10.15 rev15A - (c) 2010-2015 Chris Simmons */
remove_action( 'wp_head', 'wp_generator' ) ;
remove_action( 'wp_head', 'wlwmanifest_link' ) ;
remove_action( 'wp_head', 'rsd_link' ) ;
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
add_filter( 'pre_comment_content', 'wp_specialchars' );
function no_errors_please(){
return 'You appear to be up to no good. Please stop now!';
}
add_filter( 'login_errors', 'no_errors_please' );
/* Disable YOAST SEO Admin Bar. */
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wpseo-menu');
}
// and we hook our function via
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
function delete_enclosure(){
return '';
}
add_filter( 'get_enclosed', 'delete_enclosure' );
add_filter( 'rss_enclosure', 'delete_enclosure' );
add_filter( 'atom_enclosure', 'delete_enclosure' );
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'jpeg_quality', create_function( '', 'return 50;' ) );
function remove_pingback_url( $output, $show ) {
if ( $show == 'pingback_url' ) $output = '';
return $output;
}
add_filter( 'bloginfo_url', 'remove_pingback_url', 10, 2 );
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
add_action('wp_enqueue_scripts', 'dequeue_visual_composer_css', 1003);
Yeah.
I would turn off everything except mod_pagespeed since it does the minify of HTML on the fly, removes comments, etc.
Use the tagdiv speed booster plugin which moves and enqueues scripts at bottom of page.
Use the functions.php file to add the remove query string code.
Use W3 cache if you don’t have mod_pagspeed connected to APC/opcache/memcache on the server (which can be configured in the master mod_pagespeed config file). But use the settings recommended by TagDiv.
example of some of my custom stuff in functions.php to remove query strings, visual composer credit, etc.
*NOTE:
this also includes code you might not need
a) remove visual composer CSS from post pages
b) remove pingback URL
c) change default WP thumb compression from 90 to 50 (some like 60)
d) remove yoast admin bar (annoying)
e) add go away message for people trying to login guessing passwords; great to use with limit login attempts
f) delete enclosure in RSS feed
g) disallow some things in comments for security
——————
/*CHRISTOPHER's CUSTOM MODS - 1.10.15 rev15A (c) 2010-2015 */
remove_action( 'wp_head', 'wp_generator' ) ;
remove_action( 'wp_head', 'wlwmanifest_link' ) ;
remove_action( 'wp_head', 'rsd_link' ) ;
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
add_filter( 'pre_comment_content', 'wp_specialchars' );
function no_errors_please(){
return 'You appear to be up to no good. Please stop now!';
}
add_filter( 'login_errors', 'no_errors_please' );
/* Disable YOAST SEO Admin Bar. */
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wpseo-menu');
}
// and we hook our function via
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
function delete_enclosure(){
return '';
}
add_filter( 'get_enclosed', 'delete_enclosure' );
add_filter( 'rss_enclosure', 'delete_enclosure' );
add_filter( 'atom_enclosure', 'delete_enclosure' );
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'jpeg_quality', create_function( '', 'return 50;' ) );
function remove_pingback_url( $output, $show ) {
if ( $show == 'pingback_url' ) $output = '';
return $output;
}
add_filter( 'bloginfo_url', 'remove_pingback_url', 10, 2 );
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
add_action('wp_enqueue_scripts', 'dequeue_visual_composer_css', 1003);
Note: my “lineup” cannot be posted in an article someplace, or stuff like that; use if you wish. I have left out some other things most folks don’t need, but we do. ๐
Hope that helps ๐
I bought newspaper 1.0 and every uodate has been free which is awesome.
I guess its actually wptexturize.
Wordpress intentionally hides formatting to make it easier to write.
Some stuff i have been reading is to save in text mode, publish in text mode to keep the html.
Fir br tag i think there us a class called clear to keep br tag. Not yet tried.
Right with you there, seems to have gotten really bad last couple versions of wordpress. There might be bugtrac for this, but havent looked. I have been hoping next version of wp might fix this.
Did you install the giant “all files” zip, or just the theme zip?
Also, media.php is the media manager for WordPress not part of the theme.
WooCommerce works well. So far anyway.
Don’t use the minify javascript stuff.
btw, here are the settings I use to explicitly specify what to use with WordPress based on experimenting with this last year at this time.
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters move_css_to_head
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters insert_dns_prefetch
</IfModule>
Your mileage may vary.
Doesn’t break my setup, here: (both running mod_pagespeed on our server)
ga-ga.com
floridanewswire.com
which device are you seeing the problem on?
Have you optimized your settings for mod_pagespeed specific to WordPress, such as adding the right items to your htaccess file?
In theory you could make a 3-column grid on home page; use the custom grid option in creating a new “row”
[side][——-col——-][side]
create two custom home sidebars to put widgets into.
TIP: you can create new “page” like homepage2 to experiment and preview without impacting the live home page.
At least that’s what I do ๐
Just a comment.
Note I bought both themes so I could try both ideas out and see which worked best.
Newspaper has the “wide layout” while Newsmag has a little narrower fixed layout and the next generation of TagDiv’s framework. The next version of Newspaper (5.0) this Spring will presumably still be wide screen/responsive, but will incorporate many of the coolness created for Newsmag.
They both use Visual Composer for the big grid stuff, but obviously they are different due to the different widths/height and structure of overall page for the various @media sizes.
The demos provide a good experience of the differences between the two themes “right now” … but the NEW version of Newspaper in near future will be very nice, based on imagining the best of both current versions. ๐
Been there !!! ๐
Caching problem. Look at your hosting panel or your settings, such as if hosted with GoDaddy, you need to periodically click the “clear cache” button at top of your WordPress login. If you’re using a caching plugin, might not be configured properly.
Theme doesn’t change the basic publishing of WordPress.