mod-pagespeed brakes mobile friendly version

Posted in: Newsmag
Post count: 226

Hi guys,
I installed mod_pagespeed today and it broke the mobile version of the site, it seems to screw up the css in the mobile version.

is this a known issue ?

any ideas or solutions welcome.

Thanks in advance!

Post count: 9544

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?

Post count: 9544

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.

Post count: 9544

Don’t use the minify javascript stuff.

Post count: 226

Thanks chris, in all devices. should I turn off some off the plug-ins?

I am running:
w3 chache
better wordpress mimify
string remover
speeed buster

Thanks!

Post count: 9544

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 🙂

Post count: 226

Thanks I will go over that, something interesting that happen for them record

I turned off BWM
I turned off Several options of speed buster
I turned off strings

all that in the newspaper theme, and activated speed booster with your code.

as a result I got 69/91. Witch really satisfy me.

did the same with newsmag (in my other site) and I get 63/83 witch is not bad but was doing better without mod_pagespeed.

I am getting a ton of error in the mobile version
Remove render-blocking JavaScript:
Optimize CSS Delivery
ptimize the following images to reduce their size by 115.2KiB (43% reduction).

also images are not optimized, is wird also becuase bith instalation are in the same vps…..

good news is that mobile is working now but grades are not so hot….

I tryed truning all off but is pretty much the same.

Post count: 9544

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.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newsmag’ is closed to new topics and replies.