Query Strings not removing/ Google Fonts/expired header

Posted in: Newspaper
Post count: 69

Ok now, here’s the story:

I deleted my whole blog because still having issues. So I reinstalled everything new (had the demo running, now own build) I also thought, that Cloudflare would be the problem- but it isn’t (right now I don’t use CF)

Christopher Simmons helped me a lot- so I was able to solve a lot of things on my own.

But there are still some things I can’t handle on my own (seems like it) – and I’m on the edge of despair.

FYI my installed plugins:

tagbooster, W3 Total Cache, wpSeo, Code Embed, TinyMCE, Animated Gif Resize, Antispam Bee, Async JS and CSS, Broken Link Checker, Contact Form 7, EWW Image Optimizer, Jetpack, Query Strings Remover, WP DB-Manager, Google XML Sitemaps and the Visual Composer.

No matter what I do (installing Query Strings Remover or adding a code to the functions.php) I STILL HAVE PROBLEMS WITH THE “REMOVE QUERY STRINGS”

I really need someone to help me fix this or show me how to! I’m so helplessly I could cry over this!

I would like to start with adding content, but this makes me really desperate

The claimed files are:

Remove query strings from static resources
C (70)
88%
Content High
What does this mean?
Resources with a “?” in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:

http://cherrykoks.de/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=4.1
http://cherrykoks.de/wp-content/themes/Newspaper/includes/wp_booster/external/bootstrap/td-bootstrap.css?ver=4.1
http://cherrykoks.de/wp-content/themes/Newspaper/style.css?ver=4.1

Next one is:

Specify a cache validator
A (90)
93%
Server High
What does this mean?
The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources:

http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700?ver=4.1

http://gtmetrix.com/reports/cherrykoks.de/4u0OTZRR

Note: I use as fonts: Georgia and Times New Roman over the whole blog! I was reading a lot of threads with tips as “Comment them out” “delete it” and this is also not working. When I try to comment out in functions.php I get a syntax error. And to delete: I don’t know which lines, because my functions.php looks a little bit different.

The font problem also appears in :

Add Expires headers
B (89)
25%
Server High
What does this mean?
There is 1 static component without a far-future expiration date.
http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700?ver=4.1

Page Speed Insights for example is complaining about the “above the fold” thing on mobile Devices and desktop, these are the same files- which GTMetrix claims with “remove query strings”

see here: https://developers.google.com/speed/pagespeed/insights/?url=cherrykoks.de&tab=mobile

Everything else is ok for me- but how can I solve the “few” problems.

I hope there’s an angel in this forum who can save me from getting nuts.

If someone of you needs any file information, let me know. I’m glad for any help with this!

Julia

  • This topic was modified 12 years by Cherry.
Post count: 69

Got this wrong this is the right GT Metrix report: http://gtmetrix.com/reports/cherrykoks.de/eGTKZwey

Post count: 9544

Hi,
first you can’t do anything about the cache validation or anything with fonts loading off of google’s website, or anything loading from jetpack (or adsense, or addthis, or disqus, etc.) — as those elements live on somebody else’s server. Only solution is to remove them or workaround them (e.g., load google fonts on your site or CDN, or load the CSS from your own style sheet — you can google how to do this, as it’s a trick which has been used for couple of years — simply grab the CSS you’re loading from google for the fonts, then put it into your own CSS, then remove the “call” to that CSS from your style.css and/or functions.php).

For the remove query strings I would suggest this:
1) turn off all your plugins
2) make sure you put the remove query code at bottom of your functions.php file and have uploaded to server properly, replacing original file
3) test a post page and see if it’s working – it should work, unless you have conflicting element re-writing your code. Or, you didn’t put the code in right place with something else you’ve added to the functions.php file, or you have a missing or extra closing bracket (bad syntax). There are couple of ways to do this, but again – double check your code/syntax, which is #1 reason something doesn’t work – be careful what you copy/paste FROM … always use a proper plain text editor so it won’t introduce garbage characters.
4) start turning on plugins: pay close attention to any SEO plugin which may try to rewrite the css and js “positions” in the file
5) avoid using plugins which do the same thing – seo plugin with sitemap, and other sitemap plugin; seo plugin which rewrites location of your js and css and the tagdiv speed booster
6) once you find the conflicting plugin, you can sort out what to do for the version removal to work (and don’t have that in functions *and* use a version removal plugin at same time, AND an SEO plugin that rewrites your code AND the tagdiv speedbooster).

This is normal process to “debug” why something doesn’t work.

Post count: 555

@Cherry don’t use this plugin “Async JS and CSS” any more since the team updated the speedbooster plugin to handle those things you don’t need that plugin any more so don’t used it are it going cause you a lot of headaches…

Post count: 69

Well a good friend of mine is IT Specialist, and he is now checking the page. (although he is not familiar with wordpress.)
Looks like he found a resolution for the strings, although he says that the speedboster plugin is causing the strings….

He is also trying to find out how to solve this font problem.

btw: he tried as described to comment out the fonts- and the result was (like me yesterday) that the functions.php crashed.

Post count: 555

Also stressing over little things like fonts is a waste of time,you can’t fixed those.

In GT Metrix they show you a arrow next to each number that you should get to pass the test..if they say you should get 56% and get 89% then you should not worry about any lil issues they still showing the point in all this..is to have a fast site and a well balance one..you can’t make every thing perfect to score 100% even CNN,FACEBOOK,TWITTER AND bigger sites don’t even get that good score..stop stressing over “query string” two files one day they might go away on they own,but with this theme i don’t think they will unless the team make some magic in they speedbooster to fixed it..

Focus on making good content on ur site and keeping it fast and google bot will love you for it,but if you don’t have no good content are new content then what’s the point working on the backend if the front end is useless for google bot,msn and yahoo..

My SEO score is 87% and my rank is 3 that’s because i have good content and always updating and making sure my site is fast all the time with few problems..but i’m not going stress over every lil problem that pop up like “query string” and google fonts”any way good luck hope you get it all work out..an with out cloudfalre you will not have the CDN TO HELP UR SITE..that’s a must for all sites..

Post count: 555

This is http://www.cnn.com a very big news site that runs on wordpress look how bad they score…I’ve score way better then that..this is my point too you stop stressing..

Post count: 69

Hey Steven

nice to read you, after my pal is making it stable

I will return to Cloudflare I guess
(I’m pro now in installing it) 😀 and that’s a fact. But before I turn on CF – I want to clear the things.

yeah you’re right – I know that, but it’s frustrating when you read how to solve the things, and you try- and they do not work for you.

Post count: 69

well ok check this out: http://gtmetrix.com/reports/cherrykoks.de/dDXZBMi6

The Problem was: the speedbooster plugin

My friend says: the strings got messed up through the speedbooster plugin- it’s now deactivated, but async is running…

The fonts: the “commenting out” thing in the functions.php had to be modified in my case. But looks good now.

Wow, I’m so relieved right now.

Now I can start with CDN 😀

Post count: 555

Well there is nothing on ur site but the “Welcome page from wordpress” that i can see when i go to ur site and test it,may be that’s why you seeing that score,and also with out using the theme speedbooster all ur JS & CS not going be in the bottom and other issues you going run in too,this theme need that speedbooster to make it work good….

Every post on ur site is broken with a 404 not found…

Post count: 69

Which link do you use?

We can’t find it.

In German it looks good.

  • This reply was modified 12 years by Cherry.
Post count: 555

All the links is like that…i click on few and i get bunch 404 pages….

Post count: 555

http://cherrykoks.de/featured/td_d_slug_46/

http://cherrykoks.de/allgemein/td_d_slug_45/

http://cherrykoks.de/allgemein/td_d_slug_41/

http://cherrykoks.de/category/allgemein

http://cherrykoks.de/allgemein/td_d_slug_43/

http://cherrykoks.de/category/internet/

http://cherrykoks.de/category/fashion-und-lifestyle/

the whole site is like that…any way even testing ur site the front page is the wordpress welcome page not ur site that’s why ur score so high because they nothing to test but a blank site…

Hello World!
GenerallyApril 9, 2014 1 4
Welcome to WordPress. This is the first post. You can edit or delete it. To avoid spam, just log in and activate the plugin area the corresponding plugin. Well, now enough geschwafelt – now nothing start blogging!

Post count: 69

I even don’t have categories installed – that’s weird. These are old categories from my last installation – and I deleted all from the FTP oO

Post count: 69

Wow, I’m pissed right now.

If I reinstall everything and start from zero, I will have to activate the speedbooster plugin again, and when I do- the strings are coming back.

I’m not getting ahead with this crap -.-

Post count: 69
   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";

I think this one right here in the td-speed-booster.php is causing the strings.

When I deactivate the plugin- I have no strings.

Any resolution to avoid that right here?

Post count: 69

@Steven

CF is running again 🙂 but any resolution for this:

http://gtmetrix.com/reports/cherrykoks.de/h008RXQu

“specify cache validation” and “Specify a Vary: Accept-Encoding header”

this is coming from CF Javascript.

Post count: 69

Ok FYI if interested, I reinstalled again yesterday because of the things Steven told me.

Well Chris- I still use the W3 Cache (page only) and wrote the rest of .htaccess by myself, like u posted in another thread. (little bit proud on myself that it did not crash 😀 )
Is everything ok with that or have any other suggestion?

See my current htaccess here:

# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} =on
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=W3TC_ENC:_gzip]
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
</IfModule>
# END W3TC Page Cache core
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
AddType text/javascript .js

# 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"
</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>

# pass the default character set
AddDefaultCharset utf-8
# BEGIN Keep-Alive
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
# END Keep-Alive

#BEGIN GZIP 
<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>
#END GZIP

#BEGIN CF ALLOW
Allow from 2400:cb00::/32
Allow from 2606:4700::/32
Allow from 2803:f800::/32
Allow from 2405:b500::/32
Allow from 2405:8100::/32
#END CF ALLOW

As you can see I had to add the keep-alive code and other stuff like gzip- because otherwise GTMetrix would complain about that.

http://gtmetrix.com/reports/cherrykoks.de/4DKTK3Af I guess I can not influence the the both points about cloudflare?

The only thing I’m little bit confused about, is the fact that the mentioned code

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

in the booster plugin causes my strings. Can I change that?

And:

in the Pagespeed guide from tagdiv I read this:

The plugin will move the theme and recommended plugins js and css at the page bottom. If you have other plugins installed you have to modify the Speed Booster plugin file so it will also move those files at end of the page. In the next section you will learn how to accomplish this.
4.2 To get the list of registered css and js add the following code at the end of the functions.php file:
function td_inspect_scripts() {
global $wp_scripts, $wp_styles;
echo ‘registered scripts<br>’;
foreach ($wp_scripts->queue as $handle) {
echo $handle . ‘ | ‘ . $wp_scripts->registered[$handle]->src . ‘<br>’;
}
echo ‘registered styles<br>’;
foreach ($wp_styles->queue as $handle) {
echo $handle . ‘ | ‘ . $wp_styles->registered[$handle]->src . ‘<br>’;
}
}
add_action( ‘wp_print_scripts’, ‘td_inspect_scripts’ );

SpeedBooster plugin ist runnin as you know, do I have to change that as advised?

The sentence with “If you have other plugins installed you have to modify plugin so it will also move those files”

Other plugins means = every plugin I’m using? No problem to add this code to functions.php – just wanna make sure if this is right.

  • This reply was modified 11 years by Cherry.
  • This reply was modified 11 years by Cherry.
Post count: 9544

Hi,
fyi if your server is setup properly you don’t need to put the gzip/deflate element in your htacess as it’s set at the server level as always on; unless you need that for your CDN – but that is more likely to have gzip/deflate on for speed anyway.

For plugins modification/addition to the speedbooster; obviously this only applies to the js and css related stuff which is purpose of tagdiv speedbooster. You don’t need to mess with an image optimization plugin, for example.

The world won’t end if you don’t remove the query strings, btw. Most WP sites leave that as-is and are successful due to content and marketing, not the query strings. Also note it might be an incremental “conflict” with this dot revision of theme and speed booster; meaning the benefit of the speed booster being on is greater than losing the query strings. Google uses them, so you can too. It’s “ideal” to remove them but that might not even improve stuff by one point, particularly if you test that with Pagespeed Insights directly vs GTMetrix.

However, you are correct, it would seem like you could remove the "?ver=" and test. Why not try it ? You’re not running a live site, obviously, so if you crash, no biggie. Just remove the plugin, and put it back.

Post count: 69

Hey Chris, I also checked the if modified since check, and feedthebot.com is telling me different things.

How can I make sure, that the date is correct,

Check 1 says: correct date (today) Last-Modified: Wed, 13 Aug 2014 18:21:29 GMT
(using http://cherrykoks.de)
Check 2 says: Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT

I’m a litte bit confused 😀

Is it importan to use http? If I use just the domain name – I also get the second result.

Post count: 9544

check with your hosting provider … if the clock is off or something. I may be missing what your issue is.

You can check your headers for pages with various online tools like http://web-sniffer.net/

HTTP Response Header

Name

Value

Delim

Status: HTTP/1.1 200 OK
Date: Wed, 13 Aug 2014 20:49:28 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=d2376a9f44b520530e88bf3049c2796811407962968768; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.cherrykoks.de; HttpOnly
Expires: Wed, 13 Aug 2014 21:49:28 GMT
Pragma: public
Cache-Control: max-age=3600, public
X-Powered-By: W3 Total Cache/0.9.4
Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, must-revalidate
Vary: Accept-Encoding
Server: cloudflare-nginx
CF-RAY: 1597c78ace8e064a-FRA
Content-Encoding: gzip

Note if having issues with your setup it’s best to check with your CDN provider to debug any issues between hosted content on server and on the CDN and how they sync.

Post count: 69

Ok got response and they don’t support.
They say I have to put in htaccess:


> Header unset Last-Modified

was wondering if this is really important because feedthebot says:

“If a search engine crawler sees a web page status code of 304 it knows that web page has not been updated and does not need to be accessed again.”

And I mean, it would be quite bad if your site wouldn’t be crawled anymore.

Or will googlebot still do this?

Post count: 9544

We use last modified on our sites, but your case may be different; we’re running Apache vs Nginx which is a tad different.

I guess your problem is if you’re seeing a page saying last modified 1970 vs “yesterday” that could simply be its way of saying “not updated – ignore me for recrawl” – which is likely the case you’re seeing.

It could be the cookies your site is sending on page load, where the cookie has the 1970 expiration, and the page has yesterday.

This page might be more helpful in checking your headers, dunno:
http://www.microsoft.com/search/Tools/default.aspx

Post count: 555

What i find very weird that for weeks now ur asking us about lot things to do with a site that’s not “LIVE” are have any content of urs but the demo content and now there is a error to even access ur site…seem you just playing around with code and the theme and not serious about making a website for people to visit..i just find it weird that’s all

Btw no one can access ur site it have a error…

Parse error: syntax error, unexpected end of file in /kunden/323925_31275/cherrykoks/wordpress/wp-config.php on line 94

Post count: 9544

@Steven pretty much said what I had on my mind in very diplomatic way.


@cherry
= Seems it might make sense to try to optimize your server/CDN/ etc. with the default theme for WordPress while you’re learning how to do this, then switch to the big theme once you have your foundation set in stone, as it were. There are many many sites out there which detail how to optimize a WordPress site, server, caching, CDN, PageSpeed, etc. – before you even get to the theme features.

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