I’ve been messing with this stuff while redoing our main business site and some of this new tech is pretty amazing! đ I hit a wall with 100/100 UX, 97/100 desktop, but 91/100 mobile and have been poking away at that to shoot for 95/100 mobile (I can dream ….!). And this is with https and rotating news ticker, lots of photos (no ads, of course), and OpenSans. Too much fun! đ
Hope to get this sorted by end of month so I can go back and tweak my WordPress/NewsMag sites. Still need to clean up 1.71 with shim for some tweaks.
đ
For those using Newspaper 6 you may want to use the “slim” version of my suggested functions.php tweaks. Note this goes at END of file; make sure you edit only in a plain text editor and NOT MS Word; make sure you turn your caching OFF before changing any major files like this. Always keep backup. With caching off, switching back is as simple as uploading your original. If on Linux, make sure your text editor saves a Linux/unix “line breaks” and not “PC/windows line breaks.”
/*CHRISTOPHER's CUSTOM MODS - slim version */
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 );
function no_errors_please(){
return 'You appear to be up to no good. Please stop now!';}
add_filter( 'login_errors', 'no_errors_please' );
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;' ) );
This is intended for those using the main theme, not a child theme; meaning you need to add this to the main functions.php in your main theme folder **NOT CHILD THEME FOLDER**.
-
This reply was modified 11 years by
simchris.
Suggestion: 4.2 WordPress brought us Emoji Support that we probably don’t need.
To get rid of that JS from the head:
remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 );
remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ );
Found via:
https://wordpress.org/support/topic/emoji-and-smiley-js-and-css-added-to-head
/*CHRISTOPHER's CUSTOM MODS - slim version */
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 );
remove_action('wp_head','print_emoji_detection_script',7);
remove_action('wp_print_styles','print_emoji_styles');
function no_errors_please(){
return 'You appear to be up to no good. Please stop now!';}
add_filter( 'login_errors', 'no_errors_please' );
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;' ) );
This is the combined block of code (including the emoji removal mentioned above) that goes at the END of the functions.php file.
@neotrope Not sure why you said that code can’t go into the child theme. I’m running the child theme and inserted this into the functions.php file inside the child theme directory and it’s working spectacularly. Do you mind elaborating on why you emphasized that so much?
Thanks for codes @neotrope and @fudoki
Funnily enough it occurred to me last night to update that just as you did, but then I forgot (was watching “MIST” on Amazon Prime…. ). Good job, kind sir! đ
As to CHILD themes… well… you are correct it likely doesn’t matter anymore with TagDiv themes, although I do seem to recall it did at some point based on feedback.
I personally don’t use child themes and am against such practice, but that is my own preference due to the CSS redirect aspect. Some themes don’t do well with putting functions that change “core” behavior when put in the child theme; and this is based on my “full stack” for changes/suggested code. Your mileage may vary, depending on theme/version. Since everything in the child theme can be a redirect, I simply don’t trust it — but if it works for you, then have at it. When folks websites stop working, I usually suggest going with “lowest common denominator” and one of those debug aspects is NOT using child theme — but it’s not a “law” or anything — again, just my OPINION. đ
Put another way; I’d rather have ALL the optimizations working in main theme vs having to cut some back just to use child theme. Again, your experience may vary. If you can run mods in child theme, why are you bothering to use the “slim” version exactly?
-
This reply was modified 11 years by
simchris.
Child themes are a nice way to do things without the fear of being overwritten on update. For those who use the UI to update, can’t beat it. I typically try to not use @import or includes if at all possible, to reduce http requests, so I like to copy the parent style.css into the child style.css and remove the imports. Keeps things smoother and accomplishes the same thing.
Not too sure how that would work for the functions file, but my assumption is that it would break it based on the same reasoning you gave. Maybe not with the new theme.
Of course, given that the child theme is having other issues, and since I’m never opposed to more speed (GT Metrix score of 91 without a caching plugin so far – W3TC encrypts my pages for some reason and displays the code), I’m thinking about switching back to the parent theme. My custom CSS is all in the theme panel anyway, and my edits to header.php and td-module-single.php are pretty basic.
If I could just find a way to speed up the loading of ads from AdSense through AdZerk then I’d be blazing along. Your tips certainly help in the meantime.
I’m a bit biased as I’ve had likely 25 themes change over time and need to go in and modify the child theme which totally defeated the purpose of just using the parent thing to modify in first place. Why have all the shenanigans of having two sets of code. I understand the concept, and certainly child themes are helpful for Canvas, and other frameworks for simpler theme development, buuuuuuut …. I prefer to have stuff in one place and keep track of the mods so I know they will or will not work due to my foobar and not a child theme issue. Did I say biased? Maybe I meant jaded? đ
I think I usually take the sissy way out and just avoid the mods that put me in a position of changing things twice. Is that sad or what? haha
Need to get familiar with the new API. Although it’ll be a while before it touches on the areas I tend to modify, like the default sharing buttons. Between the API as a plugin and the Custom CSS settings, the child theme is becoming more irrelevant.
Speaking of jaded, color me jade regarding WordPress in general. I’ve been branching toward so-called lightweight CMS solutions like Bolt CMS and as it turns out, it puts WP to shame on performance, function, and customizability for a news site not dissimilar to those you run. But that’s for another topic.
Just going along to get along for now. Gonna get that parent theme going again. It’ll fix my block 18 thumbnail issue too.
Yeah… I’ve been playing with a lightweight theme like I built in 2011 for one of our sites; which uses basically Bootstrap 3 and minimal files. Too much to do, so little time.
For our main sites WP works well because of the tools developed for it that are hard to replicate without more custom coding – such as using FeedWordPress to pull content from our mothership to our hubs; Yoast SEO so I don’t have to manually put all that crap into templates anymore or build out custom XML sitemaps anymore based on page template (although we still do that in one place for push to an aggregator like LexisNexis, etc.).
I still like static hand-built .shtml files with SSI and cgi random elements. đ
Static? Nah. I run multi-author so static is never an option for me. WordPress handles that aspect pretty well.
I tried FeedWordPress on your recommendation of it a while back. Just to have a page of RSS content from other sites on the same subject. The plugin was going through some rough times back then. A new update started deleting random posts from the database. I was backed up so it wasn’t a big deal once I removed it, but it led me toward curation a nice aid for authors.
Within the next 2 years I’ll be into a setup similar to yours; multiple sites feeding a main site.
Custom coding something to work with what I need isn’t a bad thing. It’s like you said, all a matter of having the time to do it.
Hi Chris,
Can you please contact me @ info@boreddaddy.com I have some private questions.
Regards,
Alex
Hi,
I thought about opening a new thread for this, but it probably wouldn’t get noticed.. anyways i thought this may spark some good discussion.
I recently spent about $500 for a freelancer to do SEO work for my site (basically generating backlinks) they were able to improve my sites ranking for a number of keywords, although i still feel $500 is way too much for what i received (keep this in mind when hiring SEO work!). I ended up stopping this because i was scared of Google’s reaction to this sudden rise in backlinks..
The reason as to why i mention this was because i’m interested to see what other’s are doing in terms of actually marketing their site. Most of my traffic to date has been through Stumbleupon (although bounce rate was high) i was able to get 50,000 page views to one post in 24 hours, which was insane!! But it’s not sustainable traffic.
SEO work is not my forte, so i’m really struggling to know how to improve my site’s ranking in google without getting penalised for doing something wrong. I have no doubt there are some of you who are great in this area, so i would love to here your strategy.
Regards,
Glenn
Hello Chris
Thanks for your advices.
I change all things your propose to us.
One thing I don’t understand is that in PageSpeed or GT
https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.virtualmagie.org%2F
I always have the cache time end problem.
Here my htaccess content.
There is your code and so all files normaly have to be expired.
Other things :
I have W3 Total Cache but you don’t recomand it.
So I install the ZenCache Pro but it mess the site.
Finaly I used superCache and PHP optimization and compression seems to mess too and I was forced to delete it.
Note that our site is on a dedicated server.
So for waiting I activate the Falcon mode in Wordfence.
#WFIPBLOCKS - Do not remove this line. Disable Web Caching in Wordfence to remove this data.
Order Deny,Allow
#Do not remove this line. Disable Web Caching in Wordfence to remove this data - WFIPBLOCKS
#WFCACHECODE - Do not remove this line. Disable Web Caching in Wordfence to remove this data.
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_mime.c>
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
<IfModule mod_mime.c>
AddType text/html .html_gzip
AddEncoding gzip .html_gzip
AddType text/xml .xml_gzip
AddEncoding gzip .xml_gzip
</IfModule>
<IfModule mod_setenvif.c>
SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip
SetEnvIfNoCase Request_URI \.xml_gzip$ no-gzip
</IfModule>
<IfModule mod_headers.c>
Header set Vary "Accept-Encoding, Cookie"
</IfModule>
<IfModule mod_rewrite.c>
#Prevents garbled chars in cached files if there is no default charset.
AddDefaultCharset utf-8
#Cache rules:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} on
RewriteRule .* - [E=WRDFNC_HTTPS:_https]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=WRDFNC_ENC:_gzip]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$
RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]
RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$
RewriteCond "%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" -f
RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ "/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}" [L]
</IfModule>
#Do not remove this line. Disable Web caching in Wordfence to remove this data - WFCACHECODE
# BEGIN iThemes Security - Do not modify or remove this line
# iThemes Security Config Details: 2
# Enable HackRepair.com's blacklist feature - Security > Settings > Banned Users > Default Blacklist
# Start HackRepair.com Blacklist
RewriteEngine on
# Start Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*Indy" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*NEWT" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Maxthon$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SeaMonkey$" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Acunetix" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^binlar" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^BlackWidow" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Bolt 0" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^BOT for JCE" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Bot mailto\:craftbot@yahoo\.com" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^casper" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^checkprivacy" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^ChinaClaw" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^clshttp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^cmsworldmap" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^comodo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Custo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Default Browser 0" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^diavol" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^DIIbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^DISCo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^dotbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Download Demon" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^eCatch" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^EirGrabber" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^EmailCollector" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^EmailSiphon" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^EmailWolf" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Express WebPictures" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^extract" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^ExtractorPro" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^EyeNetIE" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^feedfinder" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^FHscan" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^FlashGet" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^flicky" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^g00g1e" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^GetRight" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^GetWeb\!" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Go\!Zilla" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Go\-Ahead\-Got\-It" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^grab" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^GrabNet" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Grafula" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^harvest" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^HMView" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^ia_archiver" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Image Stripper" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Image Sucker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^InterGET" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Internet Ninja" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^InternetSeer\.com" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^jakarta" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Java" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^JetCar" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^JOC Web Spider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^kanagawa" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^kmccrew" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^larbin" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^LeechFTP" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^libwww" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Mass Downloader" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^microsoft\.url" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^MIDown tool" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^miner" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Mister PiX" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^MSFrontPage" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Navroad" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^NearSite" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Net Vampire" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^NetAnts" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^NetSpider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^NetZIP" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^nutch" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Octopus" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Offline Explorer" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Offline Navigator" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^PageGrabber" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Papa Foto" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^pavuk" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^pcBrowser" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^PeoplePal" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^planetwork" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^psbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^purebot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^pycurl" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^RealDownload" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^ReGet" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Rippers 0" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^sitecheck\.internetseer\.com" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SiteSnagger" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^skygrid" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SmartDownload" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^sucker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SuperBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^SuperHTTP" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Surfbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^tAkeOut" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Teleport Pro" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Toata dragostea mea pentru diavola" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^turnit" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^vikspider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^VoidEYE" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Web Image Collector" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Web Sucker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebAuto" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebBandit" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebCopier" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebFetch" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebGo IS" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebLeacher" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebReaper" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebSauger" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Website eXtractor" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Website Quester" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebStripper" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebWhacker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WebZIP" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Wget" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Widow" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WPScan" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WWW\-Mechanize" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^WWWOFFLE" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Xaldon WebSpider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Yandex" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^Zeus" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "^zmeu" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "360Spider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "AhrefsBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "CazoodleBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "discobot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "EasouSpider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ecxi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "GT\:\:WWW" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "heritrix" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "HTTP\:\:Lite" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "HTTrack" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ia_archiver" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "id\-search" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "IDBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Indy Library" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "IRLbot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ISC Systems iRc Search 2\.1" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "LinksCrawler" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "LinksManager\.com_bot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "linkwalker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "lwp\-trivial" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "MFC_Tear_Sample" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Microsoft URL Control" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Missigua Locator" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "MJ12bot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "panscient\.com" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "PECL\:\:HTTP" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "PHPCrawl" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "PleaseCrawl" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "SBIder" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "SearchmetricsBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "SeznamBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Snoopy" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Sogou" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Steeler" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "URI\:\:Fetch" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "urllib" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Web Sucker" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "webalta" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "WebCollage" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Wells Search II" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "WEP Search" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "XoviBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "YisouSpider" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "zermelo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ZyBorg" [NC,OR]
# End Abuse Agent Blocking
# Start Abuse HTTP Referrer Blocking
RewriteCond %{HTTP_REFERER} "^https?://(?:[^/]+\.)?semalt\.com" [NC,OR]
RewriteCond %{HTTP_REFERER} "^https?://(?:[^/]+\.)?kambasoft\.com" [NC,OR]
RewriteCond %{HTTP_REFERER} "^https?://(?:[^/]+\.)?savetubevideo\.com" [NC]
# End Abuse HTTP Referrer Blocking
RewriteRule ^.* - [F,L]
# End HackRepair.com Blacklist, http://pastebin.com/u/hackrepair
<IfModule mod_rewrite.c>
RewriteEngine On
# Reduce Comment Spam - Security > Settings > System Tweaks > Comment Spam
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} /wp-comments-post\.php$
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_REFERER} !^https?://(([^/]+\.)?virtualmagie\.org|jetpack\.wordpress\.com/jetpack-comment)(/|$) [NC]
RewriteRule ^.* - [F]
</IfModule>
# END iThemes Security - Do not modify or remove this line
## EXPIRES CACHING ##
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters insert_dns_prefetch
</IfModule>
# 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
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>
HI folks … as I’m about to be enmeshed in a highly complex project for my own company, I won’t have *any* time to post “pay it forward” help around here anymore, but I thought I’d share one last thing for now — which I’d promised to do, and I just did in another post on this topic …
this is “broad strokes” on how to optimize the font loading for using Google fonts, such as OpenSans for your site; to not load the remote style sheet from Google and solve one of the issues from optimization testing related to Google fonts. This might even gain you a point in some cases!
———– SNIP————-
The theme does not load fonts via functions.php; but from the MAIN functions file used by the theme inside the /includes folder as I noted.
The following would be how we do it, in broad strokes — with idea of using OpenSans, removing roboto, and loading the CSS locally for OpenSans vs remotely.
Anybody planning to hack the theme in *any* way should explore the files in there to see what is going on with the theme.
So, to wit
theme/includes/td_wp_booster_functions.php
see around line 1318 – 1340
helps to use a proper text editor (I used “TextPad” on Windows, BBEdit on Mac).
I have not done this in awhile, but as I’m no longer going to be around here to help out, needing to move onto other things I’ll try to provide a starter point for you.
I believe I removed the whole Google fonts section; or perhaps only left in the first section as it caused error to remove it all.
————-
Next you need to search/replace any instance of Roboto from your style.css ; change the default fonts to OpenSans as you won’t be using the control panel to select it anymore.
————
‘capture’ the CSS from Google; presumably those of you who are new to HTML, webdev, etc., likely don’t understand what is going on with CSS (cascading style sheet) and how fonts are loaded.
So, basically when you “request” the fonts from Google using their API, you’re not loading the fonts, you’re loading a style sheet on their server, which in turn loads the fonts — a redirect of sorts. And this does show up as “something to fix” when doing optimization tests.
So, an old trick most of learned in the olden days of hand coding our websites from scratch is that you can put that API link into a browser window, or email it to yourself as a link also works …
Put another way if you were to go to the Google font repository, or look at the theme code, you end up with their API call, which looks something like this:
://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic
Now if you know what you’re doing, again, you can put that URL into a browser window and it will spit out the actual “what is being loaded from that URL” … which actually looks like this:
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSnhCUOGz7vYGh680lGh-uXM.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(http://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff) format('woff');
}
that is the actual CSS being loaded .. and you can put this at the bottom of your style.css file to load the fonts from your own style sheet vs loading their style sheet remotely.
So, if you combine the three things
a) search/replace your /theme/style.css to make OpenSans your default font; remove Roboto
b) remove the section in the theme main config file so that it’s NOT loading the remote style sheets
c) put your captured CSS from Google at bottom of YOUR /theme/style.css
d) there may be one instance of roboto somewhere else in the admin code files, but I forget where that is at the moment (sorry)
e) while it should be self-evident — if your site is https; change the http in above to https.
Then you have saved the redirect of the extra style sheet being loaded from Google’s server.
You can modify this procedure to use different fonts, or multiple fonts. Just setup the fonts you want on Google’s font site, get the embed code; then “capture” the actual CSS.
Try it đ
-
This reply was modified 11 years by
simchris.
…Somehow the NewsMag theme panel gets glitchy (UI colors changed, drop down options spacing issues, missing functionality) when applying the magic bunny code/ custom mods on NewsMag version 2.0
The mods didn’t create these issues on the previous NewsMag version.
When the custom mods are removed, things seem to work again.
As for website functionality, when the logo on sticky menu appears, it displayed twice, stacked on top another.. Seems very odd, and I cannot figure out what is causing these issues.
-
This reply was modified 11 years by
Ace.
Hi
I have not yet updated to NM 2.0 …
I will be doing so soon; and will post *updated* code for bottom of functions.php file. Not tested with child them, nor will I. đ
Note the things which are “safe” to use are those which modify the general WordPress core stuff, like removing versions, adding warning for those trying to guess login, changing default compression, emoji removal.
Don’t use Thomas’ long winded block of stuff for htaccess; as most of that has nothing to do with me and seems related to his optimization third party service doing stuff – some of which looks redundant to me.
Bryson T’s “slim” summary from July 2 in this thread, above, would be safe place to start.
Always remember to clear *all* your caching couple of times so you’re not loading old/new CSS and functions!
Thanks for the swift reply..
I’ll try to report back when/if I find out what’s breaking it.
Cheers!
..[10 mins later]..
This seems to be the culprit:
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 );
-
This reply was modified 11 years by
Ace.
That should not cause issues as it simply removes the ? version numbers. Of course if you’re using something like a CDN or cloudflare (no idea never used it) which “requires” versioning, then obviously you would not want to use that.
You might try changing the priority from “10” to something else.
$priority (integer) (optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the filter. Default: 10
So, in your case with your particular setup, you might try changing it to 15 and see if it works.
I’ve not run into any issues with ANY theme using that code, so would be surprised if it breaks the latest Newsmag; unless another plugin is running to ALSO try to remove the “?=123” stuff.
This may be obvious to some but you can improve your site load time MASSIVELY! if you aren’t using any of these plugins (Woocommerce, BBpress, Buddypress) remove all the CSS in the stylesheet.. i found there is quite alot for Buddypress
After that i reccommend using this site http://csscompressor.com/ – it has many settings to do with readability, so you can optimize your site but still be able to read it clearly.
TIP: To optimize the image thumbnail sizes you need and skip generation of sizes you won’t be using, do this
a) audit the modules you are actually using, make a list, and the sizes used by those modules (theme docs shows the modules and the sizes)
b) set those as ‘on’ in the theme panel; turn others off [using the toggle switches]
c) in the WP admin/ media, set the three default sizes to the ones you use most often which are smaller than what you normally upload (small/medium/large)
d) in some theme versions, no “right size” thumb was being added for the “related posts” area below posts, and I posted somewhere here how to add that “size” to the main theme functions file inside of the /theme/includes/ folder.
e) use the “regenerate thumbnails” plugin to regen thumbs, and from now on with new posts you should have fewer thumbs made, based on the sizes you actually use on layouts.
Useful to be consistent with category, tag, author, search, archive templates to use same layout/size for better optimization and caching.
Hope that helps đ
BASIC SEO TIPS:
Note that Google rolled out new version of PANDA recently. They continue to refine placement, and are putting emphasis on mobile friendly, ORIGINAL CONTENT, âanswers to questions,â https capability, pagespeed insights, sitemaps, and the usual stuff still relevant:
a) inbound links from organic sites, not paid text links or text ads, help placement
b) blocking bad links from âbad sitesâ such as low quality scrapers â you can disavow bad sites (we do this with sites like âsearchnakedâ which had thousands of links to us)
c) proper schema markup
d) limit junk posts (e.g., youtube video and one sentence â is not original content)
e) limit content you âstealâ from other sites then link to them as source â write your own version, get your own photo; that helps your ranking
f) site structure matters; good navigation, prioritize the POST over categories, tags, etc.
g) donât sell text links, avoid popups, interstitials that block content loading for Google bot
h) READ the free Google guide to best practices for SEO
i) write original headlines â check your headline to see if it already exists; do something different!
j) posts should have at least 5 paragraphs so it looks like original post and not excerpt of another post
k) donât use ânext pageâ for home page; conflicts with your category indexes
l) update site regularly â updates every 6 weeks shows lack of new content
m) create your own images where possible, vs copying somebody elseâs
n) learn to use your Google webmaster tools (now âconsoleâ) properly
o) donât overload pages with too many ad modules from adsense, amazon, other ad system, etc. â too many ads pollutes your pages
p) use h tags for your relevant subheads in your posts, not just bold sub heads â couch your subheads as answers to questions people might ask âThe right way to boil spaghettiâ ⊠etc.
q) make sure guest posts are not also being posted on other sites (!!)
r) share the heck out of your posts to social media, but use the social media worth sharing to and ignore the stuff nobody uses anymore (sorry, delicious, diigo, Technorati, etc.)
s) donât use sock puppets for clicking your ads; paid likes on social media; or similar
t) answer comments on your posts to create dialog
u) make backups of your site often and carefully (!) â if your system crashes, and youâre off the web for prolonged period of time â very bad for SEO after xx days
v) do you have a backup plan if your host goes out of business, or GoDaddy DNS crashes again and your site is down?
w) consider spending a small amount on Google ads to promote your best posts or site on the topic you most want to be found under, like âhorse breedingâ or whatever
x) make sure your site is verified with all the top search engines
y) ignore stupid things like so called âranking sitesâ like Alexa which are completely wrong on traffic, including their inability to track shortcode use
z) check your site regularly to ensure itâs secure ! Make sure you have security plan. Make sure you have privacy policy on your site.
Share and enjoy! đ
Copr. © Christopher Simmons
NOT FOR REPUBLICATION!
