Lovin it!
Archive for the ‘BooYah!’ Category
Good Morning Mug
Google’s spam filter
Google’s spam filter went crazy. Really crazy. It is not enough that spams all my payment receipts from Paypal, but today did something more amazing: it spammed its own confirmation mail! I wanted to add a new account to my gmail, so I don’t need to log in to another email account, and added the mail to gmail. This supposed to send me a verification, and I needed to click a link. The email already was set up as a forwarder to this gmail address, so I received the mail there. But it was in the spam folder! Wasn’t even looking there for a while, because I was convinced, google won’t consider spam its own mail. I was wrong :D
Split large files
From time to time I need to split large files to smaller ones. This time I had to split an XML file to small chunks of XML files. I could do the split with Total Commander, but unfortunately this program doesn’t know how to split files without breaking the data. A while ago I needed to split an SQL dump, because it was to big for uploading it to the server. Today I found a great tool, that can do split the large files, be that SQL, be that XML based on occurrence of something: GSplit.
For example an SQL file has the “INSERT INTO”. So I can tell to GSplit to split the file after the 100th occurrence of that Insert into, and this way it won’t break my queries. Also I can tell the program to split it after the whatever number of occurences of </item> and it will generate the files.
And the cherry on top of everything: Gsplit is free!
Automatic database optimization and backup with WP
According to wordpress codes there is a way to do automatic optimization to your wordpress database table.
Automatic Database Optimizing
Added with Version 2.9, there is automatic database optimization support, which you can
enable by adding the following define to your wp-config.php file only when the feature is required
define('WP_ALLOW_REPAIR', true);
The script can be found at {$your_site}/wp-admin/maint/repair.php
Please Note: That this define enables the functionality, The user does not need to be
logged in to access this functionality when this define is set. This is because its main
intent is to repair a corrupted database, Users can often not login when the database is corrupt.
now I added this to one of my sites wp-config and nothing happened. In phpmyadmin I saw that there are tables that need to be optimized, but the that don’t happened. This is when I decided I need something more that I can have better control, so I searched for a plugin to do this for me. First plugin I tried was WP-DB-Backup and it worked like a charm. If you only need database backup this is a nice solution. You can schedule the automatic wordpress database backups and get them in your mail or download them from your server. Also can make a backup to any other tables in the same mysql database, and this can be handy if you need one or another table to be saved.
Because I wanted a plugin that could do some optimization to, I searched and found Wp DB Manager. This also has an automatic backup creation part, and it can schedule optimizations to.
As non automatic solutions there are a few phpmyadmin plugins and you could do manual database backups. A while ago I used wp-phpmyadmin, but that was a few versions ago, since wordpress 3.1.1 is out I don’t know which plugin is working or not.
Always backup your databases. One day you will thank yourself if something happens and you have some backups by hand!
WordPress SEO Meta Tags Without Plugins
Ultimate WordPress SEO Meta Tags Without Plugins is a nicely written tutorial on how to add SEO meta tags to your wordpress without using plugins.
Debug Queries
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.
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!





