Debug Queries is a wordpress plugin for finding the queries needed to generate your page. Activate this plugin, and load your blog in a browser where you are logged in. This plugin will display all the plugins at the end of your page, and here you can check and analyze what are those queries that require the most of the time to be executed. This plugin will help you find the faulty or time consuming queries, and eventually removing/changing those that are trouble.
Debug Queries
You don´t need a plugin for Google Analytics!
No really! You just don´t need that plugin. This is one of the simplest things to fix and this is how it is done:
Open the theme´s footer.php and add your code from analytics before the closing </body> tag.
If you have absolutely no idea where to look for your site’s code do the following:
Open Google Analytics -> On Overview page there is an Edit link on the right, in line with each site’s name. Right after that green/read % up and down column. Click that Edit link, you now are on page “Profile Settings”. Look again for the following:

Click that “Check Status” link and this will open a page with the tracking code. Usually the one selected is all what you need. Select all, copy it and paste it to the theme’s footer. Upload the file and you are DONE. If your theme is coded correctly your footer is in every page, so you don’t need an extra plugin to do the job.
If you want, you can put the code right before the closing </head> tag, but in that case, you need to open header.php
I personally prefer the footer.php for this
Here is what google suggests:
¨For the best performance across all browsers we suggest you position other scripts in your site in one of these ways:
- before the tracking code snippet in the <head> section of your HTML
- after both the tracking code snippet and all page content (e.g. at the bottom of the HTML body)¨
No plugin solutions for Facebook Like
I love plugins, but I love to use “no plugin solutions” whenever I can. This way I can keep my sites low on plugins, and have considerable speed, and still have all the functionality I want.
Here is how it´s done:
Go to: http://developers.facebook.com/docs/reference/plugins/like/
Use the ¨wizard” to select how would you like your facebook like to be displayed

Get the code and search for:

¨placeholderforurl¨ and replace it with
<iframe src="http://www.facebook.com/plugins/like.php?href= <?php the_permalink() ?>&layout=standard&show_faces= false&width=400&action=like&font&colorscheme= light& height=35" width:400px; height:35px;"></iframe>
and replace it with <?php the_permalink() ?>
Here is the HTML5 <iframe> version of the facebook like:
<iframe src="http://www.facebook.com/plugins/like.php?href= <?php the_permalink() ?>&layout=standard&show_faces=false& amp;width=400&action=like&font&colorscheme=light& height=35" width="400" height="35" seamless="seamless"></iframe>
in the case that your theme is HTML5 ready.
Now you need to add this iframe into the loop
the “wordpress loop” usually begins after the
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
I placed it right on the top of the content. to finish this, you need to open all the files where you want the facebook like to appear: usually archive.php, index.php, single.php and page.php. If your theme has category.php, and you want the like buttons there to, you can add it also.
It looks like a little bit of work, for the same thing that you can do with one click with a plugin like Facebook Like, but I definitely wanted to have this solved without a plugin. I keep the “plugin spots” for something much more complicated.
WordPress auto update fails… what to do?
Ever happened to you ? No? Lucky :D Well maybe it will never happen, but if you are “creative” and not particulary in a good way, like me, you one day will face this issue. And believe me, it is not a good way to start a day.
Here is short and sweet what I did:
Uploaded the new files again, by ftp and accessed admin. Usually it worked. If the files saw they need to update the datbase to, I got the message and one screen click ok style everything was fine. EXCEPT one: a .maintanance file was still between my files on the site, and I needed to delete it by hand so the error would go away.
But here is a great great description of this issue, with awesome explanations and step by step help.
What to do when Auto-Update Fails
My wordpress enhancing failures
Well… I did it :D I messed up wordpress so much, that now it doesn’t do a lot of things. Definitely the server hammering stoped, but the “solution” I have fot this is just one helluva FAILURE. Here I mentioned a few wordpress hooks, and those actually work. Also the admin bar removal function works fine. But did I stopped here? NO I DIDN’t.
I had a feeling that removing more and more at a moment will kill wordpress but I had to try it. So I added more lines to my theme’s function and I ended up with a total chaos there. I should now remove them one by one, to see what is causing what but I have no patience for this meticulous job now.
So this is a reminder: do try things out, but always keep a backup copy of the files you changed. If you are forgetting things, better write it down what you changed so you can restore everything and start over again. Backup, backup, backup!
Remove wordpress admin bar (without a plugin)
I wanted to get rid of the “admin bar” on my wordpress network install. I never use it, it just takes resources, makes the admin area to load slower, and I don´t want it there. So what is the easy way to do it? Definitely a plugin would be nice, but now I am in the mood to fix as much as possible WITHOUT plugins. And here is the very quick and nice fix:
function my_function_admin_bar(){
return false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
This are the few lines you need to add to the functions.php of your THEME and admin bar just goes away. Wonderful isnt’t it?
Very good read: The Case Against WordPress Plugins
The Case Against For Better WordPress Plugins
I have to agree with this article because it has a very very valid point. The plugins are indeed a great functionality for wordpress but a lot of them are just like time bombs waiting for something bad to happen. We can easily say that for wodrpess plugins are like woman’s: “you can’t live with them, can live without them”.
Today I decided to disable 3 wordpress plugins and go with a hard coded version of the solution. It is definitely not that pretty as with plugins but it does some great work.
My first idea was to comment out a bunch of lines from “wp-includes/default-filters.php”, those that are called with the wp_head() function, and I don’t want them to be called. But I found a much more painless and elegant solution from Otto:
No need to comment out anything. Just add these lines to your theme’s functions.php file:
remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'rsd_link');Or use the plugin above. Same thing. Always preferable to use plugins/themes instead of hacking core files. Hacking core files makes it more annoying when you upgrade.
I wanted to remove anything that wasn’t put there by me, and not needed in the header. These are so called “hooks” triggered by the wp_head() function. They “reside” in “wp-includes/default-filters.php”
With the function reference I “identified” these lines and added the removal to them to my THEME’s function.php
also remember: “Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.”
Here is what I removed with it from one of my sites:
remove_action(‘wp_head’, ‘wlwmanifest_link’); -is the resource hook file needed to enable tagging support for Windows Live Writer. Because that site doesn’t need Windows Live Writer, so commenting out this hook will do no harm in any way
remove_action(‘wp_head’, ‘rsd_link’);the RSD link is used by many blog clients for discovery of the XML-RPC API end point. Now I don’t need this either. So commenting out will be just fine.
remove_action( ‘wp_head’,'feed_links_extra’,3); – displays the extra feed links (for categories for example)
remove_action( ‘wp_head’,'index_rel_link’); – removes index link, (<link rel=’index’ title=’European Travel’ href=’URL HERE’ /> line
remove_action( ‘wp_head’,'parent_post_rel_link’,10, 0 ); removes previous link
remove_action( ‘wp_head’, ‘start_post_rel_link’, 10, 0 ); – removes start link
remove_action( ‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0 ); removes relational links for the posts adjacent to the current post. from header
remove_action( ‘wp_head’,'wp_generator’); remove wordpress version (<meta name=”generator” content=”WordPress 3.1.1″ />)
Here is a reference on how to do this with other hooks
Just remember the golden rule: before you do anything create a backup. And if you mess up, just load the backup on the server and start over.
And here are other links with more info about these things.
Some wordpress optimization tips
I was like why the hell some hosting companies suggest to delete every unused plugin from the plugin folder??? In my opinion this shouldn’t be the hosting provider’s business, because if they are just sitting there, not being activated why the hell this is one from the many causes that can make wordpress run slowly…
But looking a little bit into the core of the problem I found something very interesting. Now to understand how it works, in simple terms imagine the following: there is a “thing” called cron (wp-cron) that runs every time wordpress needs to do some updates, some scheduled tasks, delete the trash, delete the spam, whatever. But also checks from time to time if there are updates for the wordpress core, for the themes and the plugins too. This helps every wordpress user to see if there is a new version of the plugin available.
And probably you noticed a lot of time: “There is a new version of plugin name available.” Yup those are thanks to this cron thing.
All good until now. But as I mentioned in the previous post I had no idea how much of crons are going on in a regular wordpress… with Wordoress Core Control I was able to find out. I do need and want my site to stay up do date but hell no I don’t need two version check a day, two plugin and two theme update check… I mean wtf???
This is when I checked through the wordpress core control, I checked this tab: Plugin, Theme, and Core Updates where I found this:
Plugins
Last updated: Wed, 13 Apr 2011 17:34:23 +0000 (3 hours ago)
32 plugins checked, there are updates available for 2 plugin(s)
so… this was the moment when I realized, that even if the plugins are not activated, the wordpress is still stressed because of them! They are checked and compared each time the update cron is running. I am still not happy with what I found to manage these crons.
I try to disable as many of these possible.And will try to run them as less as possible. But still looking for the “greatest of all great” wp cron manager plugin
Wordoress Core Control
I am still looking for a wordpress plugin. The closest I found is WordPress Core Control, but somehow this is not “the one”.
What I noticed when played around this plugin was the following:
There are a bunch of FOR ME “unnecessary” crons running.
Twice Daily wp_version_check
Twice Daily wp_update_plugins
Twice Daily wp_update_themes
Once Daily wp_scheduled_delete
Once Hourly wordbooker plugin
Twice Daily update_network_counts
Once Daily akismet_scheduled_delete
From here I need the wordbooker plugin, but it is enough to run it 5 times a day, the askimet plugin once a week. Because I set up wordpress not to use Trash, the wp Scheduled delete is not necessary. The version check, theme update check and plugin update check would be again enough 1/week (IN MY CASE). So I would like to get rid of these extra crons, and let them run as many times as I want.
I searched for days for a plugin like this, and nothing to be found.
I will stick to a “middle solution”. There are 3 plugins,
that supposed to do (half the job), Because I don´t want these tasks “Off”, I want them to be much rarely.
This is especially annoying when there are a few other sites on the same host, and all of them keeping the server busy with silly updates.
There is a WP-Cron Dashboard to, I need to test it to see if it works.
There was a “WP Control” plugin, but the last update is from 2008. So I won´t install that on my site, because I am pretty sure it won´t work properly. Well… if I will have a bunch of time, I will maybe give a try.
Page Speed tools
How fast does your page is loading? Here are some nifty little tools to check it and do something about the load speed.
Why do you need to see how fast is your site loading? Here is the answer:
“Page Speed Online analyzes the content of a web page, then generates suggestions to make that page faster. Reducing page load times can reduce bounce rates and increase conversion rates.”
Page Speed Online is a tool from Google, to analyze your page´s download speed and will also give you tips on how to speed up your website´s download time.
Page Speed from Google is also available as a Chrome plugin or a Firefox plugin.
Another page speed checking tool is YSlow from Yahoo. You need to install Firebug Firefox plugin first for make it work.




